Skip to content

Commit a5a9103

Browse files
d-bytebaseclaude
andauthored
chore: remove deprecated roles LAST_APPROVER and CREATOR (#152)
Remove the deprecated "roles/LAST_APPROVER" and "roles/CREATOR" options from: - Rollout policy configurations in examples and tutorials - Provider schema validation and constants - Resource policy handling logic These roles have been deprecated and should no longer be used. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]>
1 parent c017262 commit a5a9103

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

examples/setup/environment.tf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ resource "bytebase_policy" "rollout_policy" {
4646
automatic = true
4747
roles = [
4848
"roles/workspaceAdmin",
49-
"roles/projectOwner",
50-
"roles/LAST_APPROVER",
51-
"roles/CREATOR"
49+
"roles/projectOwner"
5250
]
5351
}
5452
}

provider/data_source_policy.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,6 @@ func getDataSourceQueryPolicySchema(computed bool) *schema.Schema {
320320
}
321321
}
322322

323-
const (
324-
issueLastApproverRole = "roles/LAST_APPROVER"
325-
issueCreatorRole = "roles/CREATOR"
326-
)
327-
328323
func getRolloutPolicySchema(computed bool) *schema.Schema {
329324
return &schema.Schema{
330325
Computed: computed,
@@ -348,10 +343,8 @@ func getRolloutPolicySchema(computed bool) *schema.Schema {
348343
Description: "If any roles are specified, Bytebase requires users with those roles to manually roll out the change.",
349344
Elem: &schema.Schema{
350345
Type: schema.TypeString,
351-
Description: fmt.Sprintf(`Role full name in roles/{id} format. You can also use the "%s" for the last approver of the issue, or "%s" for the creator of the issue.`, issueLastApproverRole, issueCreatorRole),
346+
Description: `Role full name in roles/{id} format.`,
352347
ValidateDiagFunc: internal.ResourceNameValidation(
353-
fmt.Sprintf("^%s$", issueLastApproverRole),
354-
fmt.Sprintf("^%s$", issueCreatorRole),
355348
fmt.Sprintf("^%s", internal.RoleNamePrefix),
356349
),
357350
},

provider/resource_policy.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,11 +496,7 @@ func convertToRolloutPolicy(d *schema.ResourceData) (*v1pb.RolloutPolicy, error)
496496

497497
for _, rawRole := range roles.List() {
498498
role := rawRole.(string)
499-
if role == issueLastApproverRole || role == issueCreatorRole {
500-
policy.IssueRoles = append(policy.IssueRoles, role)
501-
} else {
502-
policy.Roles = append(policy.Roles, role)
503-
}
499+
policy.Roles = append(policy.Roles, role)
504500
}
505501

506502
return policy, nil

tutorials/1-2-env-policy-rollout.tf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ resource "bytebase_policy" "rollout_policy_test" {
77
automatic = true
88
roles = [
99
"roles/workspaceAdmin",
10-
"roles/projectOwner",
11-
"roles/LAST_APPROVER",
12-
"roles/CREATOR"
10+
"roles/projectOwner"
1311
]
1412
}
1513
}
@@ -23,9 +21,7 @@ resource "bytebase_policy" "rollout_policy_prod" {
2321
automatic = false
2422
roles = [
2523
"roles/workspaceAdmin",
26-
"roles/projectOwner",
27-
"roles/LAST_APPROVER",
28-
"roles/CREATOR"
24+
"roles/projectOwner"
2925
]
3026
}
3127
}

0 commit comments

Comments
 (0)