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

fix: Correctly compare extension versions #1597

Closed arthurpitman closed 1 month ago

arthurpitman commented 1 month ago

This PR fixes an issue where 1.9 was considered greater than 1.10 when comparing extension versions. Rather than using a string compare, the existing Version struct from the version package is used. This was, however, generalized to accept 1, i.e. just a major version, as a valid version, due to existing test cases.

github-actions[bot] commented 1 month ago

Unit Test Results

1 889 tests  +8   1 888 :white_check_mark: +8   1m 55s :stopwatch: -3s   133 suites ±0       1 :zzz: ±0      1 files   ±0       0 :x: ±0 

Results for commit fd6ddc6f. ± Comparison against base commit 28703091.

This pull request removes 13 and adds 21 tests. Note that renamed tests count towards both. ``` github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1.) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1.2.236.0.20220203-192004) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1.236.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1.5) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1313.236.5) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(2.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(2.234.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(236.0.20220203-192004) … ``` ``` github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1.) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1.2.236.0.20220203-192004) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1.236.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1.5) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1313.236.5) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(2.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(2.234.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(236.0.20220203-192004) … ```

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

github-actions[bot] commented 1 month ago

E2E Test Results

    4 files  ±0    268 suites  ±0   26m 28s :stopwatch: - 13m 20s 2 001 tests +8  1 999 :white_check_mark: +8  2 :zzz: ±0  0 :x: ±0  2 116 runs  +8  2 114 :white_check_mark: +8  2 :zzz: ±0  0 :x: ±0 

Results for commit 7ae60e01. ± Comparison against base commit 28703091.

This pull request removes 13 and adds 21 tests. Note that renamed tests count towards both. ``` github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1.) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1.2.236.0.20220203-192004) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1.236.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1.5) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(1313.236.5) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(2.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(2.234.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_parseDynatraceVersion/parseVersion(236.0.20220203-192004) … ``` ``` github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1.) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1.2.236.0.20220203-192004) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1.236.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1.5) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(1313.236.5) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(2.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(2.234.0) github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/version ‑ Test_ParseVersion/parseVersion(236.0.20220203-192004) … ```
sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 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