Skip to content

Reduce the minimum Git version required for overlay#3767

Open
henrymercer wants to merge 3 commits intomainfrom
henrymercer/overlay-reduce-minimum-git-version
Open

Reduce the minimum Git version required for overlay#3767
henrymercer wants to merge 3 commits intomainfrom
henrymercer/overlay-reduce-minimum-git-version

Conversation

@henrymercer
Copy link
Contributor

Use the --stage option for git ls-files instead of --format to reduce the minimum Git version for overlay from 2.38.0 (released October 2022) to 2.11.0 (released November 2016).

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

Workflow types:

  • Advanced setup - Impacts users who have custom CodeQL workflows.
  • Managed - Impacts users with dynamic workflows (Default Setup, Code Quality, ...).

Products:

  • Code Scanning - The changes impact analyses when analysis-kinds: code-scanning.

Environments:

  • Dotcom - Impacts CodeQL workflows on github.com and/or GitHub Enterprise Cloud with Data Residency.

How did/will you validate this change?

  • Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files).

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Feature flags - All new or changed code paths can be fully disabled with corresponding feature flags.

How will you know if something goes wrong after this change is released?

  • Telemetry - I rely on existing telemetry or have made changes to the telemetry.
    • Alerts - New or existing monitors will trip if something goes wrong with this change.

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

Copilot AI review requested due to automatic review settings March 23, 2026 18:44
@henrymercer henrymercer requested a review from a team as a code owner March 23, 2026 18:44
@github-actions github-actions bot added the size/S Should be easy to review label Mar 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR lowers the minimum Git version needed for overlay (improved incremental) analysis by changing how tracked file OIDs are gathered from Git, improving compatibility with older runner images/environments.

Changes:

  • Switch getFileOidsUnderPath from git ls-files --format=... (Git ≥2.38) to git ls-files --stage (compatible with Git ≥2.11 when combined with --recurse-submodules).
  • Update unit tests to reflect the new --stage output format and parsing.
  • Add a changelog entry documenting the reduced minimum Git requirement.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/git-utils.ts Lowers the overlay minimum Git version and updates getFileOidsUnderPath to parse git ls-files --stage output.
src/git-utils.test.ts Updates/extends tests to validate parsing of --stage output, including quoted/escaped paths.
src/config-utils.test.ts Adjusts the “old git version” fallback test to reflect the new 2.11.0 minimum.
CHANGELOG.md Documents the reduced minimum Git version for improved incremental analysis.
lib/upload-sarif-action.js Generated JS update reflecting the TypeScript change.
lib/upload-lib.js Generated JS update reflecting the TypeScript change.
lib/setup-codeql-action.js Generated JS update reflecting the TypeScript change.
lib/resolve-environment-action.js Generated JS update reflecting the TypeScript change.
lib/init-action.js Generated JS update reflecting the TypeScript change (including minimum version constant).
lib/init-action-post.js Generated JS update reflecting the TypeScript change.
lib/autobuild-action.js Generated JS update reflecting the TypeScript change.
lib/analyze-action.js Generated JS update reflecting the TypeScript change.
lib/analyze-action-post.js Generated JS update reflecting the TypeScript change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Should be easy to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants