fix: emit audit-log lifecycle for multi-folder scans#887
Conversation
sonukapoor
left a comment
There was a problem hiding this comment.
Thanks @rksharma-owg - this is the right fix for #879, and much cleaner than the earlier attempt: routing the per-folder override audit to the real audit-log handle instead of NULL_AUDIT_LOG is exactly it, and it is well tested.
Two things before it goes in:
-
The
scan.finishedlifecycle only fires on 2 of the 4 exit paths inhandleMultiFolderScan(src/scan/multi-folder-scan.ts). The--fix-unsupported and--sarif/--cdx-unsupported early returns emitscan.startedbut return without a matchingscan.finished, so a consumer cannot pair start/finish for exactly those flag combos (which are common in CI). The single-folder path inindex.tspairs finish on every early return - could you add the twoscan.finishedemits on those paths, with a test? (No fd leak here, to be clear -close()is called unconditionally after the function returns, so this is an audit-completeness gap, not a resource one.) -
Same as your other PRs: this bundles the unrelated
overrides: brace-expansion+ jest commit. We already resolved that advisory via the baseline in #897, so please drop that commit and rebase.
The core routing fix is solid and should survive as-is once those are addressed.
145691a to
2c63666
Compare
|
Thanks for the review. I rebased onto current Validation:
The local full build still encounters the unrelated |
Fixes #879
Summary
Validation
src/utils/network.tspreconnecttyping innpm run build, pre-existing on main)