fix(synthetics_tests): remap mobile test principals under options.bindings - #658
Merged
michael-richey merged 1 commit intoAug 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes principal remapping for synthetics_tests by updating the access-control path from a non-existent top-level restriction_policy.bindings to the correct options.bindings shape used by real Synthetics Test resources, preventing stale source-org principals from causing destination API rejections.
Changes:
- Update
synthetics_testsprincipal-connection/remapping logic to read/writeoptions.bindings.principalsinstead ofrestriction_policy.bindings.principals. - Adjust
pre_apply_hookpolicy detection to trigger org-principal fetching based on presence ofoptions.bindings. - Update and extend unit tests to reflect the real resource shape (no
restriction_policy,options.restricted_rolesandoptions.bindingscoexisting).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| datadog_sync/model/synthetics_tests.py | Switches all principal binding paths and policy detection to options.bindings for correct remapping and drop-aware connection behavior. |
| tests/unit/test_synthetics_tests.py | Updates fixtures/assertions to options.bindings and adds regressions for real-world shapes without restriction_policy. |
Suppressed comments (1)
tests/unit/test_synthetics_tests.py:337
- These test docstrings still refer to
restriction_policy, butpre_apply_hooknow keys offoptions.bindings. Updating the description will keep the tests aligned with the real synthetics_tests shape.
def test_pre_apply_hook_sets_org_principal_on_success(self):
"""Source carries a restriction_policy → GET fires → org_principal set."""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Mobile synthetic tests store access-control bindings under options.bindings. Update principal discovery and remapping to use that documented shape so organization, user, role, and team principals resolve before the destination request.
michael-richey
force-pushed
the
michael.richey/fix-synthetics-tests-options-bindings
branch
from
August 5, 2026 15:41
12d69b2 to
53c0404
Compare
michael-richey
marked this pull request as draft
August 5, 2026 15:41
michael-richey
marked this pull request as ready for review
August 5, 2026 15:44
heyronhay
approved these changes
Aug 5, 2026
michael-richey
deleted the
michael.richey/fix-synthetics-tests-options-bindings
branch
August 5, 2026 16:01
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
options.bindings.restriction_policy.bindings, so organization, user, role, and team principals were not resolved before destination requests.options.bindings, alongside the existingoptions.restricted_roleshandling.Test plan
options.bindingsandoptions.restricted_rolescoexisting without a top-levelrestriction_policykey.pytest tests/unit/test_synthetics_tests.py-- 37 passed.tox -e py311 -- tests/unit -q-- 1103 passed, 8 skipped.