feat(rum): add rum_teams_ownership_mappings resource - #722
michael-richey wants to merge 2 commits into
Conversation
michael-richey
left a comment
There was a problem hiding this comment.
Nice work on this resource.
The delete-then-recreate update strategy is well documented and correctly tested, and I agree with treating team_handle as stable/non-remapped while remapping only application_id.
No blocking issues found in this PR diff.
28865fd to
b8c2f84
Compare
11b0454 to
ed4224c
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The update path can become unrecoverable after deletion succeeds but recreation fails.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds synchronization support for RUM team ownership mappings, including application ID remapping and delete/recreate updates.
Changes:
- Adds and registers the new resource model.
- Documents dependencies and supported-resource status.
- Adds unit coverage for CRUD and connection behavior.
| File | Description |
|---|---|
datadog_sync/model/rum_teams_ownership_mappings.py |
Implements synchronization behavior. |
datadog_sync/models/__init__.py |
Registers the resource model. |
tests/unit/test_rum_teams_ownership_mappings.py |
Tests model operations and ID remapping. |
README.md |
Documents support and dependencies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| async def update_resource(self, _id: str, resource: Dict) -> Tuple[str, Dict]: | ||
| # No PATCH endpoint -- implement update as delete-then-recreate. | ||
| await self.delete_resource(_id) |
b8c2f84 to
3b6faa3
Compare
ed4224c to
a6f1bb1
Compare
3b6faa3 to
dc95b0a
Compare
a6f1bb1 to
6a6c262
Compare
|
Fixed in |
dc95b0a to
054e500
Compare
6a6c262 to
b93a496
Compare
054e500 to
522f1b3
Compare
b93a496 to
a20e489
Compare
522f1b3 to
75e0a6d
Compare
a20e489 to
8dba3ab
Compare
75e0a6d to
b6fd215
Compare
8dba3ab to
120de49
Compare
b6fd215 to
810563c
Compare
120de49 to
f74aaf7
Compare
810563c to
93a11e6
Compare
f74aaf7 to
c87118c
Compare
93a11e6 to
aa90fd0
Compare
c87118c to
9906780
Compare
aa90fd0 to
f332f2b
Compare
9906780 to
486b57c
Compare
RUM teams-ownership mappings have no PATCH endpoint, so update is implemented as delete-then-recreate. attributes.application_id is a RUM application uuid remapped via resource_connections. attributes.team_handle is a stable handle (teams are mapped by name:handle and the handle is preserved across orgs), so it is NOT remapped -- the dependency on teams is soft (documented) rather than a resource_connection (which would mis-remap a handle as a uuid). - datadog_sync/model/rum_teams_ownership_mappings.py (new) - datadog_sync/models/__init__.py -- register - tests/unit/test_rum_teams_ownership_mappings.py (new) -- 7 unit tests - README.md -- add rum_teams_ownership_mappings (depends on rum_applications, teams) Integration tests + VCR cassettes deferred (require sandbox-org API access).
…s update Per review: update_resource called delete_resource directly, which left the old destination ID in persisted state if DELETE succeeded but POST failed. Every retry then DELETEed that stale ID, failed with 404, and never reached POST. Now uses _delete_resource (the state-aware wrapper) which removes the state entry after a successful delete and tolerates an already-missing destination, so the next retry recovers via the create path. New test verifies state is cleaned up when DELETE succeeds but POST fails.
f332f2b to
3ea7963
Compare
486b57c to
41e8074
Compare
|
Good implementation for this API shape. What I liked:
No blocking issues from my side. |

Summary
RUM teams-ownership mappings — no PATCH endpoint, so update is implemented as delete-then-recreate.
Stacked on #721 (
rum_replay_playlists).Design
attributes.application_idis a RUM application uuid → remapped viaresource_connections(rum_applications).attributes.team_handleis a stable handle (teams are mapped byname:handleand the handle is preserved across orgs), so it is not remapped. The dependency onteamsis soft (documented in README) rather than aresource_connection, which would mis-remap a handle as a uuid.id(server-assigned, popped); update = delete old destination mapping + POST new.excluded_attributes:id+ server-managedcreated_at/created_by/org_id.Changes
datadog_sync/model/rum_teams_ownership_mappings.py(new)datadog_sync/models/__init__.py— registertests/unit/test_rum_teams_ownership_mappings.py(new) — 7 unit testsREADME.md— addrum_teams_ownership_mappings(depends onrum_applications,teams)Testing
pytest tests/unit/test_rum_teams_ownership_mappings.py→ 7 passedFollow-up
Integration tests + VCR cassettes deferred (require sandbox-org API access).