You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(dart-symbol-map): Resolve org from token via config (#3113)
### Description
- Switch `dart-symbol-map` to the clap builder pattern to align with
most commands.
- Resolve org/project via existing `Config` helpers so org auth tokens
take precedence.
- Add integration coverage for org-from-token behavior.
### Issues
* resolves: #3063
* resolves:
[CLI-260](https://linear.app/getsentry/issue/CLI-260/dart-symbol-map-upload-does-not-resolve-org-from-token)
### Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,11 @@
1
1
# Changelog
2
2
3
+
## Unreleased
4
+
5
+
### Fixes
6
+
7
+
- The `dart-symbol-map upload` command now correctly resolves the organization from the auth token payload ([#3065](https://github.com/getsentry/sentry-cli/pull/3065)).
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
-9Lines changed: 0 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,3 @@
1
-
# Adding new commands
2
-
For new commands, it is recommended to use clap's [Derive API](https://docs.rs/clap/latest/clap/_derive/index.html).
3
-
In contrast to the [Builder API](https://docs.rs/clap/latest/clap/_tutorial/index.html), the Derive API makes it:
4
-
- Easier to read, write, and modify commands and arguments.
5
-
- Easier to keep argument declaration and reading in sync.
6
-
- Easier to reuse shared arguments.
7
-
8
-
An existing example of how to use the Derive API is the `send-metric` command.
9
-
10
1
# Integration Tests
11
2
12
3
Integration tests are written using `trycmd` crate. Consult the docs in case you need to understand how it works https://docs.rs/trycmd/latest/trycmd/.
use clap::{ArgMatches,Args,Command,Parseras _,Subcommand};
2
+
use clap::{ArgMatches,Command};
3
+
4
+
usecrate::utils::args::ArgExtas _;
3
5
4
6
pubmod upload;
5
7
6
8
constGROUP_ABOUT:&str = "Manage Dart/Flutter symbol maps for Sentry.";
7
-
constUPLOAD_ABOUT:&str =
8
-
"Upload a Dart/Flutter symbol map (dartsymbolmap) for deobfuscating Dart exception types.";
9
-
constUPLOAD_LONG_ABOUT:&str =
10
-
"Upload a Dart/Flutter symbol map (dartsymbolmap) for deobfuscating Dart exception types.{n}{n}Examples:{n} sentry-cli dart-symbol-map upload --org my-org --project my-proj path/to/dartsymbolmap.json path/to/debug/file{n}{n}The mapping must be a JSON array of strings with an even number of entries (pairs).{n}The debug file must contain exactly one Debug ID. {n}{n}\
11
-
This command is supported on Sentry SaaS and self-hosted versions ≥25.8.0.";
.about("Upload a Dart/Flutter symbol map (dartsymbolmap) for deobfuscating Dart exception types.")
51
+
.long_about(
52
+
"Upload a Dart/Flutter symbol map (dartsymbolmap) for deobfuscating Dart exception types.{n}{n}Examples:{n} sentry-cli dart-symbol-map upload --org my-org --project my-proj path/to/dartsymbolmap.json path/to/debug/file{n}{n}The mapping must be a JSON array of strings with an even number of entries (pairs).{n}The debug file must contain exactly one Debug ID. {n}{n}\
53
+
This command is supported on Sentry SaaS and self-hosted versions ≥25.8.0.",
54
+
)
55
+
.arg(
56
+
Arg::new(MAPPING_ARG)
57
+
.value_name("MAPPING")
58
+
.required(true)
59
+
.help("Path to the dartsymbolmap JSON file (e.g. dartsymbolmap.json). Must be a JSON array of strings with an even number of entries (pairs)."),
60
+
)
61
+
.arg(
62
+
Arg::new(DEBUG_FILE_ARG)
63
+
.value_name("DEBUG_FILE")
64
+
.required(true)
65
+
.help("Path to the corresponding debug file to extract the Debug ID from. The file must contain exactly one Debug ID."),
0 commit comments