fastlane-plugin-dynatrace 1.0.8 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -74
- data/lib/fastlane/plugin/dynatrace/actions/dynatrace_action.rb +5 -90
- data/lib/fastlane/plugin/dynatrace/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c236c8f7da15577b17f9c2515214671eb4e95c1f4cc5c1891105cc7ade2a59b2
|
4
|
+
data.tar.gz: 4725bb74807832a320be5c4fb6aaf1b29bd6de7e3cfd4880fc1931e6dcb02589
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5897a23dec9c27f728c55b4de5ff3ffab050a272a2825fdf066717417fcda7d88687792d4179ad0c53b0553acc659461eaf21141b6f6617b5f005796941a171c
|
7
|
+
data.tar.gz: e36ce10fc9a35a563992c3e675999377073b6641f6b3325427838c79e00941d19e6f27b50fc55e68310d260fd747a05cfdd4fcad560df4080c68df841d016229
|
data/README.md
CHANGED
@@ -11,67 +11,14 @@ fastlane add_plugin dynatrace
|
|
11
11
|
```
|
12
12
|
|
13
13
|
## About the Dynatrace fastlane plugin
|
14
|
-
The Dynatrace fastlane plugin manages uploading
|
15
|
-
|
16
|
-
The plugin provides a single action `dynatrace_process_symbols`. The configuration depends on whether the app is (A) iOS and Bitcode-enabled or (B) iOS/tvOS and not Bitcode-enabled or an Android app.
|
17
|
-
|
18
|
-
For Bitcode-enabled iOS apps we recommend to let the plugin handle the download of the dSYM files from App Store Connect and upload to Dynatrace.
|
14
|
+
The Dynatrace fastlane plugin manages pre-processing and uploading of dSYM files (iOS, tvOS) or uploading of obfuscation mapping files (Android) to the Dynatrace cluster. Symbol and mapping files are used to make reported stack traces human-readable.
|
19
15
|
|
16
|
+
The plugin provides a single action `dynatrace_process_symbols`. The configuration depends on whether the app is an iOS/tvOS or an Android app.
|
20
17
|
|
21
18
|
## Usage
|
22
|
-
To get started, ask your Dynatrace administrator for an [API token ](https://www.dynatrace.com/support/help/shortlink/api-authentication) with **Mobile symbolication file management** permission . To generate the API token, go to **Integration** > **Dynatrace API**.
|
23
|
-
|
24
|
-
Add the action `dynatrace_process_symbols` to your Fastfile. You'll find all the configuration options and a default configuration later in the readme.
|
25
|
-
|
26
|
-
Now, when you run fastlane, the Dynatrace plugin will manage the symbol files of your app as configured.
|
27
|
-
|
28
|
-
### Dynatrace Managed (1.195 and earlier)
|
29
|
-
For cluster versions 1.195 and earlier, the Dynatrace application 'Symbolication Client' has to be downloaded manually and explicitly specified (`dtxDssClientPath`). For all cluster versions above 1.195 it is fetched and updated automatically. A matching version can be downloaded manually with this link [https://api.mobileagent.downloads.dynatrace.com/sprint-latest-dss-client/xyz](https://api.mobileagent.downloads.dynatrace.com/sprint-latest-dss-client/xyz) by replacing `xyz` with the 3-digit sprint version of your Dynatrace Managed installation.
|
30
|
-
|
31
|
-
|
32
|
-
## A) Bitcode-enabled iOS apps
|
33
|
-
This is the right approach if your app is distributed via Apple's App Store or TestFlight and Bitcode-enabled. For all other cases, follow the approach B below.
|
19
|
+
To get started, ask your Dynatrace administrator for an [API token ](https://www.dynatrace.com/support/help/shortlink/api-authentication) with **Mobile symbolication file management** permission . To generate the API token, go to **Integration** > **Dynatrace API**. The token is used by the authenticate the plugin into Dynatrace and upload the symbol and mapping files.
|
34
20
|
|
35
|
-
|
36
|
-
|
37
|
-
### Automatically downloading dSYMs
|
38
|
-
|
39
|
-
To fully automate the following five-step workflow, add the snippets below to the respective files and fill in the placeholders. Uploading the app to App Store Connect is a necessary prerequisite and either handled manually or by fastlane directly:
|
40
|
-
|
41
|
-
1. Wait until the build is processed
|
42
|
-
2. Download the resulting dSYM files
|
43
|
-
3. Process dSYM files into the format that Dynatrace requires
|
44
|
-
4. Upload processed dSYM files to Dynatrace
|
45
|
-
|
46
|
-
#### Fastfile
|
47
|
-
```ruby
|
48
|
-
dynatrace_process_symbols(
|
49
|
-
appId: "<Dynatrace application ID>",
|
50
|
-
apitoken: "<Dynatrace API token>",
|
51
|
-
os: "ios",
|
52
|
-
bundleId: "<CFBundlebundleId>",
|
53
|
-
versionStr: "<Build Number (CFBundleVersion)>",
|
54
|
-
version: "<App Version (CFBundleShortVersionString)>",
|
55
|
-
server: "<Dynatrace Environment URL>",
|
56
|
-
downloadDsyms: true
|
57
|
-
)
|
58
|
-
```
|
59
|
-
|
60
|
-
#### Waiting time between app upload and dSYM file download
|
61
|
-
After a completed upload to App Store Connect, there is some waiting time before the dSYM files are ready to be downloaded. The Dynatrace fastlane plugin waits and downloads the symbol files if setting the `waitForDsymProcessing` is true and a waiting period is provided via `waitForDsymProcessingTimeout`. We recommend 1800 seconds (30 mins) as the default waiting time. In our experience, this is sufficiently long for the processing to happen. If this duration is not long enough, you need to increase it.
|
62
|
-
|
63
|
-
> Note: this timeout is the **maximum** waiting time. If the symbol files are ready sooner, the plugin will continue to the download and will not wait for the whole duration of the timeout.
|
64
|
-
|
65
|
-
|
66
|
-
## B) Not Bitcode-enabled iOS/tvOS apps or Android apps
|
67
|
-
If at least one of the following conditions is true, you should follow this approach:
|
68
|
-
|
69
|
-
* **not** using Bitcode for your iOS/tvOS app
|
70
|
-
* already downloaded the new symbol files from App Store Connect manually
|
71
|
-
* deploy an Android app
|
72
|
-
|
73
|
-
#### Fastfile
|
74
|
-
Use the parameter `symbolsfile` to provide a relative path to the symbols file.
|
21
|
+
Add the action `dynatrace_process_symbols` to your Fastfile. You'll find all the configuration options and a default configuration below. Use the parameter `symbolsfile` to provide a relative path to the symbols file (dSYM or Android mapping).
|
75
22
|
|
76
23
|
```ruby
|
77
24
|
dynatrace_process_symbols(
|
@@ -86,39 +33,27 @@ dynatrace_process_symbols(
|
|
86
33
|
)
|
87
34
|
```
|
88
35
|
|
36
|
+
Now, when you run fastlane, the Dynatrace plugin will manage the symbol files of your app as configured.
|
37
|
+
|
38
|
+
|
89
39
|
## List of all Parameters
|
90
40
|
| Key | Description | default value |
|
91
41
|
|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
|
92
42
|
| action | *(iOS/tvOS only)* Action to be performed by DTXDssClient (`upload` or `decode`). | `upload` |
|
93
|
-
| downloadDsyms | *(iOS/tvOS only)* Download the dSYMs from App Store Connect. | `false` |
|
94
|
-
| waitForDsymProcessing | *(iOS/tvOS only)* Wait for dSYM processing to be finished. | `true` |
|
95
|
-
| waitForDsymProcessingTimeout | *(iOS/tvOS only)* Timeout in seconds to wait for the dSYMs be downloadable. | `1800` |
|
96
43
|
| username | *(iOS/tvOS only)* The username/AppleID to use to download the dSYMs. Alternatively you can specify this in your AppFile as `apple_id`. | |
|
97
44
|
| os | The type of the symbol files, either `ios`, `tvOS` or `android`. | |
|
98
45
|
| apitoken | Dynatrace API token with mobile symbolication permissions. | |
|
99
|
-
| dtxDssClientPath | **(DEPRECATED)** The path to your DTXDssClient. The DTXDssClient is downloaded and updated automatically, unless this key is set. | |
|
100
46
|
| appID | The application ID you get from your Dynatrace environment. | |
|
101
47
|
| bundleId | The CFBundlebundleId (iOS, tvOS) / package (Android) of the application. Alternatively you can specify this in your AppFile as `app_identifier`. | |
|
102
48
|
| versionStr | The CFBundleShortVersionString (iOS, tvOS) / versionName (Android) | |
|
103
49
|
| version | The CFBundleVersion (iOS, tvOS) / versionCode (Android). Is also used for the dSYM download. | |
|
104
|
-
| symbolsfile | Path to the dSYM file to be processed. If
|
50
|
+
| symbolsfile | Path to the dSYM or Android mapping file to be processed. *(Android only)*: If the file exceeds 10MiB and doesn't end with `*.zip` it's zipped before uploading. This can be disabled by setting `symbolsfileAutoZip` to false. | |
|
105
51
|
| symbolsfileAutoZip | *(Android only)* Automatically zip symbolsfile if it exceeds 10MiB and doesn't already end with `*.zip`. | `true` |
|
106
52
|
| server | The API endpoint for the Dynatrace environment (e.g. `https://environmentID.live.dynatrace.com` or `https://dynatrace-managed.com/e/environmentID`). | |
|
107
|
-
| cleanBuildArtifacts | Clean build artifacts after processing. | `
|
53
|
+
| cleanBuildArtifacts | Clean build artifacts after processing. | `false` |
|
108
54
|
| tempdir | (OPTIONAL) Custom temporary directory for the DTXDssClient. **The plugin does not take care of cleaning this directory.** | |
|
109
55
|
| debugMode | Enable debug logging. | false |
|
110
56
|
|
111
|
-
|
112
|
-
### Fastlane Session
|
113
|
-
The full documentation for this can be found on the [fastlane docs](https://docs.fastlane.tools/best-practices/continuous-integration/#two-step-or-two-factor-auth
|
114
|
-
) under **spaceauth**.
|
115
|
-
|
116
|
-
You can generate a session by running `fastlane spaceauth -u user@email.com` on your machine and copy the output into an environment variable `FASTLANE_SESSION` on the target system (e.g. CI).
|
117
|
-
|
118
|
-
> Note:
|
119
|
-
> - Session is only valid for the "region" you created it in. If your CI is in a different geographical location, the authentication might fail
|
120
|
-
> - Generated sessions are valid for up to one month. Apple's API doesn't specify details about that, so it is only noticable by a failing build
|
121
|
-
|
122
57
|
## Example
|
123
58
|
Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
124
59
|
|
@@ -12,13 +12,13 @@ module Fastlane
|
|
12
12
|
class DynatraceProcessSymbolsAction < Action
|
13
13
|
|
14
14
|
def self.run(params)
|
15
|
-
UI.message "DTXDssClientPath: #{params[:dtxDssClientPath]}"
|
16
15
|
UI.message "Parameter API Token: #{params[:apitoken]}"
|
17
16
|
UI.message "OS: #{params[:os]}"
|
18
17
|
UI.message "Version string: #{params[:versionStr]}"
|
19
18
|
UI.message "Version: #{params[:version]}"
|
20
19
|
UI.message "Server URL: #{params[:server]}"
|
21
20
|
UI.message "Tempdir: #{params[:tempdir]}"
|
21
|
+
UI.message "Symbols file path: #{params[:symbolsfile]}"
|
22
22
|
|
23
23
|
UI.message "Checking AppFile for possible AppID"
|
24
24
|
bundleId = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
|
@@ -60,71 +60,10 @@ module Fastlane
|
|
60
60
|
# iOS/tvOS workflow
|
61
61
|
dtxDssClientPath = Helper::DynatraceHelper.get_dss_client(params)
|
62
62
|
|
63
|
-
dsym_paths = []
|
64
|
-
symbolFilesKey = "symbolsfile" # default to iOS
|
65
|
-
|
66
63
|
if !OS.mac?
|
67
64
|
UI.user_error! "A macOS machine is required to process iOS symbols."
|
68
65
|
end
|
69
66
|
|
70
|
-
if params[:downloadDsyms] == true
|
71
|
-
UI.message "Downloading dSYMs from App Store Connect"
|
72
|
-
startTime = Time.now
|
73
|
-
|
74
|
-
UI.message "Checking AppFile for possible username/AppleID"
|
75
|
-
username = CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
|
76
|
-
if username
|
77
|
-
UI.message "Using #{username} from your AppFile"
|
78
|
-
else
|
79
|
-
username = params[:username]
|
80
|
-
UI.message "Didn't find a username in AppFile, using passed username parameter: #{params[:username]}"
|
81
|
-
end
|
82
|
-
|
83
|
-
# it takes a couple of minutes until the new build is available through the API
|
84
|
-
# -> retry until available
|
85
|
-
while params[:waitForDsymProcessing] and # wait is active
|
86
|
-
!lane_context[SharedValues::DSYM_PATHS] and # has dsym path
|
87
|
-
(Time.now - startTime) < params[:waitForDsymProcessingTimeout] # is in time
|
88
|
-
|
89
|
-
Actions::DownloadDsymsAction.run(wait_for_dsym_processing: params[:waitForDsymProcessing],
|
90
|
-
wait_timeout: (params[:waitForDsymProcessingTimeout] - (Time.now - startTime)).round(0), # remaining timeout
|
91
|
-
app_identifier: bundleId,
|
92
|
-
username: username,
|
93
|
-
version: params[:version],
|
94
|
-
build_number: params[:versionStr],
|
95
|
-
platform: params[:os] == "ios" ? :ios : :appletvos)
|
96
|
-
|
97
|
-
if !lane_context[SharedValues::DSYM_PATHS] and (Time.now - startTime) < params[:waitForDsymProcessingTimeout]
|
98
|
-
UI.message "Version #{params[:version]} (Build #{params[:versionStr]}) isn't listed yet, retrying in 60 seconds (timeout in #{(params[:waitForDsymProcessingTimeout] - (Time.now - startTime)).round(0)} seconds)."
|
99
|
-
sleep(60)
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
if (Time.now - startTime) > params[:waitForDsymProcessingTimeout]
|
104
|
-
UI.user_error!("Timeout during dSYM download. Try increasing :waitForDsymProcessingTimeout.")
|
105
|
-
end
|
106
|
-
|
107
|
-
dsym_paths += Actions.lane_context[SharedValues::DSYM_PATHS] if Actions.lane_context[SharedValues::DSYM_PATHS]
|
108
|
-
|
109
|
-
if dsym_paths.count > 0
|
110
|
-
UI.message "Downloaded the dSYMs from App Store Connect. Paths: #{dsym_paths}"
|
111
|
-
else
|
112
|
-
raise 'No dSYM paths found!'
|
113
|
-
end
|
114
|
-
else
|
115
|
-
UI.important "dSYM download disabled, using local path (#{params[:symbolsfile]})"
|
116
|
-
dsym_paths << params[:symbolsfile] if params[:symbolsfile]
|
117
|
-
end
|
118
|
-
|
119
|
-
# check if we have dSYMs to proceed with
|
120
|
-
if dsym_paths.count == 0
|
121
|
-
UI.message "Symbol file path: #{params[:symbolsfile]}"
|
122
|
-
dsym_paths = params[:symbolsfile]
|
123
|
-
symbolFilesCommandSnippet = "#{symbolFilesKey}=\"#{dsym_paths}\""
|
124
|
-
else
|
125
|
-
symbolFilesCommandSnippet = "#{symbolFilesKey}=\"#{dsym_paths[0]}\""
|
126
|
-
end
|
127
|
-
|
128
67
|
# start constructing the command that will trigger the DTXDssClient
|
129
68
|
command = []
|
130
69
|
command << "#{dtxDssClientPath}"
|
@@ -135,7 +74,7 @@ module Fastlane
|
|
135
74
|
command << "bundleId=\"#{bundleId}\""
|
136
75
|
command << "versionStr=\"#{params[:versionStr]}\""
|
137
76
|
command << "version=\"#{params[:version]}\""
|
138
|
-
command <<
|
77
|
+
command << "symbolsfile=\"#{params[:symbolsfile]}\""
|
139
78
|
command << "server=\"#{Helper::DynatraceHelper.without_trailing_slash(params[:server])}\""
|
140
79
|
command << "DTXLogLevel=ALL -verbose" if params[:debugMode] == true
|
141
80
|
command << "forced=1" # if the file already exists
|
@@ -144,7 +83,6 @@ module Fastlane
|
|
144
83
|
# Create the full shell command to trigger the DTXDssClient
|
145
84
|
shell_command = command.join(' ')
|
146
85
|
|
147
|
-
UI.message "dSYM path: #{dsym_paths[0]}"
|
148
86
|
UI.message "#{shell_command}"
|
149
87
|
|
150
88
|
sh("#{shell_command}", error_callback: ->(result) {
|
@@ -186,24 +124,6 @@ module Fastlane
|
|
186
124
|
UI.user_error!("Action needs to either be \"upload\" or \"decode\"") unless (value and value == "upload" or value == "decode")
|
187
125
|
end),
|
188
126
|
|
189
|
-
FastlaneCore::ConfigItem.new(key: :downloadDsyms,
|
190
|
-
env_name: "FL_UPLOAD_TO_DYNATRACE_DOWNLOAD_DSYMS",
|
191
|
-
default_value: false,
|
192
|
-
is_string: false,
|
193
|
-
description: "(iOS only) Download the dSYMs from App Store Connect"),
|
194
|
-
|
195
|
-
FastlaneCore::ConfigItem.new(key: :waitForDsymProcessing,
|
196
|
-
env_name: "FL_UPLOAD_TO_DYNATRACE_DOWNLOAD_DSYMS_WAIT_PROCESSING",
|
197
|
-
default_value: true,
|
198
|
-
is_string: false,
|
199
|
-
description: "(iOS only) Wait for dSYM processing to be finished"),
|
200
|
-
|
201
|
-
FastlaneCore::ConfigItem.new(key: :waitForDsymProcessingTimeout,
|
202
|
-
env_name: "FL_UPLOAD_TO_DYNATRACE_DOWNLOAD_DSYMS_WAIT_TIMEOUT",
|
203
|
-
default_value: 1800,
|
204
|
-
is_string: false,
|
205
|
-
description: "(iOS only) Timeout in seconds to wait for the dSYMs be downloadable"),
|
206
|
-
|
207
127
|
FastlaneCore::ConfigItem.new(key: :username,
|
208
128
|
env_name: "FL_UPLOAD_TO_DYNATRACE_DOWNLOAD_DSYMS_USERNAME",
|
209
129
|
description: "(iOS only) The username/AppleID to use to download the dSYMs"),
|
@@ -218,17 +138,12 @@ module Fastlane
|
|
218
138
|
end),
|
219
139
|
|
220
140
|
FastlaneCore::ConfigItem.new(key: :apitoken,
|
221
|
-
env_name: "
|
141
|
+
env_name: "FL_UPLOAD_TO_DYNATRACE_APITOKEN",
|
222
142
|
description: "Dynatrace API token with mobile symbolication permissions",
|
223
143
|
verify_block: proc do |value|
|
224
144
|
UI.user_error!("No Dynatrade API token for specified, pass using `apitoken: 'token'`") unless (value and not value.empty?)
|
225
145
|
end),
|
226
146
|
|
227
|
-
FastlaneCore::ConfigItem.new(key: :dtxDssClientPath,
|
228
|
-
env_name: "FL_UPLOAD_TO_DYNATRACE_DTXDssClientPath",
|
229
|
-
description: "(DEPRECATED) The path to your DTXDssClient. The DTXDssClient is downloaded and updated automatically, unless this key is set",
|
230
|
-
optional: true),
|
231
|
-
|
232
147
|
FastlaneCore::ConfigItem.new(key: :appId,
|
233
148
|
env_name: "FL_UPLOAD_TO_DYNATRACE_APP_ID",
|
234
149
|
description: "The app ID you get from your Dynatrace environment",
|
@@ -259,7 +174,7 @@ module Fastlane
|
|
259
174
|
|
260
175
|
FastlaneCore::ConfigItem.new(key: :symbolsfile,
|
261
176
|
env_name: "FL_UPLOAD_TO_DYNATRACE_SYM_FILE_PATH",
|
262
|
-
description: "Path to the dSYM file to be processed.
|
177
|
+
description: "Path to the dSYM or Android mapping file to be processed. Android only: If the file exceeds 10MiB and doesn't end with *.zip it's zipped before uploading. This can be disabled by setting `symbolsfileAutoZip` to false",
|
263
178
|
verify_block: proc do |value|
|
264
179
|
UI.user_error!("Please provide a value for the symbol files. Pass using `symbolsfile: 'symbolsfile'`") unless (value and not value.empty?)
|
265
180
|
end),
|
@@ -279,7 +194,7 @@ module Fastlane
|
|
279
194
|
|
280
195
|
FastlaneCore::ConfigItem.new(key: :cleanBuildArtifacts,
|
281
196
|
env_name: "FL_UPLOAD_TO_DYNATRACE_CLEAN_BUILD_ARTIFACTS",
|
282
|
-
default_value:
|
197
|
+
default_value: false,
|
283
198
|
is_string: false,
|
284
199
|
description: "Clean build artifacts after processing"),
|
285
200
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-dynatrace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dynatrace LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -248,7 +248,7 @@ files:
|
|
248
248
|
- lib/fastlane/plugin/dynatrace/version.rb
|
249
249
|
homepage: https://github.com/Dynatrace/fastlane-plugin-dynatrace
|
250
250
|
licenses:
|
251
|
-
-
|
251
|
+
- Apache 2.0
|
252
252
|
metadata: {}
|
253
253
|
post_install_message:
|
254
254
|
rdoc_options: []
|