Skip to content

COR-1639: CLI-01: Scan Optimization (SHA Tracking)#123

Open
leenk7991 wants to merge 5 commits into
mainfrom
cor-1639-scan-sha-tracking
Open

COR-1639: CLI-01: Scan Optimization (SHA Tracking)#123
leenk7991 wants to merge 5 commits into
mainfrom
cor-1639-scan-sha-tracking

Conversation

@leenk7991

@leenk7991 leenk7991 commented Jul 13, 2026

Copy link
Copy Markdown

Summary

  • related doghouse PR

Opt-in --skip-if-scanned avoids re-scanning a commit that already has a completed same project/branch/SHA scan within 24h, and corgea list surfaces that SHA.

Approach: Use doghouse git_sha + ?sha= / ?branch= filters; skip only when opt-in and a recent complete match exists (exit 0). Default scan behavior unchanged.

  • src/utils/api.rs
    • Add optional git_sha to ScanResponse (#[serde(default)])
    • Extend query_scan_list with optional branch / sha query params
  • src/scanners/blast.rs
    • Early skip check before packaging/upload
    • Helpers: find_recent_matching_scan, parse_created_at, format_scan_age
    • Unit tests for match / stale / future / branch-sha mismatch / incomplete
  • src/main.rs
    • --skip-if-scanned flag (blast only; incompatible with --fail / --fail-on)
  • src/list.rs
    • SHA column (first 8 chars); JSON includes git_sha via struct
  • src/wait.rs
    • Call-site update for new query_scan_list params

Test plan

  • ./harness check
  • Manual: skip on same commit after complete scan; scan without flag; list SHA / --json
  • Pair with doghouse PR that exposes git_sha + ?sha=

Before

Screenshot 2026-07-13 at 11 13 03 AM

After

Screenshot 2026-07-13 at 11 13 16 AM
Screenshot 2026-07-13 at 11 13 56 AM
  1. run a scan for this commit
Screenshot 2026-07-13 at 11 16 29 AM
  1. run again with flag --skip-if-scanned
Screenshot 2026-07-13 at 11 17 08 AM
  1. running scan without flag, doesn't skip scan
Screenshot 2026-07-13 at 11 17 41 AM
  1. after new commits, running with skip flag doesn't skpi
Screenshot 2026-07-13 at 11 19 49 AM
  1. uncommited working tree
Screenshot 2026-07-19 at 10 52 18 AM
  1. not a git repo
Screenshot 2026-07-19 at 10 55 23 AM

Comment thread src/main.rs Outdated
Comment thread src/scanners/blast.rs Outdated
leenk7991 and others added 2 commits July 13, 2026 12:31
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 <cursoragent@cursor.com>
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 <cursoragent@cursor.com>

@Ibrahimrahhal Ibrahimrahhal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@leenk7991

Copy link
Copy Markdown
Author

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?

- API/CLI capability to retrieve the last n scans, including their commit SHAs.

- Based on what is returned we will check if it has been scanned. If scanned within the last 24 hours, skip the scan. - TransUnion - Pending

@leenk7991
leenk7991 requested a review from Ibrahimrahhal July 15, 2026 14:31
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 <cursoragent@cursor.com>
Comment thread src/scanners/blast.rs
Comment thread src/scanners/blast.rs Outdated
Comment thread src/scanners/blast.rs
@leenk7991
leenk7991 requested a review from juangaitanv July 19, 2026 07:57
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.

3 participants