-
Notifications
You must be signed in to change notification settings - Fork 363
Produce separate SARIF file for quality-queries
alerts
#2935
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
87b6687
to
fe76653
Compare
2bf7322
to
24e4f58
Compare
7e59f77
to
f7fbaa0
Compare
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 enables separate generation and upload of SARIF files for code-quality queries specified via the quality-queries
input, in addition to the existing code-scanning SARIF flow.
- Introduces
SARIF_UPLOAD_TARGET
enum andUploadTarget
interface to distinguish code scanning vs. code quality uploads. - Extends file discovery (
findSarifFilesInDir
,getSarifFilePaths
) and upload logic (uploadFiles
,uploadPayload
,validateUniqueCategory
) to filter and handle.quality.sarif
files. - Updates
analyze.ts
/analyze-action.ts
to produce and upload quality SARIFs whenquality-queries
are provided, and adjusts CI workflows to upload/check both SARIF artifacts.
Reviewed Changes
Copilot reviewed 12 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/upload-lib.ts | Added enum and targets for separate SARIF uploads, filtering logic for .quality.sarif . |
src/upload-lib.test.ts | Added tests for filtering .quality.sarif files and validateUniqueCategory prefix. |
src/analyze.ts | Introduced default query suites and resolveQuerySuiteAlias ; generate quality SARIF. |
src/analyze.test.ts | Added tests for resolveQuerySuiteAlias . |
src/analyze-action.ts | Uploads quality SARIF and sets quality-sarif-id output when quality-queries present. |
pr-checks/checks/quality-queries.yml | CI updates to upload security vs. quality SARIF artifacts and adjust checks. |
Comments suppressed due to low confidence (2)
src/upload-lib.ts:427
- The
getSarifFilePaths
function bypasses theisSarif
filter whensarifPath
is a single file. This can lead to uploading unwanted files (e.g., a.quality.sarif
when targeting code-scanning). ApplyisSarif
to the single-file case or throw if it does not match.
sarifFiles = [sarifPath];
pr-checks/checks/quality-queries.yml:29
- [nitpick] The CI step now only checks config properties in the quality SARIF, omitting the original security SARIF check. Consider adding a separate check for
${{ runner.temp }}/results/javascript.sarif
to ensure both artifacts are validated.
SARIF_PATH: "${{ runner.temp }}/results/javascript.quality.sarif"
Follows on from #2917.
This PR modifies the action to produce separate SARIF files for code quality queries (as specified as arguments to the
quality-queries
input) and uploads them to the code quality API. The approach here is that:database interpret-results
for queries that were specified as arguments to thequality-queries
input (if any). This results in SARIF files for those queries.Notes
quality-queries
alerts.Merge / deployment checklist