Skip to content

Commit 8355acc

Browse files
chore(sourcemaps): Remove sourcemaps explain (#2947)
### Description Removed the `sentry-cli sourcemaps explain` command, which has been deprecated for some time. ### Issues - Resolves #2865 - Resolves [CLI-2865](https://linear.app/getsentry/issue/CLI-195/remove-sentry-cli-sourcemaps-explain-command)
1 parent b02dcee commit 8355acc

29 files changed

+5
-1365
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ we should rename this section to "Unreleased" -->
1212

1313
### Breaking Changes
1414

15+
- Removed the `sentry-cli sourcemaps explain` command ([#2947](https://github.com/getsentry/sentry-cli/pull/2947)). The command had been deprecated for some time, since Sentry now has a better in-product debugging flow for source map problems via the "Unminify Code" button, which is displayed on any JavaScript issues which could not be unminified.
1516
- Removed support for the legacy API key authentication method ([#2935](https://github.com/getsentry/sentry-cli/pull/2935)). Sentry CLI now only supports authenticating with Auth Tokens. If you are using API key authentication via any of the following methods, you need to generate and use an [Auth Token](https://docs.sentry.io/account/auth-tokens/), instead:
1617
- `--api-key` CLI flag
1718
- `SENTRY_API_KEY` environment variable

src/api/mod.rs

Lines changed: 4 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use log::{debug, info, warn};
3737
use parking_lot::Mutex;
3838
use regex::{Captures, Regex};
3939
use secrecy::ExposeSecret as _;
40-
use sentry::protocol::{Exception, Values};
4140
use serde::de::DeserializeOwned;
4241
use serde::{Deserialize, Serialize};
4342
use sha1_smol::Digest;
@@ -286,6 +285,10 @@ impl Api {
286285
}
287286

288287
/// Convenience method that downloads a file into the given file object.
288+
///
289+
/// Currently only used on macOS, but we could make it available on other platforms
290+
/// if needed.
291+
#[cfg(target_os = "macos")]
289292
pub fn download(&self, url: &str, dst: &mut File) -> ApiResult<ApiResponse> {
290293
self.request(Method::Get, url, None)?
291294
.follow_location(true)?
@@ -551,73 +554,6 @@ impl<'a> AuthenticatedApi<'a> {
551554
self.list_release_files_by_checksum(org, project, release, &[])
552555
}
553556

554-
/// Get a single release file and store it inside provided descriptor.
555-
pub fn get_release_file(
556-
&self,
557-
org: &str,
558-
project: Option<&str>,
559-
version: &str,
560-
file_id: &str,
561-
file_desc: &mut File,
562-
) -> Result<(), ApiError> {
563-
let path = if let Some(project) = project {
564-
format!(
565-
"/projects/{}/{}/releases/{}/files/{}/?download=1",
566-
PathArg(org),
567-
PathArg(project),
568-
PathArg(version),
569-
PathArg(file_id)
570-
)
571-
} else {
572-
format!(
573-
"/organizations/{}/releases/{}/files/{}/?download=1",
574-
PathArg(org),
575-
PathArg(version),
576-
PathArg(file_id)
577-
)
578-
};
579-
580-
let resp = self.api.download(&path, file_desc)?;
581-
if resp.status() == 404 {
582-
resp.convert_rnf(ApiErrorKind::ResourceNotFound)
583-
} else {
584-
Ok(())
585-
}
586-
}
587-
588-
/// Get a single release file metadata.
589-
pub fn get_release_file_metadata(
590-
&self,
591-
org: &str,
592-
project: Option<&str>,
593-
version: &str,
594-
file_id: &str,
595-
) -> ApiResult<Option<Artifact>> {
596-
let path = if let Some(project) = project {
597-
format!(
598-
"/projects/{}/{}/releases/{}/files/{}/",
599-
PathArg(org),
600-
PathArg(project),
601-
PathArg(version),
602-
PathArg(file_id)
603-
)
604-
} else {
605-
format!(
606-
"/organizations/{}/releases/{}/files/{}/",
607-
PathArg(org),
608-
PathArg(version),
609-
PathArg(file_id)
610-
)
611-
};
612-
613-
let resp = self.get(&path)?;
614-
if resp.status() == 404 {
615-
Ok(None)
616-
} else {
617-
resp.convert()
618-
}
619-
}
620-
621557
/// Deletes a single release file. Returns `true` if the file was
622558
/// deleted or `false` otherwise.
623559
pub fn delete_release_file(
@@ -1302,37 +1238,6 @@ impl<'a> AuthenticatedApi<'a> {
13021238
Ok(rv)
13031239
}
13041240

1305-
/// Looks up an event, which was already processed by Sentry and returns it.
1306-
/// If it does not exist `None` will be returned.
1307-
pub fn get_event(
1308-
&self,
1309-
org: &str,
1310-
project: Option<&str>,
1311-
event_id: &str,
1312-
) -> ApiResult<Option<ProcessedEvent>> {
1313-
let path = if let Some(project) = project {
1314-
format!(
1315-
"/projects/{}/{}/events/{}/json/",
1316-
PathArg(org),
1317-
PathArg(project),
1318-
PathArg(event_id)
1319-
)
1320-
} else {
1321-
format!(
1322-
"/organizations/{}/events/{}/json/",
1323-
PathArg(org),
1324-
PathArg(event_id)
1325-
)
1326-
};
1327-
1328-
let resp = self.get(&path)?;
1329-
if resp.status() == 404 {
1330-
Ok(None)
1331-
} else {
1332-
resp.convert()
1333-
}
1334-
}
1335-
13361241
fn get_region_url(&self, org: &str) -> ApiResult<String> {
13371242
self.get(&format!("/organizations/{org}/region/"))
13381243
.and_then(|resp| resp.convert::<Region>())
@@ -2383,12 +2288,6 @@ pub struct ProcessedEvent {
23832288
#[expect(dead_code)]
23842289
pub project: Option<u64>,
23852290
#[serde(default, skip_serializing_if = "Option::is_none")]
2386-
pub release: Option<String>,
2387-
#[serde(default, skip_serializing_if = "Option::is_none")]
2388-
pub dist: Option<String>,
2389-
#[serde(default, skip_serializing_if = "Values::is_empty")]
2390-
pub exception: Values<Exception>,
2391-
#[serde(default, skip_serializing_if = "Option::is_none")]
23922291
pub user: Option<ProcessedEventUser>,
23932292
#[serde(default, skip_serializing_if = "Option::is_none")]
23942293
pub tags: Option<Vec<ProcessedEventTag>>,

0 commit comments

Comments
 (0)