Class: Fastlane::Actions::SentryUploadSnapshotsAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::SentryUploadSnapshotsAction
- Defined in:
- lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
Class Method Summary collapse
Class Method Details
.authors ⇒ Object
73 74 75 |
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 73 def self. ["sentry"] end |
.available_options ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 44 def self. Helper::SentryConfig.common_api_config_items + [ FastlaneCore::ConfigItem.new(key: :path, description: "Path to the folder containing snapshot images", optional: false, verify_block: proc do |value| UI.user_error! "Could not find path '#{value}'" unless File.exist?(value) UI.user_error! "Path is not a directory: '#{value}'" unless File.directory?(value) end), FastlaneCore::ConfigItem.new(key: :app_id, description: "Application identifier", optional: false), FastlaneCore::ConfigItem.new(key: :diff_threshold, description: "Only report images as changed if their difference percentage exceeds this value (0.0–1.0). " \ "For example, 0.001 ignores changes affecting less than 0.1% of pixels. " \ "Useful for filtering out sub-pixel rendering noise (e.g. anti-aliasing, transparency). " \ "Defaults to 0.0 (any pixel change is reported) when not set", optional: true, type: Float, verify_block: proc do |value| UI.user_error! "diff_threshold must be between 0.0 and 1.0" unless value.between?(0.0, 1.0) end) ] + Helper::SentryConfig.common_vcs_config_items end |
.description ⇒ Object
36 37 38 |
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 36 def self.description "Upload snapshot images to Sentry (EXPERIMENTAL)" end |
.details ⇒ Object
40 41 42 |
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 40 def self.details "This action allows you to upload snapshot images to Sentry to check for visual regressions. NOTE: This features is experimental and might be changed in future releases." end |
.is_supported?(platform) ⇒ Boolean
77 78 79 |
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 77 def self.is_supported?(platform) [:ios, :android].include?(platform) end |
.return_value ⇒ Object
69 70 71 |
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 69 def self.return_value nil end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_snapshots.rb', line 4 def self.run(params) Helper::SentryConfig.parse_api_params(params) path = params[:path] app_id = params[:app_id] UI.user_error!("Path does not exist: #{path}") unless File.exist?(path) UI.user_error!("Path is not a directory: #{path}") unless File.directory?(path) command = [ "snapshots", "upload", "--app-id", app_id ] if params[:diff_threshold] command += ["--diff-threshold", params[:diff_threshold].to_s] end command << path Helper::SentryConfig.build_vcs_command(command, params) Helper::SentryHelper.call_sentry_cli(params, command) UI.success("Successfully uploaded snapshots!") end |