Skip to content

Commit ca5c0c7

Browse files
chore: Remove deprecated files commands (#2956)
### Description Remove all `sentry-cli files ...` subcommands. Also, remove the `sentry-cli releases files ...` commands, which are aliases for the `files` subcommands. ### Issues - Resolves #2513 - Resolves [CLI-85](https://linear.app/getsentry/issue/CLI-85/remove-all-files-subcommands)
1 parent f769d02 commit ca5c0c7

File tree

11 files changed

+3
-537
lines changed

11 files changed

+3
-537
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 all `sentry-cli files ...` and `sentry-cli releases files ...` subcommands ([#2956](https://github.com/getsentry/sentry-cli/pull/2956)). These commands provided functionality for managing release files, a feature that has been deprecated in Sentry. Users still using `sentry-cli files upload` to upload source maps should migrate to `sentry-cli sourcemaps upload`.
1516
- 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.
1617
- 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:
1718
- `--api-key` CLI flag

src/api/mod.rs

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ use crate::utils::http::{self, is_absolute_url};
5252
use crate::utils::non_empty::NonEmptySlice;
5353
use crate::utils::progress::{ProgressBar, ProgressBarMode};
5454
use crate::utils::retry::{get_default_backoff, DurationAsMilliseconds as _};
55-
use crate::utils::sourcemaps::get_sourcemap_reference_from_headers;
5655
use crate::utils::ui::{capitalize_string, make_byte_progress_bar};
5756

5857
use self::pagination::Pagination;
@@ -587,32 +586,6 @@ impl<'a> AuthenticatedApi<'a> {
587586
}
588587
}
589588

590-
/// Deletes all release files. Returns `true` if files were
591-
/// deleted or `false` otherwise.
592-
pub fn delete_release_files(
593-
&self,
594-
org: &str,
595-
project: Option<&str>,
596-
version: &str,
597-
) -> ApiResult<()> {
598-
let path = if let Some(project) = project {
599-
format!(
600-
"/projects/{}/{}/files/source-maps/?name={}",
601-
PathArg(org),
602-
PathArg(project),
603-
PathArg(version)
604-
)
605-
} else {
606-
format!(
607-
"/organizations/{}/files/source-maps/?name={}",
608-
PathArg(org),
609-
PathArg(version)
610-
)
611-
};
612-
613-
self.delete(&path)?.into_result().map(|_| ())
614-
}
615-
616589
/// Creates a new release.
617590
pub fn new_release(&self, org: &str, release: &NewRelease) -> ApiResult<ReleaseInfo> {
618591
// for single project releases use the legacy endpoint that is project bound.
@@ -1440,19 +1413,9 @@ fn handle_req<W: Write>(
14401413
} else if progress_bar_mode.active() {
14411414
let pb_progress = pb.clone();
14421415
#[expect(clippy::unwrap_used, reason = "legacy code")]
1443-
handle.progress_function(move |a, b, c, d| {
1444-
let (down_len, down_pos, up_len, up_pos) = (a as u64, b as u64, c as u64, d as u64);
1416+
handle.progress_function(move |a, b, _, _| {
1417+
let (down_len, down_pos) = (a as u64, b as u64);
14451418
let mut pb = pb_progress.borrow_mut();
1446-
if up_len > 0 && progress_bar_mode.request() {
1447-
if up_pos < up_len {
1448-
if pb.is_none() {
1449-
*pb = Some(make_byte_progress_bar(up_len));
1450-
}
1451-
pb.as_ref().unwrap().set_position(up_pos);
1452-
} else if pb.is_some() {
1453-
pb.take().unwrap().finish_and_clear();
1454-
}
1455-
}
14561419
if down_len > 0 && progress_bar_mode.response() {
14571420
if down_pos < down_len {
14581421
if pb.is_none() {
@@ -1899,17 +1862,8 @@ pub struct AuthInfo {
18991862
#[derive(Clone, Deserialize, Debug)]
19001863
pub struct Artifact {
19011864
pub id: String,
1902-
pub sha1: String,
19031865
pub name: String,
1904-
pub size: u64,
19051866
pub dist: Option<String>,
1906-
pub headers: HashMap<String, String>,
1907-
}
1908-
1909-
impl Artifact {
1910-
pub fn get_sourcemap_reference(&self) -> Option<&str> {
1911-
get_sourcemap_reference_from_headers(self.headers.iter())
1912-
}
19131867
}
19141868

19151869
/// Information for new releases

src/commands/files/delete.rs

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/commands/files/list.rs

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/commands/files/mod.rs

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)