Skip to content

Support for query suites #615

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
p0 opened this issue Oct 12, 2020 · 5 comments
Open

Support for query suites #615

p0 opened this issue Oct 12, 2020 · 5 comments
Labels
enhancement New feature or request VSCode

Comments

@p0
Copy link

p0 commented Oct 12, 2020

Is your feature request related to a problem? Please describe.
It'd be great to have the extension understend CodeQL query suites. This would ideally cover both authoring them and executing query suites on the currently-selected database.

Describe the solution you'd like
The *.qls format is effectively YAML with a particular schema, so switching to YAML mode at least gives syntax highlighting at the moment. Having the schema used automatically for auto-complete suggestions and error checking would be great, though.

For bulk query execution, selecting a *.qls file would be more flexible than the current "run all queries in this folder" approach. There's a slight UI challenge around how to make well-known query suites discoverable.

Describe alternatives you've considered
The current workaround is to edit *.qls files after manually selecting YAML mode, and to use the CodeQL CLI to run query suites, though that doesn't insert them into the query history view.

@p0 p0 added the enhancement New feature or request label Oct 12, 2020
@aeisenberg
Copy link
Contributor

It sounds like you are asking for 3 separate and related features here:

  • Ability to run query suite files from inside the IDE. This will require a change to the query server. Ideally, the IDE would receive incremental updates as each query is complete, so the results view can be populated incrementally. However, that's not how the query server works and the only solution may be to wait until all queries are complete before displaying any results.
  • Ability to edit qls files. For this, we may just need to create a json schema file for query suites, submit the schema to https://www.schemastore.org/json/ and ensure this extension has a dependency on the vscode-yaml extension.
  • Ability to run well-known query suites. We will need to do some sort of discovery process for this, similar to how we implement discovery for ql tests.

@aeisenberg aeisenberg added good first issue Good for newcomers and removed good first issue Good for newcomers labels Mar 9, 2021
@vovikhangcdv
Copy link

Has the team started implementing it yet?

@aeisenberg
Copy link
Contributor

Not yet. To run query suites, I suggest using the cli directly.

@kwang1083
Copy link

On a similar note for query suites, is there a way to run query suites on the selected variant analysis repositories? Either a way through the CLI or the directly through the extension interface?

@aeisenberg
Copy link
Contributor

No. Variant analysis runs one query at a time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request VSCode
Projects
None yet
Development

No branches or pull requests

4 participants