Select CodeQL bundles from a release - #4172
Open
henrymercer wants to merge 8 commits into
Open
henrymercer wants to merge 8 commits into
henrymercer wants to merge 8 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
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.
Copilot review overview
🟡 Changes recommended
Release tags containing slashes are encoded incorrectly, producing potentially invalid release and download URLs.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds release-aware CodeQL bundle selection, including private releases, compression fallback, and per-language bundles.
Changes:
- Adds release lookup and bundle selection utilities.
- Integrates selection and fallback telemetry into setup.
- Expands tests and updates fallback messaging.
| File | Description |
|---|---|
src/codeql-release.ts |
Implements release and bundle selection. |
src/codeql-release.test.ts |
Tests release selection behavior. |
src/setup-codeql.ts |
Integrates the new selector. |
src/setup-codeql.test.ts |
Updates integration and fallback tests. |
src/per-language-bundles.ts |
Renames and rewords fallback logging. |
src/codeql-bundle.ts |
Adds fallback state to download sources. |
lib/entry-points.js |
Generated output; excluded from review. |
Files excluded by content exclusion policy (1)
- lib/entry-points.js
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
henrymercer
marked this pull request as ready for review
September 24, 2026 19:39
mbg
self-requested a review
September 25, 2026 14:16
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
henrymercer
force-pushed
the
henrymercer/select-bundles-from-releases
branch
from
September 25, 2026 16:25
065bc86 to
7f964a9
Compare
henrymercer
added this pull request to stack #4180
September 25, 2026 18:26
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Add
codeql-release.ts, which selects a CodeQL bundle from a GitHub release, and use it for the default bundle and the latest nightly. This is preparation for accepting GitHub release URLs in thetoolsinput in a follow-up PR.getReleaselooks up a release with one API request and uses its API asset URLs, so it works for private repositories.getPublicReleaseconstructs/releases/download/URLs without an API request, so a missing asset shows up as a 404 when downloading.selectBundletries the compression methods we can extract in order of preference and requires a combined bundle.A job can use a per-language bundle if the
per_language_bundlesfeature flag is enabled, thelanguagesinput lists exactly one language, the job runs on github.com using a GitHub-hosted runner, andtarsupports zstd. A per-language bundle must also be published for that language and platform, and the CLI must be version 2.27.1 or newer, unless we're using the latest nightly. These are the existing rules ingetPerLanguageBundleLanguage. When a job can use a per-language bundle,selectBundleonly selects it if the release also has a combined bundle with the same compression, which it keeps for the existing download-time fallback. The restriction to the same compression method exists to avoid the need to track varying compression methods between the initial attempt and the fallback, and for the standard releases we publish, it should be dead code.getCodeQLBundleDownloadURLbecomesselectDefaultBundle, which tries the same sources in the same order: this Action's repository on this instance,github/codeql-actionon this instance, then the public release on github.com. It moves on to the next source if a release can't be found or has no compatible bundle. The nightly path now uses thetarSupportsZstdvalue fromgetCodeQLSourcerather than checkingtaragain.This changes the default path when we look up a release, which we do unless we're running the canonical Action on github.com:
Otherwise,
toolsinputs behave as before, and on github.com with the canonical Action the default path still makes no API requests.This also renames
logPerLanguageBundleFallbacktologMissingPerLanguageBundleand rewords its warning to say that we expected a per-language bundle, following up on this review comment on #4167.Commit-by-commit review recommended as the behaviour changes to bundle selection are all in the last commit.
Risk assessment
Low risk: On github.com with the canonical Action, we select the same bundles as before, and PR checks cover this. Elsewhere, the selected bundle only changes when a release we look up lacks the preferred bundle. Per-language bundles are still behind the
per_language_bundlesfeature flag.Which use cases does this change impact?
Workflow types:
Products:
Environments:
How did/will you validate this change?
codeql-release.ts. Thesetup-codeql.tstests now expect one request per release, and gain cases for a fork release that lacks the per-language bundle, and for moving on to the public release when the fork's release has no compatible bundle or can't be found. The unit tests and lint pass locally at each commit.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?
tools_per_language_bundle_fallback, which now also covers releases that lack the per-language bundle.Are there any special considerations for merging or releasing this change?
Merge / deployment checklist