Skip to content

Fix dashboard list logging and restricted monitor filtering - #688

Merged
riyazsh merged 1 commit into
mainfrom
riyazsh/dashboard-list-logger-fix
Sep 2, 2026
Merged

Fix dashboard list logging and restricted monitor filtering#688
riyazsh merged 1 commit into
mainfrom
riyazsh/dashboard-list-logger-fix

Conversation

@riyazsh

@riyazsh riyazsh commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix the dashboard-list integration-dashboard drop log call to use only supported logger kwargs
  • Keep dropped integration dashboard IDs in the log message for operator visibility
  • Extend --skip-monitors-with-restricted-roles to filter monitors with v2 restriction_policy bindings as well as flat restricted_roles
  • Add regression coverage for dashboard-list logging and monitor restriction-policy filtering

Context

PR #683 added the correct behavior for dashboard lists: integration dashboards are not portable across orgs, so list membership should drop integration_* entries before create/update. The code path logged dropped_dashboard_ids as an extra keyword argument, but the sync-cli Log.info wrapper only accepts _id and resource_type. That caused Log.info() got an unexpected keyword argument 'dropped_dashboard_ids' before the drop could complete.

For restricted monitors, the existing skip flag only filtered the legacy flat restricted_roles field. Some monitors express access control through restriction_policy.bindings[].principals instead. With this change, the same explicit skip flag also filters those monitors so DDR runs emit an intentional filtered outcome instead of trying to create/update a monitor whose access-control principals are not ready in the destination org.

Testing

  • python -m pytest tests/unit/test_monitors.py tests/unit/test_dashboard_lists.py
  • python -m black --line-length 120 --check datadog_sync/model/monitors.py datadog_sync/commands/shared/options.py tests/unit/test_monitors.py tests/unit/test_dashboard_lists.py
  • python -m ruff --line-length 120 datadog_sync/model/monitors.py datadog_sync/commands/shared/options.py tests/unit/test_monitors.py tests/unit/test_dashboard_lists.py

Signed-off-by: riyaz.shiraguppi <riyaz.shiraguppi@datadoghq.com>
@riyazsh
riyazsh requested a review from a team as a code owner September 1, 2026 22:09
@riyazsh
riyazsh force-pushed the riyazsh/dashboard-list-logger-fix branch from efffba8 to bc10ef1 Compare September 1, 2026 22:12
@riyazsh
riyazsh force-pushed the riyazsh/dashboard-list-logger-fix branch from bc10ef1 to f4a36ce Compare September 1, 2026 23:27
@riyazsh riyazsh changed the title Fix dashboard list integration drop logging Fix dashboard list logging and restricted monitor filtering Sep 1, 2026
@riyazsh
riyazsh force-pushed the riyazsh/dashboard-list-logger-fix branch from f4a36ce to e8ba835 Compare September 1, 2026 23:33
@riyazsh
riyazsh force-pushed the riyazsh/dashboard-list-logger-fix branch from e8ba835 to b53ee4c Compare September 2, 2026 13:20
@riyazsh
riyazsh merged commit 957727d into main Sep 2, 2026
11 checks passed
@riyazsh
riyazsh deleted the riyazsh/dashboard-list-logger-fix branch September 2, 2026 13:22
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.

2 participants