Skip to content

fix: exclude reserved Datadog built-in roles from all sync operations#537

Closed
michael-richey wants to merge 1 commit intomainfrom
mrichey/exclude-reserved-role-names
Closed

fix: exclude reserved Datadog built-in roles from all sync operations#537
michael-richey wants to merge 1 commit intomainfrom
mrichey/exclude-reserved-role-names

Conversation

@michael-richey
Copy link
Copy Markdown
Collaborator

@michael-richey michael-richey commented Apr 20, 2026

Summary

  • Adds BUILTIN_ROLE_NAMES constant (Datadog Admin Role, Datadog Read Only Role, Datadog Standard Role) to roles.py
  • Overrides filter() to skip these roles at import and sync time
  • Guards delete_resource() to raise SkipResource at cleanup time

Problem

The three built-in Datadog roles are reserved and managed by Datadog — the API returns 400 when trying to create/update them and will refuse deletion. Previously sync-cli would fail with 400/403 errors when these roles appeared in source state.

Test plan

  • import no longer pulls in built-in roles
  • sync skips built-in roles from source state
  • sync --cleanup=force does not attempt to delete built-in roles from destination

🤖 Generated with Claude Code

…tions

The three built-in Datadog roles (Admin, Read Only, Standard) are reserved
and cannot be created, updated, or deleted via the API. Previously, sync
would fail with 400 errors when encountering these roles. Now they are
silently skipped at import, sync, and cleanup time.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@michael-richey
Copy link
Copy Markdown
Collaborator Author

Superseded by commit 25a1592 on PR #533, which applies this fix onto the tier 2 migrations branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant