-
Notifications
You must be signed in to change notification settings - Fork 202
New command: expose --cache-cleanup=overlay
base cache cleaning
#4082
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
66df4c2
to
82df605
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 a new command "CodeQL: Trim Overlay Base Cache" to expose the --cache-cleanup=overlay
functionality for cleaning base cache data. The command allows users to return a database to the state prior to overlay evaluation, keeping only base predicates and types needed for future overlay evaluation.
Key Changes:
- Implements new
trimOverlayBaseCache
command with corresponding message type and query server method - Adds UI integration through command registration and handler implementation
- Updates package.json to expose the command in VS Code's command palette
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
extensions/ql-vscode/src/query-server/query-runner.ts | Adds trimOverlayBaseCacheInDatabase method to handle the new cache trimming operation |
extensions/ql-vscode/src/query-server/messages.ts | Defines the trimOverlayBaseCache request type for communication with the query server |
extensions/ql-vscode/src/databases/local-databases-ui.ts | Registers command and implements handler for the new trim overlay base cache functionality |
extensions/ql-vscode/src/common/commands.ts | Adds type definition for the new command |
extensions/ql-vscode/package.json | Exposes the new command in VS Code's command palette |
extensions/ql-vscode/CHANGELOG.md | Documents the new feature addition |
4922bbf
to
380277d
Compare
I think it would make sense to add this command behind a version check, although it would be even better to hide it behind a CLI feature (one that is returned in cliServer.addVersionChangedListener((version) => {
void app.commands.execute(
"setContext",
"codeQL.cliFeatures.yourFeatureName",
version?.features?.yourFeatureName ?? false,
);
}); You can then access this context in the
If you can add tests, I think that would make sense. Once your PR is included in the nightly build, you should already be able to test it there, and based on when the PR is merged you can probably also determine which actual version it will be part of to add an actual version check. |
380277d
to
135be43
Compare
I've added a VSCode context variable for all the CLI features, but if that's too complicated, I can change it back to just the new CLI feature that we use. |
I'm fine with merging the query server changes first, so that we can include an integration test in this PR. |
Add new command "CodeQL: Trim Overlay Base Cache" that returns a database to the state prior to overlay evaluation, leaving only base predicates and types that may later be referenced during overlay evaluation.
Considerations: