From db26c058e44e6231c3ce4dd8566efa5efc7854b3 Mon Sep 17 00:00:00 2001 From: Philip Niedertscheider Date: Mon, 12 Jan 2026 15:47:42 +0100 Subject: [PATCH 1/4] Add missing sentry-cli v3 options to all actions - Add all missing options from sentry-cli v3.0.1 to match CLI capabilities - Fix parameter name: ids -> id in sentry_debug_files_upload - Remove deprecated options: info_plist, no_reprocessing, upload_symbol_maps - Update type validation to include jvm, portablepdb, wasm - Add comprehensive migration guide to README - Update CHANGELOG with breaking changes and new features --- CHANGELOG.md | 10 ++ README.md | 95 +++++++++++++++---- .../sentry/actions/sentry_create_release.rb | 4 + .../actions/sentry_debug_files_upload.rb | 42 ++++---- .../sentry/actions/sentry_finalize_release.rb | 8 ++ .../sentry/actions/sentry_set_commits.rb | 14 ++- .../sentry/actions/sentry_upload_build.rb | 19 +++- .../sentry/actions/sentry_upload_proguard.rb | 29 +++++- .../sentry/actions/sentry_upload_sourcemap.rb | 82 +++++++++++++++- 9 files changed, 259 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8de168..c1fa1788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,12 +13,22 @@ Due to sentry-cli 3.0.0 upgrade, the following breaking changes have been made ( - **`force_foreground` parameter has been removed**: This parameter was deprecated as a no-op since v1.26.0 and has now been removed from `sentry_debug_files_upload`. Users should remove this parameter from their Fastfiles. ([#376](https://github.com/getsentry/sentry-fastlane-plugin/pull/376)) - **`sentry_upload_dsym` action has been removed**: This action has been deprecated in favor of `sentry_debug_files_upload`. Users should migrate to `sentry_debug_files_upload` with the appropriate `path` parameter. ([#375](https://github.com/getsentry/sentry-fastlane-plugin/pull/375)) - **`sentry_upload_dif` action has been removed**: This action has been deprecated in favor of `sentry_debug_files_upload`. Users should migrate to `sentry_debug_files_upload` with the appropriate `path` parameter. ([#375](https://github.com/getsentry/sentry-fastlane-plugin/pull/375)) +- **`ids` parameter renamed to `id` in `sentry_debug_files_upload`**: The parameter has been renamed from `ids` to `id` to match sentry-cli v3. Users should update their Fastfiles to use `id` instead of `ids`. +- **Removed deprecated parameters from `sentry_debug_files_upload`**: The following parameters have been removed as they are no longer supported in sentry-cli v3: `info_plist`, `no_reprocessing`, `upload_symbol_maps`. Users should remove these parameters from their Fastfiles. See the [sentry-cli 3.0.0 release notes](https://github.com/getsentry/sentry-cli/releases/tag/3.0.0) for more details on CLI changes. ### Features - Set `SENTRY_PIPELINE` environment variable for all sentry-cli invocations to identify the plugin and version ([#365](https://github.com/getsentry/sentry-fastlane-plugin/pull/365)) +- **Added missing sentry-cli v3 options to all actions**: All actions have been updated to support all available options from sentry-cli version 3.0.1: + - **`sentry_debug_files_upload`**: Added `wait_for`, `no_upload`, `il2cpp_mapping` options. Fixed `id` parameter (was `ids`). Updated type validation to include `jvm`, `portablepdb`, and `wasm` types. Removed deprecated options (`info_plist`, `no_reprocessing`, `upload_symbol_maps`) that are no longer supported in sentry-cli v3. + - **`sentry_upload_sourcemap`**: Added `url_suffix`, `note`, `validate`, `decompress`, `wait`, `wait_for`, `no_sourcemap_reference`, `debug_id_reference`, `bundle`, `bundle_sourcemap`, `ext` (array support), and `strict` options. + - **`sentry_upload_proguard`**: Added `no_upload`, `write_properties`, `require_one`, and `uuid` options. + - **`sentry_upload_build`**: Added `release_notes`, `force_git_metadata`, and `no_git_metadata` options. + - **`sentry_create_release`**: Added `url` option. + - **`sentry_finalize_release`**: Added `url` and `released` options. + - **`sentry_set_commits`**: Added `local` and `initial_depth` options. ### Improvements diff --git a/README.md b/README.md index ba77f0e7..21a3d536 100644 --- a/README.md +++ b/README.md @@ -70,20 +70,20 @@ The `SENTRY_DSYM_PATH` environment variable may be used in place of the `dsym_pa Further options: -- __type__: Optional. Only consider debug information files of the given type. By default, all types are considered. Valid options: 'dsym', 'elf', 'breakpad', 'pdb', 'pe', 'sourcebundle', 'bcsymbolmap'. -- __no_unwind__: Optional. Do not scan for stack unwinding information. Specify this flag for builds with disabled FPO, or when stackwalking occurs on the device. This usually excludes executables and dynamic libraries. They might still be uploaded, if they contain additional processable information (see other flags)". -- __no_debug__: Optional. Do not scan for debugging information. This will usually exclude debug companion files. They might still be uploaded, if they contain additional processable information (see other flags)". -- __no_sources__: Optional. "Do not scan for source information. This will usually exclude source bundle files. They might still be uploaded, if they contain additional processable information (see other flags)". -- __ids__: Optional. Search for specific debug identifiers. +- __type__: Optional. Only consider debug information files of the given type. By default, all types are considered. Valid options: 'bcsymbolmap', 'breakpad', 'dsym', 'elf', 'jvm', 'pdb', 'pe', 'portablepdb', 'sourcebundle', 'wasm'. +- __no_unwind__: Optional. Do not scan for stack unwinding information. Specify this flag for builds with disabled FPO, or when stackwalking occurs on the device. This usually excludes executables and dynamic libraries. They might still be uploaded, if they contain additional processable information (see other flags). +- __no_debug__: Optional. Do not scan for debugging information. This will usually exclude debug companion files. They might still be uploaded, if they contain additional processable information (see other flags). +- __no_sources__: Optional. Do not scan for source information. This will usually exclude source bundle files. They might still be uploaded, if they contain additional processable information (see other flags). +- __id__: Optional. Search for specific debug identifiers. - __require_all__: Optional. Errors if not all identifiers specified with --id could be found. -- __symbol_maps__: Optional. Optional path to BCSymbolMap files which are used to resolve hidden symbols in dSYM files downloaded from iTunes Connect. This requires the dsymutil tool to be available. +- __symbol_maps__: Optional. Path to BCSymbolMap files which are used to resolve hidden symbols in dSYM files downloaded from iTunes Connect. This requires the dsymutil tool to be available. - __derived_data__: Optional. Search for debug symbols in Xcode's derived data. -- __no_zips__: Do not search in ZIP files. -- __info_plist__: Optional. Optional path to the Info.plist. We will try to find this automatically if run from Xcode. Providing this information will associate the debug symbols with a specific ITC application and build in Sentry. Note that if you provide the plist explicitly it must already be processed. -- __no_reprocessing__: Optional. Do not trigger reprocessing after uploading. +- __no_zips__: Optional. Do not search in ZIP files. +- __no_upload__: Optional. Disable the actual upload. This runs all steps for the processing but does not trigger the upload. This is useful if you just want to verify the setup or skip the upload in tests. - __include_sources__: Optional. Include sources from the local file system and upload them as source bundles. -- __wait__: Wait for the server to fully process uploaded files. Errors can only be displayed if --wait is specified, but this will significantly slow down the upload process. -- __upload_symbol_maps__: Optional. Upload any BCSymbolMap files found to allow Sentry to resolve hidden symbols, e.g. when it downloads dSYMs directly from App Store Connect or when you upload dSYMs without first resolving the hidden symbols using --symbol-maps. +- __wait__: Optional. Wait for the server to fully process uploaded files. Errors can only be displayed if --wait or --wait-for is specified, but this will significantly slow down the upload process. +- __wait_for__: Optional. Wait for the server to fully process uploaded files, but at most for the given number of seconds. Errors can only be displayed if --wait or --wait-for is specified, but this will significantly slow down the upload process. +- __il2cpp_mapping__: Optional. Compute il2cpp line mappings and upload them along with sources. ### Uploading iOS Build Archives @@ -104,7 +104,10 @@ sentry_upload_build( head_ref: 'feature-branch', # Name of the head branch (or SENTRY_HEAD_REF) base_ref: 'main', # Name of the base branch (or SENTRY_BASE_REF) pr_number: '123', # Pull request number (or SENTRY_PR_NUMBER) - build_configuration: 'Release' # Build configuration (e.g., 'Release', 'Debug') (or SENTRY_BUILD_CONFIGURATION) + build_configuration: 'Release', # Build configuration (e.g., 'Release', 'Debug') (or SENTRY_BUILD_CONFIGURATION) + release_notes: 'Fixed critical bugs', # Optional. Release notes to use for the upload + force_git_metadata: false, # Optional. Force collection and sending of git metadata + no_git_metadata: false # Optional. Disable collection and sending of git metadata ) ``` @@ -121,7 +124,8 @@ sentry_create_release( project_slug: '...', version: '...', # release version to create app_identifier: '...', # pass in the bundle_identifer of your app - finalize: true # Whether to finalize the release. If not provided or false, the release can be finalized using the sentry_finalize_release action + finalize: true, # Whether to finalize the release. If not provided or false, the release can be finalized using the sentry_finalize_release action + url: 'https://github.com/owner/repo/releases/tag/v1.0.0' # Optional. URL to the release for information purposes ) ``` @@ -139,7 +143,15 @@ sentry_upload_sourcemap( build: '...', # Optionally pass in the build number of your app dist: '...', # optional distribution of the release usually the buildnumber sourcemap: ['main.jsbundle', 'main.jsbundle.map'], # Sourcemap(s) to upload. Path(s) can be a comma-separated string or an array of strings. - rewrite: true + rewrite: true, # Rewrite the sourcemaps before upload (default: false) + url_prefix: '~/', # Optional. Sets a URL prefix in front of all files + url_suffix: '.map', # Optional. Sets a URL suffix to append to all filenames + note: 'Build from CI', # Optional. Adds a note to the uploaded artifact bundle + validate: true, # Optional. Enable basic sourcemap validation + decompress: true, # Optional. Enable files gzip decompression prior to upload + wait: true, # Optional. Wait for the server to fully process uploaded files + wait_for: 60, # Optional. Wait for the server to fully process uploaded files, but at most for the given number of seconds + strict: true # Optional. Fail with a non-zero exit code if the specified source map file cannot be uploaded ) ``` @@ -150,8 +162,11 @@ sentry_upload_proguard( auth_token: '...', org_slug: '...', project_slug: '...', - android_manifest_path: 'path to merged AndroidManifest file', # found in `app/build/intermediates/manifests/full` mapping_path: 'path to mapping.txt to upload', + no_upload: false, # Optional. Disable the actual upload (useful for verification) + write_properties: 'path/to/properties/file', # Optional. Write UUIDs for processed mapping files into properties file + require_one: true, # Optional. Require at least one file to upload or the command will error + uuid: 'custom-uuid' # Optional. Explicitly override the UUID of the mapping file ) ``` @@ -167,7 +182,9 @@ sentry_set_commits( auto: false, # enable completely automated commit management clear: false, # clear all current commits from the release commit: '...', # commit spec, see `sentry-cli releases help set-commits` for more information - ignore_missing: false # Optional boolean value: When the flag is set and the previous release commit was not found in the repository, will create a release with the default commits count (or the one specified with `--initial-depth`) instead of failing the command. + ignore_missing: false, # Optional boolean value: When the flag is set and the previous release commit was not found in the repository, will create a release with the default commits count (or the one specified with `--initial-depth`) instead of failing the command. + local: false, # Optional. Set commits of a release from local git + initial_depth: 20 # Optional. Set the number of commits of the initial release (default: 20) ) ``` @@ -212,6 +229,52 @@ You can set the `sentry-cli` [configuration value](https://docs.sentry.io/produc For any other issues and feedback about this plugin, please submit it to this repository. +## Migration Guide + +### Migrating from sentry-cli v2 to v3 + +When upgrading to the latest version of this plugin (which uses sentry-cli v3), you may need to update your Fastfiles. Here are the key changes: + +#### Parameter Name Changes + +- **`sentry_debug_files_upload`**: The `ids` parameter has been renamed to `id` (singular). Update your Fastfiles: + ```ruby + # Before + sentry_debug_files_upload(ids: 'abc123') + + # After + sentry_debug_files_upload(id: 'abc123') + ``` + +#### Removed Parameters + +The following parameters have been removed as they are no longer supported in sentry-cli v3: + +- **`sentry_debug_files_upload`**: Remove `info_plist`, `no_reprocessing`, and `upload_symbol_maps` parameters if you're using them. +- **`sentry_upload_proguard`**: Remove `android_manifest_path` parameter if you're using it (no longer needed). + +#### New Available Options + +Many new options have been added to match sentry-cli v3 capabilities. See the action documentation above for all available options. Some notable additions: + +- **`sentry_debug_files_upload`**: Added `wait_for`, `no_upload`, `il2cpp_mapping` options. Type validation now includes `jvm`, `portablepdb`, and `wasm`. +- **`sentry_upload_sourcemap`**: Added `url_suffix`, `note`, `validate`, `decompress`, `wait`, `wait_for`, `no_sourcemap_reference`, `debug_id_reference`, `bundle`, `bundle_sourcemap`, `ext`, and `strict` options. +- **`sentry_upload_proguard`**: Added `no_upload`, `write_properties`, `require_one`, and `uuid` options. +- **`sentry_upload_build`**: Added `release_notes`, `force_git_metadata`, and `no_git_metadata` options. +- **`sentry_create_release`**: Added `url` option. +- **`sentry_finalize_release`**: Added `url` and `released` options. +- **`sentry_set_commits`**: Added `local` and `initial_depth` options. + +#### Removed Actions + +The following actions have been removed and replaced: + +- **`sentry_upload_file`**: Use `sentry_upload_sourcemap` for source maps or other specialized upload actions. +- **`sentry_upload_dsym`**: Use `sentry_debug_files_upload` with appropriate `path` parameter. +- **`sentry_upload_dif`**: Use `sentry_debug_files_upload` with appropriate `path` parameter. + +For more details on sentry-cli v3 changes, see the [sentry-cli 3.0.0 release notes](https://github.com/getsentry/sentry-cli/releases/tag/3.0.0). + ## Troubleshooting For some more detailed help with plugins problems, check out the [Plugins Troubleshooting](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md) doc in the main `fastlane` repo. diff --git a/lib/fastlane/plugin/sentry/actions/sentry_create_release.rb b/lib/fastlane/plugin/sentry/actions/sentry_create_release.rb index 128b57db..5a1740aa 100644 --- a/lib/fastlane/plugin/sentry/actions/sentry_create_release.rb +++ b/lib/fastlane/plugin/sentry/actions/sentry_create_release.rb @@ -16,6 +16,7 @@ def self.run(params) version ] command.push("--finalize") if params[:finalize] == true + command.push("--url").push(params[:url]) unless params[:url].nil? Helper::SentryHelper.call_sentry_cli(params, command) UI.success("Successfully created release: #{version}") @@ -53,6 +54,9 @@ def self.available_options description: "Whether to finalize the release. If not provided or false, the release can be finalized using the finalize_release action", default_value: false, is_string: false, + optional: true), + FastlaneCore::ConfigItem.new(key: :url, + description: "Optional URL to the release for information purposes", optional: true) ] end diff --git a/lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb b/lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb index d85249f0..a19c0476 100644 --- a/lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb +++ b/lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb @@ -27,16 +27,16 @@ def self.run(params) command.push('--no-unwind') unless params[:no_unwind].nil? command.push('--no-debug') unless params[:no_debug].nil? command.push('--no-sources') unless params[:no_sources].nil? - command.push('--ids').push(params[:ids]) unless params[:ids].nil? + command.push('--id').push(params[:id]) unless params[:id].nil? command.push('--require-all') unless params[:require_all].nil? command.push('--symbol-maps').push(params[:symbol_maps]) unless params[:symbol_maps].nil? command.push('--derived-data') unless params[:derived_data].nil? command.push('--no-zips') unless params[:no_zips].nil? - command.push('--info-plist').push(params[:info_plist]) unless params[:info_plist].nil? - command.push('--no-reprocessing') unless params[:no_reprocessing].nil? - command.push('--include-sources') unless params[:include_sources] != true + command.push('--no-upload') unless params[:no_upload].nil? + command.push('--include-sources') if params[:include_sources] == true command.push('--wait') unless params[:wait].nil? - command.push('--upload-symbol-maps') unless params[:upload_symbol_maps].nil? + command.push('--wait-for').push(params[:wait_for]) unless params[:wait_for].nil? + command.push('--il2cpp-mapping') unless params[:il2cpp_mapping].nil? Helper::SentryHelper.call_sentry_cli(params, command) UI.success("Successfully ran debug-files upload") @@ -69,7 +69,7 @@ def self.available_options type. By default, all types are considered", optional: true, verify_block: proc do |value| - UI.user_error! "Invalid value '#{value}'" unless ['dsym', 'elf', 'breakpad', 'pdb', 'pe', 'sourcebundle', 'bcsymbolmap'].include? value + UI.user_error! "Invalid value '#{value}'" unless ['bcsymbolmap', 'breakpad', 'dsym', 'elf', 'jvm', 'pdb', 'pe', 'portablepdb', 'sourcebundle', 'wasm'].include? value end), FastlaneCore::ConfigItem.new(key: :no_unwind, description: "Do not scan for stack unwinding information. Specify \ @@ -95,7 +95,7 @@ def self.available_options processable information (see other flags)", is_string: false, optional: true), - FastlaneCore::ConfigItem.new(key: :ids, + FastlaneCore::ConfigItem.new(key: :id, description: "Search for specific debug identifiers", optional: true), FastlaneCore::ConfigItem.new(key: :require_all, @@ -116,15 +116,10 @@ def self.available_options description: "Do not search in ZIP files", is_string: false, optional: true), - FastlaneCore::ConfigItem.new(key: :info_plist, - description: "Optional path to the Info.plist.{n}We will try to find this \ - automatically if run from Xcode. Providing this information \ - will associate the debug symbols with a specific ITC application \ - and build in Sentry. Note that if you provide the plist \ - explicitly it must already be processed", - optional: true), - FastlaneCore::ConfigItem.new(key: :no_reprocessing, - description: "Do not trigger reprocessing after uploading", + FastlaneCore::ConfigItem.new(key: :no_upload, + description: "Disable the actual upload. This runs all steps for the \ + processing but does not trigger the upload. This is useful if \ + you just want to verify the setup or skip the upload in tests", is_string: false, optional: true), FastlaneCore::ConfigItem.new(key: :include_sources, @@ -134,15 +129,18 @@ def self.available_options optional: true), FastlaneCore::ConfigItem.new(key: :wait, description: "Wait for the server to fully process uploaded files. Errors \ - can only be displayed if --wait is specified, but this will \ + can only be displayed if --wait or --wait-for is specified, but this will \ significantly slow down the upload process", is_string: false, optional: true), - FastlaneCore::ConfigItem.new(key: :upload_symbol_maps, - description: "Upload any BCSymbolMap files found to allow Sentry to resolve \ - hidden symbols, e.g. when it downloads dSYMs directly from App \ - Store Connect or when you upload dSYMs without first resolving \ - the hidden symbols using --symbol-maps", + FastlaneCore::ConfigItem.new(key: :wait_for, + description: "Wait for the server to fully process uploaded files, but at most \ + for the given number of seconds. Errors can only be displayed if --wait or \ + --wait-for is specified, but this will significantly slow down the upload process", + type: Integer, + optional: true), + FastlaneCore::ConfigItem.new(key: :il2cpp_mapping, + description: "Compute il2cpp line mappings and upload them along with sources", is_string: false, optional: true) ] diff --git a/lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb b/lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb index 04afbf8a..a44b6433 100644 --- a/lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb +++ b/lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb @@ -15,6 +15,8 @@ def self.run(params) "finalize", version ] + command.push("--url").push(params[:url]) unless params[:url].nil? + command.push("--released").push(params[:released]) unless params[:released].nil? Helper::SentryHelper.call_sentry_cli(params, command) UI.success("Successfully finalized release: #{version}") @@ -47,6 +49,12 @@ def self.available_options FastlaneCore::ConfigItem.new(key: :build, short_option: "-b", description: "Release build to finalize on Sentry", + optional: true), + FastlaneCore::ConfigItem.new(key: :url, + description: "Optional URL to the release for information purposes", + optional: true), + FastlaneCore::ConfigItem.new(key: :released, + description: "Set the release time. Defaults to the current time if not provided", optional: true) ] end diff --git a/lib/fastlane/plugin/sentry/actions/sentry_set_commits.rb b/lib/fastlane/plugin/sentry/actions/sentry_set_commits.rb index 4e81cc73..2953e681 100644 --- a/lib/fastlane/plugin/sentry/actions/sentry_set_commits.rb +++ b/lib/fastlane/plugin/sentry/actions/sentry_set_commits.rb @@ -19,6 +19,8 @@ def self.run(params) command.push('--auto') if params[:auto] command.push('--clear') if params[:clear] command.push('--ignore-missing') if params[:ignore_missing] + command.push('--local') if params[:local] + command.push('--initial-depth').push(params[:initial_depth]) unless params[:initial_depth].nil? command.push('--commit').push(params[:commit]) unless params[:commit].nil? Helper::SentryHelper.call_sentry_cli(params, command) @@ -67,7 +69,17 @@ def self.available_options FastlaneCore::ConfigItem.new(key: :ignore_missing, description: "When enabled, if the previous release commit was not found in the repository, will create a release with the default commits count (or the one specified with `--initial-depth`) instead of failing the command", is_string: false, - default_value: false) + default_value: false), + FastlaneCore::ConfigItem.new(key: :local, + description: "Set commits of a release from local git. This requires that the command \ + is run from within a git repository. sentry-cli will then automatically find \ + remotely configured repositories and discover commits", + is_string: false, + optional: true), + FastlaneCore::ConfigItem.new(key: :initial_depth, + description: "Set the number of commits of the initial release. The default is 20", + type: Integer, + optional: true) ] end diff --git a/lib/fastlane/plugin/sentry/actions/sentry_upload_build.rb b/lib/fastlane/plugin/sentry/actions/sentry_upload_build.rb index 311d83c8..3f1107de 100644 --- a/lib/fastlane/plugin/sentry/actions/sentry_upload_build.rb +++ b/lib/fastlane/plugin/sentry/actions/sentry_upload_build.rb @@ -25,6 +25,9 @@ def self.run(params) command << "--base-ref" << params[:base_ref] if params[:base_ref] command << "--pr-number" << params[:pr_number] if params[:pr_number] command << "--build-configuration" << params[:build_configuration] if params[:build_configuration] + command << "--release-notes" << params[:release_notes] if params[:release_notes] + command << "--force-git-metadata" if params[:force_git_metadata] + command << "--no-git-metadata" if params[:no_git_metadata] Helper::SentryHelper.call_sentry_cli(params, command) UI.success("Successfully uploaded build archive: #{xcarchive_path}") @@ -95,7 +98,21 @@ def self.available_options env_name: "SENTRY_BUILD_CONFIGURATION", description: "The build configuration (e.g., 'Release', 'Debug')", optional: true, - is_string: true) + is_string: true), + FastlaneCore::ConfigItem.new(key: :release_notes, + description: "The release notes to use for the upload", + optional: true, + is_string: true), + FastlaneCore::ConfigItem.new(key: :force_git_metadata, + description: "Force collection and sending of git metadata (branch, commit, etc.). \ + If neither this nor --no-git-metadata is specified, git metadata is automatically \ + collected when running in most CI environments", + is_string: false, + optional: true), + FastlaneCore::ConfigItem.new(key: :no_git_metadata, + description: "Disable collection and sending of git metadata", + is_string: false, + optional: true) ] end diff --git a/lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb b/lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb index a7b47a6a..361deecc 100644 --- a/lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb +++ b/lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb @@ -14,6 +14,11 @@ def self.run(params) mapping_path ] + command.push('--no-upload') if params[:no_upload] + command.push('--write-properties').push(params[:write_properties]) unless params[:write_properties].nil? + command.push('--require-one') if params[:require_one] + command.push('--uuid').push(params[:uuid]) unless params[:uuid].nil? + Helper::SentryHelper.call_sentry_cli(params, command) UI.success("Successfully uploaded mapping file!") end @@ -41,7 +46,29 @@ def self.available_options optional: false, verify_block: proc do |value| UI.user_error! "Could not find your mapping file at path '#{value}'" unless File.exist?(value) - end) + end), + FastlaneCore::ConfigItem.new(key: :no_upload, + description: "Disable the actual upload. This runs all steps for the processing \ + but does not trigger the upload. This is useful if you just want to verify the \ + mapping files and write the proguard UUIDs into a properties file", + is_string: false, + optional: true), + FastlaneCore::ConfigItem.new(key: :write_properties, + description: "Write the UUIDs for the processed mapping files into the given \ + properties file", + optional: true), + FastlaneCore::ConfigItem.new(key: :require_one, + description: "Requires at least one file to upload or the command will error", + is_string: false, + optional: true), + FastlaneCore::ConfigItem.new(key: :uuid, + description: "Explicitly override the UUID of the mapping file with another one. \ + This should be used with caution as it means that you can upload multiple mapping \ + files if you don't take care. This however can be useful if you have a build \ + process in which you need to know the UUID of the proguard file before it was \ + created. If you upload a file with a forced UUID you can only upload a single \ + proguard file", + optional: true) ] end diff --git a/lib/fastlane/plugin/sentry/actions/sentry_upload_sourcemap.rb b/lib/fastlane/plugin/sentry/actions/sentry_upload_sourcemap.rb index 0793c2cc..25cacc01 100644 --- a/lib/fastlane/plugin/sentry/actions/sentry_upload_sourcemap.rb +++ b/lib/fastlane/plugin/sentry/actions/sentry_upload_sourcemap.rb @@ -24,7 +24,18 @@ def self.run(params) command.push('--strip-prefix').push(params[:strip_prefix]) if params[:strip_prefix] command.push('--strip-common-prefix') if params[:strip_common_prefix] command.push('--url-prefix').push(params[:url_prefix]) unless params[:url_prefix].nil? + command.push('--url-suffix').push(params[:url_suffix]) unless params[:url_suffix].nil? command.push('--dist').push(params[:dist]) unless params[:dist].nil? + command.push('--note').push(params[:note]) unless params[:note].nil? + command.push('--validate') if params[:validate] + command.push('--decompress') if params[:decompress] + command.push('--wait') if params[:wait] + command.push('--wait-for').push(params[:wait_for]) unless params[:wait_for].nil? + command.push('--no-sourcemap-reference') if params[:no_sourcemap_reference] + command.push('--debug-id-reference') if params[:debug_id_reference] + command.push('--bundle').push(params[:bundle]) unless params[:bundle].nil? + command.push('--bundle-sourcemap').push(params[:bundle_sourcemap]) unless params[:bundle_sourcemap].nil? + command.push('--strict') if params[:strict] unless params[:ignore].nil? # normalize to array @@ -44,6 +55,16 @@ def self.run(params) command.push('--ignore-file').push(params[:ignore_file]) unless params[:ignore_file].nil? + unless params[:ext].nil? + # normalize to array + unless params[:ext].kind_of?(Enumerable) + params[:ext] = [params[:ext]] + end + params[:ext].each do |extension| + command.push('--ext').push(extension) + end + end + Helper::SentryHelper.call_sentry_cli(params, command) UI.success("Successfully uploaded files to release: #{version}") end @@ -94,9 +115,11 @@ def self.available_options optional: true), FastlaneCore::ConfigItem.new(key: :strip_prefix, conflicting_options: [:strip_common_prefix], - description: "Chop-off a prefix from uploaded files", - default_value: false, - is_string: false, + description: "Chop-off a prefix from uploaded files. Strips the given prefix from all \ + sources references inside the upload sourcemaps (paths used within the sourcemap \ + content, to map minified code to it's original source). Only sources that start \ + with the given prefix will be stripped. This will not modify the uploaded sources \ + paths", optional: true), FastlaneCore::ConfigItem.new(key: :strip_common_prefix, conflicting_options: [:strip_prefix], @@ -107,6 +130,59 @@ def self.available_options FastlaneCore::ConfigItem.new(key: :url_prefix, description: "Sets a URL prefix in front of all files", optional: true), + FastlaneCore::ConfigItem.new(key: :url_suffix, + description: "Sets a URL suffix to append to all filenames", + optional: true), + FastlaneCore::ConfigItem.new(key: :note, + description: "Adds an optional note to the uploaded artifact bundle", + optional: true), + FastlaneCore::ConfigItem.new(key: :validate, + description: "Enable basic sourcemap validation", + is_string: false, + optional: true), + FastlaneCore::ConfigItem.new(key: :decompress, + description: "Enable files gzip decompression prior to upload", + is_string: false, + optional: true), + FastlaneCore::ConfigItem.new(key: :wait, + description: "Wait for the server to fully process uploaded files", + is_string: false, + optional: true), + FastlaneCore::ConfigItem.new(key: :wait_for, + description: "Wait for the server to fully process uploaded files, but at most \ + for the given number of seconds", + type: Integer, + optional: true), + FastlaneCore::ConfigItem.new(key: :no_sourcemap_reference, + description: "Disable emitting of automatic sourcemap references. By default the \ + tool will store a 'Sourcemap' header with minified files so that sourcemaps \ + are located automatically if the tool can detect a link. If this causes issues \ + it can be disabled", + is_string: false, + optional: true), + FastlaneCore::ConfigItem.new(key: :debug_id_reference, + description: "Enable emitting of automatic debug id references. By default Debug ID \ + reference has to be present both in the source and the related sourcemap. But in \ + cases of binary bundles, the tool can't verify presence of the Debug ID. This flag \ + allows use of Debug ID from the linked sourcemap", + is_string: false, + optional: true), + FastlaneCore::ConfigItem.new(key: :bundle, + description: "Path to the application bundle (indexed, file, or regular)", + optional: true), + FastlaneCore::ConfigItem.new(key: :bundle_sourcemap, + description: "Path to the bundle sourcemap", + optional: true), + FastlaneCore::ConfigItem.new(key: :ext, + description: "Set the file extensions that are considered for upload. This overrides \ + the default extensions. To add an extension, all default extensions must be repeated. \ + Specify once per extension. Defaults to: js, cjs, mjs, map, jsbundle, bundle", + type: Array, + optional: true), + FastlaneCore::ConfigItem.new(key: :strict, + description: "Fail with a non-zero exit code if the specified source map file cannot be uploaded", + is_string: false, + optional: true), FastlaneCore::ConfigItem.new(key: :ignore, description: "Ignores all files and folders matching the given glob or array of globs", is_string: false, From afe130cc0ef73f1e9a3ceb99c0ba72ed2d13c242 Mon Sep 17 00:00:00 2001 From: Philip Niedertscheider Date: Mon, 12 Jan 2026 15:54:27 +0100 Subject: [PATCH 2/4] add reference to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1fa1788..fe3990dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ See the [sentry-cli 3.0.0 release notes](https://github.com/getsentry/sentry-cli - Set `SENTRY_PIPELINE` environment variable for all sentry-cli invocations to identify the plugin and version ([#365](https://github.com/getsentry/sentry-fastlane-plugin/pull/365)) - **Added missing sentry-cli v3 options to all actions**: All actions have been updated to support all available options from sentry-cli version 3.0.1: - - **`sentry_debug_files_upload`**: Added `wait_for`, `no_upload`, `il2cpp_mapping` options. Fixed `id` parameter (was `ids`). Updated type validation to include `jvm`, `portablepdb`, and `wasm` types. Removed deprecated options (`info_plist`, `no_reprocessing`, `upload_symbol_maps`) that are no longer supported in sentry-cli v3. + - **`sentry_debug_files_upload`**: Added `wait_for`, `no_upload`, `il2cpp_mapping` options. Fixed `id` parameter (was `ids`). Updated type validation to include `jvm`, `portablepdb`, and `wasm` types. Removed deprecated options (`info_plist`, `no_reprocessing`, `upload_symbol_maps`) that are no longer supported in sentry-cli v3. (#382) - **`sentry_upload_sourcemap`**: Added `url_suffix`, `note`, `validate`, `decompress`, `wait`, `wait_for`, `no_sourcemap_reference`, `debug_id_reference`, `bundle`, `bundle_sourcemap`, `ext` (array support), and `strict` options. - **`sentry_upload_proguard`**: Added `no_upload`, `write_properties`, `require_one`, and `uuid` options. - **`sentry_upload_build`**: Added `release_notes`, `force_git_metadata`, and `no_git_metadata` options. From 1fc35246f0ed7d1ce7daa0f92c9c3b51aa04ab95 Mon Sep 17 00:00:00 2001 From: Philip Niedertscheider Date: Mon, 12 Jan 2026 16:00:37 +0100 Subject: [PATCH 3/4] fix tests and documentation --- README.md | 2 +- .../sentry/actions/sentry_create_release.rb | 4 +- .../sentry/actions/sentry_finalize_release.rb | 4 +- spec/sentry_create_release_spec.rb | 11 ++ spec/sentry_debug_files_upload_spec.rb | 78 ++++++++++---- spec/sentry_finalize_release_spec.rb | 22 ++++ spec/sentry_set_commits_spec.rb | 22 ++++ spec/sentry_upload_build_spec.rb | 66 ++++++++++++ spec/sentry_upload_proguard_spec.rb | 60 +++++++++++ spec/sentry_upload_sourcemap_spec.rb | 102 ++++++++++++++++++ 10 files changed, 345 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 21a3d536..cfefb98e 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ sentry_create_release( version: '...', # release version to create app_identifier: '...', # pass in the bundle_identifer of your app finalize: true, # Whether to finalize the release. If not provided or false, the release can be finalized using the sentry_finalize_release action - url: 'https://github.com/owner/repo/releases/tag/v1.0.0' # Optional. URL to the release for information purposes + release_url: 'https://github.com/owner/repo/releases/tag/v1.0.0' # Optional. URL to the release for information purposes ) ``` diff --git a/lib/fastlane/plugin/sentry/actions/sentry_create_release.rb b/lib/fastlane/plugin/sentry/actions/sentry_create_release.rb index 5a1740aa..8a4d87b3 100644 --- a/lib/fastlane/plugin/sentry/actions/sentry_create_release.rb +++ b/lib/fastlane/plugin/sentry/actions/sentry_create_release.rb @@ -16,7 +16,7 @@ def self.run(params) version ] command.push("--finalize") if params[:finalize] == true - command.push("--url").push(params[:url]) unless params[:url].nil? + command.push("--url").push(params[:release_url]) unless params[:release_url].nil? Helper::SentryHelper.call_sentry_cli(params, command) UI.success("Successfully created release: #{version}") @@ -55,7 +55,7 @@ def self.available_options default_value: false, is_string: false, optional: true), - FastlaneCore::ConfigItem.new(key: :url, + FastlaneCore::ConfigItem.new(key: :release_url, description: "Optional URL to the release for information purposes", optional: true) ] diff --git a/lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb b/lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb index a44b6433..2fa80e9b 100644 --- a/lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb +++ b/lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb @@ -15,7 +15,7 @@ def self.run(params) "finalize", version ] - command.push("--url").push(params[:url]) unless params[:url].nil? + command.push("--url").push(params[:release_url]) unless params[:release_url].nil? command.push("--released").push(params[:released]) unless params[:released].nil? Helper::SentryHelper.call_sentry_cli(params, command) @@ -50,7 +50,7 @@ def self.available_options short_option: "-b", description: "Release build to finalize on Sentry", optional: true), - FastlaneCore::ConfigItem.new(key: :url, + FastlaneCore::ConfigItem.new(key: :release_url, description: "Optional URL to the release for information purposes", optional: true), FastlaneCore::ConfigItem.new(key: :released, diff --git a/spec/sentry_create_release_spec.rb b/spec/sentry_create_release_spec.rb index 7a279721..93f01b0b 100644 --- a/spec/sentry_create_release_spec.rb +++ b/spec/sentry_create_release_spec.rb @@ -66,6 +66,17 @@ finalize: false) end").runner.execute(:test) end + + it "includes --url if present" do + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["releases", "new", "1.0", "--url", "https://example.com/release"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_create_release( + version: '1.0', + release_url: 'https://example.com/release') + end").runner.execute(:test) + end end end end diff --git a/spec/sentry_debug_files_upload_spec.rb b/spec/sentry_debug_files_upload_spec.rb index 5ea27703..be8f1cfc 100644 --- a/spec/sentry_debug_files_upload_spec.rb +++ b/spec/sentry_debug_files_upload_spec.rb @@ -197,6 +197,42 @@ end").runner.execute(:test) end + it "includes --type for value jvm" do + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--type", "jvm"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_debug_files_upload( + path: 'fixture-path', + type: 'jvm' + ) + end").runner.execute(:test) + end + + it "includes --type for value portablepdb" do + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--type", "portablepdb"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_debug_files_upload( + path: 'fixture-path', + type: 'portablepdb' + ) + end").runner.execute(:test) + end + + it "includes --type for value wasm" do + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--type", "wasm"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_debug_files_upload( + path: 'fixture-path', + type: 'wasm' + ) + end").runner.execute(:test) + end + it "fails with unknown --type value" do dsym_path_1 = File.absolute_path './assets/this_does_not_exist.app.dSYM.zip' @@ -246,14 +282,14 @@ end").runner.execute(:test) end - it "includes --ids if present" do + it "includes --id if present" do expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) - expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--ids", "fixture-ids"]).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--id", "fixture-id"]).and_return(true) Fastlane::FastFile.new.parse("lane :test do sentry_debug_files_upload( path: 'fixture-path', - ids: 'fixture-ids' + id: 'fixture-id' ) end").runner.execute(:test) end @@ -306,26 +342,14 @@ end").runner.execute(:test) end - it "includes --info_plist if present" do - expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) - expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--info-plist", "fixture-info_plist"]).and_return(true) - - Fastlane::FastFile.new.parse("lane :test do - sentry_debug_files_upload( - path: 'fixture-path', - info_plist: 'fixture-info_plist' - ) - end").runner.execute(:test) - end - - it "includes --no_reprocessing when true" do + it "includes --no_upload when true" do expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) - expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--no-reprocessing"]).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--no-upload"]).and_return(true) Fastlane::FastFile.new.parse("lane :test do sentry_debug_files_upload( path: 'fixture-path', - no_reprocessing: true + no_upload: true ) end").runner.execute(:test) end @@ -366,14 +390,26 @@ end").runner.execute(:test) end - it "includes --upload_symbol_maps when true" do + it "includes --wait_for if present" do + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--wait-for", 60]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_debug_files_upload( + path: 'fixture-path', + wait_for: 60 + ) + end").runner.execute(:test) + end + + it "includes --il2cpp_mapping when true" do expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) - expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--upload-symbol-maps"]).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["debug-files", "upload", "fixture-path", "--il2cpp-mapping"]).and_return(true) Fastlane::FastFile.new.parse("lane :test do sentry_debug_files_upload( path: 'fixture-path', - upload_symbol_maps: true + il2cpp_mapping: true ) end").runner.execute(:test) end diff --git a/spec/sentry_finalize_release_spec.rb b/spec/sentry_finalize_release_spec.rb index dd8be520..7bb3015d 100644 --- a/spec/sentry_finalize_release_spec.rb +++ b/spec/sentry_finalize_release_spec.rb @@ -34,6 +34,28 @@ version: '1.0') end").runner.execute(:test) end + + it "includes --url if present" do + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["releases", "finalize", "1.0", "--url", "https://example.com/release"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_finalize_release( + version: '1.0', + release_url: 'https://example.com/release') + end").runner.execute(:test) + end + + it "includes --released if present" do + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["releases", "finalize", "1.0", "--released", "1234567890"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_finalize_release( + version: '1.0', + released: '1234567890') + end").runner.execute(:test) + end end end end diff --git a/spec/sentry_set_commits_spec.rb b/spec/sentry_set_commits_spec.rb index 99c9deba..5136d219 100644 --- a/spec/sentry_set_commits_spec.rb +++ b/spec/sentry_set_commits_spec.rb @@ -144,6 +144,28 @@ ignore_missing: false) end").runner.execute(:test) end + + it "includes --local when true" do + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["releases", "set-commits", "1.0", "--local"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_set_commits( + version: '1.0', + local: true) + end").runner.execute(:test) + end + + it "includes --initial-depth if present" do + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["releases", "set-commits", "1.0", "--initial-depth", 50]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_set_commits( + version: '1.0', + initial_depth: 50) + end").runner.execute(:test) + end end end end diff --git a/spec/sentry_upload_build_spec.rb b/spec/sentry_upload_build_spec.rb index c1b6dd61..0ff5d27b 100644 --- a/spec/sentry_upload_build_spec.rb +++ b/spec/sentry_upload_build_spec.rb @@ -214,6 +214,72 @@ module SharedValues head_sha: 'explicit_abc123') end").runner.execute(:test) end + + it "includes --release-notes if present" do + mock_path = './assets/Test.xcarchive' + + allow(File).to receive(:exist?).with(mock_path).and_return(true) + allow(File).to receive(:extname).with(mock_path).and_return('.xcarchive') + + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with( + anything, + ["build", "upload", anything, "--release-notes", "Fixed bugs"] + ).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_build( + auth_token: 'test-token', + org_slug: 'test-org', + project_slug: 'test-project', + xcarchive_path: '#{mock_path}', + release_notes: 'Fixed bugs') + end").runner.execute(:test) + end + + it "includes --force-git-metadata when true" do + mock_path = './assets/Test.xcarchive' + + allow(File).to receive(:exist?).with(mock_path).and_return(true) + allow(File).to receive(:extname).with(mock_path).and_return('.xcarchive') + + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with( + anything, + ["build", "upload", anything, "--force-git-metadata"] + ).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_build( + auth_token: 'test-token', + org_slug: 'test-org', + project_slug: 'test-project', + xcarchive_path: '#{mock_path}', + force_git_metadata: true) + end").runner.execute(:test) + end + + it "includes --no-git-metadata when true" do + mock_path = './assets/Test.xcarchive' + + allow(File).to receive(:exist?).with(mock_path).and_return(true) + allow(File).to receive(:extname).with(mock_path).and_return('.xcarchive') + + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with( + anything, + ["build", "upload", anything, "--no-git-metadata"] + ).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_build( + auth_token: 'test-token', + org_slug: 'test-org', + project_slug: 'test-project', + xcarchive_path: '#{mock_path}', + no_git_metadata: true) + end").runner.execute(:test) + end end end end diff --git a/spec/sentry_upload_proguard_spec.rb b/spec/sentry_upload_proguard_spec.rb index 31777ce7..2f58340d 100644 --- a/spec/sentry_upload_proguard_spec.rb +++ b/spec/sentry_upload_proguard_spec.rb @@ -14,6 +14,66 @@ end").runner.execute(:test) end.to raise_error("Could not find your mapping file at path '#{mapping_path}'") end + + it "includes --no-upload when true" do + mapping_path = File.absolute_path './assets/AndroidExample.mapping.txt' + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["upload-proguard", mapping_path, "--no-upload"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_proguard( + org_slug: 'some_org', + auth_token: 'something123', + project_slug: 'some_project', + mapping_path: '#{mapping_path}', + no_upload: true) + end").runner.execute(:test) + end + + it "includes --write-properties if present" do + mapping_path = File.absolute_path './assets/AndroidExample.mapping.txt' + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["upload-proguard", mapping_path, "--write-properties", "path/to/properties"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_proguard( + org_slug: 'some_org', + auth_token: 'something123', + project_slug: 'some_project', + mapping_path: '#{mapping_path}', + write_properties: 'path/to/properties') + end").runner.execute(:test) + end + + it "includes --require-one when true" do + mapping_path = File.absolute_path './assets/AndroidExample.mapping.txt' + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["upload-proguard", mapping_path, "--require-one"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_proguard( + org_slug: 'some_org', + auth_token: 'something123', + project_slug: 'some_project', + mapping_path: '#{mapping_path}', + require_one: true) + end").runner.execute(:test) + end + + it "includes --uuid if present" do + mapping_path = File.absolute_path './assets/AndroidExample.mapping.txt' + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["upload-proguard", mapping_path, "--uuid", "custom-uuid"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_proguard( + org_slug: 'some_org', + auth_token: 'something123', + project_slug: 'some_project', + mapping_path: '#{mapping_path}', + uuid: 'custom-uuid') + end").runner.execute(:test) + end end end end diff --git a/spec/sentry_upload_sourcemap_spec.rb b/spec/sentry_upload_sourcemap_spec.rb index 8a74df79..73da0ca9 100644 --- a/spec/sentry_upload_sourcemap_spec.rb +++ b/spec/sentry_upload_sourcemap_spec.rb @@ -213,6 +213,108 @@ app_identifier: 'app.idf') end").runner.execute(:test) end + + it "includes --url-suffix if present" do + allow(File).to receive(:exist?).and_call_original + expect(File).to receive(:exist?).with("1.map").and_return(true) + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["sourcemaps", "upload", "--release", "1.0", "1.map", "--no-rewrite", "--url-suffix", ".map"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_sourcemap( + org_slug: 'some_org', + auth_token: 'something123', + project_slug: 'some_project', + version: '1.0', + sourcemap: '1.map', + url_suffix: '.map') + end").runner.execute(:test) + end + + it "includes --note if present" do + allow(File).to receive(:exist?).and_call_original + expect(File).to receive(:exist?).with("1.map").and_return(true) + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["sourcemaps", "upload", "--release", "1.0", "1.map", "--no-rewrite", "--note", "Build from CI"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_sourcemap( + org_slug: 'some_org', + auth_token: 'something123', + project_slug: 'some_project', + version: '1.0', + sourcemap: '1.map', + note: 'Build from CI') + end").runner.execute(:test) + end + + it "includes --validate when true" do + allow(File).to receive(:exist?).and_call_original + expect(File).to receive(:exist?).with("1.map").and_return(true) + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["sourcemaps", "upload", "--release", "1.0", "1.map", "--no-rewrite", "--validate"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_sourcemap( + org_slug: 'some_org', + auth_token: 'something123', + project_slug: 'some_project', + version: '1.0', + sourcemap: '1.map', + validate: true) + end").runner.execute(:test) + end + + it "includes --wait when true" do + allow(File).to receive(:exist?).and_call_original + expect(File).to receive(:exist?).with("1.map").and_return(true) + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["sourcemaps", "upload", "--release", "1.0", "1.map", "--no-rewrite", "--wait"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_sourcemap( + org_slug: 'some_org', + auth_token: 'something123', + project_slug: 'some_project', + version: '1.0', + sourcemap: '1.map', + wait: true) + end").runner.execute(:test) + end + + it "includes --wait-for if present" do + allow(File).to receive(:exist?).and_call_original + expect(File).to receive(:exist?).with("1.map").and_return(true) + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["sourcemaps", "upload", "--release", "1.0", "1.map", "--no-rewrite", "--wait-for", 60]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_sourcemap( + org_slug: 'some_org', + auth_token: 'something123', + project_slug: 'some_project', + version: '1.0', + sourcemap: '1.map', + wait_for: 60) + end").runner.execute(:test) + end + + it "includes --strict when true" do + allow(File).to receive(:exist?).and_call_original + expect(File).to receive(:exist?).with("1.map").and_return(true) + expect(Fastlane::Helper::SentryConfig).to receive(:parse_api_params).and_return(true) + expect(Fastlane::Helper::SentryHelper).to receive(:call_sentry_cli).with(anything, ["sourcemaps", "upload", "--release", "1.0", "1.map", "--no-rewrite", "--strict"]).and_return(true) + + Fastlane::FastFile.new.parse("lane :test do + sentry_upload_sourcemap( + org_slug: 'some_org', + auth_token: 'something123', + project_slug: 'some_project', + version: '1.0', + sourcemap: '1.map', + strict: true) + end").runner.execute(:test) + end end end end From 5e03576e455f847d52211ca4304fa521f35516ba Mon Sep 17 00:00:00 2001 From: Philip Niedertscheider Date: Mon, 12 Jan 2026 16:02:13 +0100 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cfefb98e..a7b31e1d 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,7 @@ For any other issues and feedback about this plugin, please submit it to this re ## Migration Guide -### Migrating from sentry-cli v2 to v3 +### Migrating from sentry-fastlane-plugin v1 to v2 When upgrading to the latest version of this plugin (which uses sentry-cli v3), you may need to update your Fastfiles. Here are the key changes: