Skip to content

Conversation

cklin
Copy link
Contributor

@cklin cklin commented Sep 25, 2025

This PR changes the init action so that, in situations where it would perform overlay analysis from cache, default the CodeQL CLI version to match that from the cached overlay-base database.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

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.

@cklin cklin marked this pull request as ready for review September 25, 2025 22:23
@cklin cklin requested a review from a team as a code owner September 25, 2025 22:23
@Copilot Copilot AI review requested due to automatic review settings September 25, 2025 22:23
Copy link
Contributor

@Copilot 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 PR changes the init action to use the CodeQL version from cached overlay-base databases when performing overlay analysis. The change detects the CodeQL version from the most recent compatible cache entry and defaults to that version instead of the default CLI version.

  • Adds functionality to retrieve CodeQL version from overlay-base database cache entries
  • Modifies init-action logic to use cached CodeQL version for overlay analysis when available
  • Refactors cache key generation to support reusable workflow prefix components

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/overlay-database-utils.ts Adds getCodeQLVersionFromOverlayBaseDatabase function and refactors cache key utilities
src/overlay-database-utils.test.ts Adds comprehensive tests for new cache key functionality and version extraction
src/init-action.ts Integrates overlay database CodeQL version detection into initialization workflow
src/api-client.ts Adds getMostRecentActionsCacheEntry function to retrieve latest cache entries
lib/*.js Generated JavaScript files from TypeScript compilation

}

const keyParts = cacheItem.key.split("-");
if (keyParts.length < 9) {
Copy link
Preview

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The magic number 9 for minimum key parts should be defined as a named constant to improve code maintainability and make the cache key format expectations clearer.

Copilot uses AI. Check for mistakes.

@cklin cklin force-pushed the cklin/preliminary-overlay-mode branch from 0d55271 to c4d96be Compare September 26, 2025 22:15
@cklin cklin force-pushed the cklin/overlay-cache-cli-version branch from db6a517 to d471ff9 Compare September 26, 2025 22:18
@cklin cklin force-pushed the cklin/overlay-cache-cli-version branch from d471ff9 to 8475d6a Compare September 26, 2025 22:22
@cklin cklin requested a review from mbg September 29, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant