Repository navigation
Use per-language CodeQL bundles by default - #4244
henrymercer wants to merge 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d9f196d4-6d15-44ca-bd01-cd022d57d2cc
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d9f196d4-6d15-44ca-bd01-cd022d57d2cc
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d9f196d4-6d15-44ca-bd01-cd022d57d2cc
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
🔵 Needs a closer look
The broader default rollout removes the feature-flag override, leaving release-based rollback and warranting human sign-off.
1 open finding
What changed in this PR
Makes per-language CodeQL bundles the default for eligible single-language analyses on GitHub-hosted runners on GitHub.com.
Changes:
- Removes the rollout flag and makes bundle selection synchronous.
- Updates tests for the new default and retained eligibility safeguards.
- Updates validation checks while preserving combined-bundle baseline coverage.
| File | Description |
|---|---|
| src/setup-codeql.ts | Uses synchronous bundle selection. |
| src/setup-codeql.test.ts | Updates default-selection and fallback tests. |
| src/per-language-bundles.ts | Removes feature-flag gating. |
| src/per-language-bundles.test.ts | Removes flag-dependent eligibility tests. |
| src/feature-flags.ts | Removes the rollout flag and environment override. |
| pr-checks/checks/per-language-bundle-validation.yml | Validates linked bundles after clearing the toolcache. |
| pr-checks/checks/export-file-baseline-information.yml | Uses custom configuration to select the combined bundle. |
Files excluded by content exclusion policy (3)
- .github/workflows/__export-file-baseline-information.yml
- .github/workflows/__per-language-bundle-validation.yml
- lib/entry-points.js
🧠 Review effort: Max
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mbg
left a comment
There was a problem hiding this comment.
Just a few minor points, otherwise this looks good I think.
| - name: Remove CodeQL from toolcache | ||
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL'); | ||
| fs.rmdirSync(codeqlPath, { recursive: true }); |
There was a problem hiding this comment.
Minor: Consider whether it would make sense to move this out into a pr-checks/clear-toolcache.ts script since (I think) we have more than one workflow which uses something like this now, and then run the script.
| logger, | ||
| }: ActionState<["Logger", "ReadOnlyEnv", "FeatureFlags"]>, | ||
| export function getPerLanguageBundleLanguage( | ||
| { env, logger }: ActionState<["Logger", "ReadOnlyEnv"]>, |
There was a problem hiding this comment.
Minor: To avoid diff noise when the required state features of a function change (since I have seen that in a few recent PRs), here's what I generally do / how I intended this to be used:
- Prefer using a single parameter for the
ActionState(e.g.action: ActionState<...>) rather than deconstructing it with an object pattern. - When refactoring an existing function to use
ActionStaterather than discrete parameters and updating the entire body to use e.g.action.logger.instead oflogger.would be a lot of noise, then addconst logger = action.logger;etc. early on in the function body. - When passing
ActionStateto another function, use the singleactionobject, rather than constructing anActionStatevalue with only the required features. - If the initial
actionobject in a function (the caller) isn't sufficient and it needs to be augmented with another feature before calling a function (the callee), widen the set of features required by the caller if possible. If that requires too much refactoring up the call hierarchy and the extra state is available locally, then prefer naming the resultingActionStateobject with e.g.const actionWithFeatures = extendActionState(action, { features });and then passingactionWithFeaturesto the function.
| # To balance speed and coverage, analyze only JavaScript but use the combined bundle so | ||
| # baseline information is reported for every language in the multi-language repository. A | ||
| # no-op custom configuration selects that conservative path for custom configurations. | ||
| config: | | ||
| paths-ignore: [] |
There was a problem hiding this comment.
Minor:
| # To balance speed and coverage, analyze only JavaScript but use the combined bundle so | |
| # baseline information is reported for every language in the multi-language repository. A | |
| # no-op custom configuration selects that conservative path for custom configurations. | |
| config: | | |
| paths-ignore: [] | |
| # To balance speed and coverage, analyze only JavaScript but use the combined bundle so | |
| # baseline information is reported for every language in the multi-language repository. A | |
| # custom configuration prevents per-language bundles from being used. | |
| config: | | |
| paths-ignore: [] |

Per-language CodeQL bundles are already supported and have been rolled out behind
per_language_bundles_v2. This change removes that rollout feature and makes automatic selection the default for eligible single-language analyses on GitHub-hosted runners on GitHub.com.The baseline-information check uses a no-op custom configuration to continue validating the combined bundle.
Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
dynamicworkflows (Default Setup, Code Quality, ...).Products:
analysis-kinds: code-scanning.analysis-kinds: code-quality.Environments:
github.comand/or GitHub Enterprise Cloud with Data Residency.How did/will you validate this change?
.test.tsfiles).pr-checks).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist