GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use the combined bundle when queries may need other languages' library packs by henrymercer · Pull Request #4184 · github/codeql-action

Conversation

@henrymercer

@henrymercer henrymercer commented Sep 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

We support custom configuration files that include packs for other languages, for example:

name: Use custom queries
disable-default-queries: true
queries:
  ...
  - name: Go queries
    uses: codeql-testing/go-querypack@master
  - name: Cpp queries
    uses: codeql-testing/cpp-querypack@second-branch
  - name: JavaScript queries
    uses: codeql-testing/javascript-querypack/show_ifs2.ql@master
  - name: Python queries
    uses: codeql-testing/python-querypack/show_ifs2.ql@second-branch

as taken from our PR checks.

If these custom queries live in compiled packs, then the packs ship their own dependencies. However if the custom query is just a path to a QL file, then the dependencies are resolved from a bundle.

This creates an issue with per-language bundles: CodeQL resolves every configured query before selecting the ones for the analyzed language, so a single-language analysis with a configuration like the above will fail. This is evidenced by failures in the "Go: Custom queries" and "Start proxy" PR checks when using per-language bundles.

This PR only selects a per-language bundle when the query configuration known before CodeQL is set up can't reference such queries: there's no configuration file, the config input is unset or only sets threat models and model packs like default setup's does, and the queries input and github-codeql-extra-queries repository property only name built-in query suites. This avoids loading configuration files before setting up CodeQL, at the cost of using the combined bundle for configuration files that only use built-in queries. The config input is parsed once, before setting up CodeQL, and used both for this check and to configure the analysis. As a result, an invalid config input now fails before CodeQL is downloaded, with an error that names the config input rather than a temporary file.

This PR also modifies setup-codeql to always use the combined bundle, since it can't tell whether the queries that a workflow runs with the CLI will need library packs for other languages. A separate commit corrects the docs for its languages and analysis-kinds inputs, which said to also pass them to init, even though init fails if setup-codeql has run in the same job.

It also disables per-language bundles in the "Export file baseline information" PR check, since a per-language bundle only reports file baseline information for its own language. The second commit moves defaultSuites so that per-language-bundles.ts can use it without an import cycle.

Finally, it moves per-language bundles to a new per_language_bundles_v2 feature flag, so that we can roll them out to Action versions that include this fix without also enabling them for earlier versions.

Risk assessment

Low risk: The change only affects bundle selection when the per_language_bundles or per_language_bundles_v2 feature flag is enabled.

Which use cases does this change impact?

Workflow types:

  • Advanced setup - Single-language analyses with a configuration file, a config input, or queries that aren't built-in query suites, and workflows that pass a single language to setup-codeql.
  • Managed - Default setup analyses that get a configuration file, or queries that aren't built-in query suites, from repository properties.

Products:

  • Code Scanning
  • Code Quality

Environments:

  • Dotcom - Per-language bundles are only selected on GitHub.com.

How did/will you validate this change?

  • Unit tests - Each source of query configuration, and bundle selection for releases and nightlies. The setup-codeql Action's entry point has no unit tests, so its reason is only covered indirectly.
  • End-to-end tests - "Go: Custom queries" and "Start proxy" use configuration files that reference other languages' queries, so they cover this change whenever they download a bundle with per-language bundles enabled.

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

  • Feature flags - Disable per-language bundle selection with per_language_bundles_v2.

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

  • Telemetry - Monitor init failures in analyses that use a per-language bundle.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
henrymercer and others added 5 commits September 29, 2026 19:31
@henrymercer
Disable per-language bundles in the file baseline PR check
b5a476b
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Move defaultSuites to config/db-config.ts
5e3132d
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Avoid per-language bundles when queries may need other languages' lib…
1609a51
…rary packs

Co-authored-by: Copilot App <[email protected]>
@henrymercer
Always use the combined bundle in setup-codeql
d8b6f2a
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Fix the docs for the languages and analysis-kinds inputs of `setu…
7816c33
…p-codeql`

Co-authored-by: Copilot App <[email protected]>
@github-actions github-actions Bot added the size/L May be hard to review label Sep 30, 2026
@henrymercer
henrymercer requested a balanced review from Copilot October 1, 2026 09:17
Copilot started reviewing on behalf of henrymercer October 1, 2026 09:18
View session
Copilot AI reviewed Oct 1, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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.

Copilot review overview

🟢 Approval recommended

Bundle eligibility is consistently propagated and covered by focused tests without unresolved correctness issues.

Review effort: Balanced
Findings: None

What changed in this PR

Updates bundle selection to use combined bundles whenever configured queries may depend on other languages’ library packs.

Changes:

  • Detects query configurations requiring combined bundles.
  • Propagates bundle-selection reasoning through CodeQL setup.
  • Updates tests, documentation, and PR-check configuration.
File Description
src/​per-language-bundles.ts Adds query eligibility logic.
src/​per-language-bundles.test.ts Tests eligibility and explanations.
src/​setup-codeql.ts Applies eligibility to release and nightly bundles.
src/​setup-codeql.test.ts Tests combined-bundle selection.
src/​setup-codeql-action.ts Forces combined bundles for standalone setup.
src/​init-action.ts Collects query configuration inputs.
src/​init.ts Propagates bundle-selection reasoning.
src/​codeql.ts Propagates setup options.
src/​codeql.test.ts Updates setup calls.
src/​upload-lib.ts Updates initialization call.
src/​config/​db-config.ts Centralizes built-in suite names.
src/​analyze.ts Uses centralized suite names.
src/​analyze.test.ts Updates suite import.
setup-codeql/​action.yml Corrects input documentation.
pr-checks/​checks/​export-file-baseline-information.yml Disables per-language bundles for the baseline check.
lib/​entry-points.js Generated output; excluded from review.
.github/​workflows/​__export-file-baseline-information.yml Generated workflow; excluded from review.
Files excluded by content exclusion policy (2)
  • .github/workflows/__export-file-baseline-information.yml
  • lib/entry-points.js

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
henrymercer and others added 2 commits October 1, 2026 11:48
@henrymercer
Use a new feature flag for per-language bundles
87a1923
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Omit the feature flag name from the per-language bundle debug log
2da0d29
Co-authored-by: Copilot App <[email protected]>
@henrymercer
henrymercer marked this pull request as ready for review October 1, 2026 11:32
@henrymercer
henrymercer requested a review from a team as a code owner October 1, 2026 11:32
mbg
mbg reviewed Oct 1, 2026
View reviewed changes

@mbg mbg left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thank you for taking care of this! I think this approach makes sense to work around the issue. Query customisation is reasonably rare so that this still allows most users to benefit from per-language bundles, while avoiding any issues like we saw in CI for those that do customise them.

I left a few comments, with one or two points about long-term maintainability and otherwise minor comments. So, generally this looks pretty good already and it shouldn't be far off from being ready to merge.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pr-checks/checks/export-file-baseline-information.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/setup-codeql-action.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/per-language-bundles.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/per-language-bundles.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/per-language-bundles.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/per-language-bundles.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/per-language-bundles.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/init-action.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

henrymercer and others added 7 commits October 1, 2026 17:44
@henrymercer
Read the config and queries inputs once in init
a98f604
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Extract parsing of the queries input and the extra queries reposito…
a4fbe39
…ry property

Co-authored-by: Copilot App <[email protected]>
@henrymercer
Reuse the parsing of query inputs when choosing a bundle
70897a7
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Explain that the config input can configure queries
725421c
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Explain what a reason to use the combined bundle means where it's che…
1bb99cb
…cked

Co-authored-by: Copilot App <[email protected]>
@henrymercer
Check what the config input sets instead of exempting dynamic workf…
a6cd2a5
…lows

Co-authored-by: Copilot App <[email protected]>
@henrymercer
Explain why the file baseline PR check uses the combined bundle
ce28f3e
Co-authored-by: Copilot App <[email protected]>
mbg
mbg reviewed Oct 2, 2026
View reviewed changes

@mbg mbg left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thank you for addressing the comments from my previous review! I've had some more comments on the changes here. The main ones are again related to the maintainability of duplicated logic and whether we can reduce that or move some of the work to a common place before any of the consumers.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/per-language-bundles.ts
Comment on lines +87 to +89
const query = findNonBuiltInQuery(
parseQueriesInput(inputs.queriesInput).input,
);

@mbg mbg Oct 2, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for changing this to better reuse the existing implementation!

Another concern here, which I don't think is blocking for this PR, is that getOtherLanguagePacksReason is more conservative than it needs to be. Specifically, we ignore the combines property and so are ignoring the precedence / combination rules that are implemented in combineQueries. Since that may discard some of the configured queries if others take precedence / don't allow combining, not all of the configured queries may actually end up getting passed to the CLI. If that is the case, then we might disable per-language bundles here even though we may not need to. Since this is more conservative than necessary, it is fine as-is, but we could look into reusing more of the combineQueries logic here to ensure consistency and to allow per-language bundles in more cases.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@henrymercer henrymercer Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I agree that we are more conservative than necessary, which is fine, and that it would make sense to look into refactoring this as future work.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mbg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread src/per-language-bundles.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/per-language-bundles.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

henrymercer and others added 4 commits October 2, 2026 14:22
@henrymercer
Parse lists of queries with a single function
1c0814d
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Share the check of the properties that Default Setup sets in the `con…
e869836
…fig` input

Co-authored-by: Copilot App <[email protected]>
@henrymercer
Parse the config input once
113b18e
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Point to the Default Setup config schema from the per-language bundle…
f6a7f00
… check

Co-authored-by: Copilot App <[email protected]>
@henrymercer henrymercer added Rebuild Re-transpile JS & re-generate workflows and removed Rebuild Re-transpile JS & re-generate workflows labels Oct 2, 2026
@henrymercer

This comment was marked as resolved.

Sign in to view
Copilot started work on behalf of henrymercer October 2, 2026 15:31
View session

This comment was marked as resolved.

Sign in to view
Copilot finished work on behalf of henrymercer October 2, 2026 15:42
@henrymercer

This comment was marked as resolved.

Sign in to view
@github-actions github-actions Bot added size/XL May be very hard to review and removed size/L May be hard to review labels Oct 2, 2026
@henrymercer
Merge branch 'main' into henrymercer/per-language-pr-check-failures
c275b4a
@henrymercer
henrymercer requested a review from mbg October 5, 2026 09:47
mbg
mbg reviewed Oct 5, 2026
View reviewed changes

@mbg mbg left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

A bunch more comments on this, sorry. There's nothing critical, but just a bunch of instances where comments are worded poorly or odd changes were made as part of a refactoring.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config-utils.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config-utils.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config-utils.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config-utils.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/db-config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

henrymercer and others added 11 commits October 5, 2026 14:24
@henrymercer
Reword the JSDoc for parseQueriesFromInput
c1e7769
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Return early from parseQueriesFromInput when there are no queries
ac4b9b8
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Remove the checkDefaultSetupConfig wrapper around checkSchema
711f3bf
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Say that the Default Setup config schema reflects what Default Setup …
966f3c3
…is known to send

Co-authored-by: Copilot App <[email protected]>
@henrymercer
Explain that the config input is written to disk without merging
a4a04dc
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Construct UserConfig objects directly in the config-utils tests
6cb83fa
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Parse the config input in init without the parseConfigInput wra…
e0b8480
…pper

Co-authored-by: Copilot App <[email protected]>
@henrymercer
Say that parseUserConfig's pathInput may not be a file path
9d3242e
Co-authored-by: Copilot App <[email protected]>
@henrymercer
Compare originalUserInput with a separate object in the config in…
8e6b600
…put test

Co-authored-by: Copilot App <[email protected]>
@henrymercer
Describe what parseUserConfig accepts, returns and throws more prec…
55e4091
…isely

Co-authored-by: Copilot App <[email protected]>
@henrymercer
Explain why the config input test compares with a separate object
12db63b
Co-authored-by: Copilot App <[email protected]>
mbg
mbg approved these changes Oct 5, 2026
View reviewed changes

@mbg mbg left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thank you! I think all of my feedback is addressed now and I don't have anything to add on the most recent set of commits.

Happy to approve on that basis. I haven't re-reviewed the full changes. If there's anything that you'd like me to take another look over, let me know. Otherwise, feel free to go ahead and merge this!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@henrymercer
henrymercer added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 2c8d410 Oct 6, 2026
233 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@henrymercer
henrymercer deleted the henrymercer/per-language-pr-check-failures branch October 6, 2026 12:20
@github-actions github-actions Bot mentioned this pull request Oct 8, 2026
Merge main into releases/v4 #4214
Merged
6 of 8 tasks
henrymercer added a commit that referenced this pull request Oct 8, 2026
@henrymercer
Add changelog note for #4184
69e87c5
@github-actions github-actions Bot mentioned this pull request Oct 8, 2026
Merge releases/v4 into releases/v3 #4216
Merged
5 of 6 tasks
ultragangster7

This comment was marked as duplicate.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ultragangster7

This comment was marked as duplicate.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ultragangster7
ultragangster7 approved these changes Nov 7, 2026
View reviewed changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@mbg mbg mbg approved these changes
+1 more reviewer
@ultragangster7 ultragangster7 ultragangster7 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size/XL May be very hard to review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@henrymercer @mbg @ultragangster7
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.