Repository navigation
fix(fast): drop the size() guard from delegated grant conditions - #358
Merged
Calvin-Cheng1 merged 1 commit intoOct 26, 2026
Merged
Conversation
The IAM condition language has no size() function, so IAM rejects every binding whose condition calls it, and the first Stage 0 apply fails on the delegated grant bindings. hasOnly() alone already returns false when a call modifies a role outside the list. - Remove the guard from the Stage 0 and Stage 3 delegated grant conditions. - Replace the test that required the guard with one that rejects any size() call and checks that the conditions still use hasOnly().
Calvin-Cheng1
approved these changes
Oct 26, 2026
Merged
11 of 19 tasks
15 of 26 tasks
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.
Description
Let the first Stage 0 apply create the delegated role grant bindings again, which every deployment from
maincurrently fails on.#274 added an
api.getAttribute('iam.googleapis.com/modifiedGrantsByRole', []).size() > 0guard to the delegated grant conditions. The IAM condition language has nosize()function, so IAM rejects each of these bindings withundeclared reference to 'size'.hasOnly()call alone already returns false when a request modifies a role outside the list, because that role then appears in the attribute.getIamPolicycall, and Google documents thathasOnly()returns true for an empty list.fast/stages-aw/0-bootstrap/automation.tf,fast/stages-aw/0-bootstrap/organization.tf, andfast/stages-aw/3-security/main.tf.test_delegated_iam_conditions_guard_empty_grant_listtest intests/test_bootstrap_logging_order.pyrequired the guard, so the change removes it.tests/test_iam_conditions.pytest rejects anysize()call on that attribute and checks that the three files still limit the roles withhasOnly().No GitHub issue exists for this change. The
stellarCLI work in #306 found it during a lab Stage 0 apply.Type of Change
Deployment & Compliance Impact
hasOnly()call still limits the roles that the automation service accounts can grant.Checklist
Code Quality & Reusability
modules/orfast/stages-aw/can be leveraged for this change.docs/naming-convention.md.Documentation
README.mdof the modified module or blueprint.Security
Testing
Testing Performed
mainfailed on theorganization_iam_admin_conditionalorganization binding and thedelegated_grants_resmanproject binding withundeclared reference to 'size'.terraform init -backend=falseandterraform validatepass for thefast/stages-aw/0-bootstrap/stage.terraform validatepasses for thefast/stages-aw/3-security/stage with a temporary provider file for thegoogle.billingalias, which Stage 0 normally generates.terraform fmt -checkpasses for both stages.uv run --locked pytestin the repository root passes 108 tests.main.