DataDog / dd-sdk-android-gradle-plugin

The Datadog Gradle Plugin for Android
Apache License 2.0
14 stars 9 forks source link

RUMM-2345: Read config properties from datadog-ci.json #104

Closed 0xnm closed 2 years ago

0xnm commented 2 years ago

What does this PR do?

This change supports parsing some properties from datadog-ci.json, namely datadogSite and apiKey properties.

This file may be located in the root of the project (but since the definition of the root may vary between the different setups, we try to find datadog-ci.json file by doing upward traversal).

The order of API key lookup is like the following:

The order of site lookup is like the following:

datadog-ci.json file is included as an input of upload task so that it can be watched by the Gradle for the changes, otherwise it won't be checked and any changes there won't be reflected when running upload task, which may be confusing for the user.

Review checklist (to be filled by reviewers)

codecov-commenter commented 2 years ago

Codecov Report

Merging #104 (40c5825) into nogorodnikov/rumm-2163/disable-dependencies-check-task-by-default (33f9db2) will increase coverage by 1.14%. The diff coverage is 90.91%.

@@                                           Coverage Diff                                           @@
##             nogorodnikov/rumm-2163/disable-dependencies-check-task-by-default     #104      +/-   ##
=======================================================================================================
+ Coverage                                                                87.31%   88.45%   +1.14%     
- Complexity                                                                 145      163      +18     
=======================================================================================================
  Files                                                                       20       21       +1     
  Lines                                                                      465      511      +46     
  Branches                                                                    53       61       +8     
=======================================================================================================
+ Hits                                                                       406      452      +46     
+ Misses                                                                      40       38       -2     
- Partials                                                                    19       21       +2     
Impacted Files Coverage Δ
...com/datadog/gradle/plugin/DdAndroidGradlePlugin.kt 74.34% <82.35%> (+2.06%) :arrow_up:
...m/datadog/gradle/plugin/DdMappingFileUploadTask.kt 93.55% <90.00%> (-0.14%) :arrow_down:
...in/kotlin/com/datadog/gradle/plugin/DatadogSite.kt 100.00% <100.00%> (+20.00%) :arrow_up:
.../datadog/gradle/plugin/DdExtensionConfiguration.kt 100.00% <100.00%> (ø)
...otlin/com/datadog/gradle/plugin/internal/ApiKey.kt 100.00% <100.00%> (ø)