-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
docs(id-support): Document that -p and -o arguments accept slugs and IDs #2101
Conversation
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.
Looks good, thanks for making these changes!
Before merging, please update "id" so that it is consistently capitalized, like "ID". Then, I will approve this PR!
src/api/errors/api_error.rs
Outdated
@@ -24,7 +24,7 @@ pub(in crate::api) enum ApiErrorKind { | |||
OrganizationNotFound, | |||
#[error("resource not found")] | |||
ResourceNotFound, | |||
#[error("Project not found. Please check that you entered the project and organization slugs correctly.")] | |||
#[error("Project not found. Please check that you entered the project and organization ids or slugs correctly.")] |
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.
#[error("Project not found. Please check that you entered the project and organization ids or slugs correctly.")] | |
#[error("Project not found. Please check that you entered the project and organization IDs or slugs correctly.")] |
src/config.rs
Outdated
@@ -339,7 +339,7 @@ impl Config { | |||
.get_from(Some("defaults"), "org") | |||
.map(str::to_owned) | |||
.ok_or_else(|| { | |||
format_err!("An organization slug is required (provide with --org)") | |||
format_err!("An organization id or slug is required (provide with --org)") |
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.
format_err!("An organization id or slug is required (provide with --org)") | |
format_err!("An organization ID or slug is required (provide with --org)") |
Please update anywhere else you have used lowercase id
.
Co-authored-by: Daniel Szoke <[email protected]>
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.
One more suggestion, otherwise this looks good. Much simpler than your previous PR – thanks for getting the rest of the endpoints updated!
src/utils/args.rs
Outdated
@@ -4,7 +4,7 @@ use clap::{Arg, ArgAction, Command}; | |||
|
|||
fn validate_org(v: &str) -> Result<String, String> { | |||
if v.contains('/') || v == "." || v == ".." || v.contains(' ') { | |||
Err("Invalid value for organization. Use the URL slug and not the name!".to_string()) | |||
Err("Invalid value for organization. Use the URL slug or the ID and not the name!".to_string()) |
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.
Err("Invalid value for organization. Use the URL slug or the ID and not the name!".to_string()) | |
Err("Invalid value for organization. Use the URL slug or the ID, not the name!".to_string()) |
Think this would read more clearly
@@ -19,7 +19,7 @@ pub fn validate_project(v: &str) -> Result<String, String> { | |||
|| v.contains('\t') | |||
|| v.contains('\r') | |||
{ | |||
Err("Invalid value for project. Use the URL slug and not the name!".to_string()) | |||
Err("Invalid value for project. Use the URL slug or the ID and not the name!".to_string()) |
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.
Err("Invalid value for project. Use the URL slug or the ID and not the name!".to_string()) | |
Err("Invalid value for project. Use the URL slug or the ID, not the name!".to_string()) |
With the API changes we made to support ids as well as slugs, we get the added bonus that our CLI can also support ids.
Turns out the CLI also uses a couple endpoints which passed project slug in the body parameter, so we also had to update them:
getsentry/sentry#74232
getsentry/sentry#74371
With these prs, all the endpoints the CLI uses have ID support.
@szokeasaurusrex and I had a conversation about how we would like to roll this change out in an earlier closed pr, and decided that once we support ids in all the CLI commands, we can change all the help strings at once, which is what i am doing here.