fix: make bytebase_group.members optional and release 3.17.3#193
Merged
d-bytebase merged 2 commits intomainfrom Apr 21, 2026
Merged
fix: make bytebase_group.members optional and release 3.17.3#193d-bytebase merged 2 commits intomainfrom
d-bytebase merged 2 commits intomainfrom
Conversation
The terraform-plugin-sdk/v2 core schema auto-injects MinItems=1 whenever a nested block is Required with MinItems=0 (core_schema.go:211-214), so removing the literal MinItems:1 in #191 was not enough to allow an empty members block — Terraform core still rejects the config with "Insufficient members blocks" before any RPC reaches the server. Flip members to Optional so the SDK does not reinject the constraint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Step 3 of TestAccGroup_InvalidInput asserted that a bytebase_group with no members block produces a validation error. That is exactly the behavior this change (and #191) removes, so the step now fails with "expected an error but got none". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
vsai12
approved these changes
Apr 21, 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
bytebase_group.membersfromRequired: truetoOptional: trueso the terraform-plugin-sdk/v2 core schema does not auto-injectMinItems=1on registrationBackground
#191 (3.17.2) removed the literal
MinItems: 1and the runtime "at least 1 owner" guard, but a customer reported the plan still fails with:Root cause is in the SDK at
helper/schema/core_schema.go:211-214:When a nested block is
Required: truewithMinItemsunset, the SDK synthesizesMinItems = 1on the configschema that Terraform core uses for validation — this runs before any provider code executes, so the runtime guard removal in #191 never gets a chance. Conversely, the same function clearsMinItemswhenOptional: trueis set (lines 216-222), soOptionalis the documented escape hatch.The nested
member/roleattributes stayRequired: true— those only apply when amembersblock is present, which is the desired behavior.The runtime path already handles an empty set:
convertToMemberListtype-assertsd.Get("members").(*schema.Set), which returns a non-nil empty set when the block is omitted, so iteration just yields no members.Test plan
terraform planagainst abytebase_groupresource with nomembersblock succeedsterraform planagainst abytebase_groupresource with populatedmembersstill works as beforememberscontinues to round-trip throughterraform refresh🤖 Generated with Claude Code