-
-
Notifications
You must be signed in to change notification settings - Fork 240
feat(proguard): upload-proguard → proguard upload
#3174
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
Merged
Merged
Changes from all commits
Commits
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
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
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 |
|---|---|---|
| @@ -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.
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 |
|---|---|---|
| @@ -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) | ||
| } |
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
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 |
|---|---|---|
| @@ -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
37
tests/integration/_cases/proguard/proguard-upload-help.trycmd
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 |
|---|---|---|
| @@ -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 | ||
|
|
||
| ``` |
7 changes: 7 additions & 0 deletions
7
tests/integration/_cases/proguard/proguard-upload-no-upload.trycmd
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 |
|---|---|---|
| @@ -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. | ||
|
|
||
| ``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| mod upload; |
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.
Uh oh!
There was an error while loading. Please reload this page.