Skip to content

Disable combining runs within a single file #2988

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

Merged
merged 2 commits into from
Jul 23, 2025

Conversation

koesie10
Copy link
Member

This will throw a ConfigurationError when a single SARIF file contains multiple runs with the same category.

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.

@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 11:55
@koesie10 koesie10 requested a review from a team as a code owner July 23, 2025 11:55
Copy link
Contributor

@Copilot Copilot AI 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 disables the ability to combine multiple SARIF runs within a single file by throwing a ConfigurationError when such scenarios are detected. The change enforces a restriction that each SARIF file should contain only one run per category.

  • Removes early return optimization for single SARIF files in the combining logic
  • Adds validation to throw an error when multiple runs with the same category exist in a single file
  • Updates both TypeScript source and corresponding generated JavaScript files

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/upload-lib.ts Removes single-file optimization and adds validation call for single SARIF files
lib/upload-lib.js Generated JavaScript equivalent of the TypeScript changes

@@ -206,9 +206,6 @@ async function combineSarifFilesUsingCLI(
logger: Logger,
): Promise<SarifFile> {
logger.info("Combining SARIF files using the CodeQL CLI");
if (sarifFiles.length === 1) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This case was never actually hit, so I've removed this.

@koesie10 koesie10 requested a review from mbg July 23, 2025 11:56
mbg
mbg previously approved these changes Jul 23, 2025
@koesie10 koesie10 enabled auto-merge July 23, 2025 12:01
@koesie10 koesie10 disabled auto-merge July 23, 2025 12:02
@koesie10 koesie10 enabled auto-merge July 23, 2025 12:03
@koesie10 koesie10 requested a review from mbg July 23, 2025 12:03
@koesie10 koesie10 merged commit 37264dc into main Jul 23, 2025
282 checks passed
@koesie10 koesie10 deleted the koesie10/disable-combine-single-file branch July 23, 2025 12:18
@github-actions github-actions bot mentioned this pull request Jul 23, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants