Dynatrace / dynatrace-configuration-as-code

This tool automates deployment of Dynatrace Configuration to one or multiple Dynatrace environments.
https://docs.dynatrace.com/docs/manage/configuration-as-code/monaco
Apache License 2.0
164 stars 94 forks source link

refactor: Use REST client in core library #1536

Closed arthurpitman closed 2 months ago

arthurpitman commented 3 months ago

This PR removes as much of the rest package as possible and instead uses rest.Client from the core library.

What is still left for follow ups:

Other notes:

github-actions[bot] commented 3 months ago

Unit Test Results

1 861 tests   - 32   1 860 :white_check_mark:  - 32   59s :stopwatch: +33s   133 suites ± 0       1 :zzz: ± 0      1 files   ± 0       0 :x: ± 0 

Results for commit 88c94728. ± Comparison against base commit 79e137fb.

This pull request removes 41 and adds 9 tests. Note that renamed tests count towards both. ``` github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/api ‑ TestGetUrl github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_is_empty_-_should_throw_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_is_without_scheme_-_should_throw_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_is_without_valid_local_path_-_should_return_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_starts_with_http github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_suffix_is_trimmed github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_with_leading_space_-_should_return_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/invalid_URL_-_should_throw_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/without_valid_protocol_-_should_return_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewPlatformClient … ``` ``` github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client ‑ TestCreateClassicClientSet github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client ‑ TestCreateClassicClientSet/URL_is_without_scheme_-_should_throw_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client ‑ TestCreateClassicClientSet/URL_is_without_valid_local_path_-_should_return_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client ‑ TestCreateClassicClientSet/URL_with_leading_space_-_should_return_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client ‑ TestCreateClassicClientSet/without_valid_protocol_-_should_return_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ Test_sendWithRetryFailsAfterDefinedTries github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ Test_sendWithRetryReturnContainsOriginalApiError github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ Test_sendWithRetryReturnsIfNotSuccess github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ Test_sendWithsendWithRetryReturnsFirstSuccessfulResponse ```

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 3 months ago

E2E Test Results

    4 files   -   1    268 suites   - 133   32m 17s :stopwatch: - 39m 0s 1 968 tests  -  39  1 966 :white_check_mark:  -  39  2 :zzz: ±0  0 :x: ±0  2 070 runs   - 141  2 068 :white_check_mark:  - 141  2 :zzz: ±0  0 :x: ±0 

Results for commit 273d4f41. ± Comparison against base commit 79e137fb.

This pull request removes 43 and adds 4 tests. Note that renamed tests count towards both. ``` github.com/dynatrace/dynatrace-configuration-as-code/v2/cmd/monaco/integrationtest/v2 ‑ TestPaginationClassic github.com/dynatrace/dynatrace-configuration-as-code/v2/cmd/monaco/integrationtest/v2 ‑ TestPaginationPlatform github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/api ‑ TestGetUrl github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_is_empty_-_should_throw_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_is_without_scheme_-_should_throw_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_is_without_valid_local_path_-_should_return_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_starts_with_http github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_suffix_is_trimmed github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/URL_with_leading_space_-_should_return_an_error github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ TestNewClassicClient/invalid_URL_-_should_throw_an_error … ``` ``` github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ Test_sendWithRetryFailsAfterDefinedTries github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ Test_sendWithRetryReturnContainsOriginalApiError github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ Test_sendWithRetryReturnsIfNotSuccess github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/client/dtclient ‑ Test_sendWithsendWithRetryReturnsFirstSuccessfulResponse ```

:recycle: This comment has been updated with latest results.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
4 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud