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

Avoid using whitespaces as IDs for Monaco coordinates #1517

Closed warber closed 4 months ago

warber commented 4 months ago

For some configuration types Monaco uses e.g. "names" as ID field in coordinates. These names can naturally contain whitespaces which are then part of monaco coordinates. While it is not a problem "per se" it introduces difficulties for tools that are processing coordinates, e.g. Upgrade Assistant. Further, it seems cleaner to not use whitespaces in identifiers.

This, PR introduces logic to sanitize the values used as IDs inside coordinates after they are downloaded.

sonarcloud[bot] commented 4 months 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

github-actions[bot] commented 4 months ago

Unit Test Results

1 876 tests  +1   1 876 :white_check_mark: +1   27s :stopwatch: -1s   133 suites ±0       0 :zzz: ±0      1 files   ±0       0 :x: ±0 

Results for commit 11ff8e43. ± Comparison against base commit bcbbac95.

github-actions[bot] commented 4 months ago

E2E Test Results

    4 files  ±0    268 suites  ±0   20m 53s :stopwatch: - 3m 14s 1 986 tests +1  1 985 :white_check_mark: +1  1 :zzz: ±0  0 :x: ±0  2 077 runs  +1  2 076 :white_check_mark: +1  1 :zzz: ±0  0 :x: ±0 

Results for commit 11ff8e43. ± Comparison against base commit bcbbac95.

warber commented 4 months ago

Since e.g. key user actions with "MY KUA" and "MYKUA", will effectively result in the same sanitized ID, this is is not a good enough solution. Maybe a better approach would be to use something like base64 encoding for the IDs - with the side effect that IDs of downloaded configs wouldn't give the user a hint about the actual config items anymore.

warber commented 4 months ago

Won't do at the moment. If this is still necessary, the idea would be to introduce a FF to let monaco generate uuids during download and use this as the id for the coordinate.