Skip to content

Conversation

@paldepind
Copy link
Contributor

@paldepind paldepind commented Nov 27, 2025

This PR makes "Compare Results" use the new --result-sets option that was added to the CodeQL CLI. When this option is supported we can use bqrs diff in 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 supportsFeature method automatically makes it possible to check for all the features in the CliFeatures type, without requiring us to manually add a method for all features to CliVersionConstraint. This made the CliVersionConstraint class superflous.

Closes #1364.

@paldepind paldepind marked this pull request as ready for review November 27, 2025 11:48
@paldepind paldepind requested a review from a team as a code owner November 27, 2025 11:48
Copilot AI review requested due to automatic review settings November 27, 2025 11:48
Copilot finished reviewing on behalf of paldepind November 27, 2025 11:50
Copy link
Contributor

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 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 the CliVersionConstraint class
  • Updated the compare view to use bqrs diff with the --result-sets option when available, falling back to the legacy in-extension diff only for older CLI versions
  • Added bqrsDiffResultSets feature 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.

@paldepind paldepind force-pushed the bqrs-diff-result-sets branch from 6f64dd8 to 01d4bb5 Compare November 27, 2025 11:53
@paldepind paldepind merged commit e121e05 into github:main Nov 27, 2025
31 checks passed
@paldepind paldepind deleted the bqrs-diff-result-sets branch November 27, 2025 14:10
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.

Failure to compare large results

2 participants