Skip to content

Commit aafa263

Browse files
authored
chore: handle api breaking change (#106)
* chore: handle api breaking change * fix: lint
1 parent ca99208 commit aafa263

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+372
-1249
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using Terraform Bytebase Provider to prepare those instances ready for applicati
1717

1818
- [Go](https://golang.org/doc/install) (1.19 or later)
1919
- [Terraform](https://developer.hashicorp.com/terraform/downloads?product_intent=terraform) (1.3.5 or later)
20-
- [Bytebase](https://github.com/bytebase/bytebase) (3.5.0 or later)
20+
- [Bytebase](https://github.com/bytebase/bytebase) (3.6.0 or later)
2121

2222
> If you have problems running `terraform` in MacOS with Apple Silicon, you can following https://stackoverflow.com/questions/66281882/how-can-i-get-terraform-init-to-run-on-my-apple-silicon-macbook-pro-for-the-go and use the `tfenv`.
2323

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.23
1+
1.0.24

api/client.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,6 @@ type Client interface {
5656
// GetCaller returns the API caller.
5757
GetCaller() *v1pb.User
5858

59-
// Environment
60-
// CreateEnvironment creates the environment.
61-
CreateEnvironment(ctx context.Context, environmentID string, create *v1pb.Environment) (*v1pb.Environment, error)
62-
// GetEnvironment gets the environment by full name.
63-
GetEnvironment(ctx context.Context, environmentName string) (*v1pb.Environment, error)
64-
// ListEnvironment finds all environments.
65-
ListEnvironment(ctx context.Context, showDeleted bool) (*v1pb.ListEnvironmentsResponse, error)
66-
// UpdateEnvironment updates the environment.
67-
UpdateEnvironment(ctx context.Context, patch *v1pb.Environment, updateMask []string) (*v1pb.Environment, error)
68-
// DeleteEnvironment deletes the environment.
69-
DeleteEnvironment(ctx context.Context, environmentName string) error
70-
// UndeleteEnvironment undeletes the environment.
71-
UndeleteEnvironment(ctx context.Context, environmentName string) (*v1pb.Environment, error)
72-
7359
// Instance
7460
// ListInstance will return instances.
7561
ListInstance(ctx context.Context, filter *InstanceFilter) ([]*v1pb.Instance, error)

api/setting.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const (
1212
SettingDataClassification SettingName = "bb.workspace.data-classification"
1313
// SettingSemanticTypes is the setting name for semantic types.
1414
SettingSemanticTypes SettingName = "bb.workspace.semantic-types"
15+
// SettingEnvironment is the setting name for environments.
16+
SettingEnvironment SettingName = "bb.workspace.environment"
1517
)
1618

1719
// RiskLevel is the approval risk level.
@@ -41,13 +43,3 @@ func (r RiskLevel) Int() int {
4143
return 0
4244
}
4345
}
44-
45-
// ApprovalNodeType is the type for approval node.
46-
type ApprovalNodeType string
47-
48-
const (
49-
// ApprovalNodeTypeGroup means the approval node is a group.
50-
ApprovalNodeTypeGroup ApprovalNodeType = "GROUP"
51-
// ApprovalNodeTypeRole means the approval node is a role, the value should be role fullname.
52-
ApprovalNodeTypeRole ApprovalNodeType = "ROLE"
53-
)

client/environment.go

Lines changed: 0 additions & 106 deletions
This file was deleted.

docs/data-sources/environment.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/data-sources/environment_list.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/data-sources/policy.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Optional:
4242
<a id="nestedblock--global_masking_policy--rules"></a>
4343
### Nested Schema for `global_masking_policy.rules`
4444

45-
Optional:
45+
Required:
4646

4747
- `condition` (String) The condition expression
4848
- `id` (String) The unique rule id
@@ -60,13 +60,16 @@ Optional:
6060
<a id="nestedblock--masking_exception_policy--exceptions"></a>
6161
### Nested Schema for `masking_exception_policy.exceptions`
6262

63-
Optional:
63+
Required:
6464

6565
- `action` (String)
66-
- `column` (String)
6766
- `database` (String) The database full name in instances/{instance resource id}/databases/{database name} format
68-
- `expire_timestamp` (String) The expiration timestamp in YYYY-MM-DDThh:mm:ss.000Z format
6967
- `member` (String) The member in user:{email} or group:{email} format.
68+
69+
Optional:
70+
71+
- `column` (String)
72+
- `expire_timestamp` (String) The expiration timestamp in YYYY-MM-DDThh:mm:ss.000Z format
7073
- `schema` (String)
7174
- `table` (String)
7275

docs/data-sources/setting.md

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,39 +28,49 @@ The setting data source.
2828
### Read-Only
2929

3030
- `approval_flow` (Block List) Configure risk level and approval flow for different tasks. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--approval_flow))
31+
- `environment_setting` (Block List) The environment (see [below for nested schema](#nestedblock--environment_setting))
3132
- `id` (String) The ID of this resource.
3233

3334
<a id="nestedblock--classification"></a>
3435
### Nested Schema for `classification`
3536

36-
Optional:
37+
Required:
3738

38-
- `classification_from_config` (Boolean) If true, we will only store the classification in the config. Otherwise we will get the classification from table/column comment, and write back to the schema metadata.
39-
- `classifications` (Block Set) (see [below for nested schema](#nestedblock--classification--classifications))
39+
- `classifications` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--classification--classifications))
4040
- `id` (String) The classification unique uuid.
41-
- `levels` (Block Set) (see [below for nested schema](#nestedblock--classification--levels))
41+
- `levels` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--classification--levels))
4242
- `title` (String) The classification title. Optional.
4343

44+
Optional:
45+
46+
- `classification_from_config` (Boolean) If true, we will only store the classification in the config. Otherwise we will get the classification from table/column comment, and write back to the schema metadata.
47+
4448
<a id="nestedblock--classification--classifications"></a>
4549
### Nested Schema for `classification.classifications`
4650

51+
Required:
52+
53+
- `id` (String) The classification unique id, must in {number}-{number} format.
54+
- `title` (String) The classification title.
55+
4756
Optional:
4857

4958
- `description` (String) The classification description.
50-
- `id` (String) The classification unique id, must in {number}-{number} format.
5159
- `level` (String) The classification level id.
52-
- `title` (String) The classification title.
5360

5461

5562
<a id="nestedblock--classification--levels"></a>
5663
### Nested Schema for `classification.levels`
5764

58-
Optional:
65+
Required:
5966

60-
- `description` (String) The classification level description.
6167
- `id` (String) The classification level unique uuid.
6268
- `title` (String) The classification level title.
6369

70+
Optional:
71+
72+
- `description` (String) The classification level description.
73+
6474

6575

6676
<a id="nestedblock--semantic_types"></a>
@@ -184,7 +194,28 @@ Read-Only:
184194

185195
Read-Only:
186196

187-
- `node` (String)
188-
- `type` (String)
197+
- `role` (String)
198+
199+
200+
201+
202+
203+
<a id="nestedblock--environment_setting"></a>
204+
### Nested Schema for `environment_setting`
205+
206+
Read-Only:
207+
208+
- `environment` (List of Object) (see [below for nested schema](#nestedatt--environment_setting--environment))
209+
210+
<a id="nestedatt--environment_setting--environment"></a>
211+
### Nested Schema for `environment_setting.environment`
212+
213+
Read-Only:
214+
215+
- `color` (String)
216+
- `id` (String)
217+
- `name` (String)
218+
- `protected` (Boolean)
219+
- `title` (String)
189220

190221

docs/resources/environment.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)