Skip to content

Commit f20a6a1

Browse files
docs(id-support): Document that -p and -o arguments accept slugs and IDs (#2101)
Co-authored-by: Daniel Szoke <[email protected]>
1 parent 2a18157 commit f20a6a1

28 files changed

+56
-53
lines changed

src/api/errors/api_error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(in crate::api) enum ApiErrorKind {
2424
OrganizationNotFound,
2525
#[error("resource not found")]
2626
ResourceNotFound,
27-
#[error("Project not found. Please check that you entered the project and organization slugs correctly.")]
27+
#[error("Project not found. Please check that you entered the project and organization IDs or slugs correctly.")]
2828
ProjectNotFound,
2929
#[error("release not found")]
3030
ReleaseNotFound,

src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ impl Config {
339339
.get_from(Some("defaults"), "org")
340340
.map(str::to_owned)
341341
.ok_or_else(|| {
342-
format_err!("An organization slug is required (provide with --org)")
342+
format_err!("An organization ID or slug is required (provide with --org)")
343343
}),
344344
(None, Some(cli_org)) => Ok(cli_org),
345345
(Some(token_org), None) => Ok(token_org.to_string()),
@@ -407,7 +407,7 @@ impl Config {
407407
.get_from(Some("defaults"), "project")
408408
.map(str::to_owned)
409409
})
410-
.ok_or_else(|| format_err!("A project slug is required (provide with --project)"))
410+
.ok_or_else(|| format_err!("A project ID or slug is required (provide with --project)"))
411411
}
412412

413413
/// Return the default pipeline env.

src/utils/args.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ use clap::{Arg, ArgAction, Command};
44

55
fn validate_org(v: &str) -> Result<String, String> {
66
if v.contains('/') || v == "." || v == ".." || v.contains(' ') {
7-
Err("Invalid value for organization. Use the URL slug and not the name!".to_string())
7+
Err(
8+
"Invalid value for organization. Use the URL slug or the ID and not the name!"
9+
.to_string(),
10+
)
811
} else {
912
Ok(v.to_owned())
1013
}
@@ -19,7 +22,7 @@ pub fn validate_project(v: &str) -> Result<String, String> {
1922
|| v.contains('\t')
2023
|| v.contains('\r')
2124
{
22-
Err("Invalid value for project. Use the URL slug and not the name!".to_string())
25+
Err("Invalid value for project. Use the URL slug or the ID and not the name!".to_string())
2326
} else {
2427
Ok(v.to_owned())
2528
}
@@ -90,7 +93,7 @@ impl<'a: 'b, 'b> ArgExt for Command {
9093
.short('o')
9194
.value_parser(validate_org)
9295
.global(true)
93-
.help("The organization slug"),
96+
.help("The organization ID or slug."),
9497
)
9598
}
9699

@@ -107,7 +110,7 @@ impl<'a: 'b, 'b> ArgExt for Command {
107110
} else {
108111
ArgAction::Set
109112
})
110-
.help("The project slug."),
113+
.help("The project ID or slug."),
111114
)
112115
}
113116

tests/integration/_cases/debug_files/debug_files-bundle-jvm-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Arguments:
99
<PATH> The directory containing source files to bundle.
1010

1111
Options:
12-
-o, --org <ORG> The organization slug
12+
-o, --org <ORG> The organization ID or slug.
1313
--header <KEY:VALUE> Custom headers that should be attached to all requests
1414
in key:value format.
15-
-p, --project <PROJECT> The project slug.
15+
-p, --project <PROJECT> The project ID or slug.
1616
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1717
--output <PATH> The path to the output folder.
1818
--debug-id <UUID> Debug ID (UUID) to use for the source bundle.

tests/integration/_cases/debug_files/debug_files-upload-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Arguments:
99
[PATH]... A path to search recursively for symbol files.
1010

1111
Options:
12-
-o, --org <ORG> The organization slug
12+
-o, --org <ORG> The organization ID or slug.
1313
--header <KEY:VALUE> Custom headers that should be attached to all requests
1414
in key:value format.
15-
-p, --project <PROJECT> The project slug.
15+
-p, --project <PROJECT> The project ID or slug.
1616
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1717
-t, --type <TYPE> Only consider debug information files of the given type. By
1818
default, all types are considered. [possible values: bcsymbolmap,

tests/integration/_cases/deploys/deploys-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Commands:
1111
help Print this message or the help of the given subcommand(s)
1212

1313
Options:
14-
-o, --org <ORG> The organization slug
14+
-o, --org <ORG> The organization ID or slug.
1515
--header <KEY:VALUE> Custom headers that should be attached to all requests
1616
in key:value format.
17-
-p, --project <PROJECT> The project slug.
17+
-p, --project <PROJECT> The project ID or slug.
1818
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1919
-r, --release <RELEASE> The release slug.
2020
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,

tests/integration/_cases/deploys/deploys-no-subcommand.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Commands:
1111
help Print this message or the help of the given subcommand(s)
1212

1313
Options:
14-
-o, --org <ORG> The organization slug
14+
-o, --org <ORG> The organization ID or slug.
1515
--header <KEY:VALUE> Custom headers that should be attached to all requests
1616
in key:value format.
17-
-p, --project <PROJECT> The project slug.
17+
-p, --project <PROJECT> The project ID or slug.
1818
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1919
-r, --release <RELEASE> The release slug.
2020
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,

tests/integration/_cases/events/events-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Commands:
1010
help Print this message or the help of the given subcommand(s)
1111

1212
Options:
13-
-o, --org <ORG> The organization slug
13+
-o, --org <ORG> The organization ID or slug.
1414
--header <KEY:VALUE> Custom headers that should be attached to all requests
1515
in key:value format.
16-
-p, --project <PROJECT> The project slug.
16+
-p, --project <PROJECT> The project ID or slug.
1717
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1818
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
1919
warn, error]

tests/integration/_cases/events/events-list-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ List all events in your organization.
66
Usage: sentry-cli[EXE] events list [OPTIONS]
77

88
Options:
9-
-o, --org <ORG> The organization slug
9+
-o, --org <ORG> The organization ID or slug.
1010
-U, --show-user Display the Users column.
1111
--header <KEY:VALUE> Custom headers that should be attached to all requests
1212
in key:value format.
13-
-p, --project <PROJECT> The project slug.
13+
-p, --project <PROJECT> The project ID or slug.
1414
-T, --show-tags Display the Tags column.
1515
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1616
--max-rows <MAX_ROWS> Maximum number of rows to print.

tests/integration/_cases/events/events-no-subcommand.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Commands:
1010
help Print this message or the help of the given subcommand(s)
1111

1212
Options:
13-
-o, --org <ORG> The organization slug
13+
-o, --org <ORG> The organization ID or slug.
1414
--header <KEY:VALUE> Custom headers that should be attached to all requests
1515
in key:value format.
16-
-p, --project <PROJECT> The project slug.
16+
-p, --project <PROJECT> The project ID or slug.
1717
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1818
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
1919
warn, error]

tests/integration/_cases/issues/issues-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Commands:
1414
help Print this message or the help of the given subcommand(s)
1515

1616
Options:
17-
-o, --org <ORG> The organization slug
17+
-o, --org <ORG> The organization ID or slug.
1818
--header <KEY:VALUE> Custom headers that should be attached to all requests
1919
in key:value format.
20-
-p, --project <PROJECT> The project slug.
20+
-p, --project <PROJECT> The project ID or slug.
2121
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
2222
-s, --status <STATUS> Select all issues matching a given status. [possible values:
2323
resolved, muted, unresolved]

tests/integration/_cases/issues/issues-list-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Usage: sentry-cli[EXE] issues list [OPTIONS]
77

88
Options:
99
--max-rows <MAX_ROWS> Maximum number of rows to print.
10-
-o, --org <ORG> The organization slug
10+
-o, --org <ORG> The organization ID or slug.
1111
--header <KEY:VALUE> Custom headers that should be attached to all requests
1212
in key:value format.
13-
-p, --project <PROJECT> The project slug.
13+
-p, --project <PROJECT> The project ID or slug.
1414
--pages <PAGES> Maximum number of pages to fetch (100 issues/page). [default: 5]
1515
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1616
--query <QUERY> Query to pass at the request. An example is "is:unresolved"

tests/integration/_cases/monitors/monitors-list-help.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ List all monitors for an organization.
66
Usage: sentry-cli[EXE] monitors list [OPTIONS]
77

88
Options:
9-
-o, --org <ORG> The organization slug
9+
-o, --org <ORG> The organization ID or slug.
1010
--header <KEY:VALUE> Custom headers that should be attached to all requests
1111
in key:value format.
1212
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.

tests/integration/_cases/projects/projects-help.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Commands:
1010
help Print this message or the help of the given subcommand(s)
1111

1212
Options:
13-
-o, --org <ORG> The organization slug
13+
-o, --org <ORG> The organization ID or slug.
1414
--header <KEY:VALUE> Custom headers that should be attached to all requests
1515
in key:value format.
1616
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.

tests/integration/_cases/projects/projects-list-help.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ List all projects for an organization.
66
Usage: sentry-cli[EXE] projects list [OPTIONS]
77

88
Options:
9-
-o, --org <ORG> The organization slug
9+
-o, --org <ORG> The organization ID or slug.
1010
--header <KEY:VALUE> Custom headers that should be attached to all requests
1111
in key:value format.
1212
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.

tests/integration/_cases/projects/projects-no-subcommand.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Commands:
1010
help Print this message or the help of the given subcommand(s)
1111

1212
Options:
13-
-o, --org <ORG> The organization slug
13+
-o, --org <ORG> The organization ID or slug.
1414
--header <KEY:VALUE> Custom headers that should be attached to all requests
1515
in key:value format.
1616
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.

tests/integration/_cases/releases/releases-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Commands:
1818
help Print this message or the help of the given subcommand(s)
1919

2020
Options:
21-
-o, --org <ORG> The organization slug
21+
-o, --org <ORG> The organization ID or slug.
2222
--header <KEY:VALUE> Custom headers that should be attached to all requests
2323
in key:value format.
24-
-p, --project <PROJECT> The project slug.
24+
-p, --project <PROJECT> The project ID or slug.
2525
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
2626
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
2727
warn, error]

tests/integration/_cases/releases/releases-new-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Arguments:
99
<VERSION> The version of the release
1010

1111
Options:
12-
-o, --org <ORG> The organization slug
12+
-o, --org <ORG> The organization ID or slug.
1313
--url <URL> Optional URL to the release for information purposes.
1414
--finalize Immediately finalize the release. (sets it to released)
1515
--header <KEY:VALUE> Custom headers that should be attached to all requests
1616
in key:value format.
17-
-p, --project <PROJECT> The project slug.
17+
-p, --project <PROJECT> The project ID or slug.
1818
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1919
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
2020
warn, error]

tests/integration/_cases/releases/releases-no-subcommand.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Commands:
1818
help Print this message or the help of the given subcommand(s)
1919

2020
Options:
21-
-o, --org <ORG> The organization slug
21+
-o, --org <ORG> The organization ID or slug.
2222
--header <KEY:VALUE> Custom headers that should be attached to all requests
2323
in key:value format.
24-
-p, --project <PROJECT> The project slug.
24+
-p, --project <PROJECT> The project ID or slug.
2525
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
2626
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
2727
warn, error]

tests/integration/_cases/sourcemaps/sourcemaps-explain-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Arguments:
1111
Options:
1212
--frame <frame> Position of the frame that should be used for source map
1313
resolution. [default: 0]
14-
-o, --org <ORG> The organization slug
14+
-o, --org <ORG> The organization ID or slug.
1515
-f, --force Force full validation flow, even when event is already source
1616
mapped.
1717
--header <KEY:VALUE> Custom headers that should be attached to all requests
1818
in key:value format.
19-
-p, --project <PROJECT> The project slug.
19+
-p, --project <PROJECT> The project ID or slug.
2020
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
2121
-r, --release <RELEASE> The release slug.
2222
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,

tests/integration/_cases/sourcemaps/sourcemaps-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Commands:
1313
help Print this message or the help of the given subcommand(s)
1414

1515
Options:
16-
-o, --org <ORG> The organization slug
16+
-o, --org <ORG> The organization ID or slug.
1717
--header <KEY:VALUE> Custom headers that should be attached to all requests
1818
in key:value format.
19-
-p, --project <PROJECT> The project slug.
19+
-p, --project <PROJECT> The project ID or slug.
2020
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
2121
-r, --release <RELEASE> The release slug.
2222
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,

tests/integration/_cases/sourcemaps/sourcemaps-inject-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Options:
1818
Ignores all files and folders matching the given glob
1919

2020
-o, --org <ORG>
21-
The organization slug
21+
The organization ID or slug.
2222

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

3030
-p, --project <PROJECT>
31-
The project slug.
31+
The project ID or slug.
3232

3333
--auth-token <AUTH_TOKEN>
3434
Use the given Sentry auth token.

tests/integration/_cases/sourcemaps/sourcemaps-no-subcommand.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Commands:
1313
help Print this message or the help of the given subcommand(s)
1414

1515
Options:
16-
-o, --org <ORG> The organization slug
16+
-o, --org <ORG> The organization ID or slug.
1717
--header <KEY:VALUE> Custom headers that should be attached to all requests
1818
in key:value format.
19-
-p, --project <PROJECT> The project slug.
19+
-p, --project <PROJECT> The project ID or slug.
2020
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
2121
-r, --release <RELEASE> The release slug.
2222
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,

tests/integration/_cases/sourcemaps/sourcemaps-resolve-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Arguments:
1010

1111
Options:
1212
-l, --line <LINE> Line number for minified source.
13-
-o, --org <ORG> The organization slug
13+
-o, --org <ORG> The organization ID or slug.
1414
-c, --column <COLUMN> Column number for minified source.
1515
--header <KEY:VALUE> Custom headers that should be attached to all requests
1616
in key:value format.
17-
-p, --project <PROJECT> The project slug.
17+
-p, --project <PROJECT> The project ID or slug.
1818
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1919
-r, --release <RELEASE> The release slug.
2020
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,

tests/integration/_cases/sourcemaps/sourcemaps-upload-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Arguments:
1010

1111
Options:
1212
-o, --org <ORG>
13-
The organization slug
13+
The organization ID or slug.
1414
--header <KEY:VALUE>
1515
Custom headers that should be attached to all requests
1616
in key:value format.
1717
-p, --project <PROJECT>
18-
The project slug.
18+
The project ID or slug.
1919
-u, --url-prefix <PREFIX>
2020
The URL prefix to prepend to all filenames.
2121
--auth-token <AUTH_TOKEN>

tests/integration/_cases/upload_dif/upload_dif-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Arguments:
99
[PATH]... A path to search recursively for symbol files.
1010

1111
Options:
12-
-o, --org <ORG> The organization slug
12+
-o, --org <ORG> The organization ID or slug.
1313
--header <KEY:VALUE> Custom headers that should be attached to all requests
1414
in key:value format.
15-
-p, --project <PROJECT> The project slug.
15+
-p, --project <PROJECT> The project ID or slug.
1616
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1717
-t, --type <TYPE> Only consider debug information files of the given type. By
1818
default, all types are considered. [possible values: bcsymbolmap,

tests/integration/_cases/upload_dsym/upload_dsym-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Arguments:
99
[PATH]... A path to search recursively for symbol files.
1010

1111
Options:
12-
-o, --org <ORG> The organization slug
12+
-o, --org <ORG> The organization ID or slug.
1313
--header <KEY:VALUE> Custom headers that should be attached to all requests
1414
in key:value format.
15-
-p, --project <PROJECT> The project slug.
15+
-p, --project <PROJECT> The project ID or slug.
1616
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
1717
-t, --type <TYPE> Only consider debug information files of the given type. By
1818
default, all types are considered. [possible values: bcsymbolmap,

tests/integration/_cases/upload_proguard/upload_proguard-help.trycmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Arguments:
99
[PATH]... The path to the mapping files.
1010

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

0 commit comments

Comments
 (0)