Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the start-proxy action to use getDefaultCliVersion from feature flags instead of hard-coding defaults.bundleVersion. This change allows the start-proxy action to dynamically determine the CodeQL CLI version to use, either from feature flags on GitHub.com or from defaults on GHES, making the behavior consistent with other actions in the codebase.
Changes:
- Modified
getDownloadUrlandgetProxyBinaryPathfunctions to accept aFeatureEnablementparameter - Updated
start-proxy-action.tsto initialize and pass feature flags to proxy-related functions - Added comprehensive test coverage with proper feature flag mocking
- Removed unused
Featureimport fromstart-proxy-action.ts
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/start-proxy.ts | Updated function signatures to accept FeatureEnablement; changed to use getDefaultCliVersion for dynamic version selection; added getGitHubVersion import |
| src/start-proxy.test.ts | Updated test mocking to properly handle feature flags; added mockOfflineFeatures helper; modified tests to pass features parameter |
| src/start-proxy-action.ts | Removed unused Feature import; updated getProxyBinaryPath call to pass features parameter |
| lib/start-proxy-action.js | Generated JavaScript reflecting TypeScript changes |
Comments suppressed due to low confidence (1)
src/start-proxy.ts:558
- The JSDoc comment for
getProxyBinaryPathis missing documentation for the newfeaturesparameter. Please add a@param featuresentry to document this parameter.
/**
* Gets a path to the proxy binary. If possible, this function will find the proxy in the
* runner's tool cache. Otherwise, it downloads and extracts the proxy binary,
* and stores it in the tool cache.
*
* @param logger The logger to use.
* @returns The path to the proxy binary.
*/
sam-robson
left a comment
There was a problem hiding this comment.
Just a little nit, otherwise lgtm!
| async function getCliVersionFromFeatures( | ||
| features: FeatureEnablement, | ||
| ): Promise<CodeQLDefaultVersionInfo> { | ||
| const gitHubVersion = await getGitHubVersion(); |
There was a problem hiding this comment.
To save an API call, could we thread githubVersion through from
codeql-action/src/start-proxy-action.ts
Line 49 in bce0deb
There was a problem hiding this comment.
We could thread it through, but getGitHubVersion should also cache the result from the API on the first call, so that the second call to getGitHubVersion here shouldn't result in an additional API call.
There was a problem hiding this comment.
👍🏻 I see. Well I'll leave that as a judgment call to you, happy to approve.
There was a problem hiding this comment.
Let's get this merged to unblock other PRs, thanks 👍🏻
Changes the
start-proxyaction to usegetDefaultCliVersionrather than havingdefaults.bundleVersionhard-coded. Conveniently, this adds a permanent consumer of feature flags tostart-proxy.I have put this behind a new FF to gate the new behaviour to make this a less risky change.
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