-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Extract and send tooling versions to Sentry (EME-606) #464
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: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #464 +/- ##
==========================================
+ Coverage 80.92% 81.01% +0.09%
==========================================
Files 164 166 +2
Lines 14248 14341 +93
Branches 1505 1508 +3
==========================================
+ Hits 11530 11619 +89
- Misses 2148 2152 +4
Partials 570 570 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Extract sentry-cli, fastlane, and gradle plugin versions from artifact metadata files and send them to Sentry's preprod artifact update API. Changes: - Add sentry_cli_version, fastlane_version, and gradle_plugin_version fields to UpdateData model - Add _extract_tooling_versions method to parse .sentry-cli-metadata.txt - Update _prepare_update_data to extract and include version information - Add comprehensive tests for version extraction Refs: EME-606
Moves tooling metadata extraction from artifact_processor into the platform-specific analyzers where app_info is created. This better encapsulates the metadata extraction logic and makes it more consistent with other app_info field population. Also renames sentry_cli_version to cli_version for consistency with the metadata file format. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Removes comments that simply restate what the code is doing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Makes field naming consistent by using "plugin_version" suffix for both fastlane_plugin_version and gradle_plugin_version. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates the metadata file keys to be more explicit: - fastlane-plugin -> fastlane-plugin-version - gradle-plugin -> gradle-plugin-version This makes the key names more descriptive and consistent. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1281aa7 to
0cfd711
Compare
Removed duplicate metadata extraction logic from artifact_processor.py since the tooling versions are already extracted by the platform analyzers using the dedicated metadata_extractor.py utility. The values are available via the app_info object, eliminating the need for redundant extraction. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed extract_metadata_from_zip to only check for .sentry-cli-metadata.txt in the root of the zip file, not in nested paths. This ensures we only find one metadata file and makes the behavior more predictable. Updated tests to verify that nested metadata files are ignored. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
src/launchpad/artifact_processor.py
Outdated
| android_app_info=android_app_info, | ||
| dequeued_at=dequeued_at, | ||
| cli_version=app_info.cli_version, | ||
| fastlane_plugin_version=app_info.fastlane_plugin_version, |
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.
Not sure I see a point of setting these here if you're already setting them in the apple_app_info/android_app_info - I'd recommend only one spot or the other
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.
It does seem redundant but it doesn't work without both changes.
This line takes the data from the AndroidAppInfo and AppleAppInfo and turns it in to the UpdateData in order to send it to the artifact update API. See the sentry PR here: getsentry/sentry#103062
I wasn't sure if your question was about the inheritance of the objects but both UpdateData and BaseAppInfo inherit from BaseModel so there isn't a shared base.
but maybe I am misinterpreting your question?
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.
apple_app_info and android_app_info are already top-level fields in the UpdateData model. You also have reference to those in the backend. In this case, you're still duplicating the fields, cli_version, fastlane_plugin_version and gradle_plugin_version. Those can and should be pulled from only one spot or another (top-level in UpdateData or in apple/android_app_info), not duplicated.
IMO there should be a PR here to update the backend handling to get those values from the android/apple_app_info fields and we should remove the top-level fields from UpdateData. Simpler and leverages the app_info models that are already being passed, and we don't duplicate data.
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.
Ok I see. I misinterpreted this. I think I got it correctly. I added the tooling fields to apple_app_info and android_app_info and created a backend PR to accept these fields like this as well getsentry/sentry#104846
There is still the duplication when we need to copy from the models to the api models but I think that is what you expected.
Removed docstrings that repeated what the code already expressed through clear function names and type hints. Kept only the format example in _parse_metadata_content as it provides useful context. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fix indentation in docstring to match ruff formatting rules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
07f53e7 to
76cdd8e
Compare
|
|
||
|
|
||
| class AppleAppInfo(BaseModel): | ||
| class BaseAppInfo(BaseModel): |
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.
Added this base class to reduce duplication of the cli_version. Can remove if it seems redundant.
| certificate_expiration_date=app_info.certificate_expiration_date, | ||
| missing_dsym_binaries=app_info.missing_dsym_binaries, | ||
| build_date=app_info.build_date, | ||
| cli_version=app_info.cli_version, |
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.
cli_version could alternatively be moved to update_data to reduce duplication. thoughts?
Extracts tooling version information (sentry-cli, Fastlane plugin, Gradle plugin) from uploaded artifact zip files and sends them to Sentry for database storage.
_parse_metadata_contentfunction to parse the metadata file format:sentry-cli-version: X.Y.Zsentry-fastlane-plugin: X.Y.Zsentry-gradle-plugin: X.Y.ZRefs: EME-606
Related PRs:
getsentry/sentry#103062
getsentry/sentry#104846
getsentry/sentry-cli#2994