- Notifications
You must be signed in to change notification settings - Fork143
Fix vulnerability table duplication across manifests in comment summary#953
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
base:main
Are you sure you want to change the base?
Fix vulnerability table duplication across manifests in comment summary#953
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Move vulnerability table row array initialization inside manifest loopto prevent cross-contamination of vulnerability data between differentmanifest files (package.json, requirements.txt, etc).Previously, when multiple manifests contained vulnerabilities, the samerows array was being reused across all manifests, causing vulnerabilitiesto appear duplicated in subsequent manifest tables. This was due to therows array being declared once outside the manifest iteration loop.The fix ensures each manifest gets its own clean array by moving the`const rows: SummaryTableRow[] = []` declaration inside the for loopthat iterates over manifests.Added comprehensive test coverage:- Separate table creation for different manifests- Vulnerability deduplication across manifest tables- Multiple vulnerabilities per package in different manifests- Correct vulnerability grouping within manifestsAll existing tests continue to pass, confirming no regression infunctionality.
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 fixes a bug where vulnerability table rows were being duplicated across different manifest files due to shared array reference. The fix moves the rows array initialization inside the manifest loop to ensure each manifest gets its own clean array.
- Moves
rowsarray declaration inside the manifest iteration loop - Adds comprehensive test coverage for multi-manifest vulnerability scenarios
- Ensures proper isolation of vulnerability data between manifests
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/summary.ts | Moves rows array initialization inside manifest loop to prevent cross-contamination |
| tests/summary.test.ts | Adds comprehensive test coverage for multi-manifest vulnerability scenarios |
alecbuchanan commentedJul 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Move vulnerability table row array initialization inside manifest loop to prevent cross-contamination of vulnerability data between different manifest files (package.json, requirements.txt, etc).
Previously, when multiple manifests contained vulnerabilities, the same rows array was being reused across all manifests, causing vulnerabilities to appear duplicated in subsequent manifest tables. This was due to the rows array being declared once outside the manifest iteration loop.
The fix ensures each manifest gets its own clean array by moving the
const rows: SummaryTableRow[] = []declaration inside the for loop that iterates over manifests.Added comprehensive test coverage:
All existing tests continue to pass, confirming no regression in functionality.