Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Improvements

- Moved `sentry-cli upload-proguard` to `sentry-cli proguard upload`, aligning the API with similar upload commands like `debug-files upload` and `sourcemaps upload` ([#3174](https://github.com/getsentry/sentry-cli/pull/3174)). `sentry-cli upload-proguard` remains supported as an alias, so no migration is required.

### Experimental Feature 🧑‍🔬 (internal-only)

- Print snapshot URL after successful upload ([#3167](https://github.com/getsentry/sentry-cli/pull/3167)).
Expand Down
2 changes: 2 additions & 0 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mod login;
mod logs;
mod monitors;
mod organizations;
mod proguard;
mod projects;
mod react_native;
mod releases;
Expand Down Expand Up @@ -60,6 +61,7 @@ macro_rules! each_subcommand {
$mac!(logs);
$mac!(monitors);
$mac!(organizations);
$mac!(proguard);
$mac!(projects);
$mac!(react_native);
$mac!(releases);
Expand Down
43 changes: 43 additions & 0 deletions src/commands/proguard/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
use anyhow::Result;
use clap::{ArgMatches, Command};

pub mod upload;

macro_rules! each_subcommand {
($mac:ident) => {
$mac!(upload);
};
}

pub fn make_command(mut command: Command) -> Command {
macro_rules! add_subcommand {
($name:ident) => {{
command = command.subcommand(crate::commands::proguard::$name::make_command(
Command::new(stringify!($name).replace('_', "-")),
));
}};
}

command = command
.about("Manage ProGuard mapping files.")
.subcommand_required(true)
.arg_required_else_help(true);

each_subcommand!(add_subcommand);
command
}

pub fn execute(matches: &ArgMatches) -> Result<()> {
macro_rules! execute_subcommand {
($name:ident) => {{
if let Some(sub_matches) =
matches.subcommand_matches(&stringify!($name).replace('_', "-"))
{
return crate::commands::proguard::$name::execute(&sub_matches);
}
}};
}

each_subcommand!(execute_subcommand);
unreachable!();
}
File renamed without changes.
11 changes: 11 additions & 0 deletions src/commands/upload_proguard/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use anyhow::Result;
use clap::{ArgMatches, Command};

pub fn make_command(command: Command) -> Command {
// Retained as a top-level command for backward compatibility.
crate::commands::proguard::upload::make_command(command)
}

pub fn execute(matches: &ArgMatches) -> Result<()> {
crate::commands::proguard::upload::execute(matches)
}
1 change: 1 addition & 0 deletions tests/integration/_cases/help/help-windows.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Commands:
logs [BETA] Manage logs in Sentry
monitors Manage cron monitors on Sentry.
organizations Manage organizations on Sentry.
proguard Manage ProGuard mapping files.
projects Manage projects on Sentry.
react-native Upload build artifacts for react-native projects.
releases Manage releases on Sentry.
Expand Down
1 change: 1 addition & 0 deletions tests/integration/_cases/help/help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Commands:
logs [BETA] Manage logs in Sentry
monitors Manage cron monitors on Sentry.
organizations Manage organizations on Sentry.
proguard Manage ProGuard mapping files.
projects Manage projects on Sentry.
react-native Upload build artifacts for react-native projects.
releases Manage releases on Sentry.
Expand Down
23 changes: 23 additions & 0 deletions tests/integration/_cases/proguard/proguard-help.trycmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```
$ sentry-cli proguard --help
? success
Manage ProGuard mapping files.

Usage: sentry-cli[EXE] proguard [OPTIONS] <COMMAND>

Commands:
upload Upload ProGuard mapping files to a project.
help Print this message or the help of the given subcommand(s)

Options:
--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.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
warn, error]
--quiet Do not print any output while preserving correct exit code. This
flag is currently implemented only for selected subcommands.
[aliases: --silent]
-h, --help Print help

```
37 changes: 37 additions & 0 deletions tests/integration/_cases/proguard/proguard-upload-help.trycmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
```
$ sentry-cli proguard upload --help
? success
Upload ProGuard mapping files to a project.

Usage: sentry-cli[EXE] proguard upload [OPTIONS] [PATH]...

Arguments:
[PATH]... The path to the mapping files.

Options:
-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 ID or slug.
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
--no-upload Disable the actual upload.
This runs all steps for the processing but does not trigger the
upload. This is useful if you just want to verify the mapping
files and write the proguard UUIDs into a properties file.
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
warn, error]
--write-properties <PATH> Write the UUIDs for the processed mapping files into the given
properties file.
--quiet Do not print any output while preserving correct exit code. This
flag is currently implemented only for selected subcommands.
[aliases: --silent]
--require-one Requires at least one file to upload or the command will error.
-u, --uuid <UUID> Explicitly override the UUID of the mapping file with another one.
This should be used with caution as it means that you can upload
multiple mapping files if you don't take care. This however can be
useful if you have a build process in which you need to know the
UUID of the proguard file before it was created. If you upload a
file with a forced UUID you can only upload a single proguard file.
-h, --help Print help

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```
$ sentry-cli proguard upload tests/integration/_fixtures/proguard.txt --no-upload
? success
warning: ignoring proguard mapping 'tests/integration/_fixtures/proguard.txt': Proguard mapping does not contain line information
> skipping upload.

```
1 change: 1 addition & 0 deletions tests/integration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mod logs;
mod monitors;
mod org_tokens;
mod organizations;
mod proguard;
mod projects;
#[cfg(target_os = "macos")]
mod react_native;
Expand Down
1 change: 1 addition & 0 deletions tests/integration/proguard/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod upload;
Loading