-
Notifications
You must be signed in to change notification settings - Fork 391
Fetch proxy binaries from defaults.json
release
#3110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Pull Request Overview
This PR modifies the start-proxy
action to fetch proxy binaries from the current CodeQL CLI bundle release instead of a hard-coded release. The main purpose is to ensure the proxy binaries are always up-to-date with the CLI bundle version specified in defaults.json
.
Key changes:
- Adds dynamic proxy binary discovery from the current CLI bundle release
- Implements fallback mechanism to hard-coded release if dynamic discovery fails
- Uses CLI version for proxy binary versioning in toolcache
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/start-proxy.ts | Adds new functions for dynamic proxy binary URL resolution and platform detection |
src/start-proxy.test.ts | Adds unit tests for the new proxy binary discovery logic |
src/start-proxy-action.ts | Updates proxy binary path resolution to use dynamic URL discovery |
lib/start-proxy-action.js | Generated JavaScript code (no review needed per guidelines) |
for (const asset of cliRelease.data.assets) { | ||
if (asset.name === proxyPackage) { | ||
logger.info( | ||
`Found '${proxyPackage}' in release '${defaults.bundleVersion}' at '${asset.url}'`, |
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.
[nitpick] Logging the asset URL could potentially expose sensitive information. Consider logging only the asset name and release version instead of the full URL.
`Found '${proxyPackage}' in release '${defaults.bundleVersion}' at '${asset.url}'`, | |
`Found '${proxyPackage}' in release '${defaults.bundleVersion}'.`, |
Copilot uses AI. Check for mistakes.
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.
We include the asset URL in the log in setup-codeql.ts
as well. I don't think there should be any sensitive information, since the releases are public.
let proxyBin = toolcache.find(proxyFileName, proxyInfo.version); | ||
if (!proxyBin) { | ||
const temp = await toolcache.downloadTool(proxyURL); | ||
const temp = await toolcache.downloadTool(proxyInfo.url); |
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.
The URL from proxyInfo.url
is downloaded without validation. When using the GitHub API asset URL, consider adding verification that the URL is from a trusted GitHub domain to prevent potential security issues.
Copilot uses AI. Check for mistakes.
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.
Looks good, couple of minor comments.
export const UPDATEJOB_PROXY_VERSION = "v2.0.20250624110901"; | ||
export const UPDATEJOB_PROXY_URL_PREFIX = | ||
"https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.22.0/"; |
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.
Minor: Rename to include _FALLBACK_
?
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 am not going to bother, since we can hopefully just remove the fallback logic once the next CodeQL CLI release has happened?
Currently, the
start-proxy
action obtains the platform-specificupdate-job-proxy
binary it needs from a hard-coded CodeQL CLI bundle release on thegithub/codeql-action
repo, if it is not already in the runner's toolcache.We will soon be including up-to-date versions of the
update-job-proxy
binaries with every CodeQL CLI bundle release.This PR modifies the
start-proxy
action to search the release assets of the release pointed at bydefaults.json
for an appropriateupdate-job-proxy
asset and downloads it, if it is not already in the runner's toolcache.If the release pointed at by
defaults.json
doesn't contain the right asset for whatever reason, we revert to using the hard-coded release instead.Because
update-job-proxy
isn't versioned, and we require a version for the toolcache, we use the CodeQL CLI version of the release theupdate-job-proxy
is obtained from as its version.I have added a few unit tests for this logic.
Risk assessment
For internal use only. Please select the risk level of this change:
Merge / deployment checklist