Repository navigation
fix(scan report): handle large alert output - #1602
Open
John-David Dalton (jdalton) wants to merge 1 commit into
Open
John-David Dalton (jdalton) wants to merge 1 commit into
John-David Dalton (jdalton) wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
LLM Description written by Codex:GPT-6
Summary
Remove unbounded argument spreads from scan report width calculation and table assembly. Add a 200,000-alert renderer regression that checks the count and first and last package rows. Narrow full reports with a structural
alertscheck before rendering.Validation
git diff --checkpassed.pnpmwrapper rejects its configured token. CI will validate the regression and lint.Note
Low Risk
Localized CLI report formatting fix and safer typing for short/minimal report payloads; no auth, network, or policy logic changes.
Overview
Fixes plain-text scan reports crashing or failing when a scan has a very large number of alerts (e.g. hundreds of thousands), by removing patterns that pass unbounded values through function argument spreads.
formatAlertTablenow computes column widths with nested loops instead ofMath.max(...cells.map(...))per column.toPlainTextReportappends table lines with a loop instead oflines.push(...formatAlertTable(rows)).For non-short text output,
outputGeneratedScanReportuses a newisFullScanReporttype guard ('alerts' in report) before callingtoPlainTextReport, and otherwise printsOK/ERR—replacing an unsafeas ScanReportcast when the generated data is only{ healthy: boolean }.A unit test renders 200,000 alerts and asserts the summary count and first/last package names without hitting argument-limit errors.
Reviewed by Cursor Bugbot for commit 6d325f1. Configure here.