Skip to content

Use getDefaultCliVersion for start-proxy#3512

Merged
mbg merged 4 commits intomainfrom
mbg/start-proxy/use-default-cli
Feb 26, 2026
Merged

Use getDefaultCliVersion for start-proxy#3512
mbg merged 4 commits intomainfrom
mbg/start-proxy/use-default-cli

Conversation

@mbg
Copy link
Member

@mbg mbg commented Feb 25, 2026

Changes the start-proxy action to use getDefaultCliVersion rather than having defaults.bundleVersion hard-coded. Conveniently, this adds a permanent consumer of feature flags to start-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:

  • Low risk

Which use cases does this change impact?

Workflow types:

  • 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.

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.

@mbg mbg requested a review from henrymercer February 25, 2026 17:47
@mbg mbg self-assigned this Feb 25, 2026
@mbg mbg requested a review from a team as a code owner February 25, 2026 17:47
Copilot AI review requested due to automatic review settings February 25, 2026 17:47
@github-actions github-actions bot added the size/M Should be of average difficulty to review label Feb 25, 2026
Copy link
Contributor

Copilot AI left a 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 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 getDownloadUrl and getProxyBinaryPath functions to accept a FeatureEnablement parameter
  • Updated start-proxy-action.ts to initialize and pass feature flags to proxy-related functions
  • Added comprehensive test coverage with proper feature flag mocking
  • Removed unused Feature import from start-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 getProxyBinaryPath is missing documentation for the new features parameter. Please add a @param features entry 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.
 */

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Copy link
Contributor

@sam-robson sam-robson left a comment

Choose a reason for hiding this comment

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

Just a little nit, otherwise lgtm!

async function getCliVersionFromFeatures(
features: FeatureEnablement,
): Promise<CodeQLDefaultVersionInfo> {
const gitHubVersion = await getGitHubVersion();
Copy link
Contributor

Choose a reason for hiding this comment

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

To save an API call, could we thread githubVersion through from

const gitHubVersion = await getGitHubVersion();
?

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻 I see. Well I'll leave that as a judgment call to you, happy to approve.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's get this merged to unblock other PRs, thanks 👍🏻

@mbg mbg merged commit a577f70 into main Feb 26, 2026
252 of 254 checks passed
@mbg mbg deleted the mbg/start-proxy/use-default-cli branch February 26, 2026 15:11
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