Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

docs(proto): the nearest review rule policy wins

rebelice3978de59c012
diff --git a/backend/generated-go/store/policy.pb.go b/backend/generated-go/store/policy.pb.go
index b0554d7990..36b9f4def8 100644
--- a/backend/generated-go/store/policy.pb.go
+++ b/backend/generated-go/store/policy.pb.go
@@ -174,10 +174,8 @@ func (*Policy) Descriptor() ([]byte, []int) {
return file_store_policy_proto_rawDescGZIP(), []int{0}
}
-// ReviewRulePolicy is the standard review rule switch.
-// Project: the rules on there; absent policy means every rule.
-// Workspace: the rules on in every project, which projects cannot switch
-// off; absent policy means none. The effective set is the union.
+// ReviewRulePolicy is the standard review rule switch. The nearest policy
+// wins: the project's if it has one, else the workspace's, else every rule.
type ReviewRulePolicy struct {
state protoimpl.MessageState `protogen:"open.v1"`
Rules []ReviewRule_Type `protobuf:"varint,1,rep,packed,name=rules,proto3,enum=bytebase.store.ReviewRule_Type" json:"rules,omitempty"`
diff --git a/backend/generated-go/v1/org_policy_service.pb.go b/backend/generated-go/v1/org_policy_service.pb.go
index 2470bd39ca..6cad5f87ba 100644
--- a/backend/generated-go/v1/org_policy_service.pb.go
+++ b/backend/generated-go/v1/org_policy_service.pb.go
@@ -684,16 +684,13 @@ func (*Policy_QueryDataPolicy) isPolicy_Policy() {}
func (*Policy_ReviewRulePolicy) isPolicy_Policy() {}
-// Standard review rule policy: the rules switched on, at two levels.
+// Standard review rule policy: the rules switched on. The nearest policy
+// wins: a project's own policy applies as is; a project without one uses
+// the workspace policy; with neither, every rule is on.
//
-// On a project it is the project's switch: the rules on there. Absent policy
-// means every rule. On the workspace it is a lock: the rules on in every
-// project, which projects cannot switch off. Absent policy means none. The
-// effective set for a project is the union of the two.
-//
-// A saved project list is explicit, so a rule added to the standard set in a
-// later release is appended to every saved project policy by a data
-// migration in that release.
+// A saved list is explicit, so a rule added to the standard set in a later
+// release is appended to every saved policy by a data migration in that
+// release.
type ReviewRulePolicy struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The rules switched on. Unknown or unspecified values are rejected.
diff --git a/frontend/src/types/proto-es/v1/org_policy_service_pb.d.ts b/frontend/src/types/proto-es/v1/org_policy_service_pb.d.ts
index 3256243e42..e8a3770df2 100644
--- a/frontend/src/types/proto-es/v1/org_policy_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/org_policy_service_pb.d.ts
@@ -269,16 +269,13 @@ export declare type Policy = Message<"bytebase.v1.Policy"> & {
export declare const PolicySchema: GenMessage<Policy>;
/**
- * Standard review rule policy: the rules switched on, at two levels.
+ * Standard review rule policy: the rules switched on. The nearest policy
+ * wins: a project's own policy applies as is; a project without one uses
+ * the workspace policy; with neither, every rule is on.
*
- * On a project it is the project's switch: the rules on there. Absent policy
- * means every rule. On the workspace it is a lock: the rules on in every
- * project, which projects cannot switch off. Absent policy means none. The
- * effective set for a project is the union of the two.
- *
- * A saved project list is explicit, so a rule added to the standard set in a
- * later release is appended to every saved project policy by a data
- * migration in that release.
+ * A saved list is explicit, so a rule added to the standard set in a later
+ * release is appended to every saved policy by a data migration in that
+ * release.
*
* @generated from message bytebase.v1.ReviewRulePolicy
*/
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index fff274c40f..2e72f83549 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -2758,10 +2758,8 @@ QueryDataPolicy is the policy configuration for querying data in the SQL Editor.
<a name="bytebase-store-ReviewRulePolicy"></a>
### ReviewRulePolicy
-ReviewRulePolicy is the standard review rule switch.
-Project: the rules on there; absent policy means every rule.
-Workspace: the rules on in every project, which projects cannot switch
-off; absent policy means none. The effective set is the union.
+ReviewRulePolicy is the standard review rule switch. The nearest policy
+wins: the project&#39;s if it has one, else the workspace&#39;s, else every rule.
| Field | Type | Label | Description |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index bf8b92d242..3291f7f467 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -7477,7 +7477,7 @@ Disallow running DDL statements in the SQL editor. </p></td>
<h3 id="bytebase.store.ReviewRulePolicy">ReviewRulePolicy</h3>
- <p>ReviewRulePolicy is the standard review rule switch.</p><p>Project: the rules on there; absent policy means every rule.</p><p>Workspace: the rules on in every project, which projects cannot switch</p><p>off; absent policy means none. The effective set is the union.</p>
+ <p>ReviewRulePolicy is the standard review rule switch. The nearest policy</p><p>wins: the project's if it has one, else the workspace's, else every rule.</p>
<table class="field-table">
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index e885382f26..9f257c9751 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -10022,16 +10022,13 @@ QueryDataPolicy is the policy configuration for querying data in the SQL Editor.
<a name="bytebase-v1-ReviewRulePolicy"></a>
### ReviewRulePolicy
-Standard review rule policy: the rules switched on, at two levels.
+Standard review rule policy: the rules switched on. The nearest policy
+wins: a project&#39;s own policy applies as is; a project without one uses
+the workspace policy; with neither, every rule is on.
-On a project it is the project&#39;s switch: the rules on there. Absent policy
-means every rule. On the workspace it is a lock: the rules on in every
-project, which projects cannot switch off. Absent policy means none. The
-effective set for a project is the union of the two.
-
-A saved project list is explicit, so a rule added to the standard set in a
-later release is appended to every saved project policy by a data
-migration in that release.
+A saved list is explicit, so a rule added to the standard set in a later
+release is appended to every saved policy by a data migration in that
+release.
| Field | Type | Label | Description |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 3b465dce7a..282e6f3700 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -28514,7 +28514,7 @@ If false,
<h3 id="bytebase.v1.ReviewRulePolicy">ReviewRulePolicy</h3>
- <p>Standard review rule policy: the rules switched on, at two levels.</p><p>On a project it is the project's switch: the rules on there. Absent policy</p><p>means every rule. On the workspace it is a lock: the rules on in every</p><p>project, which projects cannot switch off. Absent policy means none. The</p><p>effective set for a project is the union of the two.</p><p>A saved project list is explicit, so a rule added to the standard set in a</p><p>later release is appended to every saved project policy by a data</p><p>migration in that release.</p>
+ <p>Standard review rule policy: the rules switched on. The nearest policy</p><p>wins: a project's own policy applies as is; a project without one uses</p><p>the workspace policy; with neither, every rule is on.</p><p>A saved list is explicit, so a rule added to the standard set in a later</p><p>release is appended to every saved policy by a data migration in that</p><p>release.</p>
<table class="field-table">
diff --git a/proto/store/store/policy.proto b/proto/store/store/policy.proto
index 387dafd761..6bc3047576 100644
--- a/proto/store/store/policy.proto
+++ b/proto/store/store/policy.proto
@@ -27,10 +27,8 @@ message Policy {
}
}
-// ReviewRulePolicy is the standard review rule switch.
-// Project: the rules on there; absent policy means every rule.
-// Workspace: the rules on in every project, which projects cannot switch
-// off; absent policy means none. The effective set is the union.
+// ReviewRulePolicy is the standard review rule switch. The nearest policy
+// wins: the project's if it has one, else the workspace's, else every rule.
message ReviewRulePolicy {
repeated ReviewRule.Type rules = 1;
}
diff --git a/proto/v1/v1/org_policy_service.proto b/proto/v1/v1/org_policy_service.proto
index 47d6b4cd11..da6797fb01 100644
--- a/proto/v1/v1/org_policy_service.proto
+++ b/proto/v1/v1/org_policy_service.proto
@@ -256,16 +256,13 @@ enum PolicyResourceType {
PROJECT = 3;
}
-// Standard review rule policy: the rules switched on, at two levels.
+// Standard review rule policy: the rules switched on. The nearest policy
+// wins: a project's own policy applies as is; a project without one uses
+// the workspace policy; with neither, every rule is on.
//
-// On a project it is the project's switch: the rules on there. Absent policy
-// means every rule. On the workspace it is a lock: the rules on in every
-// project, which projects cannot switch off. Absent policy means none. The
-// effective set for a project is the union of the two.
-//
-// A saved project list is explicit, so a rule added to the standard set in a
-// later release is appended to every saved project policy by a data
-// migration in that release.
+// A saved list is explicit, so a rule added to the standard set in a later
+// release is appended to every saved policy by a data migration in that
+// release.
message ReviewRulePolicy {
// The rules switched on. Unknown or unspecified values are rejected.
repeated ReviewRule.Type rules = 1;