Skip to content

Use per-language CodeQL bundles by default - #4244

Open
henrymercer wants to merge 3 commits into
mainfrom
henrymercer/graduate-per-language-bundles
Open

henrymercer wants to merge 3 commits into
mainfrom
henrymercer/graduate-per-language-bundles

Conversation

@henrymercer

Copy link
Copy Markdown
Contributor

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:

  • 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.
  • Code Quality - The changes impact analyses when analysis-kinds: code-quality.
  • Other first-party - The changes impact other first-party analyses.

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).
  • End-to-end tests - I am depending on PR checks (i.e. tests in pr-checks).

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

  • Rollback - Change can only be disabled by rolling back the release or releasing a new version with a fix.

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.
    • Dashboards - I will watch relevant dashboards for issues after the release. Consider whether this requires this change to be released at a particular time rather than as part of a regular release.
    • 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.

henrymercer and others added 3 commits October 16, 2026 13:59
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
Copilot AI max review requested due to automatic review settings October 16, 2026 13:04
@github-actions github-actions Bot added the size/M Should be of average difficulty to review label Oct 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread src/per-language-bundles.ts
@henrymercer
henrymercer marked this pull request as ready for review October 16, 2026 14:09
@henrymercer
henrymercer requested a review from a team as a code owner October 16, 2026 14:09

@mbg mbg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a few minor points, otherwise this looks good I think.

Comment on lines +44 to +51
- 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 });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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"]>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 ActionState rather than discrete parameters and updating the entire body to use e.g. action.logger. instead of logger. would be a lot of noise, then add const logger = action.logger; etc. early on in the function body.
  • When passing ActionState to another function, use the single action object, rather than constructing an ActionState value with only the required features.
  • If the initial action object 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 resulting ActionState object with e.g. const actionWithFeatures = extendActionState(action, { features }); and then passing actionWithFeatures to the function.

Comment on lines +20 to +24
# 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: []

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor:

Suggested change
# 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: []

This branch has not been deployed

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

Labels

size/M Should be of average difficulty to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants