Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Skip validating SARIF produced by CodeQL#2894

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
henrymercer merged 6 commits intomainfromhenrymercer/skip-validating-codeql-sarif
May 14, 2025

Conversation

henrymercer
Copy link
Contributor

This PR skips validating SARIF files produced by CodeQL, unless we are running in a testing environment. This improves end-to-end performance.

We also only read the SARIF file once in the common case that only one file is being uploaded. Previously we read it twice. This should also speed things up, particularly for large SARIF files.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm thereadme has been updated if necessary.
  • Confirm thechangelog has been updated if necessary.

@henrymercerhenrymercer requested a review froma team as acode ownerMay 14, 2025 14:15
Copy link
Contributor

@CopilotCopilotAI left a 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 improves performance by skipping SARIF schema validation for CodeQL-produced results outside of testing environments and reducing redundant file reads when uploading a single SARIF file.

  • Introduce getTestingEnvironment to centralize test-environment checks.
  • Split validateSarifFileSchema into readSarifFile + validate so a single-file upload is read only once.
  • Update uploadFiles to skip validation for pure CodeQL SARIF in production and streamline multi-/single-file flows.

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/util.tsAdd getTestingEnvironment and refine JSDoc for test-mode logic.
src/workflow.tsUse getTestingEnvironment instead of direct process.env check.
src/upload-lib.tsExtract readSarifFile, update validateSarifFileSchema signature, skip validation by default for CodeQL SARIF.
src/upload-lib.test.tsUpdate schema tests to use readSarifFile before validation.
src/status-report.tsUse getTestingEnvironment for status payload and export logic.
src/analyze.tsRemove in-place validation in getPerQueryAlertCounts and update its signature.
lib/…Mirror changes in compiled JS for util, workflow, upload-lib, status-report, analyze, and tests.
CHANGELOG.mdDocument skipping SARIF validation for CodeQL.
Comments suppressed due to low confidence (1)

src/analyze.ts:683

  • Consider updating this JSDoc to reflect that the function no longer performs validation and no longer accepts a logger parameter.
/** Get an object with all queries and their counts parsed from a SARIF file path. */

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@henrymercerhenrymercer added the RebuildRe-transpile JS & re-generate workflows labelMay 14, 2025
@github-actionsgithub-actionsbot removed the RebuildRe-transpile JS & re-generate workflows labelMay 14, 2025
@github-actionsGitHub Actions
Copy link
Contributor

Pushed a commit to rebuild the Action. Please mark the PR as ready for review to trigger PR checks.

@github-actionsgithub-actionsbot marked this pull request as draftMay 14, 2025 14:23
@henrymercerhenrymercer marked this pull request as ready for reviewMay 14, 2025 14:23
Copy link
Contributor

@oscarsjoscarsj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM!

Comment on lines +767 to +773
export function getTestingEnvironment(): string | undefined {
const testingEnvironment = process.env[EnvVar.TESTING_ENVIRONMENT] || "";
if (testingEnvironment === "") {
return undefined;
}
return testingEnvironment;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍🏾

@henrymercerhenrymercer merged commit510dfa3 intomainMay 14, 2025
270 checks passed
@henrymercerhenrymercer deleted the henrymercer/skip-validating-codeql-sarif branchMay 14, 2025 18:55
@github-actionsgithub-actionsbot mentioned this pull requestMay 16, 2025
8 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@oscarsjoscarsjoscarsj approved these changes

@esbenaesbenaAwaiting requested review from esbena

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@henrymercer@oscarsj

[8]ページ先頭

©2009-2025 Movatter.jp