fix(downtime_schedules): request include=created_by on source fetches#628
Merged
Merged
Conversation
LIST and per-id GET now pass `include=created_by`, so the response body carries `relationships.created_by.data.id`. Without the include, the `relationships` block is omitted entirely. Per-id GET also unwraps the JSON:API envelope's `data` element so the rest of `import_resource` sees a bare resource object either way (the LIST path already unwraps via `paginated_request`).
Pre-merge review flagged that the defensive `envelope.get("data", envelope)`
form silently masks a list-shaped `data` field (would crash later inside
`resource["attributes"]` with a confusing TypeError). Peer resources
(`users.py`, `notebooks.py`, `service_level_objectives.py`) all use raw
`["data"]`, which fails loud on any unexpected shape. Match that.
michael-richey
previously approved these changes
Jul 14, 2026
michael-richey
approved these changes
Jul 14, 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
The v2 downtime API omits the
relationshipsblock on both LIST and per-id GET responses unless the caller passesinclude=created_by. Sync-cli currently doesn't pass it, so source-side state files haverelationships.created_by.data.idempty. Any consumer that keys on that field (e.g. downstream tooling that routes each resource under its creator's identity for OBO'd writes) can't determine the creator.Change
get_resources(LIST) andimport_resource(per-id GET) now passparams={"include": "created_by"}.dataelement soimport_resourcesees a bare resource object. Matches the sibling-resource convention (users.py,notebooks.py,service_level_objectives.py).Test plan
test_custom_client_trust_env.py(unrelated).