Skip to content

fix: multi-folder --report writes report.json and OA/DM panels - #901

Merged
sonukapoor merged 1 commit into
OWASP:mainfrom
Ayush7614:fix/multi-folder-report-parity
Aug 10, 2026
Merged

fix: multi-folder --report writes report.json and OA/DM panels#901
sonukapoor merged 1 commit into
OWASP:mainfrom
Ayush7614:fix/multi-folder-report-parity

Conversation

@Ayush7614

@Ayush7614 Ayush7614 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Multi-folder --report now writes report.json alongside index.html, matching single-folder artifact shape.
  • Override hygiene and maintenance-risk panels render per folder when --check-overrides / --check-maintenance are set (including empty-state reassurance).
  • report.json tags OA/DM findings with subfolder; docs note the multi-folder parity.

Fixes #878

Test plan

  • npm test -- tests/multi-folder-html-reporter.test.ts (8 tests)
  • npm run build
  • Manual: monorepo with ≥2 nested lockfiles, cve-lite . --check-overrides --check-maintenance --report ./cve-report --no-openindex.html + report.json, HTML includes Override hygiene / Maintenance risk when findings exist

@Ayush7614
Ayush7614 requested a review from sonukapoor as a code owner July 27, 2026 19:04
@Ayush7614

Copy link
Copy Markdown
Collaborator Author

cc: @sonukapoor

@sonukapoor sonukapoor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This closes the multi-folder gap cleanly - report.json written with findings tagged by subfolder, and the override/maintenance panels render per folder like single-folder mode. I ran it on a real two-folder layout and the outputs look right.

One thing before merge, left inline: findings get serialized twice, once for the HTML and once for report.json - worth folding into one pass. Two optional test adds would be nice too (a second-folder subfolder-tag assertion, and a mixed case where only one folder has override findings), not blocking. Thanks for this.

}): MultiFolderReportData {
const findings = params.results.flatMap(r =>
r.sorted.map(f => ({
...serializeHtmlFinding(f, r.suggestedFixCommands),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This serializes every finding twice - allSerialized further down builds the HTML rows, and this call re-runs serializeHtmlFinding over the same findings for report.json. Single-folder mode serializes once and reuses it for both. Could you thread allSerialized (with the subfolder tag folded in) into buildMultiFolderReportData instead of re-deriving it here? Keeps it to one pass and stops the two outputs drifting if serialization ever changes.

@Ayush7614

Copy link
Copy Markdown
Collaborator Author

@sonukapoor rebased onto latest main, resolved conflicts with the completeness banner work (#936), and squashed to a single commit under my author only (no agent/cursor co-authors). Should be clean to merge for #878.

@Ayush7614
Ayush7614 force-pushed the fix/multi-folder-report-parity branch 2 times, most recently from f86f591 to b9e8b14 Compare August 8, 2026 16:41
@sonukapoor

Copy link
Copy Markdown
Collaborator

Thanks for adding the report.json + OA/DM panels, this looks solid on its own. But I don't think this addresses the serialization point from my last review - buildMultiFolderReportData still calls serializeHtmlFinding fresh over r.sorted, separate from the allSerialized array computed a few lines below it in writeMultiFolderHtmlReport for the HTML/JS bundle - so findings are still serialized twice per scan, once for each. Could you thread allSerialized into buildMultiFolderReportData instead of recomputing it? The two optional test adds from before are still just nice-to-haves, not blocking - it's really just this one thing.

Multi-folder HTML reports previously only emitted index.html and never
rendered override/maintenance sections even when those checks ran.
Parity with single-folder: both artifacts plus per-folder OA/DM panels.
Serialize findings once and reuse for HTML and report.json.

Fixes OWASP#878
@Ayush7614
Ayush7614 force-pushed the fix/multi-folder-report-parity branch from 22c9782 to 05cebda Compare August 10, 2026 08:53
@Ayush7614

Copy link
Copy Markdown
Collaborator Author

@sonukapoor addressed the serialization feedback — buildMultiFolderReportData now takes serializedByFolder from the single allSerialized pass in writeMultiFolderHtmlReport instead of re-running serializeHtmlFinding. Rebased onto latest main and squashed to one commit.

@sonukapoor sonukapoor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Confirmed - findings are serialized once now and reused for both the HTML and report.json, exactly what I was after. Nice work on the OA/DM panel parity too, this closes a real gap between single-folder and multi-folder reports.

@sonukapoor
sonukapoor merged commit 0adbf73 into OWASP:main Aug 10, 2026
9 checks passed
@sonukapoor

Copy link
Copy Markdown
Collaborator

Merged - thank you @Ayush7614!

sonukapoor added a commit that referenced this pull request Aug 11, 2026
Reverts commit 0c3d129 (#961). The feature and its Cloudflare Worker
backend are being reconsidered - the public ingest endpoint is
unauthenticated by design (anyone can post fake data to skew the
aggregate numbers this feature exists to eventually cite), and the
deployed Worker's *.workers.dev URL currently bakes in a personal
Cloudflare account name. Shipping the prompt/commands/docs while this
is unresolved would create a false impression the feature is settled.

The code isn't lost - it's being consolidated, alongside the Worker
backend, on a separate branch to revisit once the open questions are
resolved.

verified to cleanly preserve both (multi-folder-scan.ts keeps #901's
report.json/OA/DM panel work, README.md keeps #956's unrelated intro
line unchanged) - confirmed by inspecting every auto-merged file
directly, not just trusting a clean git revert.
sonukapoor added a commit that referenced this pull request Aug 11, 2026
#965)

Reverts commit 0c3d129 (#961). The feature and its Cloudflare Worker
backend are being reconsidered - the public ingest endpoint is
unauthenticated by design (anyone can post fake data to skew the
aggregate numbers this feature exists to eventually cite), and the
deployed Worker's *.workers.dev URL currently bakes in a personal
Cloudflare account name. Shipping the prompt/commands/docs while this
is unresolved would create a false impression the feature is settled.

The code isn't lost - it's being consolidated, alongside the Worker
backend, on a separate branch to revisit once the open questions are
resolved.

verified to cleanly preserve both (multi-folder-scan.ts keeps #901's
report.json/OA/DM panel work, README.md keeps #956's unrelated intro
line unchanged) - confirmed by inspecting every auto-merged file
directly, not just trusting a clean git revert.
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.

bug: multi-folder --report omits report.json and never renders override/maintenance panels

2 participants