Skip to content

Commit dc55a27

Browse files
authored
chore: support ISSUE_APPROVED webhook type (#179)
1 parent 7029a42 commit dc55a27

14 files changed

Lines changed: 32 additions & 23 deletions

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.16.3
1+
3.16.4

docs/data-sources/setting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The setting data source.
1717

1818
### Required
1919

20-
- `name` (String) The setting name in settings/{name} format. The name support "WORKSPACE_APPROVAL", "WORKSPACE_PROFILE", "DATA_CLASSIFICATION", "SEMANTIC_TYPES", "ENVIRONMENT". Check the proto https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/setting_service.proto#L109 for details
20+
- `name` (String) The setting name in settings/{name} format. The name support "WORKSPACE_APPROVAL", "WORKSPACE_PROFILE", "DATA_CLASSIFICATION", "SEMANTIC_TYPES", "ENVIRONMENT". Check the proto https://github.com/bytebase/bytebase/blob/release/3.16.1/proto/v1/v1/setting_service.proto#L109 for details
2121

2222
### Optional
2323

docs/resources/database_group.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The database group resource.
1717

1818
### Required
1919

20-
- `condition` (String) The database group condition. Check the proto message https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/database_group_service.proto#L185 for details.
20+
- `condition` (String) The database group condition. Check the proto message https://github.com/bytebase/bytebase/blob/release/3.16.1/proto/v1/v1/database_group_service.proto#L185 for details.
2121
- `project` (String) The project fullname in projects/{id} format.
2222
- `resource_id` (String) The database group unique resource id.
2323
- `title` (String) The database group title.

docs/resources/review_config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Required:
3737

3838
- `engine` (String) The rule for the database engine.
3939
- `level` (String) The rule level.
40-
- `type` (String) The rule unique type. Check https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/SQL_REVIEW_RULES_DOCUMENTATION.md#rule-categories for all rules
40+
- `type` (String) The rule unique type. Check https://github.com/bytebase/bytebase/blob/release/3.16.1/proto/v1/v1/SQL_REVIEW_RULES_DOCUMENTATION.md#rule-categories for all rules
4141

4242
Optional:
4343

docs/resources/role.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The role resource. Require ENTERPRISE subscription. Check the docs https://www.b
1717

1818
### Required
1919

20-
- `permissions` (Set of String) The role permissions. Permissions should start with "bb." prefix. Check https://github.com/bytebase/bytebase/blob/main/backend/component/iam/permission.yaml for all permissions.
20+
- `permissions` (Set of String) The role permissions. Permissions should start with "bb." prefix. Check https://github.com/bytebase/bytebase/blob/release/3.16.1/backend/component/iam/permission.yaml for all permissions.
2121
- `resource_id` (String) The role unique resource id.
2222
- `title` (String) The role title.
2323

docs/resources/setting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The setting resource.
1717

1818
### Required
1919

20-
- `name` (String) The setting name in settings/{name} format. The name support "WORKSPACE_APPROVAL", "WORKSPACE_PROFILE", "DATA_CLASSIFICATION", "SEMANTIC_TYPES", "ENVIRONMENT". Check the proto https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/setting_service.proto#L109 for details
20+
- `name` (String) The setting name in settings/{name} format. The name support "WORKSPACE_APPROVAL", "WORKSPACE_PROFILE", "DATA_CLASSIFICATION", "SEMANTIC_TYPES", "ENVIRONMENT". Check the proto https://github.com/bytebase/bytebase/blob/release/3.16.1/proto/v1/v1/setting_service.proto#L109 for details
2121

2222
### Optional
2323

@@ -43,7 +43,7 @@ Required:
4343

4444
Required:
4545

46-
- `condition` (String) The condition that is associated with the rule. Check the proto message https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/setting_service.proto#L307 for details.
46+
- `condition` (String) The condition that is associated with the rule. Check the proto message https://github.com/bytebase/bytebase/blob/release/3.16.1/proto/v1/v1/setting_service.proto#L307 for details.
4747
- `flow` (Block List, Min: 1) (see [below for nested schema](#nestedblock--approval_flow--rules--flow))
4848

4949
Optional:

examples/setup/project.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ resource "bytebase_project" "sample_project" {
5656
url = "https://open.larksuite.com"
5757
notification_types = [
5858
"ISSUE_SENT_BACK",
59+
"ISSUE_APPROVED",
5960
"PIPELINE_FAILED"
6061
]
6162
}

migration/3.16.3.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Migrate from 3.16.1 to 3.16.3
1+
# Migrate from 3.16.1 to 3.16.4
22

33
## Bug Fixes
44

@@ -40,3 +40,18 @@ resource "bytebase_setting" "profile" {
4040
}
4141
}
4242
```
43+
44+
### Support `ISSUE_APPROVED` for webhook `notification_types`
45+
46+
```terraform
47+
resource "bytebase_project" "sample_project" {
48+
webhooks {
49+
title = "Sample webhook"
50+
type = "SLACK"
51+
url = "xxx"
52+
notification_types = [
53+
"ISSUE_APPROVED"
54+
]
55+
}
56+
}
57+
```

provider/data_source_project.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func getWebhooksSchema(computed bool) *schema.Schema {
138138
"type": {
139139
Type: schema.TypeString,
140140
Required: true,
141-
Description: "The webhook type. Check https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/project_service.proto#L449 for support types.",
141+
Description: "The webhook type. Check https://github.com/bytebase/bytebase/blob/release/3.16.1/proto/v1/v1/project_service.proto#L449 for support types.",
142142
ValidateFunc: validation.StringInSlice([]string{
143143
v1pb.WebhookType_SLACK.String(),
144144
v1pb.WebhookType_DISCORD.String(),
@@ -178,14 +178,7 @@ func getWebhooksSchema(computed bool) *schema.Schema {
178178
Description: "notification_types is the list of activities types that the webhook is interested in. Bytebase will only send notifications to the webhook if the activity type is in the list.",
179179
Elem: &schema.Schema{
180180
Type: schema.TypeString,
181-
Description: "Check https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/project_service.proto for support types.",
182-
ValidateFunc: validation.StringInSlice([]string{
183-
v1pb.Activity_ISSUE_CREATED.String(),
184-
v1pb.Activity_ISSUE_APPROVAL_REQUESTED.String(),
185-
v1pb.Activity_ISSUE_SENT_BACK.String(),
186-
v1pb.Activity_PIPELINE_FAILED.String(),
187-
v1pb.Activity_PIPELINE_COMPLETED.String(),
188-
}, false),
181+
Description: "Check https://github.com/bytebase/bytebase/blob/release/3.16.1/proto/v1/v1/project_service.proto for support types.",
189182
},
190183
},
191184
},

provider/data_source_setting.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func dataSourceSetting() *schema.Resource {
2222
"name": {
2323
Type: schema.TypeString,
2424
Required: true,
25-
Description: `The setting name in settings/{name} format. The name support "WORKSPACE_APPROVAL", "WORKSPACE_PROFILE", "DATA_CLASSIFICATION", "SEMANTIC_TYPES", "ENVIRONMENT". Check the proto https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/setting_service.proto#L109 for details`,
25+
Description: `The setting name in settings/{name} format. The name support "WORKSPACE_APPROVAL", "WORKSPACE_PROFILE", "DATA_CLASSIFICATION", "SEMANTIC_TYPES", "ENVIRONMENT". Check the proto https://github.com/bytebase/bytebase/blob/release/3.16.1/proto/v1/v1/setting_service.proto#L109 for details`,
2626
ValidateDiagFunc: internal.ResourceNameValidation(
2727
fmt.Sprintf("^%s%s$", internal.SettingNamePrefix, v1pb.Setting_WORKSPACE_APPROVAL.String()),
2828
fmt.Sprintf("^%s%s$", internal.SettingNamePrefix, v1pb.Setting_WORKSPACE_PROFILE.String()),
@@ -571,7 +571,7 @@ func getWorkspaceApprovalSetting(computed bool) *schema.Schema {
571571
Type: schema.TypeString,
572572
Required: true,
573573
ValidateFunc: validation.StringIsNotEmpty,
574-
Description: "The condition that is associated with the rule. Check the proto message https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/setting_service.proto#L307 for details.",
574+
Description: "The condition that is associated with the rule. Check the proto message https://github.com/bytebase/bytebase/blob/release/3.16.1/proto/v1/v1/setting_service.proto#L307 for details.",
575575
},
576576
},
577577
},

0 commit comments

Comments
 (0)