Skip to content
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

Merged
merged 5 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/errors/api_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.")]
ProjectNotFound,
#[error("release not found")]
ReleaseNotFound,
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
}),
(None, Some(cli_org)) => Ok(cli_org),
(Some(token_org), None) => Ok(token_org.to_string()),
Expand Down Expand Up @@ -407,7 +407,7 @@ impl Config {
.get_from(Some("defaults"), "project")
.map(str::to_owned)
})
.ok_or_else(|| format_err!("A project slug is required (provide with --project)"))
.ok_or_else(|| format_err!("A project ID or slug is required (provide with --project)"))
}

/// Return the default pipeline env.
Expand Down
11 changes: 7 additions & 4 deletions src/utils/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ 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(),
)
} else {
Ok(v.to_owned())
}
Expand All @@ -19,7 +22,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())
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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())

} else {
Ok(v.to_owned())
}
Expand Down Expand Up @@ -90,7 +93,7 @@ impl<'a: 'b, 'b> ArgExt for Command {
.short('o')
.value_parser(validate_org)
.global(true)
.help("The organization slug"),
.help("The organization ID or slug."),
)
}

Expand All @@ -107,7 +110,7 @@ impl<'a: 'b, 'b> ArgExt for Command {
} else {
ArgAction::Set
})
.help("The project slug."),
.help("The project ID or slug."),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Arguments:
<PATH> The directory containing source files to bundle.

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
--output <PATH> The path to the output folder.
--debug-id <UUID> Debug ID (UUID) to use for the source bundle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Arguments:
[PATH]... A path to search recursively for symbol files.

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
-t, --type <TYPE> Only consider debug information files of the given type. By
default, all types are considered. [possible values: bcsymbolmap,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/deploys/deploys-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
-r, --release <RELEASE> The release slug.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/deploys/deploys-no-subcommand.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
-r, --release <RELEASE> The release slug.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/events/events-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
warn, error]
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/events/events-list-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ List all events in your organization.
Usage: sentry-cli[EXE] events list [OPTIONS]

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
-U, --show-user Display the Users column.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
-T, --show-tags Display the Tags column.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
--max-rows <MAX_ROWS> Maximum number of rows to print.
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/events/events-no-subcommand.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
warn, error]
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/issues/issues-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
-s, --status <STATUS> Select all issues matching a given status. [possible values:
resolved, muted, unresolved]
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/issues/issues-list-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Usage: sentry-cli[EXE] issues list [OPTIONS]

Options:
--max-rows <MAX_ROWS> Maximum number of rows to print.
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--pages <PAGES> Maximum number of pages to fetch (100 issues/page). [default: 5]
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
--query <QUERY> Query to pass at the request. An example is "is:unresolved"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ List all monitors for an organization.
Usage: sentry-cli[EXE] monitors list [OPTIONS]

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/_cases/projects/projects-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ List all projects for an organization.
Usage: sentry-cli[EXE] projects list [OPTIONS]

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/releases/releases-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
warn, error]
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/releases/releases-new-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Arguments:
<VERSION> The version of the release

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--url <URL> Optional URL to the release for information purposes.
--finalize Immediately finalize the release. (sets it to released)
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
warn, error]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
warn, error]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Arguments:
Options:
--frame <frame> Position of the frame that should be used for source map
resolution. [default: 0]
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
-f, --force Force full validation flow, even when event is already source
mapped.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
-r, --release <RELEASE> The release slug.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/sourcemaps/sourcemaps-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
-r, --release <RELEASE> The release slug.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Options:
Ignores all files and folders matching the given glob

-o, --org <ORG>
The organization slug
The organization ID or slug.

--header <KEY:VALUE>
Custom headers that should be attached to all requests
Expand All @@ -28,7 +28,7 @@ Options:
Ignore all files and folders specified in the given ignore file, e.g. .gitignore.

-p, --project <PROJECT>
The project slug.
The project ID or slug.

--auth-token <AUTH_TOKEN>
Use the given Sentry auth token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
-r, --release <RELEASE> The release slug.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Arguments:

Options:
-l, --line <LINE> Line number for minified source.
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
-c, --column <COLUMN> Column number for minified source.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
-r, --release <RELEASE> The release slug.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Arguments:

Options:
-o, --org <ORG>
The organization slug
The organization ID or slug.
--header <KEY:VALUE>
Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT>
The project slug.
The project ID or slug.
-u, --url-prefix <PREFIX>
The URL prefix to prepend to all filenames.
--auth-token <AUTH_TOKEN>
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/upload_dif/upload_dif-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Arguments:
[PATH]... A path to search recursively for symbol files.

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
-t, --type <TYPE> Only consider debug information files of the given type. By
default, all types are considered. [possible values: bcsymbolmap,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/_cases/upload_dsym/upload_dsym-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Arguments:
[PATH]... A path to search recursively for symbol files.

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
-t, --type <TYPE> Only consider debug information files of the given type. By
default, all types are considered. [possible values: bcsymbolmap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Arguments:
[PATH]... The path to the mapping files.

Options:
-o, --org <ORG> The organization slug
-o, --org <ORG> The organization ID or slug.
--header <KEY:VALUE> Custom headers that should be attached to all requests
in key:value format.
-p, --project <PROJECT> The project slug.
-p, --project <PROJECT> The project ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
--version <VERSION> Optionally associate the mapping files with a human readable
version.
Expand Down
Loading