Skip to content

chore: handle api breaking change #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2025
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using Terraform Bytebase Provider to prepare those instances ready for applicati

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

> 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`.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.23
1.0.24
14 changes: 0 additions & 14 deletions api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,6 @@ type Client interface {
// GetCaller returns the API caller.
GetCaller() *v1pb.User

// Environment
// CreateEnvironment creates the environment.
CreateEnvironment(ctx context.Context, environmentID string, create *v1pb.Environment) (*v1pb.Environment, error)
// GetEnvironment gets the environment by full name.
GetEnvironment(ctx context.Context, environmentName string) (*v1pb.Environment, error)
// ListEnvironment finds all environments.
ListEnvironment(ctx context.Context, showDeleted bool) (*v1pb.ListEnvironmentsResponse, error)
// UpdateEnvironment updates the environment.
UpdateEnvironment(ctx context.Context, patch *v1pb.Environment, updateMask []string) (*v1pb.Environment, error)
// DeleteEnvironment deletes the environment.
DeleteEnvironment(ctx context.Context, environmentName string) error
// UndeleteEnvironment undeletes the environment.
UndeleteEnvironment(ctx context.Context, environmentName string) (*v1pb.Environment, error)

// Instance
// ListInstance will return instances.
ListInstance(ctx context.Context, filter *InstanceFilter) ([]*v1pb.Instance, error)
Expand Down
12 changes: 2 additions & 10 deletions api/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const (
SettingDataClassification SettingName = "bb.workspace.data-classification"
// SettingSemanticTypes is the setting name for semantic types.
SettingSemanticTypes SettingName = "bb.workspace.semantic-types"
// SettingEnvironment is the setting name for environments.
SettingEnvironment SettingName = "bb.workspace.environment"
)

// RiskLevel is the approval risk level.
Expand Down Expand Up @@ -41,13 +43,3 @@ func (r RiskLevel) Int() int {
return 0
}
}

// ApprovalNodeType is the type for approval node.
type ApprovalNodeType string

const (
// ApprovalNodeTypeGroup means the approval node is a group.
ApprovalNodeTypeGroup ApprovalNodeType = "GROUP"
// ApprovalNodeTypeRole means the approval node is a role, the value should be role fullname.
ApprovalNodeTypeRole ApprovalNodeType = "ROLE"
)
106 changes: 0 additions & 106 deletions client/environment.go

This file was deleted.

30 changes: 0 additions & 30 deletions docs/data-sources/environment.md

This file was deleted.

38 changes: 0 additions & 38 deletions docs/data-sources/environment_list.md

This file was deleted.

11 changes: 7 additions & 4 deletions docs/data-sources/policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Optional:
<a id="nestedblock--global_masking_policy--rules"></a>
### Nested Schema for `global_masking_policy.rules`

Optional:
Required:

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

Optional:
Required:

- `action` (String)
- `column` (String)
- `database` (String) The database full name in instances/{instance resource id}/databases/{database name} format
- `expire_timestamp` (String) The expiration timestamp in YYYY-MM-DDThh:mm:ss.000Z format
- `member` (String) The member in user:{email} or group:{email} format.

Optional:

- `column` (String)
- `expire_timestamp` (String) The expiration timestamp in YYYY-MM-DDThh:mm:ss.000Z format
- `schema` (String)
- `table` (String)

Expand Down
51 changes: 41 additions & 10 deletions docs/data-sources/setting.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,49 @@ The setting data source.
### Read-Only

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

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

Optional:
Required:

- `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.
- `classifications` (Block Set) (see [below for nested schema](#nestedblock--classification--classifications))
- `classifications` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--classification--classifications))
- `id` (String) The classification unique uuid.
- `levels` (Block Set) (see [below for nested schema](#nestedblock--classification--levels))
- `levels` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--classification--levels))
- `title` (String) The classification title. Optional.

Optional:

- `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.

<a id="nestedblock--classification--classifications"></a>
### Nested Schema for `classification.classifications`

Required:

- `id` (String) The classification unique id, must in {number}-{number} format.
- `title` (String) The classification title.

Optional:

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


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

Optional:
Required:

- `description` (String) The classification level description.
- `id` (String) The classification level unique uuid.
- `title` (String) The classification level title.

Optional:

- `description` (String) The classification level description.



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

Read-Only:

- `node` (String)
- `type` (String)
- `role` (String)





<a id="nestedblock--environment_setting"></a>
### Nested Schema for `environment_setting`

Read-Only:

- `environment` (List of Object) (see [below for nested schema](#nestedatt--environment_setting--environment))

<a id="nestedatt--environment_setting--environment"></a>
### Nested Schema for `environment_setting.environment`

Read-Only:

- `color` (String)
- `id` (String)
- `name` (String)
- `protected` (Boolean)
- `title` (String)


30 changes: 0 additions & 30 deletions docs/resources/environment.md

This file was deleted.

Loading