COR-1639: CLI-01: Scan Optimization (SHA Tracking)#123
Conversation
Reject skip with partial-scan/output flags, case-insensitive complete status, and satisfy clippy::question_mark on CI's Rust 1.97. Co-authored-by: Cursor <[email protected]>
Address RUSTSEC-2026-0194/0195 (quick-xml >=0.41) and RUSTSEC-2026-0204 (crossbeam-epoch >=0.9.20). Update Fortify parser for the quick-xml 0.41 API. Co-authored-by: Cursor <[email protected]>
Ibrahimrahhal
left a comment
There was a problem hiding this comment.
what is the use case here? as this can be confusing --skip-if-scanned may skip scanning because the user is working tree head is already scanned but he have uncommitted changes
yes that's expected, they mentioned they want to skip the scan if the commite was already scanned in the past 24 hours, maybe for CI reruns? |
Keep --skip-if-scanned helpers/tests alongside COR-1647 fail-on malicious gates and COR-1576 wrapper/help UX updates from main. Co-authored-by: Cursor <[email protected]>
| if *skip_if_scanned { | ||
| match &repo_info { | ||
| None => { | ||
| println!("--skip-if-scanned: not a git repository; scanning normally."); |
There was a problem hiding this comment.
should throw an error, for example "this param can only be used with git repositories"
| } | ||
| Some(_) if utils::generic::is_working_tree_dirty("./") => { | ||
| println!( | ||
| "--skip-if-scanned: working tree has uncommitted changes; scanning normally." |
Not sure, still looks not complete use case to me, for example we need to know how we should handle blocking rules. if they had a pipeline that was blocked on a day it will pass the next day if they enabled this flag. (it might not be needed but we need to understand more on how they intend to use it) |
Summary
Opt-in
--skip-if-scannedavoids re-scanning a commit that already has a completed same project/branch/SHA scan within 24h, andcorgea listsurfaces that SHA.Approach: Use doghouse
git_sha+?sha=/?branch=filters; skip only when opt-in and a recentcompletematch exists (exit 0). Default scan behavior unchanged.src/utils/api.rsgit_shatoScanResponse(#[serde(default)])query_scan_listwith optionalbranch/shaquery paramssrc/scanners/blast.rsfind_recent_matching_scan,parse_created_at,format_scan_agesrc/main.rs--skip-if-scannedflag (blast only; incompatible with--fail/--fail-on)src/list.rsgit_shavia structsrc/wait.rsquery_scan_listparamsTest plan
./harness check--jsongit_sha+?sha=Before
After