Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.1
3.11.2
2 changes: 1 addition & 1 deletion docs/data-sources/risk.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The risk data source.
- `active` (Boolean) The risk active.
- `condition` (String) The risk condition.
- `id` (String) The ID of this resource.
- `level` (Number) The risk level.
- `level` (String) The risk level.
- `source` (String) The risk source.
- `title` (String) The risk title.

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/risk_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Read-Only:

- `active` (Boolean)
- `condition` (String)
- `level` (Number)
- `level` (String)
- `name` (String)
- `source` (String)
- `title` (String)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/setting.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ Read-Only:
Read-Only:

- `description` (String)
- `id` (String)
- `roles` (List of String)
- `title` (String)

Expand Down
1 change: 1 addition & 0 deletions docs/resources/setting.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Optional:

Required:

- `id` (String) The approval template ID. Built-in templates use 'bb.*' prefix (e.g., 'bb.project-owner', 'bb.workspace-dba'), custom templates use UUIDs.
- `roles` (List of String) The role require to review in this step
- `title` (String)

Expand Down
1 change: 1 addition & 0 deletions examples/setup/approval_flow.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "bytebase_setting" "approval_flow" {
approval_flow {
rules {
flow {
id = "bb.project-owner-workspace-dba-workspace-admin"
title = "Project Owner -> DBA -> Admin"
description = "Need DBA and workspace admin approval"

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.24.4
toolchain go1.24.5

require (
buf.build/gen/go/bytebase/bytebase/connectrpc/go v1.19.1-20251010051414-0534aa930702.1
buf.build/gen/go/bytebase/bytebase/protocolbuffers/go v1.36.10-20251010051414-0534aa930702.1
buf.build/gen/go/bytebase/bytebase/connectrpc/go v1.19.1-20251010220308-691f96ff880a.1
buf.build/gen/go/bytebase/bytebase/protocolbuffers/go v1.36.10-20251010220308-691f96ff880a.1
connectrpc.com/connect v1.19.1
github.com/hashicorp/go-cty v1.5.0
github.com/hashicorp/terraform-plugin-docs v0.13.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buf.build/gen/go/bytebase/bytebase/connectrpc/go v1.19.1-20251010051414-0534aa930702.1 h1:T4v2vd8e4RkC6ccfOdsvmDZ7YnW2YyAT6OFMdwcPgOA=
buf.build/gen/go/bytebase/bytebase/connectrpc/go v1.19.1-20251010051414-0534aa930702.1/go.mod h1:A57O99YuSmuL9rUI39AMITcbFfJc6Ikv48Qb6Y2EgCw=
buf.build/gen/go/bytebase/bytebase/protocolbuffers/go v1.36.10-20251010051414-0534aa930702.1 h1:5bZgEFfHz4kUG6fkHH9wmBG3dxyaA5rKpaprSP0csTo=
buf.build/gen/go/bytebase/bytebase/protocolbuffers/go v1.36.10-20251010051414-0534aa930702.1/go.mod h1:hCjM3DsxzHQGb3QEnCNYrln9ZgB16AZLOVfRJZRKC0E=
buf.build/gen/go/bytebase/bytebase/connectrpc/go v1.19.1-20251010220308-691f96ff880a.1 h1:lHkgDYgiCUVEYxeBhBfwe53D90a/jr1kJskRHSls/WQ=
buf.build/gen/go/bytebase/bytebase/connectrpc/go v1.19.1-20251010220308-691f96ff880a.1/go.mod h1:MQOZqauUrfWO1ApLaYR4F9cjujYikybwynvA3e0og5I=
buf.build/gen/go/bytebase/bytebase/protocolbuffers/go v1.36.10-20251010220308-691f96ff880a.1 h1:l7ZT3ubbTddSaTBPfgGntWuhQgX/CMGGwxMRrYa6pr8=
buf.build/gen/go/bytebase/bytebase/protocolbuffers/go v1.36.10-20251010220308-691f96ff880a.1/go.mod h1:hCjM3DsxzHQGb3QEnCNYrln9ZgB16AZLOVfRJZRKC0E=
connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14=
connectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
Expand Down
7 changes: 7 additions & 0 deletions provider/data_source_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,12 @@ func getWorkspaceApprovalSetting(computed bool) *schema.Schema {
Type: schema.TypeList,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringIsNotEmpty,
Description: "The approval template ID. Built-in templates use 'bb.*' prefix (e.g., 'bb.project-owner', 'bb.workspace-dba'), custom templates use UUIDs.",
},
"title": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -733,6 +739,7 @@ func flattenWorkspaceApprovalSetting(ctx context.Context, client api.Client, set
"conditions": conditionList,
"flow": []interface{}{
map[string]interface{}{
"id": rule.Template.Id,
"title": rule.Template.Title,
"description": rule.Template.Description,
"roles": roleList,
Expand Down
1 change: 1 addition & 0 deletions provider/resource_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ func convertToV1ApprovalSetting(d *schema.ResourceData) (*v1pb.WorkspaceApproval
rawFlow := flowList[0].(map[string]interface{})
approvalRule := &v1pb.WorkspaceApprovalSetting_Rule{
Template: &v1pb.ApprovalTemplate{
Id: rawFlow["id"].(string),
Title: rawFlow["title"].(string),
Description: rawFlow["description"].(string),
Flow: &v1pb.ApprovalFlow{},
Expand Down
4 changes: 4 additions & 0 deletions provider/resource_setting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ resource "bytebase_setting" "%s" {
level = "LOW"
}
flow {
id = "test-flow"
title = "Test"
description = "Test"
roles = ["roles/test"]
Expand Down Expand Up @@ -261,6 +262,7 @@ resource "bytebase_setting" "%s" {
level = "LOW"
}
flow {
id = "test-flow"
title = "Test"
description = "Test"
roles = ["invalid-role"]
Expand Down Expand Up @@ -333,6 +335,7 @@ resource "bytebase_setting" "%s" {
level = "LOW"
}
flow {
id = "test-ddl-approval-flow"
title = "DDL Approval Flow"
description = "Approval flow for DDL operations"
roles = [
Expand Down Expand Up @@ -369,6 +372,7 @@ resource "bytebase_setting" "%s" {
level = "MODERATE"
}
flow {
id = "test-updated-approval-flow"
title = "Updated Approval Flow"
description = "Updated approval flow"
roles = [bytebase_role.approval_role_%s.name]
Expand Down
1 change: 1 addition & 0 deletions tutorials/4-3-approval-flow.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ resource "bytebase_setting" "approval_flow" {
approval_flow {
rules {
flow {
id = "bb.project-owner-workspace-dba-workspace-admin"
title = "Project Owner → DBA → Admin"
description = "Need DBA and workspace admin approval"
roles = [
Expand Down