fastlane-plugin-sentry 0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,162 @@
1
+ module Fastlane
2
+ module Actions
3
+ class SentryDebugFilesUploadAction < Action
4
+ def self.run(params)
5
+ require 'shellwords'
6
+
7
+ Helper::SentryConfig.parse_api_params(params)
8
+
9
+ paths = params[:path]
10
+ # Use DSYM_OUTPUT_PATH from fastlane context if available, otherwise default to current directory
11
+ if paths.nil?
12
+ dsym_path = Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]
13
+ if dsym_path && !dsym_path.to_s.empty?
14
+ paths = [dsym_path]
15
+ else
16
+ paths = ['.']
17
+ end
18
+ end
19
+
20
+ command = [
21
+ "debug-files",
22
+ "upload"
23
+ ]
24
+ command += paths
25
+
26
+ command.push('--type').push(params[:type]) unless params[:type].nil?
27
+ command.push('--no-unwind') unless params[:no_unwind].nil?
28
+ command.push('--no-debug') unless params[:no_debug].nil?
29
+ command.push('--no-sources') unless params[:no_sources].nil?
30
+ command.push('--id').push(params[:id]) unless params[:id].nil?
31
+ command.push('--require-all') unless params[:require_all].nil?
32
+ command.push('--symbol-maps').push(params[:symbol_maps]) unless params[:symbol_maps].nil?
33
+ command.push('--derived-data') unless params[:derived_data].nil?
34
+ command.push('--no-zips') unless params[:no_zips].nil?
35
+ command.push('--no-upload') unless params[:no_upload].nil?
36
+ command.push('--include-sources') if params[:include_sources] == true
37
+ command.push('--wait') unless params[:wait].nil?
38
+ command.push('--wait-for').push(params[:wait_for]) unless params[:wait_for].nil?
39
+ command.push('--il2cpp-mapping') unless params[:il2cpp_mapping].nil?
40
+
41
+ Helper::SentryHelper.call_sentry_cli(params, command)
42
+ UI.success("Successfully ran debug-files upload")
43
+ end
44
+
45
+ #####################################################
46
+ # @!group Documentation
47
+ #####################################################
48
+
49
+ def self.description
50
+ "Upload debugging information files."
51
+ end
52
+
53
+ def self.details
54
+ [
55
+ "Files can be uploaded using the `debug-files upload` command. This command will scan a given folder recursively for files and upload them to Sentry.",
56
+ "See https://docs.sentry.io/product/cli/dif/#uploading-files for more information."
57
+ ].join(" ")
58
+ end
59
+
60
+ def self.available_options
61
+ Helper::SentryConfig.common_api_config_items + [
62
+ FastlaneCore::ConfigItem.new(key: :path,
63
+ description: "Path or an array of paths to search recursively for symbol files. Defaults to DSYM_OUTPUT_PATH from fastlane context if available, otherwise '.' (current directory)",
64
+ type: Array,
65
+ optional: true),
66
+ FastlaneCore::ConfigItem.new(key: :type,
67
+ short_option: "-t",
68
+ description: "Only consider debug information files of the given \
69
+ type. By default, all types are considered",
70
+ optional: true,
71
+ verify_block: proc do |value|
72
+ UI.user_error! "Invalid value '#{value}'" unless ['bcsymbolmap', 'breakpad', 'dsym', 'elf', 'jvm', 'pdb', 'pe', 'portablepdb', 'sourcebundle', 'wasm'].include? value
73
+ end),
74
+ FastlaneCore::ConfigItem.new(key: :no_unwind,
75
+ description: "Do not scan for stack unwinding information. Specify \
76
+ this flag for builds with disabled FPO, or when \
77
+ stackwalking occurs on the device. This usually \
78
+ excludes executables and dynamic libraries. They might \
79
+ still be uploaded, if they contain additional \
80
+ processable information (see other flags)",
81
+ is_string: false,
82
+ optional: true),
83
+ FastlaneCore::ConfigItem.new(key: :no_debug,
84
+ description: "Do not scan for debugging information. This will \
85
+ usually exclude debug companion files. They might \
86
+ still be uploaded, if they contain additional \
87
+ processable information (see other flags)",
88
+ conflicting_options: [:no_unwind],
89
+ is_string: false,
90
+ optional: true),
91
+ FastlaneCore::ConfigItem.new(key: :no_sources,
92
+ description: "Do not scan for source information. This will \
93
+ usually exclude source bundle files. They might \
94
+ still be uploaded, if they contain additional \
95
+ processable information (see other flags)",
96
+ is_string: false,
97
+ optional: true),
98
+ FastlaneCore::ConfigItem.new(key: :id,
99
+ description: "Search for specific debug identifiers",
100
+ optional: true),
101
+ FastlaneCore::ConfigItem.new(key: :require_all,
102
+ description: "Errors if not all identifiers specified with --id could be found",
103
+ is_string: false,
104
+ optional: true),
105
+ FastlaneCore::ConfigItem.new(key: :symbol_maps,
106
+ description: "Optional path to BCSymbolMap files which are used to \
107
+ resolve hidden symbols in dSYM files downloaded from \
108
+ iTunes Connect. This requires the dsymutil tool to be \
109
+ available",
110
+ optional: true),
111
+ FastlaneCore::ConfigItem.new(key: :derived_data,
112
+ description: "Search for debug symbols in Xcode's derived data",
113
+ is_string: false,
114
+ optional: true),
115
+ FastlaneCore::ConfigItem.new(key: :no_zips,
116
+ description: "Do not search in ZIP files",
117
+ is_string: false,
118
+ optional: true),
119
+ FastlaneCore::ConfigItem.new(key: :no_upload,
120
+ description: "Disable the actual upload. This runs all steps for the \
121
+ processing but does not trigger the upload. This is useful if \
122
+ you just want to verify the setup or skip the upload in tests",
123
+ is_string: false,
124
+ optional: true),
125
+ FastlaneCore::ConfigItem.new(key: :include_sources,
126
+ description: "Include sources from the local file system and upload \
127
+ them as source bundles",
128
+ is_string: false,
129
+ optional: true),
130
+ FastlaneCore::ConfigItem.new(key: :wait,
131
+ description: "Wait for the server to fully process uploaded files. Errors \
132
+ can only be displayed if --wait or --wait-for is specified, but this will \
133
+ significantly slow down the upload process",
134
+ is_string: false,
135
+ optional: true),
136
+ FastlaneCore::ConfigItem.new(key: :wait_for,
137
+ description: "Wait for the server to fully process uploaded files, but at most \
138
+ for the given number of seconds. Errors can only be displayed if --wait or \
139
+ --wait-for is specified, but this will significantly slow down the upload process",
140
+ type: Integer,
141
+ optional: true),
142
+ FastlaneCore::ConfigItem.new(key: :il2cpp_mapping,
143
+ description: "Compute il2cpp line mappings and upload them along with sources",
144
+ is_string: false,
145
+ optional: true)
146
+ ]
147
+ end
148
+
149
+ def self.return_value
150
+ nil
151
+ end
152
+
153
+ def self.authors
154
+ ["denrase"]
155
+ end
156
+
157
+ def self.is_supported?(platform)
158
+ true
159
+ end
160
+ end
161
+ end
162
+ end
@@ -0,0 +1,75 @@
1
+ module Fastlane
2
+ module Actions
3
+ class SentryFinalizeReleaseAction < Action
4
+ def self.run(params)
5
+ require 'shellwords'
6
+
7
+ Helper::SentryConfig.parse_api_params(params)
8
+
9
+ version = params[:version]
10
+ version = "#{params[:app_identifier]}@#{params[:version]}" if params[:app_identifier]
11
+ version = "#{version}+#{params[:build]}" if params[:build]
12
+
13
+ command = [
14
+ "releases",
15
+ "finalize",
16
+ version
17
+ ]
18
+ command.push("--url").push(params[:release_url]) unless params[:release_url].nil?
19
+ command.push("--released").push(params[:released]) unless params[:released].nil?
20
+
21
+ Helper::SentryHelper.call_sentry_cli(params, command)
22
+ UI.success("Successfully finalized release: #{version}")
23
+ end
24
+
25
+ #####################################################
26
+ # @!group Documentation
27
+ #####################################################
28
+
29
+ def self.description
30
+ "Finalize a release for a project on Sentry"
31
+ end
32
+
33
+ def self.details
34
+ [
35
+ "This action allows you to finalize releases created for a project on Sentry.",
36
+ "See https://docs.sentry.io/learn/cli/releases/#finalizing-releases for more information."
37
+ ].join(" ")
38
+ end
39
+
40
+ def self.available_options
41
+ Helper::SentryConfig.common_api_config_items + [
42
+ FastlaneCore::ConfigItem.new(key: :version,
43
+ description: "Release version to finalize on Sentry"),
44
+ FastlaneCore::ConfigItem.new(key: :app_identifier,
45
+ short_option: "-a",
46
+ env_name: "SENTRY_APP_IDENTIFIER",
47
+ description: "App Bundle Identifier, prepended to version",
48
+ optional: true),
49
+ FastlaneCore::ConfigItem.new(key: :build,
50
+ short_option: "-b",
51
+ description: "Release build to finalize on Sentry",
52
+ optional: true),
53
+ FastlaneCore::ConfigItem.new(key: :release_url,
54
+ description: "Optional URL to the release for information purposes",
55
+ optional: true),
56
+ FastlaneCore::ConfigItem.new(key: :released,
57
+ description: "Set the release time. Defaults to the current time if not provided",
58
+ optional: true)
59
+ ]
60
+ end
61
+
62
+ def self.return_value
63
+ nil
64
+ end
65
+
66
+ def self.authors
67
+ ["wschurman"]
68
+ end
69
+
70
+ def self.is_supported?(platform)
71
+ true
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,99 @@
1
+ module Fastlane
2
+ module Actions
3
+ class SentrySetCommitsAction < Action
4
+ def self.run(params)
5
+ require 'shellwords'
6
+
7
+ Helper::SentryConfig.parse_api_params(params)
8
+
9
+ version = params[:version]
10
+ version = "#{params[:app_identifier]}@#{params[:version]}" if params[:app_identifier]
11
+ version = "#{version}+#{params[:build]}" if params[:build]
12
+
13
+ command = [
14
+ "releases",
15
+ "set-commits",
16
+ version
17
+ ]
18
+
19
+ command.push('--auto') if params[:auto]
20
+ command.push('--clear') if params[:clear]
21
+ command.push('--ignore-missing') if params[:ignore_missing]
22
+ command.push('--local') if params[:local]
23
+ command.push('--initial-depth').push(params[:initial_depth]) unless params[:initial_depth].nil?
24
+ command.push('--commit').push(params[:commit]) unless params[:commit].nil?
25
+
26
+ Helper::SentryHelper.call_sentry_cli(params, command)
27
+ UI.success("Successfully set commits for release: #{version}")
28
+ end
29
+
30
+ #####################################################
31
+ # @!group Documentation
32
+ #####################################################
33
+
34
+ def self.description
35
+ "Set commits of a release"
36
+ end
37
+
38
+ def self.details
39
+ [
40
+ "This action allows you to set commits in a release for a project on Sentry.",
41
+ "See https://docs.sentry.io/cli/releases/#sentry-cli-commit-integration for more information."
42
+ ].join(" ")
43
+ end
44
+
45
+ def self.available_options
46
+ Helper::SentryConfig.common_api_config_items + [
47
+ FastlaneCore::ConfigItem.new(key: :version,
48
+ description: "Release version on Sentry"),
49
+ FastlaneCore::ConfigItem.new(key: :app_identifier,
50
+ short_option: "-a",
51
+ env_name: "SENTRY_APP_IDENTIFIER",
52
+ description: "App Bundle Identifier, prepended to version",
53
+ optional: true),
54
+ FastlaneCore::ConfigItem.new(key: :build,
55
+ short_option: "-b",
56
+ description: "Release build on Sentry",
57
+ optional: true),
58
+ FastlaneCore::ConfigItem.new(key: :auto,
59
+ description: "Enable completely automated commit management",
60
+ is_string: false,
61
+ default_value: false),
62
+ FastlaneCore::ConfigItem.new(key: :clear,
63
+ description: "Clear all current commits from the release",
64
+ is_string: false,
65
+ default_value: false),
66
+ FastlaneCore::ConfigItem.new(key: :commit,
67
+ description: "Commit spec, see `sentry-cli releases help set-commits` for more information",
68
+ optional: true),
69
+ FastlaneCore::ConfigItem.new(key: :ignore_missing,
70
+ 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",
71
+ is_string: false,
72
+ default_value: false),
73
+ FastlaneCore::ConfigItem.new(key: :local,
74
+ description: "Set commits of a release from local git. This requires that the command \
75
+ is run from within a git repository. sentry-cli will then automatically find \
76
+ remotely configured repositories and discover commits",
77
+ is_string: false,
78
+ optional: true),
79
+ FastlaneCore::ConfigItem.new(key: :initial_depth,
80
+ description: "Set the number of commits of the initial release. The default is 20",
81
+ type: Integer,
82
+ optional: true)
83
+ ]
84
+ end
85
+
86
+ def self.return_value
87
+ nil
88
+ end
89
+
90
+ def self.authors
91
+ ["brownoxford"]
92
+ end
93
+
94
+ def self.is_supported?(platform)
95
+ true
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,132 @@
1
+ module Fastlane
2
+ module Actions
3
+ class SentryUploadBuildAction < Action
4
+ def self.run(params)
5
+ Helper::SentryConfig.parse_api_params(params)
6
+
7
+ # Verify xcarchive path
8
+ xcarchive_path = params[:xcarchive_path]
9
+ UI.user_error!("Could not find xcarchive at path '#{xcarchive_path}'") unless File.exist?(xcarchive_path)
10
+ UI.user_error!("Path '#{xcarchive_path}' is not an xcarchive") unless File.extname(xcarchive_path) == '.xcarchive'
11
+
12
+ command = [
13
+ "build",
14
+ "upload",
15
+ File.absolute_path(xcarchive_path)
16
+ ]
17
+
18
+ # Add git-related parameters if provided
19
+ command << "--head-sha" << params[:head_sha] if params[:head_sha]
20
+ command << "--base-sha" << params[:base_sha] if params[:base_sha]
21
+ command << "--vcs-provider" << params[:vcs_provider] if params[:vcs_provider]
22
+ command << "--head-repo-name" << params[:head_repo_name] if params[:head_repo_name]
23
+ command << "--base-repo-name" << params[:base_repo_name] if params[:base_repo_name]
24
+ command << "--head-ref" << params[:head_ref] if params[:head_ref]
25
+ command << "--base-ref" << params[:base_ref] if params[:base_ref]
26
+ command << "--pr-number" << params[:pr_number] if params[:pr_number]
27
+ command << "--build-configuration" << params[:build_configuration] if params[:build_configuration]
28
+ command << "--release-notes" << params[:release_notes] if params[:release_notes]
29
+ command << "--force-git-metadata" if params[:force_git_metadata]
30
+ command << "--no-git-metadata" if params[:no_git_metadata]
31
+
32
+ Helper::SentryHelper.call_sentry_cli(params, command)
33
+ UI.success("Successfully uploaded build archive: #{xcarchive_path}")
34
+ end
35
+
36
+ #####################################################
37
+ # @!group Documentation
38
+ #####################################################
39
+
40
+ def self.description
41
+ "Upload iOS build archive to Sentry with optional git context"
42
+ end
43
+
44
+ def self.details
45
+ "This action allows you to upload iOS build archives (.xcarchive) to Sentry with optional git-related parameters for enhanced context including commit SHAs, branch names, repository information, and pull request details."
46
+ end
47
+
48
+ def self.available_options
49
+ Helper::SentryConfig.common_api_config_items + [
50
+ FastlaneCore::ConfigItem.new(key: :xcarchive_path,
51
+ description: "Path to your iOS build archive (.xcarchive)",
52
+ default_value: Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE],
53
+ verify_block: proc do |value|
54
+ UI.user_error!("Could not find xcarchive at path '#{value}'") unless File.exist?(value)
55
+ UI.user_error!("Path '#{value}' is not an xcarchive") unless File.extname(value) == '.xcarchive'
56
+ end),
57
+ FastlaneCore::ConfigItem.new(key: :head_sha,
58
+ env_name: "SENTRY_HEAD_SHA",
59
+ description: "The SHA of the head of the current branch",
60
+ optional: true,
61
+ is_string: true),
62
+ FastlaneCore::ConfigItem.new(key: :base_sha,
63
+ env_name: "SENTRY_BASE_SHA",
64
+ description: "The SHA of the base branch",
65
+ optional: true,
66
+ is_string: true),
67
+ FastlaneCore::ConfigItem.new(key: :vcs_provider,
68
+ env_name: "SENTRY_VCS_PROVIDER",
69
+ description: "The version control system provider (e.g., 'github', 'gitlab')",
70
+ optional: true,
71
+ is_string: true),
72
+ FastlaneCore::ConfigItem.new(key: :head_repo_name,
73
+ env_name: "SENTRY_HEAD_REPO_NAME",
74
+ description: "The name of the head repository",
75
+ optional: true,
76
+ is_string: true),
77
+ FastlaneCore::ConfigItem.new(key: :base_repo_name,
78
+ env_name: "SENTRY_BASE_REPO_NAME",
79
+ description: "The name of the base repository",
80
+ optional: true,
81
+ is_string: true),
82
+ FastlaneCore::ConfigItem.new(key: :head_ref,
83
+ env_name: "SENTRY_HEAD_REF",
84
+ description: "The name of the head branch",
85
+ optional: true,
86
+ is_string: true),
87
+ FastlaneCore::ConfigItem.new(key: :base_ref,
88
+ env_name: "SENTRY_BASE_REF",
89
+ description: "The name of the base branch",
90
+ optional: true,
91
+ is_string: true),
92
+ FastlaneCore::ConfigItem.new(key: :pr_number,
93
+ env_name: "SENTRY_PR_NUMBER",
94
+ description: "The pull request number",
95
+ optional: true,
96
+ is_string: true),
97
+ FastlaneCore::ConfigItem.new(key: :build_configuration,
98
+ env_name: "SENTRY_BUILD_CONFIGURATION",
99
+ description: "The build configuration (e.g., 'Release', 'Debug')",
100
+ optional: true,
101
+ is_string: true),
102
+ FastlaneCore::ConfigItem.new(key: :release_notes,
103
+ description: "The release notes to use for the upload",
104
+ optional: true,
105
+ is_string: true),
106
+ FastlaneCore::ConfigItem.new(key: :force_git_metadata,
107
+ description: "Force collection and sending of git metadata (branch, commit, etc.). \
108
+ If neither this nor --no-git-metadata is specified, git metadata is automatically \
109
+ collected when running in most CI environments",
110
+ is_string: false,
111
+ optional: true),
112
+ FastlaneCore::ConfigItem.new(key: :no_git_metadata,
113
+ description: "Disable collection and sending of git metadata",
114
+ is_string: false,
115
+ optional: true)
116
+ ]
117
+ end
118
+
119
+ def self.return_value
120
+ nil
121
+ end
122
+
123
+ def self.authors
124
+ ["runningcode"]
125
+ end
126
+
127
+ def self.is_supported?(platform)
128
+ [:ios].include?(platform)
129
+ end
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,88 @@
1
+ module Fastlane
2
+ module Actions
3
+ class SentryUploadProguardAction < Action
4
+ def self.run(params)
5
+ Helper::SentryConfig.parse_api_params(params)
6
+
7
+ mapping_path = params[:mapping_path]
8
+
9
+ # Verify file exists
10
+ UI.user_error!("Mapping file does not exist at path: #{mapping_path}") unless File.exist? mapping_path
11
+
12
+ command = [
13
+ "upload-proguard",
14
+ mapping_path
15
+ ]
16
+
17
+ command.push('--no-upload') if params[:no_upload]
18
+ command.push('--write-properties').push(params[:write_properties]) unless params[:write_properties].nil?
19
+ command.push('--require-one') if params[:require_one]
20
+ command.push('--uuid').push(params[:uuid]) unless params[:uuid].nil?
21
+
22
+ Helper::SentryHelper.call_sentry_cli(params, command)
23
+ UI.success("Successfully uploaded mapping file!")
24
+ end
25
+
26
+ #####################################################
27
+ # @!group Documentation
28
+ #####################################################
29
+
30
+ def self.description
31
+ "Upload mapping to a project on Sentry"
32
+ end
33
+
34
+ def self.details
35
+ [
36
+ "This action allows you to upload the proguard mapping file to Sentry.",
37
+ "See https://docs.sentry.io/product/cli/dif/#proguard-mapping-upload for more information."
38
+ ].join(" ")
39
+ end
40
+
41
+ def self.available_options
42
+ Helper::SentryConfig.common_api_config_items + [
43
+ FastlaneCore::ConfigItem.new(key: :mapping_path,
44
+ env_name: "ANDROID_MAPPING_PATH",
45
+ description: "Path to your proguard mapping.txt file",
46
+ optional: false,
47
+ verify_block: proc do |value|
48
+ UI.user_error! "Could not find your mapping file at path '#{value}'" unless File.exist?(value)
49
+ end),
50
+ FastlaneCore::ConfigItem.new(key: :no_upload,
51
+ description: "Disable the actual upload. This runs all steps for the processing \
52
+ but does not trigger the upload. This is useful if you just want to verify the \
53
+ mapping files and write the proguard UUIDs into a properties file",
54
+ is_string: false,
55
+ optional: true),
56
+ FastlaneCore::ConfigItem.new(key: :write_properties,
57
+ description: "Write the UUIDs for the processed mapping files into the given \
58
+ properties file",
59
+ optional: true),
60
+ FastlaneCore::ConfigItem.new(key: :require_one,
61
+ description: "Requires at least one file to upload or the command will error",
62
+ is_string: false,
63
+ optional: true),
64
+ FastlaneCore::ConfigItem.new(key: :uuid,
65
+ description: "Explicitly override the UUID of the mapping file with another one. \
66
+ This should be used with caution as it means that you can upload multiple mapping \
67
+ files if you don't take care. This however can be useful if you have a build \
68
+ process in which you need to know the UUID of the proguard file before it was \
69
+ created. If you upload a file with a forced UUID you can only upload a single \
70
+ proguard file",
71
+ optional: true)
72
+ ]
73
+ end
74
+
75
+ def self.return_value
76
+ nil
77
+ end
78
+
79
+ def self.authors
80
+ ["mpp-anasa"]
81
+ end
82
+
83
+ def self.is_supported?(platform)
84
+ platform == :android
85
+ end
86
+ end
87
+ end
88
+ end