You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Organizations: ListRoots mints a new random root ID on every call, so the root has no identity #577
The root ID is generated per request and never persisted, so two ListRoots calls against the same account return two different roots. Nothing else in the plugin references a root today, which is why this is invisible — but the root ID is the target every Organizations control attaches to, so it becomes load-bearing the moment AttachPolicy, EnablePolicyType, CreateOrganizationalUnit, or ListParents exist (see #578).
An organization has exactly one root for its lifetime. The failure mode for a caller is not an error: it reads the root, attaches a policy to it, reads the root again to verify, gets a different ID, and concludes the attachment is missing. Or it walks ListParents upward looking for a terminating root ID it can never match.
Expected
ListRoots returns the same root for the lifetime of the organization. Since ensureOrganization already auto-creates on first touch and persists under org:<acct>, the natural fix is to create the root there and store it alongside — one root per organization, generated once.
Related
FeatureSet is hardcoded "ALL" at organizations_plugin.go:89. That is the right default, but it should be settable: an organization in CONSOLIDATED_BILLING mode cannot hold a service control policy at all, and a tool that has to refuse that state has no way to reach it. Likewise PolicyTypes is hardcoded to SERVICE_CONTROL_POLICY: ENABLED at :265 — the disabled case is the interesting one, because in a real organization CreatePolicy and AttachPolicy both succeed while the policy type is off and nothing is enforced. See the fixture-seeding request in the Organizations operations issue.
Activity
test(organizations): pin the store-failure and corrupt-record boundaries
feat(organizations): implement the organizational-unit tree (#578) (#608