Generated changes to set dashboard uid#157
Generated changes to set dashboard uid#157afcollins wants to merge 3 commits intocloud-bulldozer:masterfrom
Conversation
Signed-off-by: Andrew Collins <ancollin@redhat.com>
Tests cover generate_deterministic_uid directly and its usage inside create_dashboards via mocked HTTP calls. Made-with: Cursor
| @@ -0,0 +1,145 @@ | |||
| import hashlib | |||
There was a problem hiding this comment.
are you planning to setup unit-tests? If yes we need a way to run and verify this and also in the CI.
There was a problem hiding this comment.
Now I am unsure. If I remove the test file, does that mean we don't need to add to CI? ;)
Seriously though, I see the dashboard building experience has since changed with grafana-foundation-sdk and a go-native way, so now I want to migrate to this instead, which would remove this entrypoint entirely.
What do you think?
There was a problem hiding this comment.
I probably won't set up unit tests for the python script. So we can add or remove this file, but we should update the UID in the mean time.
I have another PR coming for the go sdk which will replace all python, so it's lifetime here is limited if we like that newer approach.
Type of change
Description
Dashboards currently generate a unique UID everytime the dashboards are synced, which happens after pod restarts as well. This can be annoying on long-running clusters where dashboards cannot be bookmarked.
Instead, generate a hash value using the dashboard name for the UID.
Related Tickets & Documents
Checklist before requesting a review
Testing
OpenShift Local with montioring enabled.
Rebuild syncer image. Deploy dittybopper using built syncer image. Review log output for UIDs. Delete dittybopper pod so syncer restarts. Compare UIDs to previous run to ensure they did not change.