Skip to content

Remove support for combining SARIF runs with non-unique categories #2959

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 1 commit into from
Jul 2, 2025

Conversation

koesie10
Copy link
Member

@koesie10 koesie10 commented Jul 1, 2025

This removes support for combining SARIF runs with non-unique categories, and will instead throw a configuration error. This behavior is only enabled behind a feature flag.

This is intentionally not backwards compatible when the feature flag is enabled, as this was announced over a year ago and a deprecation warning is shown for every upload that would run into this error.

Screenshot 2025-07-02 at 11 33 41

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.

@koesie10 koesie10 marked this pull request as ready for review July 2, 2025 09:34
@Copilot Copilot AI review requested due to automatic review settings July 2, 2025 09:34
@koesie10 koesie10 requested a review from a team as a code owner July 2, 2025 09:34
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 introduces a feature-flagged error when attempting to combine multiple SARIF runs that share the same category, and updates related merge logic and tests.

  • Add throwIfCombineSarifFilesDisabled & shouldDisableCombineSarifFiles to enforce non-unique-category checks behind the DisableCombineSarifFiles flag.
  • Extend combineSarifFilesUsingCLI to call the new check and update deprecation messaging.
  • Register and configure DisableCombineSarifFiles in the feature flags and expand test coverage accordingly.

Reviewed Changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated no comments.

File Description
src/upload-lib.ts Added new helper functions for feature-flagged enforcement and integrated them into merge flow
src/upload-lib.test.ts Added comprehensive AVA tests for the new enforcement logic across GitHub variants
src/feature-flags.ts Defined the DisableCombineSarifFiles feature flag and its environment default
lib/* Generated JavaScript reflecting the above TypeScript changes (mirrors TS sources)
Comments suppressed due to low confidence (1)

src/upload-lib.ts:182

  • You're using semver.lt here but there's no import for semver. Please add import * as semver from "semver"; at the top of the file.
  ) {

Copy link
Member

@mbg mbg left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this and including a bunch of tests! This generally looks good to me.

Comment on lines +221 to +225
await throwIfCombineSarifFilesDisabled(
sarifObjects,
features,
gitHubVersion,
);
Copy link
Member

Choose a reason for hiding this comment

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

I assume the deprecation warning a few lines further down is not necessary if the conditions for this are true. Should it be removed now or later?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's true, but we can only remove the deprecation warning when the action drops support for GHES 3.17. In all GHES versions between 3.14 (including) and 3.18 (excluding), the action should still show the deprecation warning and should never give this error. Until support for GHES 3.17 is dropped, customers can still sync their action from dotcom to their GHES instance and expect it to work without breaking changes.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense -- probably also worth tracking then

@koesie10 koesie10 merged commit 33f8489 into main Jul 2, 2025
557 checks passed
@koesie10 koesie10 deleted the koesie10/remove-combine-runs branch July 2, 2025 12:34
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