GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add new `quality-queries` input by mbg · Pull Request #2917 · github/codeql-action

Conversation

@mbg

@mbg mbg commented Jun 3, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This PR adds a new quality-queries input to the init action. Fundamentally, this behaves the same as the queries input and propagates a list of queries to the CLI. The list of queries given in the quality-queries input is combined with the queries input and configuration file, as expected.

The intention here is that this will later allow us to filter SARIF results depending on which input the query responsible for the alert belongs to.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
mbg marked this pull request as ready for review June 4, 2025 10:56
Copilot AI review requested due to automatic review settings June 4, 2025 10:56
@mbg
mbg requested a review from a team as a code owner June 4, 2025 10:56
Copilot AI reviewed Jun 4, 2025
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a new quality-queries input to the init action and propagates it through configuration parsing and SARIF generation, enabling code quality queries to be combined and filtered alongside existing query inputs.

  • Adds quality-queries to init-action.ts and action.yml
  • Extends config-utils and codeql modules to parse and inject quality queries
  • Updates unit tests and generated workflows to cover the new input

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/init-action.ts Propagate qualityQueriesInput from action inputs
src/config-utils.ts Extend calculateAugmentation and related interfaces
src/config-utils.test.ts Add qualityQueriesInput to test setup and cases
src/codeql.ts Inject qualityQueriesInput into SARIF config building
init/action.yml Declare new quality-queries input
pr-checks/checks/quality-queries.yml Add PR check workflow for quality queries
lib/init-action.js Build output for quality-queries handling
lib/config-utils.js Compiled parsing and augmentation updates
lib/config-utils.test.js Compiled test adjustments for quality queries
lib/codeql.js Compiled SARIF injection updates
.github/workflows/__quality-queries.yml Generated workflow for the new PR check
Comments suppressed due to low confidence (3)

src/config-utils.test.ts:860

  • Add a test case where both queries and quality-queries inputs are provided together (with and without + prefix) to verify that they merge correctly into the resulting queriesInput and qualityQueriesInput properties.
// (after existing tests for quality queries)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
mbg force-pushed the mbg/use-cq-endpoint branch 2 times, most recently from 1b15d07 to 7372582 Compare June 9, 2025 22:13
esbena
esbena reviewed Jun 11, 2025
View reviewed changes

@esbena esbena left a comment

Copy link
Copy Markdown
Contributor

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.

Generally LGTM. Pending some related discussion in internal document.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread init/action.yml Outdated
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
required: false
quality-queries:
description: Comma-separated list of code quality queries to run.

@esbena esbena Jun 11, 2025

Copy link
Copy Markdown
Contributor

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.

  • Does this also support the + semantics of queries above?
  • Does the user need to know what the difference is between these two inputs? What happens if a query is present in both? What if a non-quality query is present in the quality suite?...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mbg mbg Jun 16, 2025

Copy link
Copy Markdown
Member Author

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.

Sorry, I thought I had replied to this.

Does this also support the + semantics of queries above?

No, I omitted that for now to keep it simple, but I can add it if we think it makes sense. AFAIK it's not something that we would be using internally right now.

Does the user need to know what the difference is between these two inputs?

In default setup, we provide the inputs. For advanced setup, the user can specify this. In the future, we might want a simpler "on" switch for quality queries, but I don't think that would change us wanting to have this.

What happens if a query is present in both?

Then the resulting alerts should go in both SARIF uploads.

What if a non-quality query is present in the quality suite?...

My understanding is that this isn't necessarily something we should be concerned with in the action right now. If we get an input to quality-queries, we should assume that those are quality queries. The backend filters out things that it doesn't think are quality queries (that's already happens, since the backend only gets one big SARIF file with all alerts right now).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@esbena esbena Jun 16, 2025

Copy link
Copy Markdown
Contributor

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.

OK. Would a user want to know any of these subtleties? Alternative: Should the input perhaps be marked as internal for the time being?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@starcke starcke Jun 16, 2025

Copy link
Copy Markdown

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.

My understanding is that this isn't necessarily something we should be concerned with in the action right now. If we get an input to quality-queries, we should assume that those are quality queries. The backend filters out things that it doesn't think are quality queries (that's already happens, since the backend only gets one big SARIF file with all alerts right now).

This is correct, the backend filters the SARIF based on a list of quality queries it knows about.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mbg mbg Jun 16, 2025

Copy link
Copy Markdown
Member Author

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.

Alternative: Should the input perhaps be marked as internal for the time being?

Happy to mark as internal or experimental for now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mbg mbg Jun 16, 2025

Copy link
Copy Markdown
Member Author

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.

I have pushed a commit which marks it as internal.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/codeql.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mbg added 6 commits June 16, 2025 13:17
@mbg
Add new quality-queries input to init action
f10997b
@mbg
Read and parse quality-queries input
87c5471
@mbg
Pass quality queries to CLI
f4c96f5
@mbg
Add basic check that resulting SARIF contains quality-queries queries
7e3bc05
@mbg
Add test for security and quality query inputs
22b1968
@mbg
De-duplicate query array in generateCodeScanningConfig
6b66390
@mbg
mbg force-pushed the mbg/use-cq-endpoint branch from 003bfc3 to 6b66390 Compare June 16, 2025 12:18
@mbg
Mark quality-queries input as "Internal" for now
0fb9447
@mbg
mbg requested a review from esbena June 16, 2025 12:27
esbena
esbena approved these changes Jun 16, 2025
View reviewed changes

@esbena esbena left a comment

Copy link
Copy Markdown
Contributor

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.

LGTM with the caveat that the splitting strategy for normal and quality queries still hasn't been done.
Depending on how that is done, the quality-queries and queries inputs may have to be propagated further into the action later, so the design now may as well take that into account.

The semantics now is simply that there's a secondary input to add queries through.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg

mbg commented Jun 16, 2025

Copy link
Copy Markdown
Member Author

LGTM with the caveat that the splitting strategy for normal and quality queries still hasn't been done.
Depending on how that is done, the quality-queries and queries inputs may have to be propagated further into the action later, so the design now may as well take that into account.

Yes, that will be in a separate PR. The inputs are propagated already through the configuration file that is restored in other steps (config.augmentationProperties.qualityQueriesInput is available later).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg merged commit 3de706a into main Jun 16, 2025
@mbg
mbg deleted the mbg/use-cq-endpoint branch June 16, 2025 12:54
@mbg mbg mentioned this pull request Jun 17, 2025
Produce separate SARIF file for quality-queries alerts #2935
Merged
1 of 3 tasks
@github-actions github-actions Bot mentioned this pull request Jun 27, 2025
Merge main into releases/v3 #2953
Merged
8 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@starcke starcke starcke left review comments
Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@esbena esbena esbena approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@mbg @starcke @esbena
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.