Skip to content

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

feat: risk level in release check (#15211)

boojackcc654a6b2676
diff --git a/backend/api/v1/release_service.go b/backend/api/v1/release_service.go
index 2cfe58bd68..b73cb36b4d 100644
--- a/backend/api/v1/release_service.go
+++ b/backend/api/v1/release_service.go
@@ -2,7 +2,6 @@ package v1
import (
"context"
- "fmt"
"slices"
"github.com/google/uuid"
@@ -15,13 +14,8 @@ import (
"github.com/bytebase/bytebase/backend/common"
"github.com/bytebase/bytebase/backend/component/dbfactory"
"github.com/bytebase/bytebase/backend/component/sheet"
- "github.com/bytebase/bytebase/backend/plugin/advisor"
- "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/backend/plugin/db"
- "github.com/bytebase/bytebase/backend/runner/plancheck"
"github.com/bytebase/bytebase/backend/runner/schemasync"
"github.com/bytebase/bytebase/backend/store"
- "github.com/bytebase/bytebase/backend/utils"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -254,269 +248,6 @@ func (s *ReleaseService) UndeleteRelease(ctx context.Context, request *v1pb.Unde
return release, nil
}
-func (s *ReleaseService) CheckRelease(ctx context.Context, request *v1pb.CheckReleaseRequest) (*v1pb.CheckReleaseResponse, error) {
- if len(request.Targets) == 0 {
- return nil, status.Errorf(codes.InvalidArgument, "targets cannot be empty")
- }
-
- var targetDatabases []*store.DatabaseMessage
- for _, target := range request.Targets {
- // Handle database target.
- if instanceID, databaseName, err := common.GetInstanceDatabaseID(target); err == nil {
- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
- ResourceID: &instanceID,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get instance, error: %v", err)
- }
- if instance == nil {
- return nil, status.Errorf(codes.NotFound, "instance %q not found", instanceID)
- }
- database, err := s.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{
- InstanceID: &instanceID,
- DatabaseName: &databaseName,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get database, error: %v", err)
- }
- if database == nil {
- return nil, status.Errorf(codes.NotFound, "database %q not found", target)
- }
- targetDatabases = append(targetDatabases, database)
- }
-
- // Handle database group target. Extract all matched databases in the database group.
- if projectResourceID, databaseGroupResourceID, err := common.GetProjectIDDatabaseGroupID(target); err == nil {
- project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{
- ResourceID: &projectResourceID,
- })
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- if project == nil {
- return nil, status.Errorf(codes.NotFound, "project %q not found", projectResourceID)
- }
- if project.Deleted {
- return nil, status.Errorf(codes.NotFound, "project %q has been deleted", projectResourceID)
- }
- existedDatabaseGroup, err := s.store.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{
- ProjectID: &project.ResourceID,
- ResourceID: &databaseGroupResourceID,
- })
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- if existedDatabaseGroup == nil {
- return nil, status.Errorf(codes.NotFound, "database group %q not found", databaseGroupResourceID)
- }
- groupDatabases, err := s.store.ListDatabases(ctx, &store.FindDatabaseMessage{
- ProjectID: &projectResourceID,
- })
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- // Filter out databases that are matched with the database group.
- matches, _, err := utils.GetMatchedAndUnmatchedDatabasesInDatabaseGroup(ctx, existedDatabaseGroup, groupDatabases)
- if err != nil {
- return nil, err
- }
- targetDatabases = append(targetDatabases, matches...)
- }
- }
-
- // Validate and sanitize release files.
- var err error
- request.Release.Files, err = validateAndSanitizeReleaseFiles(request.Release.Files)
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "invalid release files, err: %v", err)
- }
-
- response := &v1pb.CheckReleaseResponse{}
- var errorAdviceCount, warningAdviceCount int
- var stopChecking bool
- for _, database := range targetDatabases {
- if stopChecking {
- break
- }
- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
- ResourceID: &database.InstanceID,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get instance, error: %v", err)
- }
- if instance == nil {
- return nil, status.Errorf(codes.NotFound, "instance %q not found", database.InstanceID)
- }
-
- catalog, err := catalog.NewCatalog(ctx, s.store, database.InstanceID, database.DatabaseName, instance.Engine, store.IgnoreDatabaseAndTableCaseSensitive(instance), nil)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to create catalog: %v", err)
- }
- for _, file := range request.Release.Files {
- if stopChecking {
- break
- }
-
- checkResult := &v1pb.CheckReleaseResponse_CheckResult{
- File: file.Path,
- Target: fmt.Sprintf("instances/%s/databases/%s", instance.ResourceID, database.DatabaseName),
- }
- // Get SQL summary report for the statement and target database.
- // Including affected rows.
- summaryReport, err := plancheck.GetSQLSummaryReport(ctx, s.store, s.sheetManager, s.dbFactory, database, file.Statement)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get SQL summary report, error: %v", err)
- }
- if summaryReport != nil {
- checkResult.AffectedRows = summaryReport.AffectedRows
- response.AffectedRows += summaryReport.AffectedRows
- }
- // Check if file has been applied to database.
- revisions, err := s.store.ListRevisions(ctx, &store.FindRevisionMessage{
- InstanceID: &database.InstanceID,
- DatabaseName: &database.DatabaseName,
- Version: &file.Version,
- ShowDeleted: false,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to list revisions: %v", err)
- }
- if len(revisions) > 0 {
- // Skip the file if it has been applied to the database.
- continue
- }
-
- adviceStatus, sqlReviewAdvices, err := s.runSQLReviewCheckForFile(ctx, catalog, instance, database, file)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to check SQL review: %v", err)
- }
- // If the advice status is not SUCCESS, we will add the file and advices to the response.
- if adviceStatus != storepb.Advice_SUCCESS {
- checkResult.Advices = sqlReviewAdvices
- }
- response.Results = append(response.Results, checkResult)
-
- // Check if we need to stop checking for the rest of files.
- for _, advice := range sqlReviewAdvices {
- switch advice.Status {
- case v1pb.Advice_ERROR:
- if errorAdviceCount < common.MaximumAdvicePerStatus {
- errorAdviceCount++
- }
- case v1pb.Advice_WARNING:
- if warningAdviceCount < common.MaximumAdvicePerStatus {
- warningAdviceCount++
- }
- default:
- }
- }
- // If we have reached the maximum number of advices for both error and warning, we will stop checking.
- if errorAdviceCount >= common.MaximumAdvicePerStatus && warningAdviceCount >= common.MaximumAdvicePerStatus {
- stopChecking = true
- }
- }
- }
- return response, nil
-}
-
-func (s *ReleaseService) runSQLReviewCheckForFile(
- ctx context.Context,
- catalog *catalog.Catalog,
- instance *store.InstanceMessage,
- database *store.DatabaseMessage,
- file *v1pb.Release_File,
-) (storepb.Advice_Status, []*v1pb.Advice, error) {
- if !isSQLReviewSupported(instance.Engine) || database == nil {
- return storepb.Advice_SUCCESS, nil, nil
- }
-
- dbSchema, err := s.store.GetDBSchema(ctx, database.InstanceID, database.DatabaseName)
- if err != nil {
- return storepb.Advice_ERROR, nil, errors.Wrapf(err, "failed to fetch database schema for database %v", database.UID)
- }
- if dbSchema == nil {
- if err := s.schemaSyncer.SyncDatabaseSchema(ctx, database, true /* force */); err != nil {
- return storepb.Advice_ERROR, nil, errors.Wrapf(err, "failed to sync database schema for database %v", database.UID)
- }
- dbSchema, err = s.store.GetDBSchema(ctx, database.InstanceID, database.DatabaseName)
- if err != nil {
- return storepb.Advice_ERROR, nil, errors.Wrapf(err, "failed to fetch database schema for database %v", database.UID)
- }
- if dbSchema == nil {
- return storepb.Advice_ERROR, nil, errors.Wrapf(err, "cannot found schema for database %v", database.UID)
- }
- }
-
- dbMetadata := dbSchema.GetMetadata()
- changeType := storepb.PlanCheckRunConfig_DDL
- switch file.ChangeType {
- case v1pb.Release_File_DDL_GHOST:
- changeType = storepb.PlanCheckRunConfig_DDL_GHOST
- case v1pb.Release_File_DML:
- changeType = storepb.PlanCheckRunConfig_DML
- }
-
- useDatabaseOwner, err := getUseDatabaseOwner(ctx, s.store, instance, database, changeType)
- if err != nil {
- return storepb.Advice_ERROR, nil, status.Errorf(codes.Internal, "failed to get use database owner: %v", err)
- }
- driver, err := s.dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{})
- if err != nil {
- return storepb.Advice_ERROR, nil, status.Errorf(codes.Internal, "failed to get database driver: %v", err)
- }
- defer driver.Close(ctx)
- connection := driver.GetDB()
-
- classificationConfig := getClassificationByProject(ctx, s.store, database.ProjectID)
- context := advisor.SQLReviewCheckContext{
- Charset: dbMetadata.CharacterSet,
- Collation: dbMetadata.Collation,
- ChangeType: changeType,
- DBSchema: dbMetadata,
- DbType: instance.Engine,
- Catalog: catalog,
- Driver: connection,
- Context: ctx,
- CurrentDatabase: database.DatabaseName,
- ClassificationConfig: classificationConfig,
- UsePostgresDatabaseOwner: useDatabaseOwner,
- ListDatabaseNamesFunc: BuildListDatabaseNamesFunc(s.store),
- InstanceID: instance.ResourceID,
- }
-
- reviewConfig, err := s.store.GetReviewConfigForDatabase(ctx, database)
- if err != nil {
- if e, ok := err.(*common.Error); ok && e.Code == common.NotFound {
- // Continue to check the builtin rules.
- reviewConfig = &storepb.ReviewConfigPayload{}
- } else {
- return storepb.Advice_ERROR, nil, status.Errorf(codes.Internal, "failed to get SQL review policy with error: %v", err)
- }
- }
-
- res, err := advisor.SQLReviewCheck(s.sheetManager, file.Statement, reviewConfig.SqlReviewRules, context)
- if err != nil {
- return storepb.Advice_ERROR, nil, status.Errorf(codes.Internal, "failed to exec SQL review with error: %v", err)
- }
-
- adviceLevel := storepb.Advice_SUCCESS
- var advices []*v1pb.Advice
- for _, advice := range res {
- switch advice.Status {
- case storepb.Advice_WARNING:
- if adviceLevel != storepb.Advice_ERROR {
- adviceLevel = storepb.Advice_WARNING
- }
- case storepb.Advice_ERROR:
- adviceLevel = storepb.Advice_ERROR
- case storepb.Advice_SUCCESS, storepb.Advice_STATUS_UNSPECIFIED:
- continue
- }
- advices = append(advices, convertToV1Advice(advice))
- }
- return adviceLevel, advices, nil
-}
-
func convertToReleases(ctx context.Context, s *store.Store, releases []*store.ReleaseMessage) ([]*v1pb.Release, error) {
var rs []*v1pb.Release
for _, release := range releases {
diff --git a/backend/api/v1/release_service_check.go b/backend/api/v1/release_service_check.go
new file mode 100644
index 0000000000..3aa7db9bda
--- /dev/null
+++ b/backend/api/v1/release_service_check.go
@@ -0,0 +1,434 @@
+package v1
+
+import (
+ "context"
+ "fmt"
+ "sort"
+
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
+
+ "github.com/google/cel-go/cel"
+ "github.com/pkg/errors"
+
+ celtypes "github.com/google/cel-go/common/types"
+
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/runner/plancheck"
+ "github.com/bytebase/bytebase/backend/store"
+ "github.com/bytebase/bytebase/backend/utils"
+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"
+ v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
+)
+
+func (s *ReleaseService) CheckRelease(ctx context.Context, request *v1pb.CheckReleaseRequest) (*v1pb.CheckReleaseResponse, error) {
+ if len(request.Targets) == 0 {
+ return nil, status.Errorf(codes.InvalidArgument, "targets cannot be empty")
+ }
+
+ var targetDatabases []*store.DatabaseMessage
+ for _, target := range request.Targets {
+ // Handle database target.
+ if instanceID, databaseName, err := common.GetInstanceDatabaseID(target); err == nil {
+ instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
+ ResourceID: &instanceID,
+ })
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to get instance, error: %v", err)
+ }
+ if instance == nil {
+ return nil, status.Errorf(codes.NotFound, "instance %q not found", instanceID)
+ }
+ database, err := s.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{
+ InstanceID: &instanceID,
+ DatabaseName: &databaseName,
+ })
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to get database, error: %v", err)
+ }
+ if database == nil {
+ return nil, status.Errorf(codes.NotFound, "database %q not found", target)
+ }
+ targetDatabases = append(targetDatabases, database)
+ }
+
+ // Handle database group target. Extract all matched databases in the database group.
+ if projectResourceID, databaseGroupResourceID, err := common.GetProjectIDDatabaseGroupID(target); err == nil {
+ project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{
+ ResourceID: &projectResourceID,
+ })
+ if err != nil {
+ return nil, status.Error(codes.Internal, err.Error())
+ }
+ if project == nil {
+ return nil, status.Errorf(codes.NotFound, "project %q not found", projectResourceID)
+ }
+ if project.Deleted {
+ return nil, status.Errorf(codes.NotFound, "project %q has been deleted", projectResourceID)
+ }
+ existedDatabaseGroup, err := s.store.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{
+ ProjectID: &project.ResourceID,
+ ResourceID: &databaseGroupResourceID,
+ })
+ if err != nil {
+ return nil, status.Error(codes.Internal, err.Error())
+ }
+ if existedDatabaseGroup == nil {
+ return nil, status.Errorf(codes.NotFound, "database group %q not found", databaseGroupResourceID)
+ }
+ groupDatabases, err := s.store.ListDatabases(ctx, &store.FindDatabaseMessage{
+ ProjectID: &projectResourceID,
+ })
+ if err != nil {
+ return nil, status.Error(codes.Internal, err.Error())
+ }
+ // Filter out databases that are matched with the database group.
+ matches, _, err := utils.GetMatchedAndUnmatchedDatabasesInDatabaseGroup(ctx, existedDatabaseGroup, groupDatabases)
+ if err != nil {
+ return nil, err
+ }
+ targetDatabases = append(targetDatabases, matches...)
+ }
+ }
+
+ // Validate and sanitize release files.
+ var err error
+ request.Release.Files, err = validateAndSanitizeReleaseFiles(request.Release.Files)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "invalid release files, err: %v", err)
+ }
+
+ response := &v1pb.CheckReleaseResponse{}
+ var errorAdviceCount, warningAdviceCount int
+ var stopChecking bool
+ var maxRiskLevel int32
+ for _, database := range targetDatabases {
+ if stopChecking {
+ break
+ }
+ instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
+ ResourceID: &database.InstanceID,
+ })
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to get instance, error: %v", err)
+ }
+ if instance == nil {
+ return nil, status.Errorf(codes.NotFound, "instance %q not found", database.InstanceID)
+ }
+
+ catalog, err := catalog.NewCatalog(ctx, s.store, database.InstanceID, database.DatabaseName, instance.Engine, store.IgnoreDatabaseAndTableCaseSensitive(instance), nil)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to create catalog: %v", err)
+ }
+ for _, file := range request.Release.Files {
+ if stopChecking {
+ break
+ }
+
+ // Check if file has been applied to database.
+ revisions, err := s.store.ListRevisions(ctx, &store.FindRevisionMessage{
+ InstanceID: &database.InstanceID,
+ DatabaseName: &database.DatabaseName,
+ Version: &file.Version,
+ ShowDeleted: false,
+ })
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to list revisions: %v", err)
+ }
+ if len(revisions) > 0 {
+ // Skip the file if it has been applied to the database.
+ continue
+ }
+
+ checkResult := &v1pb.CheckReleaseResponse_CheckResult{
+ File: file.Path,
+ Target: fmt.Sprintf("instances/%s/databases/%s", instance.ResourceID, database.DatabaseName),
+ }
+ // Get SQL summary report for the statement and target database.
+ // Including affected rows.
+ summaryReport, err := plancheck.GetSQLSummaryReport(ctx, s.store, s.sheetManager, s.dbFactory, database, file.Statement)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to get SQL summary report, error: %v", err)
+ }
+ if summaryReport != nil {
+ checkResult.AffectedRows = summaryReport.AffectedRows
+ response.AffectedRows += summaryReport.AffectedRows
+ }
+
+ changeType := storepb.PlanCheckRunConfig_DDL
+ switch file.ChangeType {
+ case v1pb.Release_File_DDL_GHOST:
+ changeType = storepb.PlanCheckRunConfig_DDL_GHOST
+ case v1pb.Release_File_DML:
+ changeType = storepb.PlanCheckRunConfig_DML
+ }
+
+ riskLevel, err := s.calculateRiskLevel(ctx, instance, database, changeType, summaryReport)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to calculate risk level, error: %v", err)
+ }
+ if riskLevel > maxRiskLevel {
+ maxRiskLevel = riskLevel
+ }
+ riskLevelEnum, err := convertRiskLevel(riskLevel)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to convert risk level, error: %v", err)
+ }
+ checkResult.RiskLevel = riskLevelEnum
+
+ adviceStatus, sqlReviewAdvices, err := s.runSQLReviewCheckForFile(ctx, catalog, instance, database, changeType, file.Statement)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to check SQL review: %v", err)
+ }
+ // If the advice status is not SUCCESS, we will add the file and advices to the response.
+ if adviceStatus != storepb.Advice_SUCCESS {
+ checkResult.Advices = sqlReviewAdvices
+ }
+ response.Results = append(response.Results, checkResult)
+
+ // Check if we need to stop checking for the rest of files.
+ for _, advice := range sqlReviewAdvices {
+ switch advice.Status {
+ case v1pb.Advice_ERROR:
+ if errorAdviceCount < common.MaximumAdvicePerStatus {
+ errorAdviceCount++
+ }
+ case v1pb.Advice_WARNING:
+ if warningAdviceCount < common.MaximumAdvicePerStatus {
+ warningAdviceCount++
+ }
+ default:
+ }
+ }
+ // If we have reached the maximum number of advices for both error and warning, we will stop checking.
+ if errorAdviceCount >= common.MaximumAdvicePerStatus && warningAdviceCount >= common.MaximumAdvicePerStatus {
+ stopChecking = true
+ }
+ }
+ }
+
+ riskLevelEnum, err := convertRiskLevel(maxRiskLevel)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to convert risk level, error: %v", err)
+ }
+ response.RiskLevel = riskLevelEnum
+ return response, nil
+}
+
+func (s *ReleaseService) runSQLReviewCheckForFile(
+ ctx context.Context,
+ catalog *catalog.Catalog,
+ instance *store.InstanceMessage,
+ database *store.DatabaseMessage,
+ changeType storepb.PlanCheckRunConfig_ChangeDatabaseType,
+ statement string,
+) (storepb.Advice_Status, []*v1pb.Advice, error) {
+ if !isSQLReviewSupported(instance.Engine) || database == nil {
+ return storepb.Advice_SUCCESS, nil, nil
+ }
+
+ dbSchema, err := s.store.GetDBSchema(ctx, database.InstanceID, database.DatabaseName)
+ if err != nil {
+ return storepb.Advice_ERROR, nil, errors.Wrapf(err, "failed to fetch database schema for database %v", database.UID)
+ }
+ if dbSchema == nil {
+ if err := s.schemaSyncer.SyncDatabaseSchema(ctx, database, true /* force */); err != nil {
+ return storepb.Advice_ERROR, nil, errors.Wrapf(err, "failed to sync database schema for database %v", database.UID)
+ }
+ dbSchema, err = s.store.GetDBSchema(ctx, database.InstanceID, database.DatabaseName)
+ if err != nil {
+ return storepb.Advice_ERROR, nil, errors.Wrapf(err, "failed to fetch database schema for database %v", database.UID)
+ }
+ if dbSchema == nil {
+ return storepb.Advice_ERROR, nil, errors.Wrapf(err, "cannot found schema for database %v", database.UID)
+ }
+ }
+
+ dbMetadata := dbSchema.GetMetadata()
+ useDatabaseOwner, err := getUseDatabaseOwner(ctx, s.store, instance, database, changeType)
+ if err != nil {
+ return storepb.Advice_ERROR, nil, status.Errorf(codes.Internal, "failed to get use database owner: %v", err)
+ }
+ driver, err := s.dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{})
+ if err != nil {
+ return storepb.Advice_ERROR, nil, status.Errorf(codes.Internal, "failed to get database driver: %v", err)
+ }
+ defer driver.Close(ctx)
+ connection := driver.GetDB()
+
+ classificationConfig := getClassificationByProject(ctx, s.store, database.ProjectID)
+ context := advisor.SQLReviewCheckContext{
+ Charset: dbMetadata.CharacterSet,
+ Collation: dbMetadata.Collation,
+ ChangeType: changeType,
+ DBSchema: dbMetadata,
+ DbType: instance.Engine,
+ Catalog: catalog,
+ Driver: connection,
+ Context: ctx,
+ CurrentDatabase: database.DatabaseName,
+ ClassificationConfig: classificationConfig,
+ UsePostgresDatabaseOwner: useDatabaseOwner,
+ ListDatabaseNamesFunc: BuildListDatabaseNamesFunc(s.store),
+ InstanceID: instance.ResourceID,
+ }
+
+ reviewConfig, err := s.store.GetReviewConfigForDatabase(ctx, database)
+ if err != nil {
+ if e, ok := err.(*common.Error); ok && e.Code == common.NotFound {
+ // Continue to check the builtin rules.
+ reviewConfig = &storepb.ReviewConfigPayload{}
+ } else {
+ return storepb.Advice_ERROR, nil, status.Errorf(codes.Internal, "failed to get SQL review policy with error: %v", err)
+ }
+ }
+
+ res, err := advisor.SQLReviewCheck(s.sheetManager, statement, reviewConfig.SqlReviewRules, context)
+ if err != nil {
+ return storepb.Advice_ERROR, nil, status.Errorf(codes.Internal, "failed to exec SQL review with error: %v", err)
+ }
+
+ adviceLevel := storepb.Advice_SUCCESS
+ var advices []*v1pb.Advice
+ for _, advice := range res {
+ switch advice.Status {
+ case storepb.Advice_WARNING:
+ if adviceLevel != storepb.Advice_ERROR {
+ adviceLevel = storepb.Advice_WARNING
+ }
+ case storepb.Advice_ERROR:
+ adviceLevel = storepb.Advice_ERROR
+ case storepb.Advice_SUCCESS, storepb.Advice_STATUS_UNSPECIFIED:
+ continue
+ }
+ advices = append(advices, convertToV1Advice(advice))
+ }
+ return adviceLevel, advices, nil
+}
+
+func (s *ReleaseService) calculateRiskLevel(ctx context.Context, instance *store.InstanceMessage, database *store.DatabaseMessage, changeType storepb.PlanCheckRunConfig_ChangeDatabaseType, summaryReport *storepb.PlanCheckRunResult_Result_SqlSummaryReport) (int32, error) {
+ risks, err := s.store.ListRisks(ctx)
+ if err != nil {
+ return 0, errors.Wrap(err, "failed to list risks")
+ }
+ // sort by level DESC, higher risks go first.
+ sort.Slice(risks, func(i, j int) bool {
+ return risks[i].Level > risks[j].Level
+ })
+
+ riskSource := getRiskSourceFromChangeType(changeType)
+ if riskSource == store.RiskSourceUnknown {
+ return 0, nil
+ }
+
+ risk, err := func() (int32, error) {
+ for _, risk := range risks {
+ if !risk.Active {
+ continue
+ }
+ if risk.Source != riskSource {
+ continue
+ }
+ if risk.Expression == nil || risk.Expression.Expression == "" {
+ continue
+ }
+ e, err := cel.NewEnv(common.RiskFactors...)
+ if err != nil {
+ return 0, errors.Wrapf(err, "failed to create cel environment")
+ }
+ ast, issues := e.Parse(risk.Expression.Expression)
+ if issues != nil && issues.Err() != nil {
+ return 0, errors.Errorf("failed to parse expression: %v", issues.Err())
+ }
+ prg, err := e.Program(ast, cel.EvalOptions(cel.OptPartialEval))
+ if err != nil {
+ return 0, err
+ }
+ args := map[string]any{
+ "environment_id": instance.EnvironmentID,
+ "project_id": database.ProjectID,
+ "database_name": database.DatabaseName,
+ // convert to string type otherwise cel-go will complain that storepb.Engine is not string type.
+ "db_engine": instance.Engine.String(),
+ }
+
+ vars, err := e.PartialVars(args)
+ if err != nil {
+ return 0, errors.Wrapf(err, "failed to get vars")
+ }
+ out, _, err := prg.Eval(vars)
+ if err != nil {
+ return 0, errors.Wrapf(err, "failed to eval expression")
+ }
+ if res, ok := out.Equal(celtypes.True).Value().(bool); ok && res {
+ return risk.Level, nil
+ }
+
+ var tableRows int64
+ for _, db := range summaryReport.GetChangedResources().GetDatabases() {
+ for _, sc := range db.GetSchemas() {
+ for _, tb := range sc.GetTables() {
+ tableRows += tb.GetTableRows()
+ }
+ }
+ }
+ args["affected_rows"] = summaryReport.AffectedRows
+ args["table_rows"] = tableRows
+
+ var tableNames []string
+ for _, db := range summaryReport.GetChangedResources().GetDatabases() {
+ for _, schema := range db.GetSchemas() {
+ for _, table := range schema.GetTables() {
+ tableNames = append(tableNames, table.Name)
+ }
+ }
+ }
+ for _, statementType := range summaryReport.StatementTypes {
+ args["sql_type"] = statementType
+ for _, tableName := range tableNames {
+ args["table_name"] = tableName
+ out, _, err := prg.Eval(args)
+ if err != nil {
+ return 0, err
+ }
+ if res, ok := out.Equal(celtypes.True).Value().(bool); ok && res {
+ return risk.Level, nil
+ }
+ }
+ }
+ }
+ return 0, nil
+ }()
+ if err != nil {
+ return 0, errors.Wrap(err, "failed to calculate risk level")
+ }
+ return risk, nil
+}
+
+func getRiskSourceFromChangeType(changeType storepb.PlanCheckRunConfig_ChangeDatabaseType) store.RiskSource {
+ switch changeType {
+ case storepb.PlanCheckRunConfig_DDL, storepb.PlanCheckRunConfig_DDL_GHOST:
+ return store.RiskSourceDatabaseSchemaUpdate
+ case storepb.PlanCheckRunConfig_DML:
+ return store.RiskSourceDatabaseDataUpdate
+ default:
+ return store.RiskSourceUnknown
+ }
+}
+
+func convertRiskLevel(riskLevel int32) (v1pb.CheckReleaseResponse_RiskLevel, error) {
+ switch riskLevel {
+ case 0:
+ return v1pb.CheckReleaseResponse_RISK_LEVEL_UNSPECIFIED, nil
+ case 100:
+ return v1pb.CheckReleaseResponse_LOW, nil
+ case 200:
+ return v1pb.CheckReleaseResponse_MODERATE, nil
+ case 300:
+ return v1pb.CheckReleaseResponse_HIGH, nil
+ }
+ return v1pb.CheckReleaseResponse_RISK_LEVEL_UNSPECIFIED, errors.Errorf("unexpected risk level %d", riskLevel)
+}
diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.ts
index ae3f877dc7..2fdf22f5e2 100644
--- a/frontend/src/types/proto/google/protobuf/descriptor.ts
+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts
@@ -36,7 +36,7 @@ export enum Edition {
EDITION_2024 = "EDITION_2024",
/**
* EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be
- * used or relyed on outside of tests.
+ * used or relied on outside of tests.
*/
EDITION_1_TEST_ONLY = "EDITION_1_TEST_ONLY",
EDITION_2_TEST_ONLY = "EDITION_2_TEST_ONLY",
@@ -1093,12 +1093,13 @@ export interface MessageOptions {
export interface FieldOptions {
/**
+ * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
* The ctype option instructs the C++ code generator to use a different
* representation of the field than it normally would. See the specific
* options below. This option is only implemented to support use of
* [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
- * type "bytes" in the open source release -- sorry, we'll try to include
- * other types in a future version!
+ * type "bytes" in the open source release.
+ * TODO: make ctype actually deprecated.
*/
ctype?:
| FieldOptions_CType
@@ -1314,11 +1315,7 @@ export function fieldOptions_JSTypeToNumber(object: FieldOptions_JSType): number
}
}
-/**
- * If set to RETENTION_SOURCE, the option will be omitted from the binary.
- * Note: as of January 2023, support for this is in progress and does not yet
- * have an effect (b/264593489).
- */
+/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */
export enum FieldOptions_OptionRetention {
RETENTION_UNKNOWN = "RETENTION_UNKNOWN",
RETENTION_RUNTIME = "RETENTION_RUNTIME",
@@ -1375,8 +1372,7 @@ export function fieldOptions_OptionRetentionToNumber(object: FieldOptions_Option
/**
* This indicates the types of entities that the field may apply to when used
* as an option. If it is unset, then the field may be freely used as an
- * option on any kind of entity. Note: as of January 2023, support for this is
- * in progress and does not yet have an effect (b/264593489).
+ * option on any kind of entity.
*/
export enum FieldOptions_OptionTargetType {
TARGET_TYPE_UNKNOWN = "TARGET_TYPE_UNKNOWN",
diff --git a/frontend/src/types/proto/v1/release_service.ts b/frontend/src/types/proto/v1/release_service.ts
index 56865d9199..117be533b1 100644
--- a/frontend/src/types/proto/v1/release_service.ts
+++ b/frontend/src/types/proto/v1/release_service.ts
@@ -235,6 +235,8 @@ export interface CheckReleaseResponse_CheckResult {
advices: Advice[];
/** The count of affected rows of the statement on the target. */
affectedRows: number;
+ /** The risk level of the statement on the target. */
+ riskLevel: CheckReleaseResponse_RiskLevel;
}
export interface Release {
@@ -1043,7 +1045,13 @@ export const CheckReleaseResponse: MessageFns<CheckReleaseResponse> = {
};
function createBaseCheckReleaseResponse_CheckResult(): CheckReleaseResponse_CheckResult {
- return { file: "", target: "", advices: [], affectedRows: 0 };
+ return {
+ file: "",
+ target: "",
+ advices: [],
+ affectedRows: 0,
+ riskLevel: CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED,
+ };
}
export const CheckReleaseResponse_CheckResult: MessageFns<CheckReleaseResponse_CheckResult> = {
@@ -1060,6 +1068,9 @@ export const CheckReleaseResponse_CheckResult: MessageFns<CheckReleaseResponse_C
if (message.affectedRows !== 0) {
writer.uint32(32).int32(message.affectedRows);
}
+ if (message.riskLevel !== CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
+ writer.uint32(40).int32(checkReleaseResponse_RiskLevelToNumber(message.riskLevel));
+ }
return writer;
},
@@ -1102,6 +1113,14 @@ export const CheckReleaseResponse_CheckResult: MessageFns<CheckReleaseResponse_C
message.affectedRows = reader.int32();
continue;
}
+ case 5: {
+ if (tag !== 40) {
+ break;
+ }
+
+ message.riskLevel = checkReleaseResponse_RiskLevelFromJSON(reader.int32());
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -1117,6 +1136,9 @@ export const CheckReleaseResponse_CheckResult: MessageFns<CheckReleaseResponse_C
target: isSet(object.target) ? globalThis.String(object.target) : "",
advices: globalThis.Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromJSON(e)) : [],
affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
+ riskLevel: isSet(object.riskLevel)
+ ? checkReleaseResponse_RiskLevelFromJSON(object.riskLevel)
+ : CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED,
};
},
@@ -1134,6 +1156,9 @@ export const CheckReleaseResponse_CheckResult: MessageFns<CheckReleaseResponse_C
if (message.affectedRows !== 0) {
obj.affectedRows = Math.round(message.affectedRows);
}
+ if (message.riskLevel !== CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
+ obj.riskLevel = checkReleaseResponse_RiskLevelToJSON(message.riskLevel);
+ }
return obj;
},
@@ -1146,6 +1171,7 @@ export const CheckReleaseResponse_CheckResult: MessageFns<CheckReleaseResponse_C
message.target = object.target ?? "";
message.advices = object.advices?.map((e) => Advice.fromPartial(e)) || [];
message.affectedRows = object.affectedRows ?? 0;
+ message.riskLevel = object.riskLevel ?? CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED;
return message;
},
};
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 14ce7bdef1..bb7214e8fa 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -9069,6 +9069,15 @@ components:
type: integer
description: The count of affected rows of the statement on the target.
format: int32
+ riskLevel:
+ enum:
+ - RISK_LEVEL_UNSPECIFIED
+ - LOW
+ - MODERATE
+ - HIGH
+ type: string
+ description: The risk level of the statement on the target.
+ format: enum
CheckRequest:
required:
- name
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index cd17f7760f..d459bc1b57 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -9399,6 +9399,7 @@ for field description.
| target | [string](#string) | | The target that the check is performed on. Should be a database. Format: instances/{instance}/databases/{database} |
| advices | [Advice](#bytebase-v1-Advice) | repeated | The list of advice for the file and the target. |
| affected_rows | [int32](#int32) | | The count of affected rows of the statement on the target. |
+| risk_level | [CheckReleaseResponse.RiskLevel](#bytebase-v1-CheckReleaseResponse-RiskLevel) | | The risk level of the statement on the target. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 5c2fc5a9cc..01aa595ea2 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -26061,6 +26061,13 @@ Should be a database. Format: instances/{instance}/databases/{database} </p></td
<td><p>The count of affected rows of the statement on the target. </p></td>
</tr>
+ <tr>
+ <td>risk_level</td>
+ <td><a href="#bytebase.v1.CheckReleaseResponse.RiskLevel">CheckReleaseResponse.RiskLevel</a></td>
+ <td></td>
+ <td><p>The risk level of the statement on the target. </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/generated-go/v1/release_service.pb.go b/proto/generated-go/v1/release_service.pb.go
index e55ce71547..f3aab04241 100644
--- a/proto/generated-go/v1/release_service.pb.go
+++ b/proto/generated-go/v1/release_service.pb.go
@@ -786,7 +786,9 @@ type CheckReleaseResponse_CheckResult struct {
// The list of advice for the file and the target.
Advices []*Advice `protobuf:"bytes,3,rep,name=advices,proto3" json:"advices,omitempty"`
// The count of affected rows of the statement on the target.
- AffectedRows int32 `protobuf:"varint,4,opt,name=affected_rows,json=affectedRows,proto3" json:"affected_rows,omitempty"`
+ AffectedRows int32 `protobuf:"varint,4,opt,name=affected_rows,json=affectedRows,proto3" json:"affected_rows,omitempty"`
+ // The risk level of the statement on the target.
+ RiskLevel CheckReleaseResponse_RiskLevel `protobuf:"varint,5,opt,name=risk_level,json=riskLevel,proto3,enum=bytebase.v1.CheckReleaseResponse_RiskLevel" json:"risk_level,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -849,6 +851,13 @@ func (x *CheckReleaseResponse_CheckResult) GetAffectedRows() int32 {
return 0
}
+func (x *CheckReleaseResponse_CheckResult) GetRiskLevel() CheckReleaseResponse_RiskLevel {
+ if x != nil {
+ return x.RiskLevel
+ }
+ return CheckReleaseResponse_RISK_LEVEL_UNSPECIFIED
+}
+
type Release_File struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The unique identifier for the file.
@@ -1097,7 +1106,7 @@ var file_v1_release_service_proto_rawDesc = string([]byte{
0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x42, 0x04,
0xe2, 0x41, 0x01, 0x02, 0x52, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a,
0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07,
- 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0xaa, 0x03, 0x0a, 0x14, 0x43, 0x68, 0x65, 0x63,
+ 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0xf6, 0x03, 0x0a, 0x14, 0x43, 0x68, 0x65, 0x63,
0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x47, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
@@ -1110,7 +1119,7 @@ var file_v1_release_service_proto_rawDesc = string([]byte{
0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x69, 0x73, 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52,
- 0x09, 0x72, 0x69, 0x73, 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x8d, 0x01, 0x0a, 0x0b, 0x43,
+ 0x09, 0x72, 0x69, 0x73, 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0xd9, 0x01, 0x0a, 0x0b, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x69,
0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
@@ -1119,144 +1128,149 @@ var file_v1_release_service_proto_rawDesc = string([]byte{
0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x61, 0x64,
0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65,
0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x61, 0x66,
- 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x22, 0x48, 0x0a, 0x09, 0x52, 0x69,
- 0x73, 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x49, 0x53, 0x4b, 0x5f,
- 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
- 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08,
- 0x4d, 0x4f, 0x44, 0x45, 0x52, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x49,
- 0x47, 0x48, 0x10, 0x03, 0x22, 0xfd, 0x06, 0x0a, 0x07, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04,
- 0xe2, 0x41, 0x01, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69,
- 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
- 0x12, 0x2f, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
- 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65,
- 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65,
- 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x76, 0x63, 0x73, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18,
- 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x56, 0x43, 0x53, 0x53,
- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x76, 0x63, 0x73, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
- 0x12, 0x1e, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28,
- 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72,
- 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
- 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
- 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54,
- 0x69, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01,
- 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x05, 0x73, 0x74,
- 0x61, 0x74, 0x65, 0x1a, 0xac, 0x03, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02,
- 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04,
- 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68,
- 0x12, 0x2d, 0x0a, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x17, 0xfa, 0x41, 0x14, 0x0a, 0x12, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63,
- 0x6f, 0x6d, 0x2f, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12,
- 0x27, 0x0a, 0x0c, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18,
- 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0b, 0x73, 0x68, 0x65,
- 0x65, 0x74, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
- 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65,
- 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65,
- 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x74,
- 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e,
- 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52,
- 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73,
- 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
- 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x0e, 0x73, 0x74, 0x61,
- 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,
- 0x03, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65,
- 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x4a, 0x0a, 0x0a, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
- 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x54,
- 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
- 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x44,
- 0x4c, 0x5f, 0x47, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x4d, 0x4c,
- 0x10, 0x03, 0x1a, 0x4e, 0x0a, 0x09, 0x56, 0x43, 0x53, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12,
- 0x2f, 0x0a, 0x08, 0x76, 0x63, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x56, 0x43, 0x53, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x76, 0x63, 0x73, 0x54, 0x79, 0x70, 0x65,
- 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75,
- 0x72, 0x6c, 0x3a, 0x40, 0xea, 0x41, 0x3d, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x25, 0x70,
- 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
- 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65,
- 0x61, 0x73, 0x65, 0x7d, 0x2a, 0x36, 0x0a, 0x0f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46,
- 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f,
- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a,
- 0x09, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x32, 0xf5, 0x08, 0x0a,
- 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
- 0x8a, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1e,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
+ 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x4a, 0x0a, 0x0a, 0x72, 0x69,
+ 0x73, 0x6b, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65,
+ 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x2e, 0x52, 0x69, 0x73, 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x09, 0x72, 0x69, 0x73,
+ 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x48, 0x0a, 0x09, 0x52, 0x69, 0x73, 0x6b, 0x4c, 0x65,
+ 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x49, 0x53, 0x4b, 0x5f, 0x4c, 0x45, 0x56, 0x45,
+ 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
+ 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x4f, 0x44, 0x45,
+ 0x52, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x49, 0x47, 0x48, 0x10, 0x03,
+ 0x22, 0xfd, 0x06, 0x0a, 0x07, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03,
+ 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x2f, 0x0a, 0x05,
+ 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73,
+ 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x3d, 0x0a,
+ 0x0a, 0x76, 0x63, 0x73, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x56, 0x43, 0x53, 0x53, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x52, 0x09, 0x76, 0x63, 0x73, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x07,
+ 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2,
+ 0x41, 0x01, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x0b,
+ 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0xe2,
+ 0x41, 0x01, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12,
+ 0x2e, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61,
+ 0x74, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a,
+ 0xac, 0x03, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x2d, 0x0a, 0x05,
+ 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, 0xfa, 0x41, 0x14,
+ 0x0a, 0x12, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53,
+ 0x68, 0x65, 0x65, 0x74, 0x52, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0c, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x04, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x53, 0x68,
+ 0x61, 0x32, 0x35, 0x36, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01,
+ 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65,
+ 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
+ 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
+ 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18,
+ 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65,
+ 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x63, 0x68, 0x61,
+ 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x42, 0x04, 0xe2,
+ 0x41, 0x01, 0x03, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x69,
+ 0x7a, 0x65, 0x22, 0x4a, 0x0a, 0x0a, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65,
+ 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a,
+ 0x03, 0x44, 0x44, 0x4c, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x44, 0x4c, 0x5f, 0x47, 0x48,
+ 0x4f, 0x53, 0x54, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x03, 0x1a, 0x4e,
+ 0x0a, 0x09, 0x56, 0x43, 0x53, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x76,
+ 0x63, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x54,
+ 0x79, 0x70, 0x65, 0x52, 0x07, 0x76, 0x63, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03,
+ 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x3a, 0x40,
+ 0xea, 0x41, 0x3d, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x2f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x25, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x72, 0x65,
+ 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x7d,
+ 0x2a, 0x36, 0x0a, 0x0f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x54,
+ 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50,
+ 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x56, 0x45, 0x52,
+ 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x32, 0xf5, 0x08, 0x0a, 0x0e, 0x52, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x0a,
+ 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65,
+ 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x22, 0x46, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x0f, 0x62, 0x62, 0x2e,
+ 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x9e, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73,
+ 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65,
+ 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
+ 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49,
+ 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xea, 0x30, 0x10, 0x62, 0x62, 0x2e,
+ 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30,
+ 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d,
+ 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0xa6, 0x01, 0x0a, 0x0d, 0x43, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x21, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14,
0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c,
- 0x65, 0x61, 0x73, 0x65, 0x22, 0x46, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30,
- 0x0f, 0x62, 0x62, 0x2e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x67, 0x65, 0x74,
- 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x9e, 0x01, 0x0a,
- 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x20, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,
- 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69,
- 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x22, 0x49, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xea, 0x30,
- 0x10, 0x62, 0x62, 0x2e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x6c, 0x69, 0x73,
- 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31,
- 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
- 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0xa6, 0x01,
- 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12,
- 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72,
- 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x5c, 0xda, 0x41, 0x0e, 0x70, 0x61, 0x72,
- 0x65, 0x6e, 0x74, 0x2c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x8a, 0xea, 0x30, 0x12, 0x62,
- 0x62, 0x2e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
- 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x07, 0x72, 0x65, 0x6c,
- 0x65, 0x61, 0x73, 0x65, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65,
- 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0xb3, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74,
- 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c,
- 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73,
- 0x65, 0x22, 0x69, 0xda, 0x41, 0x13, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2c, 0x75, 0x70,
- 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e,
- 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90,
- 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61,
- 0x73, 0x65, 0x32, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x95, 0x01, 0x0a,
- 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x21,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c,
- 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x49, 0xda, 0x41, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x73, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93,
- 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72,
- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x0f, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74,
- 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52,
- 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65,
- 0x61, 0x73, 0x65, 0x22, 0x4d, 0x8a, 0xea, 0x30, 0x14, 0x62, 0x62, 0x2e, 0x72, 0x65, 0x6c, 0x65,
- 0x61, 0x73, 0x65, 0x73, 0x2e, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x90, 0xea, 0x30,
- 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65,
- 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65,
- 0x74, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65,
- 0x61, 0x73, 0x65, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x8a, 0xea, 0x30, 0x11, 0x62, 0x62,
- 0x2e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x90,
- 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76,
- 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x3a, 0x63,
- 0x68, 0x65, 0x63, 0x6b, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,
- 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x65, 0x61, 0x73, 0x65, 0x22, 0x5c, 0xda, 0x41, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c,
+ 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x72, 0x65,
+ 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30,
+ 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72,
+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73,
+ 0x65, 0x73, 0x12, 0xb3, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x69, 0xda,
+ 0x41, 0x13, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x72, 0x65, 0x6c, 0x65,
+ 0x61, 0x73, 0x65, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x32, 0x28,
+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x95, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c,
+ 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52,
+ 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
+ 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x49, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea,
+ 0x30, 0x12, 0x62, 0x62, 0x2e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x64, 0x65,
+ 0x6c, 0x65, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x2a, 0x20,
+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+ 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d,
+ 0x12, 0x9b, 0x01, 0x0a, 0x0f, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61,
+ 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22,
+ 0x4d, 0x8a, 0xea, 0x30, 0x14, 0x62, 0x62, 0x2e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73,
+ 0x2e, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x2b, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70,
+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73,
+ 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x9f,
+ 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12,
+ 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68,
+ 0x65, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x8a, 0xea, 0x30, 0x11, 0x62, 0x62, 0x2e, 0x72, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x90, 0xea, 0x30, 0x01, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
+ 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x3a, 0x63, 0x68, 0x65, 0x63, 0x6b,
+ 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f,
+ 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
})
var (
@@ -1310,28 +1324,29 @@ var file_v1_release_service_proto_depIdxs = []int32{
17, // 9: bytebase.v1.Release.create_time:type_name -> google.protobuf.Timestamp
18, // 10: bytebase.v1.Release.state:type_name -> bytebase.v1.State
19, // 11: bytebase.v1.CheckReleaseResponse.CheckResult.advices:type_name -> bytebase.v1.Advice
- 0, // 12: bytebase.v1.Release.File.type:type_name -> bytebase.v1.ReleaseFileType
- 2, // 13: bytebase.v1.Release.File.change_type:type_name -> bytebase.v1.Release.File.ChangeType
- 20, // 14: bytebase.v1.Release.VCSSource.vcs_type:type_name -> bytebase.v1.VCSType
- 3, // 15: bytebase.v1.ReleaseService.GetRelease:input_type -> bytebase.v1.GetReleaseRequest
- 4, // 16: bytebase.v1.ReleaseService.ListReleases:input_type -> bytebase.v1.ListReleasesRequest
- 6, // 17: bytebase.v1.ReleaseService.CreateRelease:input_type -> bytebase.v1.CreateReleaseRequest
- 7, // 18: bytebase.v1.ReleaseService.UpdateRelease:input_type -> bytebase.v1.UpdateReleaseRequest
- 8, // 19: bytebase.v1.ReleaseService.DeleteRelease:input_type -> bytebase.v1.DeleteReleaseRequest
- 9, // 20: bytebase.v1.ReleaseService.UndeleteRelease:input_type -> bytebase.v1.UndeleteReleaseRequest
- 10, // 21: bytebase.v1.ReleaseService.CheckRelease:input_type -> bytebase.v1.CheckReleaseRequest
- 12, // 22: bytebase.v1.ReleaseService.GetRelease:output_type -> bytebase.v1.Release
- 5, // 23: bytebase.v1.ReleaseService.ListReleases:output_type -> bytebase.v1.ListReleasesResponse
- 12, // 24: bytebase.v1.ReleaseService.CreateRelease:output_type -> bytebase.v1.Release
- 12, // 25: bytebase.v1.ReleaseService.UpdateRelease:output_type -> bytebase.v1.Release
- 21, // 26: bytebase.v1.ReleaseService.DeleteRelease:output_type -> google.protobuf.Empty
- 12, // 27: bytebase.v1.ReleaseService.UndeleteRelease:output_type -> bytebase.v1.Release
- 11, // 28: bytebase.v1.ReleaseService.CheckRelease:output_type -> bytebase.v1.CheckReleaseResponse
- 22, // [22:29] is the sub-list for method output_type
- 15, // [15:22] is the sub-list for method input_type
- 15, // [15:15] is the sub-list for extension type_name
- 15, // [15:15] is the sub-list for extension extendee
- 0, // [0:15] is the sub-list for field type_name
+ 1, // 12: bytebase.v1.CheckReleaseResponse.CheckResult.risk_level:type_name -> bytebase.v1.CheckReleaseResponse.RiskLevel
+ 0, // 13: bytebase.v1.Release.File.type:type_name -> bytebase.v1.ReleaseFileType
+ 2, // 14: bytebase.v1.Release.File.change_type:type_name -> bytebase.v1.Release.File.ChangeType
+ 20, // 15: bytebase.v1.Release.VCSSource.vcs_type:type_name -> bytebase.v1.VCSType
+ 3, // 16: bytebase.v1.ReleaseService.GetRelease:input_type -> bytebase.v1.GetReleaseRequest
+ 4, // 17: bytebase.v1.ReleaseService.ListReleases:input_type -> bytebase.v1.ListReleasesRequest
+ 6, // 18: bytebase.v1.ReleaseService.CreateRelease:input_type -> bytebase.v1.CreateReleaseRequest
+ 7, // 19: bytebase.v1.ReleaseService.UpdateRelease:input_type -> bytebase.v1.UpdateReleaseRequest
+ 8, // 20: bytebase.v1.ReleaseService.DeleteRelease:input_type -> bytebase.v1.DeleteReleaseRequest
+ 9, // 21: bytebase.v1.ReleaseService.UndeleteRelease:input_type -> bytebase.v1.UndeleteReleaseRequest
+ 10, // 22: bytebase.v1.ReleaseService.CheckRelease:input_type -> bytebase.v1.CheckReleaseRequest
+ 12, // 23: bytebase.v1.ReleaseService.GetRelease:output_type -> bytebase.v1.Release
+ 5, // 24: bytebase.v1.ReleaseService.ListReleases:output_type -> bytebase.v1.ListReleasesResponse
+ 12, // 25: bytebase.v1.ReleaseService.CreateRelease:output_type -> bytebase.v1.Release
+ 12, // 26: bytebase.v1.ReleaseService.UpdateRelease:output_type -> bytebase.v1.Release
+ 21, // 27: bytebase.v1.ReleaseService.DeleteRelease:output_type -> google.protobuf.Empty
+ 12, // 28: bytebase.v1.ReleaseService.UndeleteRelease:output_type -> bytebase.v1.Release
+ 11, // 29: bytebase.v1.ReleaseService.CheckRelease:output_type -> bytebase.v1.CheckReleaseResponse
+ 23, // [23:30] is the sub-list for method output_type
+ 16, // [16:23] is the sub-list for method input_type
+ 16, // [16:16] is the sub-list for extension type_name
+ 16, // [16:16] is the sub-list for extension extendee
+ 0, // [0:16] is the sub-list for field type_name
}
func init() { file_v1_release_service_proto_init() }
diff --git a/proto/v1/release_service.proto b/proto/v1/release_service.proto
index 8f54d5a9cb..4027ea1e35 100644
--- a/proto/v1/release_service.proto
+++ b/proto/v1/release_service.proto
@@ -176,6 +176,9 @@ message CheckReleaseResponse {
// The count of affected rows of the statement on the target.
int32 affected_rows = 4;
+
+ // The risk level of the statement on the target.
+ RiskLevel risk_level = 5;
}
repeated CheckResult results = 1;