Repository navigation
Conversation
Contributor
Author
|
Opened by mistake: this branch name was already taken by an older branch (3f1793f), so the PR picked up that commit instead of the intended one. Replaced by a PR from feat/nested-subgroups-v2. |
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.
Why
Groups can only be two levels deep:
gitlab_group.subgroupssetsparent_id = gitlab_group.parent_groups[each.value.parent].id, soparentmust be a top-level group. A layout such asinfra/terraform/terraform-aws-modules(a mirror per upstream GitHub org, with projects likeinfra/terraform/terraform-aws-modules/terraform-aws-vpc) can't be expressed:parent = "infra/terraform"is not a key ofparent_groupsand plan fails.What
gitlab_group.nested_subgroupsresource for groups whoseparentis a subgroup key ("<top>/<name>").parentmatches the subgroup's name, not its path.gitlab_group.subgroupsnow only takes groups whose parent has no/. No existing config has a slash inparent, so no existing address moves.local.group_idsmaps every managed group (all three levels) to its ID. All per-group resources (memberships, shares, variables, access/deploy tokens, labels, badges, boards, SAML links, push rules and others) andgitlab_project.namespace_idresolve through it instead of theparent_groups/subgroupsternaries.gitlab_groupsvalidation rejects aparentdeeper than one subgroup.nested_subgroups_group_ids.tests/nested_subgroups.tftest.hcl: subgroup stays insubgroups, nested group lands innested_subgroups, a nested group works as share target and project namespace, too-deep parent is rejected.Verification
terraform test: 11 passed, 0 failed.infra/terraformplus 7 nested groups added:9 to add, 0 to change, 0 to destroy.🤖 Generated with Claude Code