Skip to content

Commit 425455b

Browse files
committed
Marke all files subcommands as deprecated.
The commands are now hidden from help output (making them less likely to be discovered and used), and they are marked with a deprecation notice. When invoking the commands, a deprecation notice will be printed as well. Also the previously deprecated `sourcemaps explain` command (which was explained by an in-app sourcemaps debugger) which already prints a deprecation notice is also being marked as hidden to be less discoverabe.
1 parent 38d3c40 commit 425455b

File tree

10 files changed

+16
-9
lines changed

10 files changed

+16
-9
lines changed

src/commands/files/delete.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ use crate::config::Config;
88

99
pub fn make_command(command: Command) -> Command {
1010
command
11-
.about("Delete a release file.")
11+
.about("[DEPRECATED] Delete a release file.")
12+
.hide(true)
1213
// Backward compatibility with `releases files <VERSION>` commands.
1314
.arg(Arg::new("version").long("version").hide(true))
1415
.arg(

src/commands/files/list.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use crate::{api::Api, config::Config, utils::formatting::Table};
66

77
pub fn make_command(command: Command) -> Command {
88
command
9-
.about("List all release files.")
9+
.about("[DEPRECATED] List all release files.")
10+
.hide(true)
1011
// Backward compatibility with `releases files <VERSION>` commands.
1112
.arg(Arg::new("version").long("version").hide(true))
1213
}

src/commands/files/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use anyhow::Result;
22
use clap::{ArgMatches, Command};
3+
use console::style;
34

45
use crate::utils::args::ArgExt;
56

@@ -25,7 +26,8 @@ pub fn make_command(mut command: Command) -> Command {
2526
}
2627

2728
command = command
28-
.about("Manage release artifacts.")
29+
.about("[DEPRECATED] Manage release artifacts.")
30+
.hide(true)
2931
.subcommand_required(true)
3032
.arg_required_else_help(true)
3133
.org_arg()
@@ -42,6 +44,9 @@ pub fn make_command(mut command: Command) -> Command {
4244
}
4345

4446
pub fn execute(matches: &ArgMatches) -> Result<()> {
47+
println!("{}", style(format!("⚠ DEPRECATION NOTICE: This functionality will be removed in a future version of `sentry-cli`. \
48+
Use the `sourcemaps` command instead.")).yellow());
49+
4550
macro_rules! execute_subcommand {
4651
($name:ident) => {{
4752
if let Some(sub_matches) =

src/commands/files/upload.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ use crate::utils::progress::ProgressBarMode;
2424

2525
pub fn make_command(command: Command) -> Command {
2626
command
27-
.about("Upload files for a release.")
27+
.about("[DEPRECATED] Upload files for a release.")
28+
.hide(true)
2829
// Backward compatibility with `releases files <VERSION>` commands.
2930
.arg(Arg::new("version").long("version").hide(true))
3031
.arg(

src/commands/sourcemaps/explain.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ use super::resolve::print_source;
1616

1717
pub fn make_command(command: Command) -> Command {
1818
command
19-
.about("Explain why sourcemaps are not working for a given event.")
19+
.about("[DEPRECATED] Explain why sourcemaps are not working for a given event.")
20+
.hide(true)
2021
.alias("why")
2122
.arg(
2223
Arg::new("event")

tests/integration/_cases/help/help.trycmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Commands:
1414
debug-files Locate, analyze or upload debug information files. [aliases: dif]
1515
deploys Manage deployments for Sentry releases.
1616
events Manage events on Sentry.
17-
files Manage release artifacts.
1817
info Print information about the configuration and verify authentication.
1918
issues Manage issues in Sentry.
2019
login Authenticate with the Sentry server.

tests/integration/_cases/releases/releases-files-upload-sourcemaps.trycmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```
22
$ sentry-cli releases files wat-release upload-sourcemaps --url-prefix '~/assets' build/assets --rewrite
33
? success
4+
⚠ DEPRECATION NOTICE: This functionality will be removed in a future version of `sentry-cli`. Use the `sourcemaps` command instead.
45
> Rewriting sources
56
> Adding source map references
67
> Nothing to upload

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```
22
$ sentry-cli sourcemaps explain --help
33
? success
4-
Explain why sourcemaps are not working for a given event.
4+
[DEPRECATED] Explain why sourcemaps are not working for a given event.
55

66
Usage: sentry-cli[EXE] sourcemaps explain [OPTIONS] <EVENT_ID>
77

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Manage sourcemaps for Sentry releases.
66
Usage: sentry-cli[EXE] sourcemaps [OPTIONS] <COMMAND>
77

88
Commands:
9-
explain Explain why sourcemaps are not working for a given event.
109
inject Fixes up JavaScript source files and sourcemaps with debug ids.
1110
resolve Resolve sourcemap for a given line/column position.
1211
upload Upload sourcemaps for a release.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Manage sourcemaps for Sentry releases.
66
Usage: sentry-cli[EXE] sourcemaps [OPTIONS] <COMMAND>
77

88
Commands:
9-
explain Explain why sourcemaps are not working for a given event.
109
inject Fixes up JavaScript source files and sourcemaps with debug ids.
1110
resolve Resolve sourcemap for a given line/column position.
1211
upload Upload sourcemaps for a release.

0 commit comments

Comments
 (0)