Skip to content

Conversation

@airadier
Copy link
Collaborator

This PR fixes an issue where packages in the "Package vulnerabilities per layer" summary table were not being correctly sorted by vulnerability severity. Previously, the sorting logic was inconsistent or incorrect; now, packages are strictly ordered by:

  1. Number of Critical vulnerabilities (descending).
  2. Number of High vulnerabilities (descending).
  3. Number of Medium vulnerabilities (descending).
  4. (And so on for lower severities).

Changes:

  • Refactor: Extracted the package sorting logic into a dedicated domain service src/domain/services/sorting.ts.
  • Refactor: Decoupled SummaryReportPresenter from the global @actions/core summary object by introducing an ISummary interface (though currently we still default to core.summary in production code, this structure allows for easier testing).
  • Testing: Added comprehensive unit tests for the new sorting service in tests/domain/services/sorting.test.ts.
  • Testing: Added an integration-style test in tests/infrastructure/github/SummaryReportPresenter.test.ts that generates a report using the real core.summary and validates the HTML output to ensure packages appear in the correct order.

Fixes:

  • Ensures that the most critical packages appear at the top of the summary report tables, improving visibility of high-risk items.

@airadier airadier requested a review from a team as a code owner November 27, 2025 12:47
@airadier airadier enabled auto-merge (squash) November 27, 2025 12:50
@airadier airadier disabled auto-merge November 27, 2025 12:50
@airadier airadier enabled auto-merge (squash) November 27, 2025 12:51
@airadier airadier merged commit 90e7e27 into master Nov 27, 2025
10 checks passed
@airadier airadier deleted the fix-package-sort-in-summary branch November 27, 2025 13:07
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.

3 participants