-
Notifications
You must be signed in to change notification settings - Fork 375
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
base: main
Are you sure you want to change the base?
Conversation
7a174b3
to
230fc32
Compare
This commit inlines runInit(), so that it is easier to repeat the runDatabaseInitCluster() call when needed.
230fc32
to
d0d4112
Compare
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 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 interfacePackInfo
exported fromsrc/codeql.ts
. Consider renaming this test-specific type to avoid confusion, such asTestPackInfo
orMockPackInfo
.
type PackInfo = {
kind: "query" | "library";
packinfoContents?: string;
};
return true; | ||
} | ||
|
||
const packInfoPath = path.join(path.dirname(packInfo.path), ".packinfo"); |
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 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.
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"), | ||
); |
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.
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.
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.Merge / deployment checklist