Skip to content

feat!: Migrate the plugin to the new Sentry CLI - #542

Draft
itaybre wants to merge 2 commits into
masterfrom
itaybre/feat/migrate-to-new-sentry-cli
Draft

itaybre wants to merge 2 commits into
masterfrom
itaybre/feat/migrate-to-new-sentry-cli

Conversation

@itaybre

@itaybre itaybre commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Replace the bundled legacy sentry-cli (v3) with the new Sentry CLI (sentry). All actions keep their names and, apart from a few options the new CLI dropped, their parameters. This is a breaking change meant to ship as plugin 3.0.0; see MIGRATION.md for the user-facing guide.

CLI download instead of bundling

The new CLI's standalone binaries are 100–135 MB per platform, so bundling all five would turn the ~40 MB gem into a ~160 MB one. The plugin now pins the CLI version and the SHA-256 of every release asset in lib/fastlane/plugin/sentry/sentry-cli.json, downloads the gzip asset for the current host from GitHub Releases on first use, verifies it, and caches it in ~/.cache/sentry-fastlane-plugin (SENTRY_FASTLANE_PLUGIN_CACHE_DIR overrides). The gem is now 26 KB. sentry_cli_path / SENTRY_CLI_PATH still work for a preinstalled binary; a legacy sentry-cli is rejected with a pointer to the migration guide. Supported hosts are macOS x64/arm64, Linux x64/arm64 (glibc) and Windows x64; 32-bit hosts are dropped. The manifest is regenerated by script/update-sentry-cli.sh, which the dependency updater now runs as a post-update script instead of committing binaries.

Command mapping and dropped options

releases new|finalize|set-commits   -> release create|finalize|set-commits
releases deploys <v> new --env <e>  -> release deploy <v> <e> [name]
upload-proguard                     -> proguard upload
sourcemaps upload <files...>        -> sourcemap upload <directory>  (one call per directory)
build upload --dsym <path>          -> build upload                  (flag does not exist yet)

sentry_upload_sourcemap now takes directories, joins ext/ignore with commas (the CLI accepts each flag once) and the CLI only scans .js/.cjs/.mjs by default, so react-native users need ext: ['jsbundle', 'bundle']. Options the new CLI dropped (symbol_maps, ignore_missing, write_properties, and the sourcemap url_suffix, note, validate, decompress, wait, wait_for, no_sourcemap_reference, debug_id_reference, bundle, bundle_sourcemap, strict) stay declared as deprecated: config items that warn and are ignored, so existing Fastfiles keep running. dSYMs passed to sentry_upload_build are still uploaded via debug-files upload for symbolication, but can no longer be attached to the IPA build upload because build upload has no --dsym flag in the new CLI.

Tests and infrastructure

Unit specs cover the installer (asset selection, cache paths, download, checksum verification, manifest/properties consistency) and the new commands. The integration tests run all six lanes against the mock API server with the real CLI; the mock now URL-decodes request paths and the sourcemap lane uses a small JS + sourcemap fixture directory. CI no longer installs the legacy CLI, the integration workflow caches the downloaded CLI, and LICENSE gains the FSL-1.1-Apache-2.0 third-party notice for the Sentry CLI.

Fixes #536

🤖 Generated with Claude Code

Replace the bundled legacy sentry-cli (v3) with the new Sentry CLI
(getsentry/cli, the `sentry` binary). Its standalone binaries are
about 100 MB per platform, so bundling them in the gem is no longer
practical. The plugin now pins a CLI version plus SHA-256 checksums in
lib/fastlane/plugin/sentry/sentry-cli.json, downloads the matching
release asset on first use, verifies it and caches it locally. A custom
binary can still be used via sentry_cli_path / SENTRY_CLI_PATH; the
legacy sentry-cli is rejected with a pointer to the migration guide.

Adapt every action to the new command surface (release create /
finalize / deploy / set-commits, proguard upload, one sourcemap upload
per directory with comma-joined ext and ignore values, build upload
without --dsym). Options the new CLI dropped stay declared as deprecated
no-ops so existing Fastfiles keep running with a warning.

Also regenerate the checksum manifest from the dependency updater via
a post-update script, drop the bundled binaries and the 32-bit hosts,
add Linux arm64, update the mock API server and fixtures used by the
integration tests, add a migration guide and add the Sentry CLI FSL
third-party notice to LICENSE.

BREAKING CHANGE: the plugin requires the new Sentry CLI, downloads it on
first use and no longer supports 32-bit hosts or the legacy sentry-cli.
Fixes #536
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comment thread lib/fastlane/plugin/sentry/helper/sentry_helper.rb Fixed
CodeQL flagged the unanchored version pattern as polynomial backtracking on
uncontrolled input. Match an anchored pattern against whitespace-split tokens
of the --version output instead, which also keeps working if the CLI ever
prefixes its version string.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

Migrate the Fastlane plugin to the new Sentry CLI

2 participants