feat(restriction_policies): opt-in prefetched bodies via --restriction-policies-bulk-source#589
Open
riyazsh wants to merge 1 commit into
Open
feat(restriction_policies): opt-in prefetched bodies via --restriction-policies-bulk-source#589riyazsh wants to merge 1 commit into
riyazsh wants to merge 1 commit into
Conversation
…n-policies-bulk-source When set, restriction_policies import reads bodies from a prefetched JSON file and skips per-ID GETs. Default unset preserves existing behavior. File entries are validated against the per-ID GET response body shape. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
heyronhay
approved these changes
Jun 5, 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
Adds an opt-in
--restriction-policies-bulk-source <path>flag toimport. When set, therestriction_policiesmodel reads prefetched per-ID GET response bodies from a JSON file on disk and skips the per-IDGET /api/v2/restriction_policy/<id>pass. Default unset preserves existing behavior.Intended for callers that have already fetched policies in bulk and want to skip the per-ID GET fan-out.
File shape
JSON array of unwrapped per-ID GET response bodies. Each entry must have:
id: non-empty string of the form<type>:<resource-id>, withtypein{dashboard, notebook, slo}(the set enumerated by the legacy path and remapped byconnect_id)type:"restriction_policy"attributes.bindings: array (may be empty — SkipResource is applied identically to the live per-ID GET path)Entries are validated at load time; producer-bug shapes (wrong type, malformed id, duplicate id, etc.) are rejected with an actionable error before any HTTP calls fire.
Filter behavior note
When
--restriction-policies-bulk-sourceis set,restriction_policiesfilters are evaluated against the prefetched full bodies. This can differ from legacy discovery for filters onattributes.*because the legacy LIST-derived stubs only containid.Test plan
attributesis present withoutbindings.