fastlane-plugin-datadog 0.2.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: cfc108d55eb1484b1c6664ca7318b862582fe3da70bb3a406808d7525d46b6b9
4
- data.tar.gz: 22d8dac92a6bb2e14c379e3e40deff5956556171ca5422b39638cf63c4d28f50
3
+ metadata.gz: 27128ade63154ac29c43e39004871189c54dfee3ca7497e3b7169ae0114a4f84
4
+ data.tar.gz: dd2c0f47e8b96bb77dbd9897fe4a5348b06a43c48b136e49fa1be7ea1e0386ba
5
5
  SHA512:
6
- metadata.gz: 0ec6713fb90cb3ccd06dc35da266a52da80086436b820c6daabb8e86a886aee79d997b23e216dfd60779a535afffa9d99cb38dfdd31c4bdadfe924960002fa6a
7
- data.tar.gz: 0f02ba3333a97f1c208e3961f256bf5177b770bdd674d57f524a72e5ef8d0b4c53a557f41d3029f1a0c9791746484dfd2c5f1a92f70d77d9ff71e4aa461c7f74
6
+ metadata.gz: 06c71c5e0d55c37b6dc9c8d9b952858027a776f9334ef17a31bfdf2a7fb2aee159be1382468fc970ef91f5acad372129ba21364542b700d13035cfe30a03835c
7
+ data.tar.gz: d619a5f7f3268bd089897b43caad4548a61d3efee6f66ae9a154ebac43f6d7054dee1fdba4d3d3d03133af8affa70adfe380fa3ef83292244815aebb970fb558
data/README.md CHANGED
@@ -10,13 +10,15 @@ 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
@@ -25,27 +27,31 @@ Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plu
25
27
 
26
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.
27
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.
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
45
51
 
46
52
  # Upload to EU site
47
- lane :upload_dsym_with_download_dsyms do
48
- download_dsyms
53
+ lane :upload_dsym_with_download_dsyms do |options|
54
+ download_dsyms options
49
55
  upload_symbols_to_datadog(
50
56
  api_key: "datadog-api-key",
51
57
  site: 'datadoghq.eu'
@@ -11,25 +11,36 @@ module Fastlane
11
11
  dsym_paths = [dsym_paths]
12
12
  end
13
13
 
14
- 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 = []
15
19
  is_dry_run = params[:dry_run]
20
+ throw_errors = params[:throw_errors]
16
21
  dsym_paths.each do |path|
17
- upload_path(path, is_dry_run)
18
- rescue FastlaneShellError => e
19
- error << e.to_s
22
+ upload_path(path, is_dry_run, throw_errors)
23
+ rescue StandardError => e
24
+ error << e.message
20
25
  end
21
26
 
22
- raise error unless error.empty?
27
+ raise error.join("\n") unless error.empty?
23
28
  end
24
29
 
25
- def self.upload_path(path, is_dry_run)
26
- cmd = 'npx @datadog/datadog-ci dsyms upload '
27
- cmd += path
28
- if is_dry_run
29
- 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
30
38
  end
31
39
 
32
- sh(cmd)
40
+ cmd = ['npx', '@datadog/datadog-ci', 'dsyms', 'upload', path]
41
+ cmd << '--dry-run' if is_dry_run
42
+
43
+ sh(*cmd)
33
44
  end
34
45
 
35
46
  #####################################################
@@ -67,13 +78,20 @@ module Fastlane
67
78
  key: :dsym_paths,
68
79
  default_value: Actions.lane_context[SharedValues::DSYM_PATHS],
69
80
  description: "An array of the folders and/or the zip files which contains the dSYM files",
81
+ optional: true,
70
82
  type: Array
71
83
  ),
72
84
  FastlaneCore::ConfigItem.new(
73
85
  key: :dry_run,
74
86
  description: "No upload to Datadog",
75
87
  default_value: false,
76
- is_string: 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
77
95
  )
78
96
  ]
79
97
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Datadog
3
- VERSION = "0.2.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.2.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-12-29 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
@@ -178,7 +178,7 @@ dependencies:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
- description:
181
+ description:
182
182
  email: packages@datadoghq.com
183
183
  executables: []
184
184
  extensions: []
@@ -193,7 +193,7 @@ homepage: https://github.com/DataDog/datadog-fastlane-plugin
193
193
  licenses:
194
194
  - Apache-2.0
195
195
  metadata: {}
196
- post_install_message:
196
+ post_install_message:
197
197
  rdoc_options: []
198
198
  require_paths:
199
199
  - lib
@@ -208,8 +208,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubygems_version: 3.1.4
212
- signing_key:
211
+ rubygems_version: 3.4.19
212
+ signing_key:
213
213
  specification_version: 4
214
214
  summary: Datadog actions for iOS development
215
215
  test_files: []