Skip to content

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

chore: add rollout to plan (#16440)

boojackd815fe775145
diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.go
index 30a1f66bb0..25c095f82d 100644
--- a/backend/api/v1/rollout_service_converter.go
+++ b/backend/api/v1/rollout_service_converter.go
@@ -32,7 +32,6 @@ func convertToPlans(ctx context.Context, s *store.Store, plans []*store.PlanMess
func convertToPlan(ctx context.Context, s *store.Store, plan *store.PlanMessage) (*v1pb.Plan, error) {
p := &v1pb.Plan{
Name: common.FormatPlan(plan.ProjectID, plan.UID),
- Issue: "",
Title: plan.Name,
Description: plan.Description,
Specs: convertToPlanSpecs(plan.Config.Specs), // Use specs field for output
@@ -55,6 +54,9 @@ func convertToPlan(ctx context.Context, s *store.Store, plan *store.PlanMessage)
if issue != nil {
p.Issue = common.FormatIssue(issue.Project.ResourceID, issue.UID)
}
+ if plan.PipelineUID != nil {
+ p.Rollout = common.FormatRollout(issue.Project.ResourceID, *issue.PipelineUID)
+ }
return p, nil
}
diff --git a/frontend/src/types/proto/v1/plan_service.ts b/frontend/src/types/proto/v1/plan_service.ts
index efecdd2020..a1d679a4de 100644
--- a/frontend/src/types/proto/v1/plan_service.ts
+++ b/frontend/src/types/proto/v1/plan_service.ts
@@ -142,6 +142,12 @@ export interface Plan {
* Format: projects/{project}/issues/{issue}
*/
issue: string;
+ /**
+ * The rollout associated with the plan.
+ * Can be empty.
+ * Format: projects/{project}/rollouts/{rollout}
+ */
+ rollout: string;
title: string;
description: string;
specs: Plan_Spec[];
@@ -1176,6 +1182,7 @@ function createBasePlan(): Plan {
return {
name: "",
issue: "",
+ rollout: "",
title: "",
description: "",
specs: [],
@@ -1195,6 +1202,9 @@ export const Plan: MessageFns<Plan> = {
if (message.issue !== "") {
writer.uint32(26).string(message.issue);
}
+ if (message.rollout !== "") {
+ writer.uint32(122).string(message.rollout);
+ }
if (message.title !== "") {
writer.uint32(34).string(message.title);
}
@@ -1245,6 +1255,14 @@ export const Plan: MessageFns<Plan> = {
message.issue = reader.string();
continue;
}
+ case 15: {
+ if (tag !== 122) {
+ break;
+ }
+
+ message.rollout = reader.string();
+ continue;
+ }
case 4: {
if (tag !== 34) {
break;
@@ -1329,6 +1347,9 @@ export const Plan: MessageFns<Plan> = {
if (message.issue !== "") {
obj.issue = message.issue;
}
+ if (message.rollout !== "") {
+ obj.rollout = message.rollout;
+ }
if (message.title !== "") {
obj.title = message.title;
}
@@ -1369,6 +1390,7 @@ export const Plan: MessageFns<Plan> = {
const message = createBasePlan();
message.name = object.name ?? "";
message.issue = object.issue ?? "";
+ message.rollout = object.rollout ?? "";
message.title = object.title ?? "";
message.description = object.description ?? "";
message.specs = object.specs?.map((e) => Plan_Spec.fromPartial(e)) || [];
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 3bf64ea213..17b84803b9 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -11210,11 +11210,19 @@ components:
`plan` is a system generated ID.
Format: projects/{project}/plans/{plan}
issue:
+ readOnly: true
type: string
description: |-
The issue associated with the plan.
Can be empty.
Format: projects/{project}/issues/{issue}
+ rollout:
+ readOnly: true
+ type: string
+ description: |-
+ The rollout associated with the plan.
+ Can be empty.
+ Format: projects/{project}/rollouts/{rollout}
title:
type: string
description:
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 32c38a35cd..e11b66a360 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -7366,6 +7366,7 @@ When paginating, all other parameters provided to `ListPlans` must match the cal
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | The name of the plan. `plan` is a system generated ID. Format: projects/{project}/plans/{plan} |
| issue | [string](#string) | | The issue associated with the plan. Can be empty. Format: projects/{project}/issues/{issue} |
+| rollout | [string](#string) | | The rollout associated with the plan. Can be empty. Format: projects/{project}/rollouts/{rollout} |
| title | [string](#string) | | |
| description | [string](#string) | | |
| specs | [Plan.Spec](#bytebase-v1-Plan-Spec) | repeated | |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 4cc9339541..b75d7f16ee 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -20558,6 +20558,15 @@ Can be empty.
Format: projects/{project}/issues/{issue} </p></td>
</tr>
+ <tr>
+ <td>rollout</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The rollout associated with the plan.
+Can be empty.
+Format: projects/{project}/rollouts/{rollout} </p></td>
+ </tr>
+
<tr>
<td>title</td>
<td><a href="#string">string</a></td>
diff --git a/proto/generated-go/v1/plan_service.pb.go b/proto/generated-go/v1/plan_service.pb.go
index d1a8c3d99c..8a4084054d 100644
--- a/proto/generated-go/v1/plan_service.pb.go
+++ b/proto/generated-go/v1/plan_service.pb.go
@@ -690,7 +690,11 @@ type Plan struct {
// The issue associated with the plan.
// Can be empty.
// Format: projects/{project}/issues/{issue}
- Issue string `protobuf:"bytes,3,opt,name=issue,proto3" json:"issue,omitempty"`
+ Issue string `protobuf:"bytes,3,opt,name=issue,proto3" json:"issue,omitempty"`
+ // The rollout associated with the plan.
+ // Can be empty.
+ // Format: projects/{project}/rollouts/{rollout}
+ Rollout string `protobuf:"bytes,15,opt,name=rollout,proto3" json:"rollout,omitempty"`
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
Specs []*Plan_Spec `protobuf:"bytes,14,rep,name=specs,proto3" json:"specs,omitempty"`
@@ -753,6 +757,13 @@ func (x *Plan) GetIssue() string {
return ""
}
+func (x *Plan) GetRollout() string {
+ if x != nil {
+ return x.Rollout
+ }
+ return ""
+}
+
func (x *Plan) GetTitle() string {
if x != nil {
return x.Title
@@ -2049,10 +2060,11 @@ const file_v1_plan_service_proto_rawDesc = "" +
"\x11UpdatePlanRequest\x12+\n" +
"\x04plan\x18\x01 \x01(\v2\x11.bytebase.v1.PlanB\x04\xe2A\x01\x02R\x04plan\x12A\n" +
"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x04\xe2A\x01\x02R\n" +
- "updateMask\"\xb1\x11\n" +
+ "updateMask\"\xd7\x11\n" +
"\x04Plan\x12\x12\n" +
- "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
- "\x05issue\x18\x03 \x01(\tR\x05issue\x12\x14\n" +
+ "\x04name\x18\x01 \x01(\tR\x04name\x12\x1a\n" +
+ "\x05issue\x18\x03 \x01(\tB\x04\xe2A\x01\x03R\x05issue\x12\x1e\n" +
+ "\arollout\x18\x0f \x01(\tB\x04\xe2A\x01\x03R\arollout\x12\x14\n" +
"\x05title\x18\x04 \x01(\tR\x05title\x12 \n" +
"\vdescription\x18\x05 \x01(\tR\vdescription\x12,\n" +
"\x05specs\x18\x0e \x03(\v2\x16.bytebase.v1.Plan.SpecR\x05specs\x12\x1e\n" +
diff --git a/proto/v1/v1/plan_service.proto b/proto/v1/v1/plan_service.proto
index 714e5f26b8..1ff5537df2 100644
--- a/proto/v1/v1/plan_service.proto
+++ b/proto/v1/v1/plan_service.proto
@@ -215,7 +215,12 @@ message Plan {
// The issue associated with the plan.
// Can be empty.
// Format: projects/{project}/issues/{issue}
- string issue = 3;
+ string issue = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The rollout associated with the plan.
+ // Can be empty.
+ // Format: projects/{project}/rollouts/{rollout}
+ string rollout = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
string title = 4;
string description = 5;