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 — Skip validating SARIF produced by CodeQL by henrymercer · Pull Request #2894 · github/codeql-action

Conversation

@henrymercer

@henrymercer henrymercer commented May 14, 2025

Copy link
Copy Markdown
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 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
henrymercer added 3 commits May 14, 2025 14:10
@henrymercer
Add utility function to get testing environment
f681ad6
@henrymercer
Skip validating SARIF produced by CodeQL
2f70a98
@henrymercer
Add changelog note
f7ab654
@henrymercer
henrymercer requested review from Copilot and esbena May 14, 2025 14:15
@henrymercer
henrymercer requested a review from a team as a code owner May 14, 2025 14:15
Copilot AI reviewed May 14, 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 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
File Description
src/util.ts Add getTestingEnvironment and refine JSDoc for test-mode logic.
src/workflow.ts Use getTestingEnvironment instead of direct process.env check.
src/upload-lib.ts Extract readSarifFile, update validateSarifFileSchema signature, skip validation by default for CodeQL SARIF.
src/upload-lib.test.ts Update schema tests to use readSarifFile before validation.
src/status-report.ts Use getTestingEnvironment for status payload and export logic.
src/analyze.ts Remove 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.md Document 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. */

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/upload-lib.ts Resolved

Uh oh!

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

Comment thread lib/upload-lib.js Resolved

Uh oh!

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

Comment thread src/upload-lib.ts Resolved

Uh oh!

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

@henrymercer
Improve docstring
15f19ac
Co-authored-by: Copilot <[email protected]>
@henrymercer henrymercer added the Rebuild Re-transpile JS & re-generate workflows label May 14, 2025
@github-actions github-actions Bot removed the Rebuild Re-transpile JS & re-generate workflows label May 14, 2025
@github-actions
Rebuild
bacf5fe
@github-actions

github-actions Bot commented May 14, 2025

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions
github-actions Bot marked this pull request as draft May 14, 2025 14:23
@henrymercer
henrymercer marked this pull request as ready for review May 14, 2025 14:23
@henrymercer
Merge branch 'main' into henrymercer/skip-validating-codeql-sarif
492d783
oscarsj
oscarsj approved these changes May 14, 2025
View reviewed changes

@oscarsj oscarsj left a comment

Copy link
Copy Markdown
Member

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!

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/util.ts
Comment on lines +767 to +773
export function getTestingEnvironment(): string | undefined {
const testingEnvironment = process.env[EnvVar.TESTING_ENVIRONMENT] || "";
if (testingEnvironment === "") {
return undefined;
}
return testingEnvironment;
}

@oscarsj oscarsj May 14, 2025

Copy link
Copy Markdown
Member

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, something went wrong.

Uh oh!

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

All reactions
@henrymercer
henrymercer merged commit 510dfa3 into main May 14, 2025
@henrymercer
henrymercer deleted the henrymercer/skip-validating-codeql-sarif branch May 14, 2025 18:55
@github-actions github-actions Bot mentioned this pull request May 16, 2025
Merge main into releases/v3 #2896
Merged
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

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

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.

3 participants

@henrymercer @oscarsj
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.