Skip to content

Conversation

@runningcode
Copy link
Contributor

Summary

Adds CLI version metadata to all zip archives created during build uploads for debugging purposes.

Resolves EME-471

Changes

  • Adds a .sentry-cli-metadata.txt file at the root of each build upload zip archive
  • The file contains: sentry-cli-version: <version>
  • Applied to both single-file uploads (APK, AAB) and directory uploads (XCArchive)
  • Uses the same compression and timestamp settings as other files to maintain consistent checksums

🤖 Generated with Claude Code

@linear
Copy link

linear bot commented Oct 29, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against caff448

)?;
}

let options = SimpleFileOptions::default()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the same options as set in upload.rs (scroll up further in the file to see it)

@runningcode runningcode marked this pull request as ready for review October 29, 2025 17:59
@runningcode runningcode requested review from a team and szokeasaurusrex as code owners October 29, 2025 17:59
runningcode and others added 3 commits October 29, 2025 18:00
Adds a `.sentry-cli-metadata.txt` file to all zip archives created during
build uploads. This file contains the sentry-cli version for debugging purposes.

The metadata file is added to both single-file uploads (APK, AAB) and directory
uploads (XCArchive) with the same compression and timestamp settings as other
files to maintain consistent checksums.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@runningcode runningcode force-pushed the no/add-cli-version-to-build-uploads branch from 9d2ccb4 to caff448 Compare October 29, 2025 18:00

let options = SimpleFileOptions::default()
.compression_method(zip::CompressionMethod::Deflated)
.last_modified_time(DateTime::default());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Compression Inconsistency Causes Checksum Mismatch

The .sentry-cli-metadata.txt file is compressed with Deflated in normalize.rs but Stored in upload.rs. This inconsistency violates the intended goal of uniform compression and timestamp settings, which affects checksum consistency across different upload types.

Fix in Cursor Fix in Web

Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments/suggestions.

Also just wondering, were you able to test the changes manually? It would be cool if we could also have an automated test to check that the file is created and added to the ZIP, so we can ensure the behavior remains in CI

? success
WARN [..] EXPERIMENTAL: The build subcommand is experimental. The command is subject to breaking changes and may be removed without notice in any release.
> Preparing for upload completed in [..]
> Uploading completed in [..]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: I don't see why this line of output is disappearing following this change; I would expect that it should stay the same.

Please double-check why this is changing, and whether the change is intentional.

Comment on lines +115 to +116
zip.start_file(".sentry-cli-metadata.txt", options)?;
writeln!(zip, "sentry-cli-version: {VERSION}")?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: To ensure we always generate the version information in the same way, I would suggest we extract this logic to a separate method, that we can also reuse in the commands/build/upload.rs file


## Unreleased

### Various fixes & improvements
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Various fixes & improvements
### Features


### Various fixes & improvements

- Add CLI version metadata to build upload archives for debugging purposes ([#2890](https://github.com/getsentry/sentry-cli/pull/2890))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add more details to this changelog entry, specifically so that users understand the user-facing changes. I have been making user-readable changelog entries a priority in the last few Sentry CLI releases.

> Uploading completed in [..]
Successfully uploaded 1 file to Sentry
- tests/integration/_fixtures/build/apk.apk (http[..]/wat-org/preprod/wat-project/42)
- tests/integration/_fixtures/build/apk.apk (http://sentry.io/wat-org/preprod/wat-project/42)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case, this line should remain the same

Suggested change
- tests/integration/_fixtures/build/apk.apk (http://sentry.io/wat-org/preprod/wat-project/42)
- tests/integration/_fixtures/build/apk.apk (http[..]/wat-org/preprod/wat-project/42)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants