Skip to content

Overlay: check query packs for compatibility #2993

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

cklin
Copy link
Contributor

@cklin cklin commented Jul 25, 2025

This PR updates the init action to prevent overlay analysis (or overlay-base database construction) when one of the query packs involved does not support overlay analysis with the installed CodeQL CLI.

  • @alexet Please review the aspects concerning interaction with the CodeQL bundle
  • @mbg Please review all other aspects of the change

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@cklin cklin force-pushed the cklin/overlay-pack-check branch 3 times, most recently from 7a174b3 to 230fc32 Compare July 28, 2025 21:17
@cklin cklin force-pushed the cklin/overlay-pack-check branch from 230fc32 to d0d4112 Compare July 29, 2025 18:58
@cklin cklin marked this pull request as ready for review July 29, 2025 19:20
@Copilot Copilot AI review requested due to automatic review settings July 29, 2025 19:20
@cklin cklin requested a review from a team as a code owner July 29, 2025 19:20
@cklin cklin requested review from mbg and alexet July 29, 2025 19:20
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 adds compatibility checking for query packs with overlay analysis in the CodeQL Action, preventing overlay analysis when query packs don't support the feature. The overlay minimum version is also updated from 2.20.5 to 2.22.2.

  • Implements pack compatibility checking that validates overlay version requirements
  • Refactors database initialization to support re-initialization when incompatible packs are found
  • Updates minimum CodeQL version for overlay support and adds comprehensive test coverage

Reviewed Changes

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

Show a summary per file
File Description
src/testing-utils.ts Adds overlayVersion parameter to makeVersionInfo utility for testing
src/overlay-database-utils.ts Updates minimum CodeQL version for overlay support from 2.20.5 to 2.22.2
src/init.ts Refactors database initialization and adds pack compatibility checking logic
src/init.test.ts Adds comprehensive tests for pack compatibility checking functionality
src/init-action.ts Integrates pack compatibility checking into the main initialization flow
src/config-utils.test.ts Updates test to use new minimum overlay version constant
src/codeql.ts Adds resolvePacks method interface and implementation
lib/* Generated JavaScript files mirroring the TypeScript changes
Comments suppressed due to low confidence (1)

src/init.test.ts:146

  • The type name PackInfo conflicts with the interface PackInfo exported from src/codeql.ts. Consider renaming this test-specific type to avoid confusion, such as TestPackInfo or MockPackInfo.
type PackInfo = {
  kind: "query" | "library";
  packinfoContents?: string;
};

return true;
}

const packInfoPath = path.join(path.dirname(packInfo.path), ".packinfo");
Copy link
Preview

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

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

The hard-coded .packinfo filename is used multiple times in this function. Consider extracting it as a constant (e.g., PACK_INFO_FILENAME) to improve maintainability and reduce the risk of typos.

Suggested change
const packInfoPath = path.join(path.dirname(packInfo.path), ".packinfo");
const packInfoPath = path.join(path.dirname(packInfo.path), PACK_INFO_FILENAME);

Copilot uses AI. Check for mistakes.


const packInfoFileContents = JSON.parse(
fs.readFileSync(packInfoPath, "utf8"),
);
Copy link
Preview

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

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

JSON parsing errors should be caught and provide more descriptive error messages. The current catch block at line 225 doesn't distinguish between file system errors and JSON parsing errors, which could make debugging more difficult.

Copilot uses AI. Check for mistakes.

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy