Repository navigation
feat(dashboards): upsert dashboards by the dash0.com/origin label - #401
nicolastakashi wants to merge 4 commits into
Conversation
v1.34.0 splits profiles.Configuration into the stored schema and a ResolvedConfiguration that is read through methods. Only a Store builds one, so tests now get theirs from testutil.ResolvedConfiguration. The profile lookup no longer refreshes the OAuth token. The client now asks the token provider once when it is built, so a rejected refresh token still fails with the "run dash0 login" hint.
apply, diff, create, update -f, and --since read a dashboard's key from dash0.com/origin, then metadata.dash0Extensions.id, then dash0.com/id. A dashboard kept as a Kubernetes custom resource loses dash0Extensions, so it used to become a new dashboard on every apply. An exported file carries the server UUID in dash0.com/id and now updates the dashboard it came from. A file whose origin and dash0Extensions.id differ fails validation before anything is written. Fixes #380
|
When the dash0.com/origin of a dashboard is not found and the file also carries the dash0.com/id label, apply updates the dashboard at that id, which then gets the origin. apply --since treats the id as the same dashboard, so it does not delete it. The validation error for a mismatched origin and dash0Extensions.id now tells the user to move the id to the dash0.com/id label. Also sync the agent skill with the new dashboard keys, list the behavior changes in the changelog entry, and add tests for create, for a second apply with no changes, and for restoring a deleted dashboard by origin. Refs #380
|
Update after the Darkplane run on 32a4d8b. fdc1fde addresses most of it:
Still needed before this leaves draft:
|
Fixes #380
Kubernetes drops unknown
metadatafields, so aDashboardkept as a custom resource lostdash0Extensions.id, and every apply created a new dashboard.The CLI now reads the key from
dash0.com/origin, thendash0Extensions.id, thendash0.com/id, the same way in apply, diff, create,update -f, andapply --since.dash0.com/originupdates the same dashboard on every apply.dash0Extensions.idworks as before.dash0.com/id, the server UUID fromdashboards get -o yaml, updates that dashboard instead of creating a second one.dash0Extensions.iddiffer fails validation before any write.apply --sincedoes not report a deletion when a file moves the same value fromdash0Extensions.idtodash0.com/origin.The client's
GetIDreadsdash0.com/idbeforedash0Extensions.id, soasset.DashboardKeyssets the order the issue asks for, and every reader goes through it.This needs dash0-api-client-go v1.34.0, which also changes the
profilespackage, so the first commit migrates toResolvedConfiguration.v1.34.0 no longer refreshes the OAuth token during profile lookup, so the client now asks the token provider once when it is built, which keeps the
dash0 loginhint for a rejected refresh token.For #376:
dashboards previewshould derive each preview id fromasset.DashboardKey, andEphemeralDashboardshould go through the same key andasset.ValidateDashboard.Follow-up: login and logout still write the OAuth token to
Configuration.AuthToken. v1.34.0 keeps it in sync withOAuthState.AccessToken, and the next client-go release won't.Tests:
make lint && make test(unit, integration, e2e) pass. I did not run the roundtrip tests. Each new test fails with the feature files reverted.TestUpdateDashboard_WithOriginFromFileis the exception, because the v1.34.0 bump alone already routesupdate -fby origin.