Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported, and the change includes focused coverage for empty, multi-run, and malformed SARIF inputs while preserving validation behavior.
No open issues 🎉
1 file not reviewed
lib/entry-points.js: Excluded by your content exclusion settings
What changed in this PR
This pull request updates SARIF upload telemetry to count results directly from the materialized SARIF object, avoiding redundant parsing while preserving validation behavior and telemetry values.
Changes:
- Exported and refactored
countResultsInSarif. - Added coverage for empty, multi-run, and malformed SARIF inputs.
- Added a changenote documenting the optimization.
| File | Description |
|---|---|
unreleased-change-notes/count-materialized-sarif-results.md |
Documents the upload post-processing efficiency improvement. |
src/upload-lib.ts |
Counts results directly from the existing SARIF object for upload telemetry. |
src/upload-lib.test.ts |
Tests result counting across runs and malformed SARIF arrays. |
Review effort: Lite (auto)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Count results directly from the SARIF object already available in
uploadPostProcessedFilesinstead of parsing the serialized upload payload again. Keep the existing missing-runs and missing-results array validation errors and continue reporting the same result count in upload telemetry.Serialization, schema validation, compression, and upload behavior are unchanged. The counter is exported for direct unit coverage, and the action bundle and change note are included.
Validation
npm run ava -- src/upload-lib.test.ts: all 48 upstream upload-library tests passed; the command also typechecks/transpiles the project.lib/entry-points.jswithnode build.mjsand validated the change note.npm ciusing npm 11; the generated bundle was identical and no dependency/lockfile changes are included.Validated locally with Node 24.22.2. This removes one redundant parse/allocation, not SARIF serialization, CodeQL query work, compression, or network transfer.