-
Notifications
You must be signed in to change notification settings - Fork 1
fix(cli): resolve list/wait projects by repo URL, not directory name (COR-1577) #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6a2efae
fix(cli): resolve list/wait projects by repo URL, not directory name …
juangaitanv 916df20
fix(cli): harden list/wait project resolution (PR #122 review)
juangaitanv 03cbb74
Merge origin/main into worktree-COR-1577
e96867e
fix(cli): address PR #122 review (COR-1577)
fb7774a
test(cli): pin the post-scan wait test to the non-CI upload path
d77a3e7
refactor(cli): core cleanups over the COR-1577 diff
175f2af
refactor(cli): pass list/wait arguments as structs
0b0abdd
test(cli): share the resolution e2e stub harness
da0848d
style(cli): early-return the SCA branch in list::run
173be59
fix(cli): page through /projects and fail loudly on a bad body (PR #1…
26cbaa6
feat(cli): add `corgea wait --project-id` (PR #122 review)
efe1ce0
fix(cli): host-qualify repo matches and restore the legacy fallback name
58027ec
fix(cli): require the /projects envelope and scope SCA to the selector
b1ddd18
fix(cli): keep bare multi-segment repo slugs whole, trim --project-name
fe5b050
fix(cli): mark network remotes by scheme/userinfo/scp colon, not a dot
5069de0
fix(cli): encode the issues query, fail closed on a truncated page walk
ea1e811
fix(cli): make the repo host a tie-breaker, not a match gate
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,7 +141,27 @@ enum Commands { | |
| project_name: Option<String>, | ||
| }, | ||
| /// Wait for the latest in progress scan | ||
| Wait { scan_id: Option<String> }, | ||
| Wait { | ||
| scan_id: Option<String>, | ||
| #[arg( | ||
| long, | ||
| conflicts_with = "repo", | ||
|
juangaitanv marked this conversation as resolved.
|
||
| help = "Query this exact Corgea project name directly (skips repo auto-resolution)." | ||
| )] | ||
| project_name: Option<String>, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we use |
||
| #[arg( | ||
| long, | ||
| help = "Resolve the project from this repo (org/repo slug or remote URL) instead of the git remote." | ||
| )] | ||
| repo: Option<String>, | ||
| #[arg( | ||
| long, | ||
| requires = "scan_id", | ||
| value_parser = clap::builder::NonEmptyStringValueParser::new(), | ||
| help = "Use this known Corgea project id for the result link, skipping project resolution. Requires a scan id, which is what the id then belongs to." | ||
| )] | ||
|
cursor[bot] marked this conversation as resolved.
|
||
| project_id: Option<String>, | ||
| }, | ||
| /// List something, by default it lists the scans | ||
| #[command(alias = "ls")] | ||
| List { | ||
|
|
@@ -166,6 +186,19 @@ enum Commands { | |
|
|
||
| #[arg(long, value_parser = clap::value_parser!(u16), help = "Number of items per page")] | ||
| page_size: Option<u16>, | ||
|
|
||
| #[arg( | ||
| long, | ||
| conflicts_with = "repo", | ||
| help = "Query this exact Corgea project name directly (skips repo auto-resolution)." | ||
| )] | ||
| project_name: Option<String>, | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| #[arg( | ||
| long, | ||
| help = "Resolve the project from this repo (org/repo slug or remote URL) instead of the git remote." | ||
| )] | ||
| repo: Option<String>, | ||
|
cursor[bot] marked this conversation as resolved.
|
||
| }, | ||
| /// Inspect something, by default it will inspect a scan | ||
| Inspect { | ||
|
|
@@ -663,9 +696,24 @@ fn main() { | |
| ), | ||
| } | ||
| } | ||
| Some(Commands::Wait { scan_id }) => { | ||
| Some(Commands::Wait { | ||
| scan_id, | ||
| project_name, | ||
| repo, | ||
| project_id, | ||
| }) => { | ||
| verify_token_and_exit_when_fail(&corgea_config); | ||
| wait::run(&corgea_config, scan_id.clone(), None); | ||
| wait::run( | ||
| &corgea_config, | ||
| wait::WaitArgs { | ||
| scan_id: scan_id.clone(), | ||
| selector: utils::api::ProjectSelector { | ||
| name: project_name.clone(), | ||
| repo: repo.clone(), | ||
| }, | ||
| project_id: project_id.clone(), | ||
| }, | ||
| ); | ||
| } | ||
| Some(Commands::List { | ||
| issues, | ||
|
|
@@ -674,6 +722,8 @@ fn main() { | |
| page_size, | ||
| scan_id, | ||
| sca_issues, | ||
| project_name, | ||
| repo, | ||
| }) => { | ||
| verify_token_and_exit_when_fail(&corgea_config); | ||
| if *issues && *sca_issues { | ||
|
|
@@ -686,12 +736,18 @@ fn main() { | |
| } | ||
| list::run( | ||
| &corgea_config, | ||
| issues, | ||
| sca_issues, | ||
| json, | ||
| page, | ||
| page_size, | ||
| scan_id, | ||
| list::ListArgs { | ||
| issues: *issues, | ||
| sca_issues: *sca_issues, | ||
| json: *json, | ||
| page: *page, | ||
| page_size: *page_size, | ||
| scan_id: scan_id.clone(), | ||
| selector: utils::api::ProjectSelector { | ||
| name: project_name.clone(), | ||
| repo: repo.clone(), | ||
| }, | ||
| }, | ||
| ); | ||
| } | ||
| Some(Commands::Inspect { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selector flags are silently ignored when we pass
--scan-id, should we add a warning log? or handle it during args parsing?