fastlane-plugin-datadog 0.1.0 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f40be0373d045d8fdfeb9010b0470db07a45df54b99c6a8fc01ed110ea25b24d
4
- data.tar.gz: 23e42adefd2742f19c153c4debc1675757b27eaea4efc3dab6fbedc79c62257f
3
+ metadata.gz: 27128ade63154ac29c43e39004871189c54dfee3ca7497e3b7169ae0114a4f84
4
+ data.tar.gz: dd2c0f47e8b96bb77dbd9897fe4a5348b06a43c48b136e49fa1be7ea1e0386ba
5
5
  SHA512:
6
- metadata.gz: 345fb6b2783ffda60046dde521523660342aa94005ee7f22060781f7a32ea8caa5396b71b1181d8c6671df13c9dc15de418f0e334e0b571cf2d811528e54707a
7
- data.tar.gz: 2fc90a6f72b7a9609de9470026beb5bad54adcd8d6a6eaa8b70a9f0972581c46a8c491ae3b264fe3c1bb03de063d25f2ebf6637db8d46e9d3c5b18a99cbf964c
6
+ metadata.gz: 06c71c5e0d55c37b6dc9c8d9b952858027a776f9334ef17a31bfdf2a7fb2aee159be1382468fc970ef91f5acad372129ba21364542b700d13035cfe30a03835c
7
+ data.tar.gz: d619a5f7f3268bd089897b43caad4548a61d3efee6f66ae9a154ebac43f6d7054dee1fdba4d3d3d03133af8affa70adfe380fa3ef83292244815aebb970fb558
data/README.md CHANGED
@@ -10,38 +10,53 @@ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To
10
10
  fastlane add_plugin datadog
11
11
  ```
12
12
 
13
+ > ⚠️ Node.js is required for this plugin. Make sure it is installed and available in your system `PATH`.
14
+
13
15
  ## About datadog
14
16
 
15
17
  Datadog plugin helps you uploading dSYM files to Datadog in order to symbolicate crash reports.
16
18
 
17
19
  If you are sending crashes to Datadog, they will appear without symbol names. You also need to provide dSYM files to symbolicate your crash reports.
18
20
 
19
- When used with `download_dsyms` action, no need to specify `dsym_paths` parameter.
21
+ When used with `download_dsyms` action, no need to specify `dsym_paths` parameter. If `download_dsyms` doesn't find any dSYMs, the upload fails; to skip it instead, use `upload_symbols_to_datadog(...) if lane_context[SharedValues::DSYM_PATHS]`.
20
22
  This action is a wrapper around `datadog-ci` npm package, you can look at [`datadog-ci` documentation](https://github.com/DataDog/datadog-ci/blob/master/src/commands/dsyms/README.md) for more info.
21
23
 
22
24
  ## Example
23
25
 
24
26
  Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
25
27
 
26
- You can use `DATADOG_API_KEY` environment variable instead of `api_key` parameter in `Fastfile`.
28
+ You can use `DATADOG_API_KEY` environment variable instead of `api_key` parameter in `Fastfile` as well as the `DATADOG_SITE` instead of the `site` parameter.
29
+
30
+ To validate the paths of dSYM files, you can enable the `throw_errors` parameter to raise an error if any files are missing.
27
31
 
28
32
  ```ruby
29
33
  # upload symbols from...
30
- lane :upload_dsyms do
34
+ lane :upload_dsyms do |options|
31
35
  upload_symbols_to_datadog(
32
36
  api_key: "datadog-api-key",
33
37
  dsym_paths: [
34
38
  "~/Downloads/appdSYMs.zip", # ...a zip file...
35
39
  "~/some/folder/with/dsym/files/" # ...or from a folder
36
- ]
40
+ ],
41
+ dry_run: options[:dry_run],
42
+ throw_errors: options[:throw_errors]
37
43
  )
38
44
  end
39
45
 
40
46
  # download_dsyms action feeds dsym_paths automatically
41
- lane :upload_dsym_with_download_dsyms do
42
- download_dsyms
47
+ lane :upload_dsym_with_download_dsyms do |options|
48
+ download_dsyms options
43
49
  upload_symbols_to_datadog(api_key: "datadog-api-key")
44
50
  end
51
+
52
+ # Upload to EU site
53
+ lane :upload_dsym_with_download_dsyms do |options|
54
+ download_dsyms options
55
+ upload_symbols_to_datadog(
56
+ api_key: "datadog-api-key",
57
+ site: 'datadoghq.eu'
58
+ )
59
+ end
45
60
  ```
46
61
 
47
62
  ## Run tests for this plugin
@@ -5,30 +5,42 @@ module Fastlane
5
5
  class UploadSymbolsToDatadogAction < Action
6
6
  def self.run(params)
7
7
  ENV['DATADOG_API_KEY'] = params[:api_key]
8
+ ENV['DATADOG_SITE'] = params[:site]
8
9
  dsym_paths = params[:dsym_paths] # get array of paths
9
10
  if dsym_paths.instance_of?(String) # if a string is passed, put it in an array
10
11
  dsym_paths = [dsym_paths]
11
12
  end
12
13
 
13
- error = ''
14
+ if dsym_paths.nil? || dsym_paths.empty?
15
+ UI.user_error!("No dSYM paths to upload. If you used `download_dsyms`, it did not find any dSYMs for this build. Otherwise, pass `dsym_paths`.")
16
+ end
17
+
18
+ error = []
14
19
  is_dry_run = params[:dry_run]
20
+ throw_errors = params[:throw_errors]
15
21
  dsym_paths.each do |path|
16
- upload_path(path, is_dry_run)
17
- rescue FastlaneShellError => e
18
- error << e.to_s
22
+ upload_path(path, is_dry_run, throw_errors)
23
+ rescue StandardError => e
24
+ error << e.message
19
25
  end
20
26
 
21
- raise error unless error.empty?
27
+ raise error.join("\n") unless error.empty?
22
28
  end
23
29
 
24
- def self.upload_path(path, is_dry_run)
25
- cmd = 'npx @datadog/datadog-ci dsyms upload '
26
- cmd += path
27
- if is_dry_run
28
- cmd += ' --dry-run'
30
+ def self.upload_path(path, is_dry_run, throw_errors)
31
+ # Expand `~` and relative paths in Ruby: since the command is passed to
32
+ # `sh` as an argv array (no shell), the shell no longer expands them.
33
+ path = File.expand_path(path)
34
+
35
+ unless File.exist?(path)
36
+ UI.error("dSYM path does not exist: #{path}")
37
+ UI.user_error!("dSYM path does not exist: #{path}") if throw_errors
29
38
  end
30
39
 
31
- sh(cmd)
40
+ cmd = ['npx', '@datadog/datadog-ci', 'dsyms', 'upload', path]
41
+ cmd << '--dry-run' if is_dry_run
42
+
43
+ sh(*cmd)
32
44
  end
33
45
 
34
46
  #####################################################
@@ -48,20 +60,39 @@ module Fastlane
48
60
 
49
61
  def self.available_options
50
62
  [
51
- FastlaneCore::ConfigItem.new(key: :api_key,
52
- env_name: 'DATADOG_API_KEY',
53
- description: "Datadog API Key for upload_symbols_to_datadog",
54
- verify_block: proc do |value|
55
- UI.user_error!("No API key for upload_symbols_to_datadog given, pass using `api_key: 'api_key'`") unless value && !value.empty?
56
- end),
57
- FastlaneCore::ConfigItem.new(key: :dsym_paths,
58
- default_value: Actions.lane_context[SharedValues::DSYM_PATHS],
59
- description: "An array of the folders and/or the zip files which contains the dSYM files",
60
- type: Array),
61
- FastlaneCore::ConfigItem.new(key: :dry_run,
62
- description: "No upload to Datadog",
63
- default_value: false,
64
- is_string: false)
63
+ FastlaneCore::ConfigItem.new(
64
+ key: :api_key,
65
+ env_name: 'DATADOG_API_KEY',
66
+ description: "Datadog API Key for upload_symbols_to_datadog",
67
+ verify_block: proc do |value|
68
+ UI.user_error!("No API key for upload_symbols_to_datadog given, pass using `api_key: 'api_key'`") unless value && !value.empty?
69
+ end
70
+ ),
71
+ FastlaneCore::ConfigItem.new(
72
+ key: :site,
73
+ env_name: 'DATADOG_SITE',
74
+ optional: true,
75
+ description: "Datadog site region. `datadoghq.com` by default, use `datadoghq.eu` for the EU"
76
+ ),
77
+ FastlaneCore::ConfigItem.new(
78
+ key: :dsym_paths,
79
+ default_value: Actions.lane_context[SharedValues::DSYM_PATHS],
80
+ description: "An array of the folders and/or the zip files which contains the dSYM files",
81
+ optional: true,
82
+ type: Array
83
+ ),
84
+ FastlaneCore::ConfigItem.new(
85
+ key: :dry_run,
86
+ description: "No upload to Datadog",
87
+ default_value: false,
88
+ type: Boolean
89
+ ),
90
+ FastlaneCore::ConfigItem.new(
91
+ key: :throw_errors,
92
+ description: "Throw errors instead of logging them",
93
+ default_value: false,
94
+ type: Boolean
95
+ )
65
96
  ]
66
97
  end
67
98
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Datadog
3
- VERSION = "0.1.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-datadog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-23 00:00:00.000000000 Z
11
+ date: 2026-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: rubocop-require_tools
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +150,20 @@ dependencies:
136
150
  - - ">="
137
151
  - !ruby/object:Gem::Version
138
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-rspec
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
139
167
  - !ruby/object:Gem::Dependency
140
168
  name: simplecov
141
169
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +178,7 @@ dependencies:
150
178
  - - ">="
151
179
  - !ruby/object:Gem::Version
152
180
  version: '0'
153
- description:
181
+ description:
154
182
  email: packages@datadoghq.com
155
183
  executables: []
156
184
  extensions: []
@@ -165,7 +193,7 @@ homepage: https://github.com/DataDog/datadog-fastlane-plugin
165
193
  licenses:
166
194
  - Apache-2.0
167
195
  metadata: {}
168
- post_install_message:
196
+ post_install_message:
169
197
  rdoc_options: []
170
198
  require_paths:
171
199
  - lib
@@ -180,8 +208,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
208
  - !ruby/object:Gem::Version
181
209
  version: '0'
182
210
  requirements: []
183
- rubygems_version: 3.1.2
184
- signing_key:
211
+ rubygems_version: 3.4.19
212
+ signing_key:
185
213
  specification_version: 4
186
214
  summary: Datadog actions for iOS development
187
215
  test_files: []