-
-
Notifications
You must be signed in to change notification settings - Fork 236
feat(build): Track plugin versions from SENTRY_PIPELINE in build uploads (EME-606) #2994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
| metadata_content.contains("sentry-cli-version:"), | ||
| "Metadata should contain sentry-cli-version" | ||
| ); | ||
| assert!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically it is impossible to have both. i could also add an assertion that both are not set but I didn't think it was worth it.
e5a54f1 to
2ba8eda
Compare
Add support for tracking Gradle and Fastlane plugin versions in build uploads by accepting them as CLI parameters and writing them to the metadata file in the uploaded zip archive. This enables the backend to store plugin version information in the PreprodArtifact database table for size analysis and build distribution tracking. Changes: - Add --gradle-plugin-version and --fastlane-plugin-version CLI parameters - Write plugin versions to .sentry-cli-metadata.txt in uploaded zips - Update write_version_metadata() to accept optional plugin versions - Add test coverage for metadata file generation with plugin versions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…data (EME-XXX) Replace specific --gradle-plugin-version and --fastlane-plugin-version parameters with a more general --metadata parameter that accepts key-value pairs. This allows for flexible metadata inclusion in build uploads without requiring new CLI parameters for each metadata type. Usage: --metadata gradle-plugin=4.12.0 --metadata fastlane-plugin=1.2.3 Metadata is written to .sentry-cli-metadata.txt in uploaded archives in a sorted, deterministic format for consistent checksums. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
c981217 to
2ab57cf
Compare
Remove references to --gradle-plugin-version and --fastlane-plugin-version from test fixtures, replacing them with the new --metadata parameter that was introduced in the previous commits. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replace to_string() calls on string literals with to_owned() as recommended by clippy lint str_to_string. This is more idiomatic for converting &str to String when the source is already a string literal. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Address security and data integrity issues identified in PR review: 1. Reject empty metadata keys to prevent malformed output lines - Check that parts[0] is not empty before accepting key-value pairs - Update warning message to clarify requirement for non-empty keys 2. Reject reserved 'sentry-cli-version' key to prevent spoofing - Filter out any user-provided 'sentry-cli-version' metadata - Log warning when reserved key is detected - Prevents duplicate entries and version spoofing in tracking This ensures the .sentry-cli-metadata.txt file maintains integrity and prevents backend parser confusion. Fixes issues reported by Cursor bot in PR #2994. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…-XXX) Replace --metadata CLI argument with automatic detection of plugin versions from the SENTRY_PIPELINE environment variable. This simplifies the interface and leverages existing infrastructure used for User-Agent headers. Changes: - Remove --metadata argument from CLI - Parse SENTRY_PIPELINE to extract plugin name and version - Format: "sentry-gradle-plugin/4.12.0" or "sentry-fastlane-plugin/1.2.3" - Only recognize known Sentry plugins (gradle and fastlane) - Update function signatures from HashMap to (plugin_name, plugin_version) - Write plugin info to .sentry-cli-metadata.txt in uploaded archives - Update all tests to use new parameter format The SENTRY_PIPELINE variable is already set by the Gradle and Fastlane plugins, so this requires no changes to those plugins while enabling version tracking for size analysis and build distribution. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
| debug!("Detected {name} version {version} from SENTRY_PIPELINE"); | ||
| Some((name.to_owned(), version.to_owned())) | ||
| } else { | ||
| debug!("SENTRY_PIPELINE contains unrecognized plugin: {name}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be printed out as debug for javascript when they use the SENTRY_PIPELINE variable. I think this message is helpful for debugging but might be confusing if we print it for javascript devs.
Alternatively, we can also detect the javascript tool and not print this in that case. WDYT?
Format code to match Rust style guidelines. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…-606) Update changelog to reflect that plugin versions are automatically tracked from SENTRY_PIPELINE environment variable rather than via CLI parameters.
Summary
Automatically track Sentry plugin versions in build uploads by parsing the existing
SENTRY_PIPELINEenvironment variable. This enables size analysis and build distribution tracking by storing plugin version metadata in the PreprodArtifact database table.Changes
Plugin Version Detection
SENTRY_PIPELINEenvironment variablesentry-gradle-plugin/4.12.0orsentry-fastlane-plugin/1.2.3sentry-gradle-pluginsentry-fastlane-pluginMetadata File Format
The
.sentry-cli-metadata.txtfile inside uploaded zips now includes detected plugin info:Related PRs:
getsentry/launchpad#464
getsentry/sentry#103062
getsentry/sentry-android-gradle-plugin#1036
getsentry/sentry-fastlane-plugin#365