-
Notifications
You must be signed in to change notification settings - Fork 363
Add new quality-queries
input
#2917
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
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
toinit-action.ts
andaction.yml
- Extends
config-utils
andcodeql
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
andquality-queries
inputs are provided together (with and without+
prefix) to verify that they merge correctly into the resultingqueriesInput
andqualityQueriesInput
properties.
// (after existing tests for quality queries)
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.
@@ -83,6 +83,9 @@ inputs: | |||
queries: | |||
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. |
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 ofqueries
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?...
if ( | ||
config.augmentationProperties.queriesInput || | ||
config.augmentationProperties.qualityQueriesInput | ||
) { | ||
if (config.augmentationProperties.queriesInputCombines) { | ||
augmentedConfig.queries = (augmentedConfig.queries || []).concat( | ||
config.augmentationProperties.queriesInput, | ||
config.augmentationProperties.queriesInput || [], | ||
config.augmentationProperties.qualityQueriesInput || [], | ||
); | ||
} else { | ||
augmentedConfig.queries = config.augmentationProperties.queriesInput; | ||
augmentedConfig.queries = ( | ||
config.augmentationProperties.queriesInput || [] | ||
).concat(config.augmentationProperties.qualityQueriesInput || []); |
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.
Nit: deduplication. Perhaps introduce a shared variable.
This PR adds a new
quality-queries
input to theinit
action. Fundamentally, this behaves the same as thequeries
input and propagates a list of queries to the CLI. The list of queries given in thequality-queries
input is combined with thequeries
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