Skip to content

Commit fb0f14a

Browse files
d-bytebaseclaude
andauthored
fix: make bytebase_group.members optional and release 3.17.3 (#193)
* fix: make bytebase_group.members optional and release 3.17.3 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> * test: drop stale "no members" error expectation 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> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6b94d65 commit fb0f14a

4 files changed

Lines changed: 3 additions & 14 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.17.2
1+
3.17.3

provider/resource_group.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func resourceGroup() *schema.Resource {
5656
},
5757
"members": {
5858
Type: schema.TypeSet,
59-
Required: true,
59+
Optional: true,
6060
Description: "The members in the group.",
6161
Elem: &schema.Resource{
6262
Schema: map[string]*schema.Schema{

provider/resource_group_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,17 +259,6 @@ resource "bytebase_group" "%s" {
259259
`, identifier, identifier, identifier),
260260
ExpectError: regexp.MustCompile(`expected "title" to not be an empty string`),
261261
},
262-
// No members
263-
{
264-
Config: fmt.Sprintf(`
265-
resource "bytebase_group" "%s" {
266-
email = "group@example.com"
267-
title = "Test Group"
268-
description = "Description"
269-
}
270-
`, identifier),
271-
ExpectError: regexp.MustCompile(`(expected members to have at least|At least 1 "members" blocks are required|Missing required argument)`),
272-
},
273262
// Invalid member format
274263
{
275264
Config: fmt.Sprintf(`

tutorials/0-provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
bytebase = {
4-
version = "3.17.2"
4+
version = "3.17.3"
55
# For local development, please use "terraform.local/bytebase/bytebase" instead
66
source = "registry.terraform.io/bytebase/bytebase"
77
}

0 commit comments

Comments
 (0)