Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: update rollout policy (#15350)
p0ny93ac81bf8f44
diff --git a/backend/api/v1/issue_service_convert.go b/backend/api/v1/issue_service_convert.goindex d7d62f535d..4aa3b04153 100644--- a/backend/api/v1/issue_service_convert.go+++ b/backend/api/v1/issue_service_convert.go@@ -124,10 +124,6 @@ func (s *IssueService) convertToIssueReleasers(ctx context.Context, issue *store}var releasers []string- if policy.Automatic {- releasers = append(releasers, common.FormatRole(api.ProjectOwner.String()), common.FormatUserEmail(issue.Creator.Email))- return releasers, nil- }releasers = append(releasers, policy.Roles...)for _, role := range policy.IssueRoles {diff --git a/backend/api/v1/rollout_service.go b/backend/api/v1/rollout_service.goindex 30872ae688..2c94c24004 100644--- a/backend/api/v1/rollout_service.go+++ b/backend/api/v1/rollout_service.go@@ -1210,16 +1210,6 @@ func getPipelineCreateToTargetStage(ctx context.Context, s *store.Store, snapsho}func GetValidRolloutPolicyForStage(ctx context.Context, stores *store.Store, stage *store.StageMessage) (*storepb.RolloutPolicy, error) {- for _, task := range stage.TaskList {- instance, err := stores.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &task.InstanceID})- if err != nil {- return nil, err- }- if instance == nil || instance.Deleted {- continue- }- }-policy, err := stores.GetRolloutPolicy(ctx, stage.Environment)if err != nil {return nil, errors.Wrapf(err, "failed to get rollout policy for stageEnvironmentID %s", stage.Environment)@@ -1235,8 +1225,7 @@ func (s *RolloutService) canUserRunStageTasks(ctx context.Context, user *store.U}// Users with bb.taskRuns.create can always create task runs.- // The roles should be set on the workspace level, workspace Admin and DBA.- ok, err := s.iamManager.CheckPermission(ctx, iam.PermissionTaskRunsCreate, user)+ ok, err := s.iamManager.CheckPermission(ctx, iam.PermissionTaskRunsCreate, user, project.ResourceID)if err != nil {return false, errors.Wrapf(err, "failed to check workspace role")}@@ -1263,10 +1252,6 @@ func (s *RolloutService) canUserRunStageTasks(ctx context.Context, user *store.Uroles[k] = true}- if p.Automatic {- return true, nil- }-for _, role := range p.Roles {if roles[role] {return true, nildiff --git a/backend/component/iam/acl.yaml b/backend/component/iam/acl.yamlindex dc6e033ed3..9514aede00 100644--- a/backend/component/iam/acl.yaml+++ b/backend/component/iam/acl.yaml@@ -492,6 +492,7 @@ roles:- bb.rollouts.get- bb.rollouts.list- bb.sheets.get+ - bb.taskRuns.create- bb.taskRuns.list- name: roles/projectViewertitle: Project viewerdiff --git a/backend/runner/taskrun/schedulerv2.go b/backend/runner/taskrun/schedulerv2.goindex 6c111aadba..d26f4190fa 100644--- a/backend/runner/taskrun/schedulerv2.go+++ b/backend/runner/taskrun/schedulerv2.go@@ -138,32 +138,6 @@ func (s *SchedulerV2) scheduleAutoRolloutTasks(ctx context.Context) error {return nil}-func (s *SchedulerV2) canTaskAutoRollout(ctx context.Context, rolloutPolicy *storepb.RolloutPolicy, task *store.TaskMessage) (bool, error) {- if rolloutPolicy.Automatic {- return true, nil- }-- if s.licenseService.IsFeatureEnabled(api.FeatureRolloutPolicy) != nil {- // nolint:nilerr- return true, nil- }-- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &task.InstanceID})- if err != nil {- return false, err- }- if instance == nil || instance.Deleted {- return false, nil- }-- if s.licenseService.IsFeatureEnabledForInstance(api.FeatureRolloutPolicy, instance) != nil {- // nolint:nilerr- return true, nil- }-- return false, nil-}-func (s *SchedulerV2) scheduleAutoRolloutTask(ctx context.Context, rolloutPolicy *storepb.RolloutPolicy, taskUID int) error {task, err := s.store.GetTaskV2ByID(ctx, taskUID)if err != nil {@@ -173,11 +147,7 @@ func (s *SchedulerV2) scheduleAutoRolloutTask(ctx context.Context, rolloutPolicyreturn nil}- canAutoRollout, err := s.canTaskAutoRollout(ctx, rolloutPolicy, task)- if err != nil {- return err- }- if !canAutoRollout {+ if !rolloutPolicy.Automatic {return nil}diff --git a/frontend/src/types/proto/v1/issue_service.ts b/frontend/src/types/proto/v1/issue_service.tsindex 9a250f5f5d..bbb06d032e 100644--- a/frontend/src/types/proto/v1/issue_service.ts+++ b/frontend/src/types/proto/v1/issue_service.ts@@ -279,7 +279,6 @@ export interface Issue {/*** The releasers of the pending stage of the issue rollout, judging* from the rollout policy.- * If the policy is auto rollout, the releasers are the project owners and the issue creator.* Format:* - roles/workspaceOwner* - roles/workspaceDBAdiff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex e843d01fe2..19c598dd48 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -10417,7 +10417,6 @@ components:description: |-The releasers of the pending stage of the issue rollout, judgingfrom the rollout policy.- If the policy is auto rollout, the releasers are the project owners and the issue creator.Format:- roles/workspaceOwner- roles/workspaceDBAdiff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex b0345333f5..3efbf2e362 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -3602,7 +3602,7 @@ LIST, HASH (https://www.postgresql.org/docs/current/ddl-partitioning.html)| plan | [string](#string) | | The plan associated with the issue. Can be empty. Format: projects/{project}/plans/{plan} || rollout | [string](#string) | | The rollout associated with the issue. Can be empty. Format: projects/{project}/rollouts/{rollout} || grant_request | [GrantRequest](#bytebase-v1-GrantRequest) | | Used if the issue type is GRANT_REQUEST. |-| releasers | [string](#string) | repeated | The releasers of the pending stage of the issue rollout, judging from the rollout policy. If the policy is auto rollout, the releasers are the project owners and the issue creator. Format: - roles/workspaceOwner - roles/workspaceDBA - roles/projectOwner - roles/projectReleaser - users/{email} |+| releasers | [string](#string) | repeated | The releasers of the pending stage of the issue rollout, judging from the rollout policy. Format: - roles/workspaceOwner - roles/workspaceDBA - roles/projectOwner - roles/projectReleaser - users/{email} || risk_level | [Issue.RiskLevel](#bytebase-v1-Issue-RiskLevel) | | || task_status_count | [Issue.TaskStatusCountEntry](#bytebase-v1-Issue-TaskStatusCountEntry) | repeated | The status count of the issue. Keys are the following: - NOT_STARTED - SKIPPED - PENDING - RUNNING - DONE - FAILED - CANCELED || labels | [string](#string) | repeated | |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex 4fb8029a6a..2adda2b078 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -10977,7 +10977,6 @@ Format: projects/{project}/rollouts/{rollout} </p></td><td>repeated</td><td><p>The releasers of the pending stage of the issue rollout, judgingfrom the rollout policy.-If the policy is auto rollout, the releasers are the project owners and the issue creator.Format:- roles/workspaceOwner- roles/workspaceDBAdiff --git a/proto/generated-go/v1/issue_service.pb.go b/proto/generated-go/v1/issue_service.pb.goindex 0bb005c1e5..155f693c4d 100644--- a/proto/generated-go/v1/issue_service.pb.go+++ b/proto/generated-go/v1/issue_service.pb.go@@ -1271,7 +1271,6 @@ type Issue struct {GrantRequest *GrantRequest `protobuf:"bytes,19,opt,name=grant_request,json=grantRequest,proto3" json:"grant_request,omitempty"`// The releasers of the pending stage of the issue rollout, judging// from the rollout policy.- // If the policy is auto rollout, the releasers are the project owners and the issue creator.// Format:// - roles/workspaceOwner// - roles/workspaceDBAdiff --git a/proto/v1/issue_service.proto b/proto/v1/issue_service.protoindex b107835f73..40f442045a 100644--- a/proto/v1/issue_service.proto+++ b/proto/v1/issue_service.proto@@ -370,7 +370,6 @@ message Issue {// The releasers of the pending stage of the issue rollout, judging// from the rollout policy.- // If the policy is auto rollout, the releasers are the project owners and the issue creator.// Format:// - roles/workspaceOwner// - roles/workspaceDBA