Skip to content

Commit a70417b

Browse files
feat(snapshots): Add local image diff command using odiff
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 807b12c commit a70417b

21 files changed

Lines changed: 1027 additions & 21 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
/src/api/data_types/snapshots.rs @getsentry/emerge-tools @getsentry/owners-sentry-cli
1717
/src/commands/build @getsentry/emerge-tools @getsentry/owners-sentry-cli
1818
/src/utils/build @getsentry/emerge-tools @getsentry/owners-sentry-cli
19+
/src/commands/snapshots @getsentry/emerge-tools @getsentry/owners-sentry-cli
20+
/src/utils/odiff @getsentry/emerge-tools @getsentry/owners-sentry-cli
1921
/tests/integration/build @getsentry/emerge-tools @getsentry/owners-sentry-cli
2022

2123
# Files without codeowner protection

CHANGELOG.md

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

33
## Unreleased
44

5+
### Features
6+
7+
- (snapshots) Add `snapshots diff` command for locally comparing directories of PNG snapshot images using odiff ([#3306](https://github.com/getsentry/sentry-cli/pull/3306))
8+
59
### Fixes
610

711
- Improve error message when organization slug is missing from config ([#3311](https://github.com/getsentry/sentry-cli/pull/3311))

src/commands/build/mod.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ use clap::{ArgMatches, Command};
44
use crate::utils::args::ArgExt as _;
55

66
pub mod download;
7-
pub mod snapshots;
87
pub mod upload;
98

109
macro_rules! each_subcommand {
1110
($mac:ident) => {
1211
$mac!(download);
13-
$mac!(snapshots);
1412
$mac!(upload);
1513
};
1614
}
@@ -31,6 +29,11 @@ pub fn make_command(mut command: Command) -> Command {
3129
.org_arg()
3230
.project_arg(true);
3331
each_subcommand!(add_subcommand);
32+
command = command.subcommand(
33+
crate::commands::snapshots::upload::make_command(Command::new("snapshots"))
34+
.hide(true)
35+
.about("[DEPRECATED] Use `sentry-cli snapshots upload` instead."),
36+
);
3437
command
3538
}
3639

@@ -45,5 +48,12 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
4548
}};
4649
}
4750
each_subcommand!(execute_subcommand);
51+
if let Some(sub_matches) = matches.subcommand_matches("snapshots") {
52+
eprintln!(
53+
"WARNING: `sentry-cli build snapshots` is deprecated. \
54+
Use `sentry-cli snapshots upload` instead."
55+
);
56+
return crate::commands::snapshots::upload::execute(sub_matches);
57+
}
4858
unreachable!();
4959
}

src/commands/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ mod releases;
4040
mod repos;
4141
mod send_envelope;
4242
mod send_event;
43+
mod snapshots;
4344
mod sourcemaps;
4445
#[cfg(not(feature = "managed"))]
4546
mod uninstall;
@@ -70,6 +71,7 @@ macro_rules! each_subcommand {
7071
$mac!(repos);
7172
$mac!(send_event);
7273
$mac!(send_envelope);
74+
$mac!(snapshots);
7375
$mac!(sourcemaps);
7476
$mac!(dart_symbol_map);
7577
#[cfg(not(feature = "managed"))]

0 commit comments

Comments
 (0)