Skip to content

Commit 6ca69fb

Browse files
fix(progress): Replace eprintln! with log::info! in CI fallback
When progress bars are disabled (e.g. in CI where stderr is not a terminal), `finish_with_duration` printed its completion message via `eprintln!`. Some CI configurations treat any stderr output as an error, causing false positives. Use `log::info!` instead, which is suppressed at the default `Warn` log level. Users who want to see these messages can use `--log-level info`. The `> ` prefix is dropped since the log framework adds its own formatting. Closes #3016 Closes [CLI-244](https://linear.app/getsentry/issue/CLI-244/avoid-eprintln-for-progress-bar-messages-in-ci)
1 parent 44c3a91 commit 6ca69fb

27 files changed

+51
-62
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Replace `eprintln!` with `log::info!` for progress bar completion messages when the progress bar is disabled (e.g. in CI). This avoids spurious stderr output that some CI systems treat as errors ([#3223](https://github.com/getsentry/sentry-cli/pull/3223)).
8+
39
## 3.3.3
410

511
### Internal Changes 🔧

src/utils/progress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl ProgressBar {
7171
inner.finish_with_message(&msg);
7272
logging::set_progress_bar(None);
7373
} else {
74-
eprintln!("> {msg}");
74+
log::info!("{msg}");
7575
}
7676
}
7777

tests/integration/_cases/build/build-upload-apk-all-uploaded.trycmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
```
22
$ sentry-cli build upload tests/integration/_fixtures/build/apk.apk
33
? success
4-
> Preparing for upload completed in [..]
54
Successfully uploaded 1 file to Sentry
65
- tests/integration/_fixtures/build/apk.apk (http[..]/wat-org/preprod/wat-project/42)
76

tests/integration/_cases/build/build-upload-apk.trycmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
```
22
$ sentry-cli build upload tests/integration/_fixtures/build/apk.apk --head-sha 12345678deadbeef78900987feebdaed87654321
33
? success
4-
> Preparing for upload completed in [..]
5-
> Uploading completed in [..]
64
Successfully uploaded 1 file to Sentry
75
- tests/integration/_fixtures/build/apk.apk (http[..]/wat-org/preprod/wat-project/42)
86

tests/integration/_cases/build/build-upload-empty-shas.trycmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
```
22
$ sentry-cli build upload tests/integration/_fixtures/build/apk.apk --head-sha "" --base-sha ""
33
? success
4-
> Preparing for upload completed in [..]
54
Successfully uploaded 1 file to Sentry
65
- tests/integration/_fixtures/build/apk.apk (http://sentry.io/wat-org/preprod/wat-project/42)
76

tests/integration/_cases/debug_files/bundle_jvm/debug_files-bundle-jvm-input-dir-empty.trycmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
$ sentry-cli debug-files bundle-jvm --output . --debug-id 48dee70b-4f3f-4a49-9223-de441738f7cd empty-dir
33
? success
44
> Found 0 files
5-
> Bundling completed in [..]
65
> Bundled 0 files for upload
76
> Bundle ID: [..]-[..]-[..]-[..]-[..]
87
Created ./48dee70b-4f3f-4a49-9223-de441738f7cd.zip

tests/integration/_cases/debug_files/bundle_jvm/debug_files-bundle-jvm-output-is-file.trycmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
$ sentry-cli debug-files bundle-jvm --output ./file.txt --debug-id D384DC3B-AB2F-4DC7-903D-2C851E27E094 ./io
33
? failed
44
> Found 2 files
5-
> Bundling completed in [..]
65
> Bundled 2 files for upload
76
> Bundle ID: [..]-[..]-[..]-[..]-[..]
87
error: Unable to write source bundle

tests/integration/_cases/debug_files/bundle_jvm/debug_files-bundle-jvm-output-not-found.trycmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
$ sentry-cli debug-files bundle-jvm --output i-do-not-exist --debug-id 0B693ABA-531C-4EB6-99E4-B7320C3C85DA jvm
33
? success
44
> Found 2 files
5-
> Bundling completed in [..]
65
> Bundled 2 files for upload
76
> Bundle ID: [..]-[..]-[..]-[..]-[..]
87
Created i-do-not-exist/0b693aba-531c-4eb6-99e4-b7320c3c85da.zip

tests/integration/_cases/debug_files/bundle_jvm/debug_files-bundle-jvm.trycmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
$ sentry-cli debug-files bundle-jvm --output . --debug-id a4368a48-0880-40d7-9a26-c9ef5a84d156 ./io
33
? success
44
> Found 2 files
5-
> Bundling completed in [..]
65
> Bundled 2 files for upload
76
> Bundle ID: [..]-[..]-[..]-[..]-[..]
87
Created ./a4368a48-0880-40d7-9a26-c9ef5a84d156.zip

tests/integration/_cases/react_native/xcode-upload-source-maps-invalid-plist.trycmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ react-native-xcode.sh called with args:
55
Using React Native Packager bundle and source map.
66
Processing react-native sourcemaps for Sentry upload.
77
> Analyzing 2 sources
8-
> Analyzing completed in [..]
98
> Rewriting sources
10-
> Rewriting completed in [..]
119
> Adding source map references
1210
error: Info.plist was not found or an parsing error occurred
1311

0 commit comments

Comments
 (0)