fix(dashboards): clone on read-only PUT conflict; skip unmodified suggested presets#621
Merged
Merged
Conversation
0d2c1af to
738e426
Compare
…gested presets On a 403 with body containing "This dashboard is read-only" or "user does not have permission", fall back to POST so source content still lands on destination as a new dashboard. Unrelated 403s and other statuses propagate unchanged. Exception: when the destination is an unmodified Datadog-suggested preset (description contains "[[suggested_dashboards]]") and the sync-relevant fields match the source byte-for-byte, SkipResource is raised instead of cloning — no-op, and cloning would duplicate the preset. Divergent source still clones so customer edits are preserved.
738e426 to
6127d9b
Compare
nathantournant
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On dashboard update, a 403 Forbidden with either
"This dashboard is read-only"or"user does not have permission"means the destination copy cannot beedited in place by the sync identity. Previously the 403 propagated and
the source content was lost.
lands on destination as a new dashboard.
(
descriptioncontains[[suggested_dashboards]]) and thesync-relevant fields match the source byte-for-byte,
SkipResourceis raised instead — no-op. If any field diverges (customer forked
the preset), fall through to clone so those edits are preserved.
Test plan
tests/unit/test_dashboards.py:clone on either 403 body shape, unrelated 403 re-raised, suggested-preset
match skipped, suggested-preset divergence cloned, missing destination
state still clones, non-403 propagates.
tests/unit/suite: passes (0 regressions from this change).