Skip to content

Generated changes to set dashboard uid#157

Draft
afcollins wants to merge 3 commits intocloud-bulldozer:masterfrom
afcollins:db-uid
Draft

Generated changes to set dashboard uid#157
afcollins wants to merge 3 commits intocloud-bulldozer:masterfrom
afcollins:db-uid

Conversation

@afcollins
Copy link
Member

Type of change

  • Bug fix

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

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please describe the System Under Test.

OpenShift Local with montioring enabled.

  • Please provide detailed steps to perform tests related to this code change.

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.

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
@afcollins afcollins requested a review from vishnuchalla March 13, 2026 17:00
@@ -0,0 +1,145 @@
import hashlib
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you planning to setup unit-tests? If yes we need a way to run and verify this and also in the CI.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@afcollins afcollins marked this pull request as draft March 20, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard UIDs change after dittybopper restarts

2 participants