fastlane-plugin-dynatrace 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e893f895c684763a074f06dfa448156b4f4bdf639f7d287e409cd09c437a1709
4
- data.tar.gz: c758ebf1327254eed71f2b138efe9b50b9058a38a3e2a235411fcbeb06fcefb2
3
+ metadata.gz: 99b5f6070d7eb68fccc4b912a89c4ae9a15814f041baa97c683a2f8c1b9e8590
4
+ data.tar.gz: c547493757afd54cc2f256debbba3487dd73cfab0aa23c961b1a641220c18ab9
5
5
  SHA512:
6
- metadata.gz: 3ba82e96e1e13c05504f5f732f7313ad10b743664da56f7198d4e5701e278c92a6fb4512088419200fede8b6e596f447a3ebccf921356a072fd067a2c333a978
7
- data.tar.gz: 3f752665d4a5128e32d8340b795ce5ab323b97ae4314619f4d0f78d9482c572a273aa677db50cd6fc2786c35be1731a51e9cc330c33a09706bab22dfeba042dc
6
+ metadata.gz: 7b06bfc63cf1707d8e9d33d2c0f36046a848f43adfa1babac635e8dfb8a7d42dfc85cd19f25d49453de686c5577ab1910fe6f2a3fe77af885a97b926210d350d
7
+ data.tar.gz: 594bd21d1c29fc5b59adda5307ba4a7b064fb345d4d984446ecc143732265757a1810db839c9dceb069f72d49c9cb2a19b7dbbc19d6fe54e1b3a9547c3e87e32
data/README.md CHANGED
@@ -10,30 +10,45 @@ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To
10
10
  fastlane add_plugin dynatrace
11
11
  ```
12
12
 
13
- ### Dynatrace Managed
14
- If the installation is on version 1.195 or earlier the Symbolication Client has to be manually download and specified (`dtxDssClientPath`), else it's 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.
13
+ ⚠️ The way Apple introduced the two-factor authentication interferes with a fully automated workflow. The workaround requires manual interaction. For more information, see **App Store Connect Two-Factor-Authentication** section below for details.
15
14
 
16
15
  ## About the Dynatrace fastlane plugin
17
- This plugin allows you to decode and upload symbol files (iOS) or just upload obfuscation mapping files (Android) to Dynatrace. You can also use it to first download your latest dSYM files from App Store Connect if you use Bitcode.
16
+ The Dynatrace fastlane plugin manages uploading symbol files (iOS, tvOS) or obfuscation mapping files (Android) to the Dynatrace cluster. Symbol and mapping files are used to make reported stack traces human-readable. The plugin also allows to download the latest dSYM files from App Store Connect, which enables full automation of the mobile app deployment, and the pre-processing of dSYM files, a step that is necessary for the Dynatrace cluster to be able to symbolicate.
18
17
 
19
- ## Action: `dynatrace_process_symbols`
18
+ 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.
20
19
 
21
- | Supported Platforms | ios, android |
22
- |---------------------|--------------|
20
+ 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.
23
21
 
24
- ## Is your app Bitcode enabled?
25
- > Only applies for apps distributed via the AppStore or TestFlight.
26
22
 
27
- If your app is bitcode enabled, then the dSYMs that are generated during the Xcode build are **_not_** the dSYMs you want to upload to Dynatrace. This is because Apple recompiles the application on their servers, generating new dSYM files in the process. These newly generated dSYM files need to be downloaded from *App Store Connect*, then processed and uploaded to Dynatrace.
23
+ ## Usage
24
+ 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.
28
25
 
29
- ### Important
30
- There is a time gap between the application being uploaded to App Store Connect and the dSYM files to be ready. So **_we have to introduce some "wait" time in the CI to accomodate for this_**. You can do this by setting the `waitForDsymProcessing` to true. Unfortunately, Apple does not specify how long this time is. We recommend 1800 seconds (30 mins) as this is usually enough for the symbols are ready for download. You can increase this timeout if needed (`waitForDsymProcessingTimeout`).
26
+ Add the action `dynatrace_process_symbols` to your Fastfile. You'll find all the configuration options and a default configuration later in the readme.
31
27
 
32
- > Notice that this timeout is only the **maximum** waiting time. If the symbol files are ready sooner, it will continue processing and will not wait for the whole duration of the timeout.
28
+ Now, when you run fastlane, the Dynatrace plugin will manage the symbol files of your app as configured.
29
+
30
+ ### Dynatrace Managed (1.195 and earlier)
31
+ 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.
32
+
33
+
34
+ ## A) Bitcode-enabled iOS apps
35
+ 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.
36
+
37
+ Background: If your app is Bitcode-enabled, then the dSYMs that are generated during the Xcode build are **not** the dSYMs that need to be uploaded to Dynatrace. Apple recompiles the application on their servers, generating new dSYM files in the process. These newly generated dSYM files need to be downloaded from *App Store Connect*, processed and uploaded to Dynatrace.
38
+
39
+ ### Automatically downloading dSYMs
40
+
41
+ To fully automate the following five-step workflow, add the snippets below to the respective files and fill in the placeholders. Uploading the app the App Store Connect is a necessary prerequisite and either handled manually or by fastlane directly:
42
+
43
+ 1. Wait until the build is processed
44
+ 2. Download the resulting dSYM files
45
+ 3. Process dSYM files into the format that Dynatrace requires
46
+ 4. Upload processed dSYM files to Dynatrace
33
47
 
34
- ### Automatically downloading dSYMs and using AppFile for authentication
35
48
 
36
49
  #### AppFile
50
+ Make sure the following information is present in `AppFile` to authenticate with App Store Connect.
51
+
37
52
  ```ruby
38
53
  app_identifier("com.yourcompany.yourappID") # bundle identifier of your app
39
54
  apple_id("user@email.com")
@@ -45,7 +60,7 @@ dynatrace_process_symbols(
45
60
  appId: "<Dynatrace application ID>",
46
61
  apitoken: "<Dynatrace API token>",
47
62
  os: "ios",
48
- bundleId: "<CFBundlebundleId (iOS) / package (Android)>",
63
+ bundleId: "<CFBundlebundleId>",
49
64
  versionStr: "<Build Number (CFBundleVersion)>",
50
65
  version: "<App Version (CFBundleShortVersionString)>",
51
66
  server: "<Dynatrace Environment URL>",
@@ -53,18 +68,30 @@ dynatrace_process_symbols(
53
68
  )
54
69
  ```
55
70
 
71
+ #### Waiting time between app upload and dSYM file download
72
+ 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.
73
+
74
+ > 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.
75
+
76
+
77
+ ## B) Not Bitcode-enabled iOS/tvOS apps or Android apps
78
+ If at least one of the following conditions is true, you should follow this approach:
56
79
 
57
- ## If you are NOT using Bitcode, or if you have already downloaded your new symbols from App Store Connect manually.
80
+ * **not** using Bitcode for your iOS/tvOS app
81
+ * already downloaded the new symbol files from App Store Connect manually
82
+ * deploy an Android app
83
+
84
+ #### Fastfile
85
+ Use the parameter `symbolsfile` to provide a relative path to the symbols file.
58
86
 
59
- ### Supply all parameters locally
60
87
  ```ruby
61
88
  dynatrace_process_symbols(
62
89
  appId: "<Dynatrace application ID>",
63
90
  apitoken: "<Dynatrace API Token>",
64
- os: "<ios> or <android>",
65
- bundleId: "<CFBundlebundleId (iOS) / package (Android)>",
66
- versionStr: "<CFBundleShortVersionString (iOS) / versionName (Android)>",
67
- version: "<CFBundleVersion (iOS) / versionCode (Android)>",
91
+ os: "<ios>, <tvos> or <android>",
92
+ bundleId: "<CFBundlebundleId (iOS, tvOS) / package (Android)>",
93
+ versionStr: "<CFBundleShortVersionString (iOS, tvOS) / versionName (Android)>",
94
+ version: "<CFBundleVersion (iOS, tvOS) / versionCode (Android)>",
68
95
  server: "<Dynatrace Environment URL>",
69
96
  symbolsfile: "<Symbols File Path>"
70
97
  )
@@ -73,26 +100,26 @@ dynatrace_process_symbols(
73
100
  ## List of all Parameters
74
101
  | Key | Description | default value |
75
102
  |------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
76
- | action | *(iOS only)* Action to be performed by DTXDssClient (`upload` or `decode`). | `upload` |
77
- | downloadDsyms | *(iOS only)* Download the dSYMs from App Store Connect. | `false` |
78
- | waitForDsymProcessing | *(iOS only)* Wait for dSYM processing to be finished. | `true` |
79
- | waitForDsymProcessingTimeout | *(iOS only)* Timeout in seconds to wait for the dSYMs be downloadable. | `1800` |
80
- | username | *(iOS only)* The username/AppleID to use to download the dSYMs. Alternatively you can specify this in your AppFile as `apple_id`. | |
81
- | os | The type of the symbol files, either `ios` or `android`. | |
103
+ | action | *(iOS/tvOS only)* Action to be performed by DTXDssClient (`upload` or `decode`). | `upload` |
104
+ | downloadDsyms | *(iOS/tvOS only)* Download the dSYMs from App Store Connect. | `false` |
105
+ | waitForDsymProcessing | *(iOS/tvOS only)* Wait for dSYM processing to be finished. | `true` |
106
+ | waitForDsymProcessingTimeout | *(iOS/tvOS only)* Timeout in seconds to wait for the dSYMs be downloadable. | `1800` |
107
+ | username | *(iOS/tvOS only)* The username/AppleID to use to download the dSYMs. Alternatively you can specify this in your AppFile as `apple_id`. | |
108
+ | os | The type of the symbol files, either `ios`, `tvOS` or `android`. | |
82
109
  | apitoken | Dynatrace API token with mobile symbolication permissions. | |
83
110
  | dtxDssClientPath | **(DEPRECATED)** The path to your DTXDssClient. The DTXDssClient is downloaded and updated automatically, unless this key is set. | |
84
111
  | appID | The application ID you get from your Dynatrace environment. | |
85
- | bundleId | The CFBundlebundleId (iOS) / package (Android) of the application. Alternatively you can specify this in your AppFile as `app_identifier`. | |
86
- | versionStr | The CFBundleShortVersionString (iOS) / versionName (Android) | |
87
- | version | The CFBundleVersion (iOS) / versionCode (Android). Is also used for the dSYM download. | |
112
+ | bundleId | The CFBundlebundleId (iOS, tvOS) / package (Android) of the application. Alternatively you can specify this in your AppFile as `app_identifier`. | |
113
+ | versionStr | The CFBundleShortVersionString (iOS, tvOS) / versionName (Android) | |
114
+ | version | The CFBundleVersion (iOS, tvOS) / versionCode (Android). Is also used for the dSYM download. | |
88
115
  | symbolsfile | Path to the dSYM file to be processed. If downloadDsyms is set, this is only a fallback. | |
89
116
  | server | The API endpoint for the Dynatrace environment (e.g. `https://environmentID.live.dynatrace.com` or `https://dynatrace-managed.com/e/environmentID`). | |
90
117
  | debugMode | Enable debug logging. | false |
91
118
 
92
- ## AppStore Connect Two-Factor-Authentication
93
- When the plugin is used to download symbols from *AppStore Connect* automatically (`downloadDsyms: true`) valid login credentials to an account with permissions to access the dSYM files are required. The preferred method of doing so is by setting the `FASTLANE_USER` and `FASTLANE_PASSWORD` environment variables to their respective values.
119
+ ## App Store Connect Two-Factor-Authentication
120
+ When the plugin is used to download symbols from *App Store Connect* automatically (`downloadDsyms: true`), valid App Store Connect credentials with access to the dSYM files are required. The preferred method of doing so is by setting the `FASTLANE_USER` and `FASTLANE_PASSWORD` environment variables to their respective values.
94
121
 
95
- [Apple announced](https://github.com/fastlane/fastlane/discussions/17655) that 2-Factor-Authentication for the *AppStore Connect* API will be enforced starting February 2021. This limits the ability to automate the symbol processing, because it will most likely involve manual interaction, which is not suitable for CI automation. The only workaround at this point in time is to pre-generate a session and cache it in CI.
122
+ Apple started enforcing 2-Factor-Authentication for the *App Store Connect* API in February 2021. This [limits the ability to automate the symbol processing](https://github.com/fastlane/fastlane/discussions/17655), because it will most likely involve manual interaction, which is not suitable for CI automation. The only workaround at this point in time is to pre-generate a session and cache it in CI.
96
123
 
97
124
  ### Fastlane Session
98
125
  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
@@ -100,10 +127,9 @@ The full documentation for this can be found on the [fastlane docs](https://docs
100
127
 
101
128
  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).
102
129
 
103
- ### NOTE
104
- - Session is only valid in the "region" you create it. If you CI is in a different geographical location the authentication might fail.
105
-
106
- - Generated sessions are valid up to one month. Apple's API doesn't specify details about that, so it will only be visible by a failing build.
130
+ > Note:
131
+ > - Session is only valid for the "region" you created it in. If your CI is in a different geographical location, the authentication might fail
132
+ > - 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
107
133
 
108
134
  ## Example
109
135
  Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
@@ -121,4 +147,4 @@ If you have trouble using plugins, check out the [Plugins Troubleshooting](https
121
147
  For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
122
148
 
123
149
  ## About _fastlane_
124
- _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
150
+ _fastlane_ is the easiest way to automate beta deployments and releases for your iOS, tvOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
@@ -51,11 +51,11 @@ module Fastlane
51
51
  end
52
52
  end
53
53
  return
54
- elsif params[:os] != "ios"
54
+ elsif params[:os] != "ios" && params[:os] != "tvos"
55
55
  UI.user_error! "Unsopported value os=#{params[:os]}"
56
56
  end
57
57
 
58
- # iOS workflow
58
+ # iOS/tvOS workflow
59
59
  dtxDssClientPath = Helper::DynatraceHelper.get_dss_client(params)
60
60
 
61
61
  dsym_paths = []
@@ -90,7 +90,7 @@ module Fastlane
90
90
  username: username,
91
91
  version: params[:version],
92
92
  build_number: params[:versionStr],
93
- platform: :ios) # should be optional (Hint: it's not)
93
+ platform: params[:os] == "ios" ? :ios : :appletvos)
94
94
 
95
95
  if !lane_context[SharedValues::DSYM_PATHS] and (Time.now - startTime) < params[:waitForDsymProcessingTimeout]
96
96
  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)."
@@ -205,11 +205,11 @@ module Fastlane
205
205
 
206
206
  FastlaneCore::ConfigItem.new(key: :os,
207
207
  env_name: "FL_UPLOAD_TO_DYNATRACE_OS",
208
- description: "The type of the symbol files, either \"ios\" or \"android\"",
208
+ description: "The type of the symbol files, either \"ios\", \"tvos\" or \"android\"",
209
209
  sensitive: false,
210
210
  optional: false,
211
211
  verify_block: proc do |value|
212
- UI.user_error!("Please specify the type of the symbol files. Possible values are \"ios\" or \"android\".") unless (value and not value.empty? and (value == "ios" || value =="android"))
212
+ UI.user_error!("Please specify the type of the symbol files. Possible values are \"ios\", \"tvos\" or \"android\".") unless (value and not value.empty? and (value == "ios" || value == "tvos" || value =="android"))
213
213
  end),
214
214
 
215
215
  FastlaneCore::ConfigItem.new(key: :apitoken,
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Dynatrace
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
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: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dynatrace LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-29 00:00:00.000000000 Z
11
+ date: 2021-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry