Skip to content

COR-1641: CLI-02: Scan-Level Metadata Tagging - #124

Merged
leenk7991 merged 5 commits into
cor-1639-scan-sha-trackingfrom
cor-1641-scan-metadata-tagging
Jul 22, 2026
Merged

COR-1641: CLI-02: Scan-Level Metadata Tagging#124
leenk7991 merged 5 commits into
cor-1639-scan-sha-trackingfrom
cor-1641-scan-metadata-tagging

Conversation

@leenk7991

Copy link
Copy Markdown
Member

Summary

Add repeatable --metadata KEY=VALUE on corgea scan so CI can tag a blast scan; the CLI sends it as a JSON metadata multipart part on upload.

Changes

  • src/main.rs
    • New --metadata KEY=VALUE (repeatable, blast-only)
    • Validate before packaging
    • Incompatible with --skip-if-scanned (same rule as --policy / --scan-type / …)
  • src/scanners/blast.rs
    • metadata_json_from_pairs: parse pairs → JSON object string (= split on first occurrence; duplicate keys last-wins)
    • Thread Option<String> into upload
    • Unit tests for parser behavior
  • src/utils/api.rs
    • upload_zip(..., metadata: Option<String>) — add metadata multipart part when present
    • ScanResponse.metadata for corgea list --json parity

Notes

Screenshots

  1. invalid metadata
Screenshot 2026-07-13 at 1 45 19 PM
Screenshot 2026-07-13 at 1 45 30 PM
  1. running a scan with metadata
Screenshot 2026-07-13 at 1 46 19 PM
Screenshot 2026-07-13 at 1 47 30 PM
Screenshot 2026-07-13 at 1 49 39 PM
  1. running a scan without metadata
Screenshot 2026-07-13 at 1 50 55 PM
Screenshot 2026-07-13 at 1 51 57 PM

Comment thread src/utils/api.rs

@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 for this? why do we need to store these tags

@yhoztak yhoztak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@leenk7991

Copy link
Copy Markdown
Member Author

What is the use case for this? why do we need to store these tags

i think it's one of the requirements from the meeting with TransUnion: https://linear.app/corgea/issue/COR-1641/cli-02-scan-level-metadata-tagging

@leenk7991
leenk7991 requested a review from Ibrahimrahhal July 15, 2026 08:41

@juangaitanv juangaitanv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@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.

LGTM in terms of code, but I think its worth checking with Ahmad or Allan to see what is there use cases, we want to avoid implementing specs that is auto generated from dennis as he might not really get the context from the transcript

leenk7991 and others added 2 commits July 20, 2026 17:04
…-tagging

Keep --metadata tagging; drop --skip-if-scanned removed on the base branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@leenk7991
leenk7991 merged commit d2c3d2c into cor-1639-scan-sha-tracking Jul 22, 2026
16 checks passed
leenk7991 added a commit that referenced this pull request Jul 22, 2026
* COR-1639: CLI-01: Scan Optimization (SHA Tracking)

* Address PR review: tighten skip-if-scanned guards and fix CI clippy

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>

* Fix cargo audit: bump quick-xml and crossbeam-epoch

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>

* COR-1639: address comments and other updates

* COR-1639: log error instead of print

* COR-1639: use repository discover and include submodule status in dirty check

* COR-1639: check repo root and other updates

* COR-1639: drop --skip-if-scanned; keep scan SHA surfacing

Remove the opt-in skip path and unused list filters. Retain git_sha on
scan responses/list output, plus get_repo_info discover for subdirectory SHA.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: drop no-op whitespace from blast scan

Co-authored-by: Cursor <cursoragent@cursor.com>

* COR-1639: address comments

* COR-1641: CLI-02: Scan-Level Metadata Tagging (#124)

* COR-1641: CLI-02: Scan-Level Metadata Tagging

* COR-1641: serde skip if none

---------

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

4 participants