feat(output): report scan completeness - #936
Conversation
|
Hi @luojiyin1987, heads up - this one picked up a conflict with main after #927 (a small status-line fix) landed in printers.ts, which this PR also reworks heavily. Could you rebase on the latest main and resolve? Once it is clean I will review it properly alongside #937. Appreciate the work on the completeness series. |
10f7e08 to
5fd97fe
Compare
sonukapoor
left a comment
There was a problem hiding this comment.
Really nice work @luojiyin1987 - this renders the completeness model cleanly across terminal, JSON, and HTML, and the detection-vs-remediation split is exactly right: a remediation-only gap keeps the headline intact and just notes fix guidance is incomplete, while a detection gap flips it to a partial-scan warning so a zero-findings result never reads as clean. Escaping and tests are solid. Two small things before it goes in.
src/scan/completeness.ts(the fetch message): small grammar bug that is now user-visible -pluralize(count, "fetch")prints "packument fetchs" for count > 1. Same fix we just landed for "vulnerability" in #927: pass the explicit plural,pluralize(count, "fetch", "fetches"). A quick test with count > 1 would keep it from regressing.src/output/html-reporter.ts(renderCompletenessBanner): you extractedgetCompletenessImpact()in this same PR, but the banner here still does the two inline.some()checks - could you route those throughgetCompletenessImpact(completeness)so there is one source of truth?- Non-blocking, for later: the
.diag-itemseverity/impact CSS classes have no matching rules yet, and the JSON carries bothstatusandcomplete. Leave as-is or tidy in a follow-up. - Coordination: I would like to merge this one first (it adds the shared helper), then have #937 rebase onto it.
sonukapoor
left a comment
There was a problem hiding this comment.
The plural fix and DRY reuse of getCompletenessImpact() look good - thanks for addressing both. Verified the fix commit directly against the diff, all checks pass.
|
Merged - thank you @luojiyin1987! |
Summary
Report scan completeness data in terminal, JSON, and HTML output.
This PR excludes ratchet and baseline behavior.
Part of #907.
Validation
npm run build