feat(rum): add rum_config resource (singleton) - #723
michael-richey wants to merge 3 commits into
Conversation
michael-richey
left a comment
There was a problem hiding this comment.
Good singleton modeling overall, and tests clearly cover create-vs-update delegation plus payload minimization.
One reliability concern worth tightening:
_existing_destination()catches broadExceptionand treats all failures as "singleton absent".- On transient/network/auth errors, this can incorrectly fall through to POST and produce misleading failures.
Recommendation: catch CustomClientHTTPError and only suppress 404 (or equivalent not-found), re-raising everything else.
No other blockers in this diff.
e1b613c to
9906fd9
Compare
11b0454 to
ed4224c
Compare
|
Good catch — fixed in |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The existence check incorrectly treats non-HTTP failures as confirmation that the singleton is absent.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds synchronization support for the organization-level RUM configuration singleton.
Changes:
- Registers and documents the
rum_configresource. - Implements singleton retrieval, creation, update, and no-op deletion.
- Adds unit coverage for its lifecycle behavior.
| File | Description |
|---|---|
datadog_sync/model/rum_config.py |
Implements the RUM configuration model. |
datadog_sync/models/__init__.py |
Registers the new resource. |
tests/unit/test_rum_config.py |
Tests singleton synchronization behavior. |
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.
ed4224c to
a6f1bb1
Compare
9906fd9 to
11e9493
Compare
|
Fixed in |
a6f1bb1 to
6a6c262
Compare
11e9493 to
3b15fa3
Compare
6a6c262 to
b93a496
Compare
3b15fa3 to
a96af0f
Compare
b93a496 to
a20e489
Compare
a96af0f to
39a3adb
Compare
a20e489 to
8dba3ab
Compare
39a3adb to
a183917
Compare
8dba3ab to
120de49
Compare
a183917 to
db198e5
Compare
120de49 to
f74aaf7
Compare
db198e5 to
3ab658b
Compare
f74aaf7 to
c87118c
Compare
3ab658b to
65d39cd
Compare
c87118c to
9906780
Compare
65d39cd to
2d94958
Compare
9906780 to
486b57c
Compare
2d94958 to
ac43644
Compare
RUM config is a singleton org setting (no DELETE, no per-id path). Only enforced_application_tags is configurable; all other attributes are server-managed and excluded from diffs. create_resource checks whether the destination singleton already exists and delegates to update_resource if so (mirroring logs_archives_order); delete_resource is a no-op. - datadog_sync/model/rum_config.py (new) - datadog_sync/models/__init__.py -- register - tests/unit/test_rum_config.py (new) -- 6 unit tests - README.md -- add rum_config (no dependencies) Integration tests + VCR cassettes deferred (require sandbox-org API access).
Per review: _existing_destination() caught broad Exception and treated all failures as 'singleton absent'. On transient/network/auth errors, this incorrectly fell through to POST and produced misleading failures. Fix: catch CustomClientHTTPError and only suppress 404 (not found), re-raising everything else. A broad Exception fallback is kept for non-HTTP errors (e.g. JSON decode) but HTTP errors now propagate correctly.
Per review: the broad except Exception fallback in _existing_destination() converted timeouts, connection failures, and malformed responses into 'absent', causing create_resource to proceed with a POST after an inconclusive GET. Now only CustomClientHTTPError 404 is suppressed; all other exceptions propagate.
486b57c to
41e8074
Compare
ac43644 to
1cab88e
Compare
|
Nice work — singleton semantics are handled cleanly. Highlights:
No blocking concerns from me. |

Summary
RUM config — singleton org setting (no DELETE, no per-id path). Only
enforced_application_tagsis configurable; all other attributes are server-managed and excluded from diffs.Stacked on #722 (
rum_teams_ownership_mappings).Design
get_resourcesreturns a single-element list fromGET /rum/config;import_resourcekeys it by a fixedrum-configid.create_resourcechecks whether the destination singleton already exists (GET); if so, hydratesstate.destinationand delegates toupdate_resource(mirrorslogs_archives_order); otherwise POSTs.update_resourcePATCHes/rum/configwith onlyenforced_application_tags.delete_resourceis a no-op (no DELETE endpoint).concurrent=False(singleton).excluded_attributes:id+ all server-managed read-only attrs; onlyenforced_application_tagsparticipates in diffs.Changes
datadog_sync/model/rum_config.py(new)datadog_sync/models/__init__.py— registertests/unit/test_rum_config.py(new) — 6 unit testsREADME.md— addrum_config(no dependencies)Testing
pytest tests/unit/test_rum_config.py→ 6 passedFollow-up
Integration tests + VCR cassettes deferred (require sandbox-org API access).