Skip to content

Commit 8d0d3f2

Browse files
feat(proguard): Remove release association arguments (#2876)
⚠️ **Breaking change:** Do not merge until ready to release in a major. Remove the `--app-id`, `--version`, and `--version-code` arguments to the `sentry-cli upload-proguard` command. Users currently using these arguments should simply stop using them. With this change, we also no longer wait for assembly of the mapping to finish on the backend; previously we needed to wait to associate the release. This change also removes any code that had been called when these flags were specified. - Resolves #2868 - Resolves [CLI-197](https://linear.app/getsentry/issue/CLI-197/remove-flags-for-setting-release)
1 parent b9001c5 commit 8d0d3f2

File tree

6 files changed

+13
-208
lines changed

6 files changed

+13
-208
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
`sentry-cli` 3.0.0 and above only officially supports Sentry SaaS and Sentry self-hosted versions [25.11.1](https://github.com/getsentry/sentry/releases/tag/25.11.1) and higher. While many Sentry CLI features may, in practice, continue working with some older Sentry versions, continued support for Sentry versions older than 25.11.1 is not guaranteed. Changes which break support for Sentry versions below 25.11.1 may occur in minor or patch releases.
88

9+
### Breaking Changes
10+
11+
- Removed the `upload-proguard` subcommand's `--app-id`, `--version`, and `--version-code` arguments ([#2876](https://github.com/getsentry/sentry-cli/pull/2876)). Users using these arguments should stop using them, as they are unnecessary. The information passed to these arguments is no longer visible in Sentry.
12+
913
## 2.58.4
1014

1115
### Fixes

src/api/mod.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,36 +1059,6 @@ impl<'a> AuthenticatedApi<'a> {
10591059
.convert_rnf(ApiErrorKind::ProjectNotFound)
10601060
}
10611061

1062-
pub fn associate_proguard_mappings(
1063-
&self,
1064-
org: &str,
1065-
project: &str,
1066-
data: &AssociateProguard,
1067-
) -> ApiResult<()> {
1068-
let path = format!(
1069-
"/projects/{}/{}/files/proguard-artifact-releases",
1070-
PathArg(org),
1071-
PathArg(project)
1072-
);
1073-
let resp: ApiResponse = self
1074-
.request(Method::Post, &path)?
1075-
.with_json_body(data)?
1076-
.send()?;
1077-
if resp.status() == 201 {
1078-
Ok(())
1079-
} else if resp.status() == 409 {
1080-
info!(
1081-
"Release association for release '{}', UUID '{}' already exists.",
1082-
data.release_name, data.proguard_uuid
1083-
);
1084-
Ok(())
1085-
} else if resp.status() == 404 {
1086-
Err(ApiErrorKind::ResourceNotFound.into())
1087-
} else {
1088-
resp.convert()
1089-
}
1090-
}
1091-
10921062
/// List all organizations associated with the authenticated token
10931063
/// in the given `Region`. If no `Region` is provided, we assume
10941064
/// we're issuing a request to a monolith deployment.
@@ -2246,12 +2216,6 @@ impl DebugInfoFile {
22462216
}
22472217
}
22482218

2249-
#[derive(Debug, Serialize)]
2250-
pub struct AssociateProguard {
2251-
pub release_name: String,
2252-
pub proguard_uuid: String,
2253-
}
2254-
22552219
#[derive(Deserialize)]
22562220
struct MissingChecksumsResponse {
22572221
missing: HashSet<Digest>,

src/commands/upload_proguard.rs

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use symbolic::common::ByteView;
99
use uuid::Uuid;
1010

1111
use crate::api::Api;
12-
use crate::api::AssociateProguard;
1312
use crate::config::Config;
1413
use crate::utils::android::dump_proguard_uuids_as_properties;
1514
use crate::utils::args::ArgExt as _;
@@ -33,62 +32,11 @@ pub fn make_command(command: Command) -> Command {
3332
.num_args(1..)
3433
.action(ArgAction::Append),
3534
)
36-
.arg(
37-
Arg::new("version")
38-
.hide(true)
39-
.long("version")
40-
.value_name("VERSION")
41-
.requires("app_id")
42-
.help(
43-
"[DEPRECATED] Optionally associate the mapping files \
44-
with a human readable version.{n}This helps you \
45-
understand which ProGuard files go with which version \
46-
of your app.\n\
47-
Sentry SaaS and self-hosted version 25.9.0 and later no \
48-
longer display this association, as it has no effect on \
49-
deobfuscation. This flag is scheduled for removal in \
50-
Sentry CLI 3.0.0.",
51-
),
52-
)
53-
.arg(
54-
Arg::new("version_code")
55-
.hide(true)
56-
.long("version-code")
57-
.value_name("VERSION_CODE")
58-
.requires("app_id")
59-
.requires("version")
60-
.help(
61-
"[DEPRECATED] Optionally associate the mapping files with a version \
62-
code.{n}This helps you understand which ProGuard files \
63-
go with which version of your app.\n\
64-
Sentry SaaS and self-hosted version 25.9.0 and later no \
65-
longer display this association, as it has no effect on \
66-
deobfuscation. This flag is scheduled for removal in \
67-
Sentry CLI 3.0.0.",
68-
),
69-
)
70-
.arg(
71-
Arg::new("app_id")
72-
.hide(true)
73-
.long("app-id")
74-
.value_name("APP_ID")
75-
.requires("version")
76-
.help(
77-
"[DEPRECATED] Optionally associate the mapping files with an application \
78-
ID.{n}If you have multiple apps in one sentry project, you can \
79-
then easily tell them apart.\n\
80-
Sentry SaaS and self-hosted version 25.9.0 and later no \
81-
longer display this association, as it has no effect on \
82-
deobfuscation. This flag is scheduled for removal in \
83-
Sentry CLI 3.0.0.",
84-
),
85-
)
8635
.arg(
8736
Arg::new("platform")
8837
.hide(true)
8938
.long("platform")
9039
.value_name("PLATFORM")
91-
.requires("app_id")
9240
.help(
9341
"[DEPRECATED] This flag is a no-op, scheduled \
9442
for removal in Sentry CLI 3.0.0.",
@@ -109,7 +57,6 @@ pub fn make_command(command: Command) -> Command {
10957
Arg::new("android_manifest")
11058
.long("android-manifest")
11159
.value_name("PATH")
112-
.conflicts_with("app_id")
11360
.hide(true)
11461
.help(
11562
"[DEPRECATED] This flag is a no-op, scheduled \
@@ -304,40 +251,5 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
304251
}
305252
}
306253

307-
// if values are given associate
308-
if let Some(app_id) = matches.get_one::<String>("app_id") {
309-
log::warn!(
310-
"[DEPRECATION NOTICE] The --app-id, --version, and --version-code flags are deprecated. \
311-
and scheduled for removal in Sentry CLI 3.0.0. \
312-
These values have no effect on deobfuscation, and are no longer displayed anywhere \
313-
in the Sentry UI (neither in SaaS nor in self-hosted versions 25.9.0 and later)."
314-
);
315-
316-
#[expect(clippy::unwrap_used, reason = "legacy code")]
317-
let version = matches.get_one::<String>("version").unwrap().to_owned();
318-
let build: Option<String> = matches.get_one::<String>("version_code").cloned();
319-
320-
let mut release_name = app_id.to_owned();
321-
release_name.push('@');
322-
release_name.push_str(&version);
323-
324-
if let Some(build_str) = build {
325-
release_name.push('+');
326-
release_name.push_str(&build_str);
327-
}
328-
329-
for mapping in &mappings {
330-
let uuid = forced_uuid.copied().unwrap_or(mapping.uuid());
331-
authenticated_api.associate_proguard_mappings(
332-
&org,
333-
&project,
334-
&AssociateProguard {
335-
release_name: release_name.clone(),
336-
proguard_uuid: uuid.to_string(),
337-
},
338-
)?;
339-
}
340-
}
341-
342254
Ok(())
343255
}

src/utils/proguard/upload.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,12 @@
44
//! Proguard mappings, while we work on a more permanent solution, which will
55
//! work for all different types of debug files.
66
7-
use std::time::Duration;
8-
97
use anyhow::Result;
108

119
use crate::api::ChunkServerOptions;
1210
use crate::utils::chunks::{upload_chunked_objects, ChunkOptions, Chunked};
1311
use crate::utils::proguard::ProguardMapping;
1412

15-
/// How long to wait for the server to assemble the mappings before giving up.
16-
// 120 seconds was chosen somewhat arbitrarily, but in my testing, assembly
17-
// usually was almost instantaneous, so this should probably be enough time.
18-
const ASSEMBLE_POLL_TIMEOUT: Duration = Duration::from_secs(120);
19-
2013
/// Uploads a set of Proguard mappings to Sentry.
2114
/// Blocks until the mappings have been assembled (up to ASSEMBLE_POLL_TIMEOUT).
2215
/// Returns an error if the mappings fail to assemble, or if the timeout is reached.
@@ -32,8 +25,7 @@ pub fn chunk_upload(
3225
.map(|mapping| Chunked::from(mapping, chunk_size))
3326
.collect::<Vec<_>>();
3427

35-
let options =
36-
ChunkOptions::new(chunk_upload_options, org, project).with_max_wait(ASSEMBLE_POLL_TIMEOUT);
28+
let options = ChunkOptions::new(chunk_upload_options, org, project);
3729

3830
let (_, has_processing_errors) = upload_chunked_objects(&chunked_mappings, options)?;
3931

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ Options:
1414
in key:value format.
1515
-p, --project <PROJECT> The project ID or slug.
1616
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
17+
--no-upload Disable the actual upload.
18+
This runs all steps for the processing but does not trigger the
19+
upload. This is useful if you just want to verify the mapping
20+
files and write the proguard UUIDs into a properties file.
1721
--log-level <LOG_LEVEL> Set the log output verbosity. [possible values: trace, debug, info,
1822
warn, error]
1923
--quiet Do not print any output while preserving correct exit code. This
2024
flag is currently implemented only for selected subcommands.
2125
[aliases: --silent]
22-
--no-upload Disable the actual upload.
23-
This runs all steps for the processing but does not trigger the
24-
upload. This is useful if you just want to verify the mapping
25-
files and write the proguard UUIDs into a properties file.
2626
--write-properties <PATH> Write the UUIDs for the processed mapping files into the given
2727
properties file.
2828
--require-one Requires at least one file to upload or the command will error.

tests/integration/upload_proguard.rs

Lines changed: 4 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -152,38 +152,14 @@ fn chunk_upload_needs_upload() {
152152
}\
153153
}"
154154
}
155-
2 => {
156-
// Third call: Assembly completed
157-
"{\
158-
\"297ecd9143fc2882e4b6758c1ccd13ea82930eeb\":{\
159-
\"state\":\"ok\",\
160-
\"detail\":null,\
161-
\"missingChunks\":[],\
162-
\"dif\":{\
163-
\"id\":\"12\",\
164-
\"uuid\":\"c038584d-c366-570c-ad1e-034fa0d194d7\",\
165-
\"debugId\":\"c038584d-c366-570c-ad1e-034fa0d194d7\",\
166-
\"codeId\":null,\
167-
\"cpuName\":\"any\",\
168-
\"objectName\":\"proguard-mapping\",\
169-
\"symbolType\":\"proguard\",\
170-
\"headers\":{\"Content-Type\":\"text/x-proguard+plain\"},\
171-
\"size\":155,\
172-
\"sha1\":\"297ecd9143fc2882e4b6758c1ccd13ea82930eeb\",\
173-
\"dateCreated\":\"1776-07-04T12:00:00.000Z\",\
174-
\"data\":{\"features\":[\"mapping\"]}\
175-
}\
176-
}\
177-
}"
178-
}
179155
n => panic!(
180-
"Only 3 calls to the assemble endpoint expected, but there were {}.",
156+
"Only 2 calls to the assemble endpoint expected, but there were {}.",
181157
n + 1
182158
),
183159
}
184160
.into()
185161
})
186-
.expect(3),
162+
.expect(2),
187163
)
188164
.assert_cmd([
189165
"upload-proguard",
@@ -298,57 +274,14 @@ fn chunk_upload_two_files() {
298274
}\
299275
}"
300276
}
301-
2 => {
302-
// Third call: Assembly completed
303-
"{\
304-
\"297ecd9143fc2882e4b6758c1ccd13ea82930eeb\":{\
305-
\"state\":\"ok\",\
306-
\"detail\":null,\
307-
\"missingChunks\":[],\
308-
\"dif\":{\
309-
\"id\":\"12\",\
310-
\"uuid\":\"c038584d-c366-570c-ad1e-034fa0d194d7\",\
311-
\"debugId\":\"c038584d-c366-570c-ad1e-034fa0d194d7\",\
312-
\"codeId\":null,\
313-
\"cpuName\":\"any\",\
314-
\"objectName\":\"proguard-mapping\",\
315-
\"symbolType\":\"proguard\",\
316-
\"headers\":{\"Content-Type\":\"text/x-proguard+plain\"},\
317-
\"size\":155,\
318-
\"sha1\":\"297ecd9143fc2882e4b6758c1ccd13ea82930eeb\",\
319-
\"dateCreated\":\"1776-07-04T12:00:00.000Z\",\
320-
\"data\":{\"features\":[\"mapping\"]}\
321-
}\
322-
},\
323-
\"e5329624a8d06e084941f133c75b5874f793ee7c\":{\
324-
\"state\":\"ok\",\
325-
\"detail\":null,\
326-
\"missingChunks\":[],\
327-
\"dif\":{\
328-
\"id\":\"13\",\
329-
\"uuid\":\"747e1d76-509b-5225-8a5b-db7b7d4067d4\",\
330-
\"debugId\":\"747e1d76-509b-5225-8a5b-db7b7d4067d4\",\
331-
\"codeId\":null,\
332-
\"cpuName\":\"any\",\
333-
\"objectName\":\"proguard-mapping\",\
334-
\"symbolType\":\"proguard\",\
335-
\"headers\":{\"Content-Type\":\"text/x-proguard+plain\"},\
336-
\"size\":158,\
337-
\"sha1\":\"e5329624a8d06e084941f133c75b5874f793ee7c\",\
338-
\"dateCreated\":\"1776-07-04T12:00:00.000Z\",\
339-
\"data\":{\"features\":[\"mapping\"]}\
340-
}\
341-
}\
342-
}"
343-
}
344277
n => panic!(
345-
"Only 3 calls to the assemble endpoint expected, but there were {}.",
278+
"Only 2 calls to the assemble endpoint expected, but there were {}.",
346279
n + 1
347280
),
348281
}
349282
.into()
350283
})
351-
.expect(3),
284+
.expect(2),
352285
)
353286
.assert_cmd([
354287
"upload-proguard",

0 commit comments

Comments
 (0)