Use bqrs diff for all cases in the compare view when --result-sets is supported#4211
Merged
paldepind merged 4 commits intogithub:mainfrom Nov 27, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the "Compare Results" view to use the CodeQL CLI's bqrs diff --result-sets option for all comparison scenarios when supported by the CLI version. This improves performance and accuracy while maintaining backward compatibility with older CLI versions.
Key Changes:
- Introduced a generic
supportsFeature()method to check CLI feature availability, eliminating the need for theCliVersionConstraintclass - Updated the compare view to use
bqrs diffwith the--result-setsoption when available, falling back to the legacy in-extension diff only for older CLI versions - Added
bqrsDiffResultSetsfeature flag to track CLI support for the new option
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| extensions/ql-vscode/src/codeql-cli/cli-version.ts | Adds bqrsDiffResultSets feature flag to CliFeatures interface |
| extensions/ql-vscode/src/codeql-cli/cli.ts | Exports OLDEST_SUPPORTED_CLI_VERSION, adds generic supportsFeature() method, implements resultSets option for bqrsDiff, removes CliVersionConstraint class |
| extensions/ql-vscode/src/query-server/query-server-client.ts | Refactors to use new supportsFeature() method instead of cliConstraints |
| extensions/ql-vscode/src/extension.ts | Updates to use exported constant and simplifies version check logic |
| extensions/ql-vscode/src/compare/compare-view.ts | Implements conditional use of bqrs diff --result-sets based on CLI feature support |
| extensions/ql-vscode/src/compare/resultsDiff.ts | Adds deprecation notice indicating legacy status |
| extensions/ql-vscode/CHANGELOG.md | Documents the enhancement with PR references |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6f64dd8 to
01d4bb5
Compare
ginsbach
approved these changes
Nov 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes "Compare Results" use the new
--result-setsoption that was added to the CodeQL CLI. When this option is supported we can usebqrs diffin all cases, and only need to fall back to the in-extension diff for old CLI versions (where "old" at the time of writing is all released CLI versions 😉).I also made a small refactor to how we check for supported features. The new
supportsFeaturemethod automatically makes it possible to check for all the features in theCliFeaturestype, without requiring us to manually add a method for all features toCliVersionConstraint. This made theCliVersionConstraintclass superflous.Closes #1364.