Commit 8505a31
feat(build): Add --force-git-metadata flag with CI auto-detection (EME-604) (#2974)
## Summary
- Adds `--force-git-metadata` and `--no-git-metadata` flags to control
git metadata collection for build uploads
- Implements CI detection that automatically enables git metadata only
when running in most CI environments (GitHub Actions, GitLab CI,
Jenkins, etc.)
- Prevents local dev builds from triggering unwanted GitHub status
checks while maintaining automatic behavior for CI builds
- Refactors git metadata handling to use `VcsInfo` directly, eliminating
duplicate `GitMetadata` struct
## Changes
**New CI Detection Module** (`src/utils/ci.rs`):
- Checks common CI environment variables to determine if running in CI
- Based on logic from sentry-android-gradle-plugin
**Build Upload Command** (`src/commands/build/upload.rs`):
- Added two separate boolean flags for clarity:
- `--force-git-metadata` - Force enable git metadata collection
- `--no-git-metadata` - Force disable git metadata collection
- Default (no flag) - Auto-detect CI environment
- Refactored to use `VcsInfo` struct directly instead of intermediate
`GitMetadata` struct
- Simplified string handling in `collect_git_metadata` function
Fixes EME-604
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>1 parent 0387052 commit 8505a31
File tree
7 files changed
+347
-177
lines changed- src
- api/data_types/chunking
- commands/build
- utils
- tests/integration/_cases/build
7 files changed
+347
-177
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | | - | |
| 37 | + | |
36 | 38 | | |
37 | | - | |
| 39 | + | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
40 | 42 | | |
41 | | - | |
| 43 | + | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
0 commit comments