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: migrate activity (create & update issue comment) (#6673)
ecmadaoc9832b1aa43f
diff --git a/backend/api/v1/logging_service.go b/backend/api/v1/logging_service.goindex a9b6d4d3c1..80ba68ed5c 100644--- a/backend/api/v1/logging_service.go+++ b/backend/api/v1/logging_service.go@@ -135,7 +135,7 @@ func (s *LoggingService) ListLogs(ctx context.Context, request *v1pb.ListLogsReqif user == nil {return nil, errors.Errorf("cannot found user %s", creatorEmail)}- activityFind.CreatorID = &user.ID+ activityFind.CreatorUID = &user.IDcase "resource":if spec.operator != comparatorTypeEqual {return nil, status.Errorf(codes.InvalidArgument, `only support "=" operation for "resource" filter`)@@ -346,7 +346,7 @@ func (s *LoggingService) convertToLogEntity(ctx context.Context, activity *storeresource = fmt.Sprintf("%s%s", instanceNamePrefix, instance.ResourceID)}- user, err := s.store.GetUserByID(ctx, activity.CreatorID)+ user, err := s.store.GetUserByID(ctx, activity.CreatorUID)if err != nil {return nil, err}diff --git a/backend/api/v1/review_service.go b/backend/api/v1/review_service.goindex cc8d8559a9..e331a30563 100644--- a/backend/api/v1/review_service.go+++ b/backend/api/v1/review_service.go@@ -6,6 +6,7 @@ import ("fmt""strconv""strings"+ "time""go.uber.org/zap""google.golang.org/grpc/codes"@@ -55,16 +56,9 @@ func NewReviewService(store *store.Store, activityManager *activity.Manager, tas// GetReview gets a review.// Currently, only review.ApprovalTemplates and review.Approvers are set.func (s *ReviewService) GetReview(ctx context.Context, request *v1pb.GetReviewRequest) (*v1pb.Review, error) {- reviewID, err := getReviewID(request.Name)+ issue, err := s.getIssue(ctx, request.Name)if err != nil {- return nil, status.Errorf(codes.InvalidArgument, err.Error())- }- issue, err := s.store.GetIssueV2(ctx, &store.FindIssueMessage{UID: &reviewID})- if err != nil {- return nil, status.Errorf(codes.Internal, "failed to get issue, error: %v", err)- }- if issue == nil {- return nil, status.Errorf(codes.NotFound, "issue %d not found", reviewID)+ return nil, err}review, err := convertToReview(ctx, s.store, issue)if err != nil {@@ -75,16 +69,9 @@ func (s *ReviewService) GetReview(ctx context.Context, request *v1pb.GetReviewRe// ApproveReview approves the approval flow of the review.func (s *ReviewService) ApproveReview(ctx context.Context, request *v1pb.ApproveReviewRequest) (*v1pb.Review, error) {- reviewID, err := getReviewID(request.Name)- if err != nil {- return nil, status.Errorf(codes.InvalidArgument, err.Error())- }- issue, err := s.store.GetIssueV2(ctx, &store.FindIssueMessage{UID: &reviewID})+ issue, err := s.getIssue(ctx, request.Name)if err != nil {- return nil, status.Errorf(codes.Internal, "failed to get issue, error: %v", err)- }- if issue == nil {- return nil, status.Errorf(codes.NotFound, "issue %d not found", reviewID)+ return nil, err}payload := &storepb.IssuePayload{}if err := protojson.Unmarshal([]byte(issue.Payload), payload); err != nil {@@ -310,16 +297,9 @@ func (s *ReviewService) ApproveReview(ctx context.Context, request *v1pb.Approve// RejectReview rejects a review.func (s *ReviewService) RejectReview(ctx context.Context, request *v1pb.RejectReviewRequest) (*v1pb.Review, error) {- reviewID, err := getReviewID(request.Name)+ issue, err := s.getIssue(ctx, request.Name)if err != nil {- return nil, status.Errorf(codes.InvalidArgument, err.Error())- }- issue, err := s.store.GetIssueV2(ctx, &store.FindIssueMessage{UID: &reviewID})- if err != nil {- return nil, status.Errorf(codes.Internal, "failed to get issue, error: %v", err)- }- if issue == nil {- return nil, status.Errorf(codes.NotFound, "issue %d not found", reviewID)+ return nil, err}payload := &storepb.IssuePayload{}if err := protojson.Unmarshal([]byte(issue.Payload), payload); err != nil {@@ -423,16 +403,9 @@ func (s *ReviewService) RejectReview(ctx context.Context, request *v1pb.RejectRe// RequestReview requests a review.func (s *ReviewService) RequestReview(ctx context.Context, request *v1pb.RequestReviewRequest) (*v1pb.Review, error) {- reviewID, err := getReviewID(request.Name)+ issue, err := s.getIssue(ctx, request.Name)if err != nil {- return nil, status.Errorf(codes.InvalidArgument, err.Error())- }- issue, err := s.store.GetIssueV2(ctx, &store.FindIssueMessage{UID: &reviewID})- if err != nil {- return nil, status.Errorf(codes.Internal, "failed to get issue, error: %v", err)- }- if issue == nil {- return nil, status.Errorf(codes.NotFound, "issue %d not found", reviewID)+ return nil, err}payload := &storepb.IssuePayload{}if err := protojson.Unmarshal([]byte(issue.Payload), payload); err != nil {@@ -545,16 +518,9 @@ func (s *ReviewService) UpdateReview(ctx context.Context, request *v1pb.UpdateReif request.UpdateMask == nil {return nil, status.Errorf(codes.InvalidArgument, "update_mask must be set")}- reviewID, err := getReviewID(request.Review.Name)+ issue, err := s.getIssue(ctx, request.Review.Name)if err != nil {- return nil, status.Errorf(codes.InvalidArgument, err.Error())- }- issue, err := s.store.GetIssueV2(ctx, &store.FindIssueMessage{UID: &reviewID})- if err != nil {- return nil, status.Errorf(codes.Internal, "failed to get issue, error: %v", err)- }- if issue == nil {- return nil, status.Errorf(codes.NotFound, "issue %d not found", reviewID)+ return nil, err}patch := &store.UpdateIssueMessage{}@@ -606,6 +572,94 @@ func (s *ReviewService) UpdateReview(ctx context.Context, request *v1pb.UpdateRereturn review, nil}+// CreateReviewComment creates the review comment.+func (s *ReviewService) CreateReviewComment(ctx context.Context, request *v1pb.CreateReviewCommentRequest) (*v1pb.ReviewComment, error) {+ if request.ReviewComment.Comment == "" {+ return nil, status.Errorf(codes.InvalidArgument, "review comment is empty")+ }+ issue, err := s.getIssue(ctx, request.Parent)+ if err != nil {+ return nil, err+ }++ // TODO: migrate to store v2+ activityCreate := &api.ActivityCreate{+ CreatorID: ctx.Value(common.PrincipalIDContextKey).(int),+ ContainerID: issue.UID,+ Type: api.ActivityIssueCommentCreate,+ Level: api.ActivityInfo,+ Comment: request.ReviewComment.Comment,+ }++ var payload api.ActivityIssueCommentCreatePayload+ if activityCreate.Payload != "" {+ if err := json.Unmarshal([]byte(activityCreate.Payload), &payload); err != nil {+ return nil, status.Errorf(codes.Internal, "failed to unmarshal payload: %v", err.Error())+ }+ }+ payload.IssueName = issue.Title+ bytes, err := json.Marshal(payload)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to marshal payload: %v", err.Error())+ }+ activityCreate.Payload = string(bytes)++ activity, err := s.activityManager.CreateActivity(ctx, activityCreate, &activity.Metadata{Issue: issue})+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to create review comment: %v", err.Error())+ }+ return &v1pb.ReviewComment{+ Uid: fmt.Sprintf("%d", activity.ID),+ Comment: activity.Comment,+ Payload: activity.Payload,+ CreateTime: timestamppb.New(time.Unix(activity.CreatedTs, 0)),+ UpdateTime: timestamppb.New(time.Unix(activity.UpdatedTs, 0)),+ }, nil+}++// UpdateReviewComment updates the review comment.+func (s *ReviewService) UpdateReviewComment(ctx context.Context, request *v1pb.UpdateReviewCommentRequest) (*v1pb.ReviewComment, error) {+ if request.UpdateMask.Paths == nil {+ return nil, status.Errorf(codes.InvalidArgument, "update_mask is required")+ }+ activityUID, err := strconv.Atoi(request.ReviewComment.Uid)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, `invalid comment id "%s": %v`, request.ReviewComment.Uid, err.Error())+ }++ principalID := ctx.Value(common.PrincipalIDContextKey).(int)+ update := &store.UpdateActivityMessage{+ UID: activityUID,+ CreatorUID: &principalID,+ UpdaterUID: principalID,+ }++ for _, path := range request.UpdateMask.Paths {+ switch path {+ case "comment":+ update.Comment = &request.ReviewComment.Comment+ default:+ return nil, status.Errorf(codes.InvalidArgument, `unsupport update_mask: "%s"`, path)+ }+ }++ activity, err := s.store.UpdateActivityV2(ctx, update)+ if err != nil {+ if common.ErrorCode(err) == common.NotFound {+ return nil, status.Errorf(codes.NotFound, "cannot found the review comment %s", request.ReviewComment.Uid)+ }+ return nil, status.Errorf(codes.Internal, "failed to update the review comment with error: %v", err.Error())+ }++ return &v1pb.ReviewComment{+ Uid: fmt.Sprintf("%d", activity.UID),+ Comment: activity.Comment,+ Payload: activity.Payload,+ CreateTime: timestamppb.New(time.Unix(activity.CreatedTs, 0)),+ UpdateTime: timestamppb.New(time.Unix(activity.UpdatedTs, 0)),+ }, nil+}+func (s *ReviewService) onReviewApproved(ctx context.Context, issue *store.IssueMessage) {if issue.Type == api.IssueGrantRequest {if err := func() error {@@ -629,6 +683,21 @@ func (s *ReviewService) onReviewApproved(ctx context.Context, issue *store.Issue}}+func (s *ReviewService) getIssue(ctx context.Context, name string) (*store.IssueMessage, error) {+ reviewID, err := getReviewID(name)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }+ issue, err := s.store.GetIssueV2(ctx, &store.FindIssueMessage{UID: &reviewID})+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to get issue, error: %v", err)+ }+ if issue == nil {+ return nil, status.Errorf(codes.NotFound, "issue %d not found", reviewID)+ }+ return issue, nil+}+func canRequestReview(issueCreator *store.UserMessage, user *store.UserMessage) bool {return issueCreator.ID == user.ID}diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.goindex ce8f14fe5a..02996ea3c9 100644--- a/backend/api/v1/sql_service.go+++ b/backend/api/v1/sql_service.go@@ -184,11 +184,11 @@ func (s *SQLService) postAdminExecute(ctx context.Context, activity *api.Activit}payloadString := string(payloadBytes)- if _, err := s.store.PatchActivity(ctx, &api.ActivityPatch{- ID: activity.ID,- UpdaterID: activity.CreatorID,- Level: newLevel,- Payload: &payloadString,+ if _, err := s.store.UpdateActivityV2(ctx, &store.UpdateActivityMessage{+ UID: activity.ID,+ UpdaterUID: activity.CreatorID,+ Level: newLevel,+ Payload: &payloadString,}); err != nil {return status.Errorf(codes.Internal, "Failed to update activity after executing sql statement: %v", err)}@@ -272,11 +272,11 @@ func (s *SQLService) postExport(ctx context.Context, activity *api.Activity, dur}payloadString := string(payloadBytes)- if _, err := s.store.PatchActivity(ctx, &api.ActivityPatch{- ID: activity.ID,- UpdaterID: activity.CreatorID,- Level: newLevel,- Payload: &payloadString,+ if _, err := s.store.UpdateActivityV2(ctx, &store.UpdateActivityMessage{+ UID: activity.ID,+ UpdaterUID: activity.CreatorID,+ Level: newLevel,+ Payload: &payloadString,}); err != nil {return status.Errorf(codes.Internal, "Failed to update activity after exporting sql statement: %v", err)}@@ -618,11 +618,11 @@ func (s *SQLService) postQuery(ctx context.Context, _ *v1pb.QueryRequest, advice}payloadString := string(payloadBytes)- if _, err := s.store.PatchActivity(ctx, &api.ActivityPatch{- ID: activity.ID,- UpdaterID: activity.CreatorID,- Level: &newLevel,- Payload: &payloadString,+ if _, err := s.store.UpdateActivityV2(ctx, &store.UpdateActivityMessage{+ UID: activity.ID,+ UpdaterUID: activity.CreatorID,+ Level: &newLevel,+ Payload: &payloadString,}); err != nil {return nil, status.Errorf(codes.Internal, "Failed to update activity after executing sql statement: %v", err)}diff --git a/backend/server/acl.go b/backend/server/acl.goindex 9ea210f82a..e706b307b0 100644--- a/backend/server/acl.go+++ b/backend/server/acl.go@@ -212,7 +212,7 @@ func isUpdatingSelf(ctx context.Context, c echo.Context, s *Server, curPrincipalreturn false, echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Activity ID not found: %d", activityID))}- return activity.CreatorID == curPrincipalID, nil+ return activity.CreatorUID == curPrincipalID, nil}}return false, nildiff --git a/backend/server/activity.go b/backend/server/activity.godeleted file mode 100644index 58d8971f22..0000000000--- a/backend/server/activity.go+++ /dev/null@@ -1,93 +0,0 @@-package server--import (- "encoding/json"- "fmt"- "net/http"- "strconv"-- "github.com/google/jsonapi"- "github.com/labstack/echo/v4"-- "github.com/bytebase/bytebase/backend/common"- "github.com/bytebase/bytebase/backend/component/activity"- api "github.com/bytebase/bytebase/backend/legacyapi"- "github.com/bytebase/bytebase/backend/store"-)--func (s *Server) registerActivityRoutes(g *echo.Group) {- g.POST("/activity", func(c echo.Context) error {- ctx := c.Request().Context()- activityCreate := &api.ActivityCreate{}- if err := jsonapi.UnmarshalPayload(c.Request().Body, activityCreate); err != nil {- return echo.NewHTTPError(http.StatusBadRequest, "Malformed create activity request").SetInternal(err)- }- if activityCreate.Type != api.ActivityIssueCommentCreate {- return echo.NewHTTPError(http.StatusBadRequest, "Only allow to create activity for issue comment")- }-- activityCreate.Level = api.ActivityInfo- activityCreate.CreatorID = c.Get(getPrincipalIDContextKey()).(int)- issue, err := s.store.GetIssueV2(ctx, &store.FindIssueMessage{UID: &activityCreate.ContainerID})- if err != nil {- return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to fetch issue ID when creating the comment: %d", activityCreate.ContainerID)).SetInternal(err)- }- if issue == nil {- return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Unable to find issue ID for creating the comment: %d", activityCreate.ContainerID))- }-- var payload api.ActivityIssueCommentCreatePayload- if activityCreate.Payload != "" {- if err := json.Unmarshal([]byte(activityCreate.Payload), &payload); err != nil {- return echo.NewHTTPError(http.StatusBadRequest, "Failed to unmarshal payload %v", activityCreate.Payload).SetInternal(err)- }- }- payload.IssueName = issue.Title- bytes, err := json.Marshal(payload)- if err != nil {- return echo.NewHTTPError(http.StatusInternalServerError, "Failed to construct activity payload").SetInternal(err)- }- activityCreate.Payload = string(bytes)-- activity, err := s.ActivityManager.CreateActivity(ctx, activityCreate, &activity.Metadata{Issue: issue})- if err != nil {- return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err)- }-- c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)- if err := jsonapi.MarshalPayload(c.Response().Writer, activity); err != nil {- return echo.NewHTTPError(http.StatusInternalServerError, "Failed to marshal created activity response").SetInternal(err)- }- return nil- })-- g.PATCH("/activity/:activityID", func(c echo.Context) error {- ctx := c.Request().Context()- id, err := strconv.Atoi(c.Param("activityID"))- if err != nil {- return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("ID is not a number: %s", c.Param("activityID"))).SetInternal(err)- }-- activityPatch := &api.ActivityPatch{- ID: id,- UpdaterID: c.Get(getPrincipalIDContextKey()).(int),- }- if err := jsonapi.UnmarshalPayload(c.Request().Body, activityPatch); err != nil {- return echo.NewHTTPError(http.StatusBadRequest, "Malformed patch activity request").SetInternal(err)- }- // We only allow to update comment from frontend.- activity, err := s.store.PatchActivity(ctx, activityPatch)- if err != nil {- if common.ErrorCode(err) == common.NotFound {- return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Activity ID not found: %d", id))- }- return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to patch activity ID: %v", id)).SetInternal(err)- }-- c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)- if err := jsonapi.MarshalPayload(c.Response().Writer, activity); err != nil {- return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to marshal activity ID response: %v", id)).SetInternal(err)- }- return nil- })-}diff --git a/backend/server/server.go b/backend/server/server.goindex 6bd28dc5ef..21a84a7d4b 100644--- a/backend/server/server.go+++ b/backend/server/server.go@@ -521,7 +521,6 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {s.registerIssueSubscriberRoutes(apiGroup)s.registerTaskRoutes(apiGroup)s.registerStageRoutes(apiGroup)- s.registerActivityRoutes(apiGroup)s.registerSQLRoutes(apiGroup)// Register healthz endpoint.diff --git a/backend/store/activity.go b/backend/store/activity.goindex 65948d6c76..6c7f9dc18a 100644--- a/backend/store/activity.go+++ b/backend/store/activity.go@@ -91,19 +91,6 @@ func (s *Store) BatchCreateActivity(ctx context.Context, creates []*api.Activityreturn activityList, nil}-// PatchActivity patches an instance of Activity.-func (s *Store) PatchActivity(ctx context.Context, patch *api.ActivityPatch) (*api.Activity, error) {- activityRaw, err := s.patchActivityRaw(ctx, patch)- if err != nil {- return nil, errors.Wrapf(err, "failed to patch Activity with ActivityPatch[%+v]", patch)- }- activity, err := s.composeActivity(ctx, activityRaw)- if err != nil {- return nil, errors.Wrapf(err, "failed to compose Activity with activityRaw[%+v]", activityRaw)- }- return activity, nil-}-//// private function//@@ -151,27 +138,6 @@ func (s *Store) createActivityRaw(ctx context.Context, create *api.ActivityCreatreturn activityRawList[0], nil}-// patchActivityRaw updates an existing activity by ID.-// Returns ENOTFOUND if activity does not exist.-func (s *Store) patchActivityRaw(ctx context.Context, patch *api.ActivityPatch) (*activityRaw, error) {- tx, err := s.db.BeginTx(ctx, nil)- if err != nil {- return nil, err- }- defer tx.Rollback()-- activity, err := patchActivityImpl(ctx, tx, patch)- if err != nil {- return nil, err- }-- if err := tx.Commit(); err != nil {- return nil, err- }-- return activity, nil-}-func (s *Store) composeActivity(ctx context.Context, raw *activityRaw) (*api.Activity, error) {activity := raw.toActivity()@@ -270,57 +236,6 @@ func createActivityImpl(ctx context.Context, tx *Tx, creates ...*api.ActivityCrereturn activityRawList, nil}-// patchActivityImpl updates a activity by ID. Returns the new state of the activity after update.-func patchActivityImpl(ctx context.Context, tx *Tx, patch *api.ActivityPatch) (*activityRaw, error) {- // Build UPDATE clause.- set, args := []string{"updater_id = $1"}, []any{patch.UpdaterID}- if v := patch.Comment; v != nil {- set, args = append(set, fmt.Sprintf("comment = $%d", len(args)+1)), append(args, api.Role(*v))- }- if v := patch.Payload; v != nil {- set, args = append(set, fmt.Sprintf("payload = $%d", len(args)+1)), append(args, *v)- }- if v := patch.Level; v != nil {- set, args = append(set, fmt.Sprintf("level = $%d", len(args)+1)), append(args, *v)- }-- args = append(args, patch.ID)-- var activityRaw activityRaw- var protoPayload string- // Execute update query with RETURNING.- if err := tx.QueryRowContext(ctx, fmt.Sprintf(`- UPDATE activity- SET `+strings.Join(set, ", ")+`- WHERE id = $%d- RETURNING id, creator_id, created_ts, updater_id, updated_ts, container_id, type, level, comment, payload- `, len(args)),- args...,- ).Scan(- &activityRaw.ID,- &activityRaw.CreatorID,- &activityRaw.CreatedTs,- &activityRaw.UpdaterID,- &activityRaw.UpdatedTs,- &activityRaw.ContainerID,- &activityRaw.Type,- &activityRaw.Level,- &activityRaw.Comment,- &protoPayload,- ); err != nil {- if err == sql.ErrNoRows {- return nil, &common.Error{Code: common.NotFound, Err: errors.Errorf("activity ID not found: %d", patch.ID)}- }- return nil, err- }- var err error- if activityRaw.Payload, err = convertProtoPayloadToAPIPayload(activityRaw.Type, protoPayload); err != nil {- return nil, err- }-- return &activityRaw, nil-}-func convertAPIPayloadToProtoPayload(activityType api.ActivityType, payload string) (string, error) {// TODO(zp): remove here when we migrate all payloads.switch activityType {@@ -531,8 +446,8 @@ type ActivityMessage struct {UpdatedTs int64// Related fields- CreatorID int- UpdaterID int+ CreatorUID int+ UpdaterUID int// The object where this activity belongs// e.g if Type is "bb.issue.xxx", then this field refers to the corresponding issue's id.ContainerUID int@@ -547,7 +462,7 @@ type ActivityMessage struct {// FindActivityMessage is the API message for listing activities.type FindActivityMessage struct {UID *int- CreatorID *int+ CreatorUID *intLevelList []api.ActivityLevelTypeList []api.ActivityTypeContainerUID *int@@ -561,6 +476,88 @@ type FindActivityMessage struct {Order *api.SortOrder}+// UpdateActivityMessage updates the activity.+type UpdateActivityMessage struct {+ UID int+ CreatorUID *int+ UpdaterUID int+ Comment *string+ Level *api.ActivityLevel+ Payload *string+}++// UpdateActivityV2 updates the activity.+// Returns ENOTFOUND if activity does not exist.+func (s *Store) UpdateActivityV2(ctx context.Context, update *UpdateActivityMessage) (*ActivityMessage, error) {+ tx, err := s.db.BeginTx(ctx, nil)+ if err != nil {+ return nil, err+ }+ defer tx.Rollback()++ set, args := []string{"updater_id = $1"}, []any{update.UpdaterUID}+ if v := update.Comment; v != nil {+ set, args = append(set, fmt.Sprintf("comment = $%d", len(args)+1)), append(args, *v)+ }+ if v := update.Payload; v != nil {+ set, args = append(set, fmt.Sprintf("payload = $%d", len(args)+1)), append(args, *v)+ }+ if v := update.Level; v != nil {+ set, args = append(set, fmt.Sprintf("level = $%d", len(args)+1)), append(args, *v)+ }++ where, args := []string{fmt.Sprintf("id = $%d", len(args)+1)}, append(args, update.UID)+ if v := update.CreatorUID; v != nil {+ where, args = append(where, fmt.Sprintf("creator_id = $%d", len(args)+1)), append(args, *v)+ }++ query := fmt.Sprintf(`+ UPDATE activity+ SET %s+ WHERE %s+ RETURNING+ id,+ creator_id,+ updater_id,+ created_ts,+ updated_ts,+ container_id,+ type,+ level,+ comment,+ payload+ `, strings.Join(set, ", "), strings.Join(where, " AND "))++ var activity ActivityMessage+ var protoPayload string+ if err := tx.QueryRowContext(ctx, query, args...).Scan(+ &activity.UID,+ &activity.CreatorUID,+ &activity.UpdaterUID,+ &activity.CreatedTs,+ &activity.UpdatedTs,+ &activity.ContainerUID,+ &activity.Type,+ &activity.Level,+ &activity.Comment,+ &protoPayload,+ ); err != nil {+ if err == sql.ErrNoRows {+ return nil, &common.Error{Code: common.NotFound, Err: errors.Errorf("cannot found activity with id: %d", update.UID)}+ }+ return nil, err+ }+ if activity.Payload, err = convertProtoPayloadToAPIPayload(activity.Type, protoPayload); err != nil {+ return nil, err+ }++ if err := tx.Commit(); err != nil {+ return nil, err+ }++ return &activity, nil+}+// GetActivityV2 gets the activity.// Returns ECONFLICT if finding more than 1 matching records.func (s *Store) GetActivityV2(ctx context.Context, uid int) (*ActivityMessage, error) {@@ -627,7 +624,7 @@ func listActivityImplV2(ctx context.Context, tx *Tx, find *FindActivityMessage)if v := find.ContainerUID; v != nil {where, args = append(where, fmt.Sprintf("container_id = $%d", len(args)+1)), append(args, *v)}- if v := find.CreatorID; v != nil {+ if v := find.CreatorUID; v != nil {where, args = append(where, fmt.Sprintf("creator_id = $%d", len(args)+1)), append(args, *v)}if v := find.LevelList; len(v) > 0 {@@ -689,8 +686,8 @@ func listActivityImplV2(ctx context.Context, tx *Tx, find *FindActivityMessage)var protoPayload stringif err := rows.Scan(&activity.UID,- &activity.CreatorID,- &activity.UpdaterID,+ &activity.CreatorUID,+ &activity.UpdaterUID,&activity.CreatedTs,&activity.UpdatedTs,&activity.ContainerUID,diff --git a/frontend/src/components/Issue/IssueActivityPanel.vue b/frontend/src/components/Issue/IssueActivityPanel.vueindex 0af1d052b6..ecfcfe7dc4 100644--- a/frontend/src/components/Issue/IssueActivityPanel.vue+++ b/frontend/src/components/Issue/IssueActivityPanel.vue@@ -156,7 +156,6 @@ import UserAvatar from "../User/UserAvatar.vue";import type {Issue,ActivityIssueFieldUpdatePayload,- ActivityCreate,IssueSubscriber,ActivityIssueCommentCreatePayload,} from "@/types";@@ -164,7 +163,7 @@ import { extractUserResourceName, sizeToFit } from "@/utils";import { IssueBuiltinFieldId } from "@/plugins";import {useIssueSubscriberStore,- useActivityLegacyStore,+ useReviewV1Store,useActivityV1Store,useCurrentUserV1,useCurrentUser,@@ -185,7 +184,7 @@ interface LocalState {activeActivity?: LogEntity;}-const activityLegacyStore = useActivityLegacyStore();+const reviewV1Store = useReviewV1Store();const activityV1Store = useActivityV1Store();const route = useRoute();@@ -280,30 +279,30 @@ const cancelEditComment = () => {};const doCreateComment = (comment: string, clear = true) => {- const createActivity: ActivityCreate = {- type: "bb.issue.comment.create",- containerId: issue.value.id,- comment,- };- activityLegacyStore.createActivity(createActivity).then(() => {- if (clear) {- newComment.value = "";- nextTick(() => sizeToFit(newCommentTextArea.value));- }+ reviewV1Store+ .createReviewComment({+ reviewId: issue.value.id,+ comment,+ })+ .then(() => {+ if (clear) {+ newComment.value = "";+ nextTick(() => sizeToFit(newCommentTextArea.value));+ }- // Because the user just added a comment and we assume she is interested in this- // issue, and we add her to the subscriber list if she is not there- let isSubscribed = false;- for (const subscriber of subscriberList.value) {- if (subscriber.subscriber.id == currentUser.value.id) {- isSubscribed = true;- break;+ // Because the user just added a comment and we assume she is interested in this+ // issue, and we add her to the subscriber list if she is not there+ let isSubscribed = false;+ for (const subscriber of subscriberList.value) {+ if (subscriber.subscriber.id == currentUser.value.id) {+ isSubscribed = true;+ break;+ }}- }- if (!isSubscribed) {- addSubscriberId(currentUser.value.id);- }- });+ if (!isSubscribed) {+ addSubscriberId(currentUser.value.id);+ }+ });};const allowEditActivity = (activity: LogEntity) => {@@ -336,11 +335,11 @@ const doUpdateComment = () => {return;}const activityId = getLogId(state.activeActivity.name);- activityLegacyStore- .updateComment({- activityId,- issueId: issue.value.id,- updatedComment: editComment.value,+ reviewV1Store+ .updateReviewComment({+ commentId: `${activityId}`,+ reviewId: issue.value.id,+ comment: editComment.value,}).then(() => {cancelEditComment();diff --git a/frontend/src/components/Issue/rollback/common.ts b/frontend/src/components/Issue/rollback/common.tsindex ba825e5668..6880600cd0 100644--- a/frontend/src/components/Issue/rollback/common.ts+++ b/frontend/src/components/Issue/rollback/common.ts@@ -2,8 +2,6 @@ import { computed } from "vue";import { head } from "lodash-es";import {- ActivityCreate,- ActivityIssueCommentCreatePayload,ComposedDatabase,Issue,IssueCreate,@@ -25,7 +23,7 @@ import {} from "@/utils";import { flattenTaskList, useIssueLogic } from "../logic";import {- useActivityLegacyStore,+ useReviewV1Store,useCurrentUserV1,useDatabaseV1Store,useIssueStore,@@ -189,19 +187,14 @@ export const useRollbackLogic = () => {const issueEntity = issue.value as Issue;const action = on ? "Enable" : "Disable";- const taskName = `[${taskEntity.name}]`;- const comment = `${action} SQL rollback log for task ${taskName}.`;- const payload: ActivityIssueCommentCreatePayload = {- issueName: issueEntity.name,- };- const createActivity: ActivityCreate = {- type: "bb.issue.comment.create",- containerId: issueEntity.id,- comment,- payload,- };try {- await useActivityLegacyStore().createActivity(createActivity);+ await useReviewV1Store().createReviewComment({+ reviewId: issueEntity.id,+ comment: `${action} SQL rollback log for task [${taskEntity.name}].`,+ payload: {+ issueName: issueEntity.name,+ },+ });} catch {// do nothing// failing to comment to won't be too bad@@ -267,24 +260,20 @@ export const maybeCreateBackTraceComments = async (newIssue: Issue) => {"to rollback task",`[${fromTask.name}]`,].join(" ");-- const payload: ActivityIssueCommentCreatePayload = {- issueName: fromIssue.name,- taskRollbackBy: {- issueId: fromIssue.id,- taskId: fromTask.id,- rollbackByIssueId: newIssue.id,- rollbackByTaskId: byTask.id,- },- };- const createActivity: ActivityCreate = {- type: "bb.issue.comment.create",- containerId: fromIssue.id,- comment,- payload,- };try {- await useActivityLegacyStore().createActivity(createActivity);+ await useReviewV1Store().createReviewComment({+ reviewId: fromIssue.id,+ comment,+ payload: {+ issueName: fromIssue.name,+ taskRollbackBy: {+ issueId: fromIssue.id,+ taskId: fromTask.id,+ rollbackByIssueId: newIssue.id,+ rollbackByTaskId: byTask.id,+ },+ },+ });} catch {// do nothing// failing to comment to won't be too baddiff --git a/frontend/src/store/modules/activity.ts b/frontend/src/store/modules/activity.tsdeleted file mode 100644index e3c43da7c0..0000000000--- a/frontend/src/store/modules/activity.ts+++ /dev/null@@ -1,50 +0,0 @@-import { defineStore } from "pinia";-import axios from "axios";-import { cloneDeep } from "lodash-es";-import { ActivityCreate, IdType, ActivityPatch, IssueId } from "@/types";-import { useActivityV1Store } from "./v1";--export const useActivityLegacyStore = defineStore("activity", {- actions: {- async createActivity(newActivity: ActivityCreate) {- const postData = {- data: {- type: "activityCreate",- attributes: cloneDeep(newActivity) as any,- },- };- if (postData.data.attributes.payload) {- postData.data.attributes.payload = JSON.stringify(- postData.data.attributes.payload- );- }- await axios.post(`/api/activity`, postData);- // There might exist other activities happened since the last fetch, so we do a full refetch.- if (newActivity.type.startsWith("bb.issue.")) {- useActivityV1Store().fetchActivityListByIssueId(- newActivity.containerId- );- }- },- async updateComment({- activityId,- issueId,- updatedComment,- }: {- activityId: IdType;- issueId: IssueId;- updatedComment: string;- }) {- const activityPatch: ActivityPatch = {- comment: updatedComment,- };- await axios.patch(`/api/activity/${activityId}`, {- data: {- type: "activityPatch",- attributes: activityPatch,- },- });- useActivityV1Store().fetchActivityListByIssueId(issueId);- },- },-});diff --git a/frontend/src/store/modules/index.ts b/frontend/src/store/modules/index.tsindex e85d117f1e..391a1ef2ab 100644--- a/frontend/src/store/modules/index.ts+++ b/frontend/src/store/modules/index.ts@@ -1,4 +1,3 @@-export * from "./activity";export * from "./auth";export * from "./command";export * from "./database";diff --git a/frontend/src/store/modules/v1/common.ts b/frontend/src/store/modules/v1/common.tsindex d0aac6d12e..2fa6b5ccee 100644--- a/frontend/src/store/modules/v1/common.ts+++ b/frontend/src/store/modules/v1/common.ts@@ -13,6 +13,7 @@ export const databaseGroupNamePrefix = "databaseGroups/";export const schemaGroupNamePrefix = "schemaGroups/";export const externalVersionControlPrefix = "externalVersionControls/";export const logNamePrefix = "logs/";+export const reviewNamePrefix = "reviews/";export const getNameParentTokens = (name: string,diff --git a/frontend/src/store/modules/v1/index.ts b/frontend/src/store/modules/v1/index.tsindex 2a131bf033..bd58ecbc5b 100644--- a/frontend/src/store/modules/v1/index.ts+++ b/frontend/src/store/modules/v1/index.ts@@ -21,3 +21,4 @@ export * from "./activity";export * from "./bookmark";export * from "./inbox";export * from "./anomaly";+export * from "./review";diff --git a/frontend/src/store/modules/v1/review.ts b/frontend/src/store/modules/v1/review.tsnew file mode 100644index 0000000000..5de628f81c--- /dev/null+++ b/frontend/src/store/modules/v1/review.ts@@ -0,0 +1,52 @@+import { defineStore } from "pinia";++import { reviewServiceClient } from "@/grpcweb";+import { useActivityV1Store } from "./activity";+import { IdType, ActivityIssueCommentCreatePayload } from "@/types";+import { projectNamePrefix, reviewNamePrefix } from "./common";++export const useReviewV1Store = defineStore("review_v1", () => {+ const createReviewComment = async ({+ reviewId,+ comment,+ payload,+ }: {+ reviewId: IdType;+ comment: string;+ payload?: ActivityIssueCommentCreatePayload;+ }) => {+ await reviewServiceClient.createReviewComment({+ parent: `${projectNamePrefix}-/${reviewNamePrefix}${reviewId}`,+ reviewComment: {+ comment,+ payload: JSON.stringify(payload ?? {}),+ },+ });+ await useActivityV1Store().fetchActivityListByIssueId(reviewId);+ };++ const updateReviewComment = async ({+ commentId,+ reviewId,+ comment,+ }: {+ commentId: string;+ reviewId: IdType;+ comment: string;+ }) => {+ await reviewServiceClient.updateReviewComment({+ parent: `${projectNamePrefix}-/${reviewNamePrefix}${reviewId}`,+ reviewComment: {+ uid: commentId,+ comment,+ },+ updateMask: ["comment"],+ });+ await useActivityV1Store().fetchActivityListByIssueId(reviewId);+ };++ return {+ createReviewComment,+ updateReviewComment,+ };+});diff --git a/frontend/src/types/activity.ts b/frontend/src/types/activity.tsindex d4a3110421..c20ffd9cc6 100644--- a/frontend/src/types/activity.ts+++ b/frontend/src/types/activity.ts@@ -1,7 +1,6 @@import { ExternalApprovalEvent } from "./externalApproval";import { FieldId } from "../plugins";import {- ContainerId,DatabaseId,InstanceId,IssueId,@@ -204,19 +203,6 @@ export type ActionPayloadType =| ActivityProjectDatabaseTransferPayload| ActivitySQLEditorQueryPayload;-export type ActivityCreate = {- // Domain specific fields- containerId: ContainerId;- type: "bb.issue.comment.create";- comment: string;- payload?: ActionPayloadType;-};--export type ActivityPatch = {- // Domain specific fields- comment: string;-};-export interface FindActivityMessage {resource?: string;creatorEmail?: string;diff --git a/frontend/src/types/proto/v1/review_service.ts b/frontend/src/types/proto/v1/review_service.tsindex c2620973ed..2cfa57e072 100644--- a/frontend/src/types/proto/v1/review_service.ts+++ b/frontend/src/types/proto/v1/review_service.ts@@ -431,6 +431,35 @@ export function approvalNode_GroupValueToJSON(object: ApprovalNode_GroupValue):}}+export interface CreateReviewCommentRequest {+ /**+ * The review name+ * Format: projects/{project}/reviews/{review}+ */+ parent: string;+ reviewComment?: ReviewComment;+}++export interface UpdateReviewCommentRequest {+ /**+ * The review name+ * Format: projects/{project}/reviews/{review}+ */+ parent: string;+ reviewComment?: ReviewComment;+ /** The list of fields to update. */+ updateMask?: string[];+}++export interface ReviewComment {+ uid: string;+ comment: string;+ /** TODO: use struct message instead. */+ payload: string;+ createTime?: Date;+ updateTime?: Date;+}+function createBaseGetReviewRequest(): GetReviewRequest {return { name: "" };}@@ -1843,6 +1872,277 @@ export const ApprovalNode = {},};+function createBaseCreateReviewCommentRequest(): CreateReviewCommentRequest {+ return { parent: "", reviewComment: undefined };+}++export const CreateReviewCommentRequest = {+ encode(message: CreateReviewCommentRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.parent !== "") {+ writer.uint32(10).string(message.parent);+ }+ if (message.reviewComment !== undefined) {+ ReviewComment.encode(message.reviewComment, writer.uint32(18).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): CreateReviewCommentRequest {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseCreateReviewCommentRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.parent = reader.string();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.reviewComment = ReviewComment.decode(reader, reader.uint32());+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): CreateReviewCommentRequest {+ return {+ parent: isSet(object.parent) ? String(object.parent) : "",+ reviewComment: isSet(object.reviewComment) ? ReviewComment.fromJSON(object.reviewComment) : undefined,+ };+ },++ toJSON(message: CreateReviewCommentRequest): unknown {+ const obj: any = {};+ message.parent !== undefined && (obj.parent = message.parent);+ message.reviewComment !== undefined &&+ (obj.reviewComment = message.reviewComment ? ReviewComment.toJSON(message.reviewComment) : undefined);+ return obj;+ },++ create(base?: DeepPartial<CreateReviewCommentRequest>): CreateReviewCommentRequest {+ return CreateReviewCommentRequest.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<CreateReviewCommentRequest>): CreateReviewCommentRequest {+ const message = createBaseCreateReviewCommentRequest();+ message.parent = object.parent ?? "";+ message.reviewComment = (object.reviewComment !== undefined && object.reviewComment !== null)+ ? ReviewComment.fromPartial(object.reviewComment)+ : undefined;+ return message;+ },+};++function createBaseUpdateReviewCommentRequest(): UpdateReviewCommentRequest {+ return { parent: "", reviewComment: undefined, updateMask: undefined };+}++export const UpdateReviewCommentRequest = {+ encode(message: UpdateReviewCommentRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.parent !== "") {+ writer.uint32(10).string(message.parent);+ }+ if (message.reviewComment !== undefined) {+ ReviewComment.encode(message.reviewComment, writer.uint32(18).fork()).ldelim();+ }+ if (message.updateMask !== undefined) {+ FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(26).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): UpdateReviewCommentRequest {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseUpdateReviewCommentRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.parent = reader.string();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.reviewComment = ReviewComment.decode(reader, reader.uint32());+ continue;+ case 3:+ if (tag !== 26) {+ break;+ }++ message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): UpdateReviewCommentRequest {+ return {+ parent: isSet(object.parent) ? String(object.parent) : "",+ reviewComment: isSet(object.reviewComment) ? ReviewComment.fromJSON(object.reviewComment) : undefined,+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,+ };+ },++ toJSON(message: UpdateReviewCommentRequest): unknown {+ const obj: any = {};+ message.parent !== undefined && (obj.parent = message.parent);+ message.reviewComment !== undefined &&+ (obj.reviewComment = message.reviewComment ? ReviewComment.toJSON(message.reviewComment) : undefined);+ message.updateMask !== undefined && (obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask)));+ return obj;+ },++ create(base?: DeepPartial<UpdateReviewCommentRequest>): UpdateReviewCommentRequest {+ return UpdateReviewCommentRequest.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<UpdateReviewCommentRequest>): UpdateReviewCommentRequest {+ const message = createBaseUpdateReviewCommentRequest();+ message.parent = object.parent ?? "";+ message.reviewComment = (object.reviewComment !== undefined && object.reviewComment !== null)+ ? ReviewComment.fromPartial(object.reviewComment)+ : undefined;+ message.updateMask = object.updateMask ?? undefined;+ return message;+ },+};++function createBaseReviewComment(): ReviewComment {+ return { uid: "", comment: "", payload: "", createTime: undefined, updateTime: undefined };+}++export const ReviewComment = {+ encode(message: ReviewComment, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.uid !== "") {+ writer.uint32(10).string(message.uid);+ }+ if (message.comment !== "") {+ writer.uint32(18).string(message.comment);+ }+ if (message.payload !== "") {+ writer.uint32(26).string(message.payload);+ }+ if (message.createTime !== undefined) {+ Timestamp.encode(toTimestamp(message.createTime), writer.uint32(34).fork()).ldelim();+ }+ if (message.updateTime !== undefined) {+ Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(42).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): ReviewComment {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseReviewComment();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.uid = reader.string();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.comment = reader.string();+ continue;+ case 3:+ if (tag !== 26) {+ break;+ }++ message.payload = reader.string();+ continue;+ case 4:+ if (tag !== 34) {+ break;+ }++ message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));+ continue;+ case 5:+ if (tag !== 42) {+ break;+ }++ message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): ReviewComment {+ return {+ uid: isSet(object.uid) ? String(object.uid) : "",+ comment: isSet(object.comment) ? String(object.comment) : "",+ payload: isSet(object.payload) ? String(object.payload) : "",+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,+ updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,+ };+ },++ toJSON(message: ReviewComment): unknown {+ const obj: any = {};+ message.uid !== undefined && (obj.uid = message.uid);+ message.comment !== undefined && (obj.comment = message.comment);+ message.payload !== undefined && (obj.payload = message.payload);+ message.createTime !== undefined && (obj.createTime = message.createTime.toISOString());+ message.updateTime !== undefined && (obj.updateTime = message.updateTime.toISOString());+ return obj;+ },++ create(base?: DeepPartial<ReviewComment>): ReviewComment {+ return ReviewComment.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<ReviewComment>): ReviewComment {+ const message = createBaseReviewComment();+ message.uid = object.uid ?? "";+ message.comment = object.comment ?? "";+ message.payload = object.payload ?? "";+ message.createTime = object.createTime ?? undefined;+ message.updateTime = object.updateTime ?? undefined;+ return message;+ },+};+export type ReviewServiceDefinition = typeof ReviewServiceDefinition;export const ReviewServiceDefinition = {name: "ReviewService",@@ -2073,6 +2373,220 @@ export const ReviewServiceDefinition = {},},},+ createReviewComment: {+ name: "CreateReviewComment",+ requestType: CreateReviewCommentRequest,+ requestStream: false,+ responseType: ReviewComment,+ responseStream: false,+ options: {+ _unknownFields: {+ 8410: [+ new Uint8Array([+ 21,+ 112,+ 97,+ 114,+ 101,+ 110,+ 116,+ 44,+ 114,+ 101,+ 118,+ 105,+ 101,+ 119,+ 95,+ 99,+ 111,+ 109,+ 109,+ 101,+ 110,+ 116,+ ]),+ ],+ 578365826: [+ new Uint8Array([+ 59,+ 58,+ 14,+ 114,+ 101,+ 118,+ 105,+ 101,+ 119,+ 95,+ 99,+ 111,+ 109,+ 109,+ 101,+ 110,+ 116,+ 34,+ 41,+ 47,+ 118,+ 49,+ 47,+ 123,+ 112,+ 97,+ 114,+ 101,+ 110,+ 116,+ 61,+ 112,+ 114,+ 111,+ 106,+ 101,+ 99,+ 116,+ 115,+ 47,+ 42,+ 47,+ 114,+ 101,+ 118,+ 105,+ 101,+ 119,+ 115,+ 47,+ 42,+ 125,+ 58,+ 99,+ 111,+ 109,+ 109,+ 101,+ 110,+ 116,+ ]),+ ],+ },+ },+ },+ updateReviewComment: {+ name: "UpdateReviewComment",+ requestType: UpdateReviewCommentRequest,+ requestStream: false,+ responseType: ReviewComment,+ responseStream: false,+ options: {+ _unknownFields: {+ 8410: [+ new Uint8Array([+ 33,+ 112,+ 97,+ 114,+ 101,+ 110,+ 116,+ 44,+ 114,+ 101,+ 118,+ 105,+ 101,+ 119,+ 95,+ 99,+ 111,+ 109,+ 109,+ 101,+ 110,+ 116,+ 44,+ 117,+ 112,+ 100,+ 97,+ 116,+ 101,+ 95,+ 109,+ 97,+ 115,+ 107,+ ]),+ ],+ 578365826: [+ new Uint8Array([+ 59,+ 58,+ 14,+ 114,+ 101,+ 118,+ 105,+ 101,+ 119,+ 95,+ 99,+ 111,+ 109,+ 109,+ 101,+ 110,+ 116,+ 50,+ 41,+ 47,+ 118,+ 49,+ 47,+ 123,+ 112,+ 97,+ 114,+ 101,+ 110,+ 116,+ 61,+ 112,+ 114,+ 111,+ 106,+ 101,+ 99,+ 116,+ 115,+ 47,+ 42,+ 47,+ 114,+ 101,+ 118,+ 105,+ 101,+ 119,+ 115,+ 47,+ 42,+ 125,+ 58,+ 99,+ 111,+ 109,+ 109,+ 101,+ 110,+ 116,+ ]),+ ],+ },+ },+ },batchUpdateReviews: {name: "BatchUpdateReviews",requestType: BatchUpdateReviewsRequest,@@ -2327,6 +2841,14 @@ export interface ReviewServiceImplementation<CallContextExt = {}> {context: CallContext & CallContextExt,): Promise<DeepPartial<ListReviewsResponse>>;updateReview(request: UpdateReviewRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Review>>;+ createReviewComment(+ request: CreateReviewCommentRequest,+ context: CallContext & CallContextExt,+ ): Promise<DeepPartial<ReviewComment>>;+ updateReviewComment(+ request: UpdateReviewCommentRequest,+ context: CallContext & CallContextExt,+ ): Promise<DeepPartial<ReviewComment>>;batchUpdateReviews(request: BatchUpdateReviewsRequest,context: CallContext & CallContextExt,@@ -2344,6 +2866,14 @@ export interface ReviewServiceClient<CallOptionsExt = {}> {options?: CallOptions & CallOptionsExt,): Promise<ListReviewsResponse>;updateReview(request: DeepPartial<UpdateReviewRequest>, options?: CallOptions & CallOptionsExt): Promise<Review>;+ createReviewComment(+ request: DeepPartial<CreateReviewCommentRequest>,+ options?: CallOptions & CallOptionsExt,+ ): Promise<ReviewComment>;+ updateReviewComment(+ request: DeepPartial<UpdateReviewCommentRequest>,+ options?: CallOptions & CallOptionsExt,+ ): Promise<ReviewComment>;batchUpdateReviews(request: DeepPartial<BatchUpdateReviewsRequest>,options?: CallOptions & CallOptionsExt,diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex ce03aa743b..9fd599743d 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -360,6 +360,7 @@- [ApproveReviewRequest](#bytebase-v1-ApproveReviewRequest)- [BatchUpdateReviewsRequest](#bytebase-v1-BatchUpdateReviewsRequest)- [BatchUpdateReviewsResponse](#bytebase-v1-BatchUpdateReviewsResponse)+ - [CreateReviewCommentRequest](#bytebase-v1-CreateReviewCommentRequest)- [CreateReviewRequest](#bytebase-v1-CreateReviewRequest)- [GetReviewRequest](#bytebase-v1-GetReviewRequest)- [ListReviewsRequest](#bytebase-v1-ListReviewsRequest)@@ -368,6 +369,8 @@- [RequestReviewRequest](#bytebase-v1-RequestReviewRequest)- [Review](#bytebase-v1-Review)- [Review.Approver](#bytebase-v1-Review-Approver)+ - [ReviewComment](#bytebase-v1-ReviewComment)+ - [UpdateReviewCommentRequest](#bytebase-v1-UpdateReviewCommentRequest)- [UpdateReviewRequest](#bytebase-v1-UpdateReviewRequest)- [ApprovalNode.GroupValue](#bytebase-v1-ApprovalNode-GroupValue)@@ -5788,6 +5791,22 @@ TYPE_PROJECT_REPOSITORY_PUSH represents Bytebase receiving a push event from the+<a name="bytebase-v1-CreateReviewCommentRequest"></a>++### CreateReviewCommentRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| parent | [string](#string) | | The review name Format: projects/{project}/reviews/{review} |+| review_comment | [ReviewComment](#bytebase-v1-ReviewComment) | | |++++++<a name="bytebase-v1-CreateReviewRequest"></a>### CreateReviewRequest@@ -5933,6 +5952,42 @@ When paginating, all other parameters provided to `ListReviews` must match the c+<a name="bytebase-v1-ReviewComment"></a>++### ReviewComment++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| uid | [string](#string) | | |+| comment | [string](#string) | | |+| payload | [string](#string) | | TODO: use struct message instead. |+| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |+| update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |+++++++<a name="bytebase-v1-UpdateReviewCommentRequest"></a>++### UpdateReviewCommentRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| parent | [string](#string) | | The review name Format: projects/{project}/reviews/{review} |+| review_comment | [ReviewComment](#bytebase-v1-ReviewComment) | | |+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to update. |++++++<a name="bytebase-v1-UpdateReviewRequest"></a>### UpdateReviewRequest@@ -6045,6 +6100,8 @@ ANY means approving any node will proceed.| CreateReview | [CreateReviewRequest](#bytebase-v1-CreateReviewRequest) | [Review](#bytebase-v1-Review) | || ListReviews | [ListReviewsRequest](#bytebase-v1-ListReviewsRequest) | [ListReviewsResponse](#bytebase-v1-ListReviewsResponse) | || UpdateReview | [UpdateReviewRequest](#bytebase-v1-UpdateReviewRequest) | [Review](#bytebase-v1-Review) | |+| CreateReviewComment | [CreateReviewCommentRequest](#bytebase-v1-CreateReviewCommentRequest) | [ReviewComment](#bytebase-v1-ReviewComment) | |+| UpdateReviewComment | [UpdateReviewCommentRequest](#bytebase-v1-UpdateReviewCommentRequest) | [ReviewComment](#bytebase-v1-ReviewComment) | || BatchUpdateReviews | [BatchUpdateReviewsRequest](#bytebase-v1-BatchUpdateReviewsRequest) | [BatchUpdateReviewsResponse](#bytebase-v1-BatchUpdateReviewsResponse) | || ApproveReview | [ApproveReviewRequest](#bytebase-v1-ApproveReviewRequest) | [Review](#bytebase-v1-Review) | || RejectReview | [RejectReviewRequest](#bytebase-v1-RejectReviewRequest) | [Review](#bytebase-v1-Review) | |diff --git a/proto/generated-go/v1/review_service.pb.go b/proto/generated-go/v1/review_service.pb.goindex a2c6c74d9e..06144eeae3 100644--- a/proto/generated-go/v1/review_service.pb.go+++ b/proto/generated-go/v1/review_service.pb.go@@ -1339,6 +1339,209 @@ func (*ApprovalNode_Role) isApprovalNode_Payload() {}func (*ApprovalNode_ExternalNodeId) isApprovalNode_Payload() {}+type CreateReviewCommentRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The review name+ // Format: projects/{project}/reviews/{review}+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`+ ReviewComment *ReviewComment `protobuf:"bytes,2,opt,name=review_comment,json=reviewComment,proto3" json:"review_comment,omitempty"`+}++func (x *CreateReviewCommentRequest) Reset() {+ *x = CreateReviewCommentRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_review_service_proto_msgTypes[15]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *CreateReviewCommentRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*CreateReviewCommentRequest) ProtoMessage() {}++func (x *CreateReviewCommentRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_review_service_proto_msgTypes[15]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use CreateReviewCommentRequest.ProtoReflect.Descriptor instead.+func (*CreateReviewCommentRequest) Descriptor() ([]byte, []int) {+ return file_v1_review_service_proto_rawDescGZIP(), []int{15}+}++func (x *CreateReviewCommentRequest) GetParent() string {+ if x != nil {+ return x.Parent+ }+ return ""+}++func (x *CreateReviewCommentRequest) GetReviewComment() *ReviewComment {+ if x != nil {+ return x.ReviewComment+ }+ return nil+}++type UpdateReviewCommentRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The review name+ // Format: projects/{project}/reviews/{review}+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`+ ReviewComment *ReviewComment `protobuf:"bytes,2,opt,name=review_comment,json=reviewComment,proto3" json:"review_comment,omitempty"`+ // The list of fields to update.+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`+}++func (x *UpdateReviewCommentRequest) Reset() {+ *x = UpdateReviewCommentRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_review_service_proto_msgTypes[16]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *UpdateReviewCommentRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UpdateReviewCommentRequest) ProtoMessage() {}++func (x *UpdateReviewCommentRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_review_service_proto_msgTypes[16]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use UpdateReviewCommentRequest.ProtoReflect.Descriptor instead.+func (*UpdateReviewCommentRequest) Descriptor() ([]byte, []int) {+ return file_v1_review_service_proto_rawDescGZIP(), []int{16}+}++func (x *UpdateReviewCommentRequest) GetParent() string {+ if x != nil {+ return x.Parent+ }+ return ""+}++func (x *UpdateReviewCommentRequest) GetReviewComment() *ReviewComment {+ if x != nil {+ return x.ReviewComment+ }+ return nil+}++func (x *UpdateReviewCommentRequest) GetUpdateMask() *fieldmaskpb.FieldMask {+ if x != nil {+ return x.UpdateMask+ }+ return nil+}++type ReviewComment struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`+ Comment string `protobuf:"bytes,2,opt,name=comment,proto3" json:"comment,omitempty"`+ // TODO: use struct message instead.+ Payload string `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`+}++func (x *ReviewComment) Reset() {+ *x = ReviewComment{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_review_service_proto_msgTypes[17]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *ReviewComment) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*ReviewComment) ProtoMessage() {}++func (x *ReviewComment) ProtoReflect() protoreflect.Message {+ mi := &file_v1_review_service_proto_msgTypes[17]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use ReviewComment.ProtoReflect.Descriptor instead.+func (*ReviewComment) Descriptor() ([]byte, []int) {+ return file_v1_review_service_proto_rawDescGZIP(), []int{17}+}++func (x *ReviewComment) GetUid() string {+ if x != nil {+ return x.Uid+ }+ return ""+}++func (x *ReviewComment) GetComment() string {+ if x != nil {+ return x.Comment+ }+ return ""+}++func (x *ReviewComment) GetPayload() string {+ if x != nil {+ return x.Payload+ }+ return ""+}++func (x *ReviewComment) GetCreateTime() *timestamppb.Timestamp {+ if x != nil {+ return x.CreateTime+ }+ return nil+}++func (x *ReviewComment) GetUpdateTime() *timestamppb.Timestamp {+ if x != nil {+ return x.UpdateTime+ }+ return nil+}+type Review_Approver struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -1353,7 +1556,7 @@ type Review_Approver struct {func (x *Review_Approver) Reset() {*x = Review_Approver{}if protoimpl.UnsafeEnabled {- mi := &file_v1_review_service_proto_msgTypes[15]+ mi := &file_v1_review_service_proto_msgTypes[18]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1366,7 +1569,7 @@ func (x *Review_Approver) String() string {func (*Review_Approver) ProtoMessage() {}func (x *Review_Approver) ProtoReflect() protoreflect.Message {- mi := &file_v1_review_service_proto_msgTypes[15]+ mi := &file_v1_review_service_proto_msgTypes[18]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1574,81 +1777,138 @@ var file_v1_review_service_proto_rawDesc = []byte{0x0a, 0x0d, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10,0x03, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x45, 0x4d,0x42, 0x45, 0x52, 0x10, 0x04, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,- 0x2a, 0x4f, 0x0a, 0x0c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,- 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55,- 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,- 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x4e,- 0x45, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x45, 0x44, 0x10,- 0x03, 0x32, 0xb7, 0x08, 0x0a, 0x0d, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x53, 0x65, 0x72, 0x76,- 0x69, 0x63, 0x65, 0x12, 0x6f, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77,- 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47,- 0x65, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,- 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65,- 0x76, 0x69, 0x65, 0x77, 0x22, 0x2e, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4,- 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70,- 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77,- 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52,- 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,- 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77,- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x3f, 0xda, 0x41,- 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x82, 0xd3,- 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x06, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x1f, 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, 0x76, 0x69, 0x65, 0x77, 0x73, 0x12, 0x82, 0x01,- 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x12, 0x1f, 0x2e,- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,- 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20,- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,- 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,- 0x22, 0x30, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02,- 0x21, 0x12, 0x1f, 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, 0x76, 0x69, 0x65,- 0x77, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76,- 0x69, 0x65, 0x77, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,- 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65,+ 0x22, 0x77, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77,+ 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16,+ 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0e, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77,+ 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76,+ 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0d, 0x72, 0x65, 0x76, 0x69,+ 0x65, 0x77, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xb9, 0x01, 0x0a, 0x1a, 0x55, 0x70,+ 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e,+ 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65,+ 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,+ 0x12, 0x41, 0x0a, 0x0e, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65,+ 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6d,+ 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0d, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6d, 0x6d,+ 0x65, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61,+ 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,+ 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64,+ 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74,+ 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0xde, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77,+ 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01,+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x18,+ 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c,+ 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f,+ 0x61, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d,+ 0x65, 0x18, 0x04, 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, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,+ 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74,+ 0x69, 0x6d, 0x65, 0x18, 0x05, 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, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x2a, 0x4f, 0x0a, 0x0c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77,+ 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57,+ 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,+ 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x10, 0x01, 0x12,+ 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x41, 0x4e,+ 0x43, 0x45, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x32, 0xb3, 0x0b, 0x0a, 0x0d, 0x52, 0x65, 0x76, 0x69,+ 0x65, 0x77, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6f, 0x0a, 0x09, 0x47, 0x65, 0x74,+ 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65,0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,- 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x4b, 0xda, 0x41, 0x12, 0x72,- 0x65, 0x76, 0x69, 0x65, 0x77, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73,- 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, 0x06, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x32,- 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x2e, 0x6e, 0x61, 0x6d,- 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76,- 0x69, 0x65, 0x77, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x9d, 0x01, 0x0a, 0x12, 0x42, 0x61, 0x74, 0x63,- 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x12, 0x26,- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74,- 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x52,- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,- 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,- 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, 0x01, 0x2a, 0x22, 0x2b, 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, 0x76, 0x69, 0x65, 0x77, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63,- 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x7b, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x72, 0x6f,- 0x76, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x52, 0x65,+ 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x2e, 0xda, 0x41, 0x04, 0x6e,+ 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x7b,+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,+ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x0c, 0x43,+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x20, 0x2e, 0x62, 0x79,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,+ 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69,+ 0x65, 0x77, 0x22, 0x3f, 0xda, 0x41, 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x72, 0x65,+ 0x76, 0x69, 0x65, 0x77, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x06, 0x72, 0x65, 0x76, 0x69,+ 0x65, 0x77, 0x22, 0x1f, 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, 0x76, 0x69,+ 0x65, 0x77, 0x73, 0x12, 0x82, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69,+ 0x65, 0x77, 0x73, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,+ 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x52, 0x65, 0x71,+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x52, 0x65,+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,+ 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 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, 0x76, 0x69, 0x65, 0x77, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64,+ 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65,0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79,0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77,- 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a, 0x01, 0x2a, 0x22, 0x27, 0x2f, 0x76, 0x31,- 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,- 0x2a, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x70, 0x70,- 0x72, 0x6f, 0x76, 0x65, 0x12, 0x78, 0x0a, 0x0c, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65,- 0x76, 0x69, 0x65, 0x77, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,- 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52,- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x31, 0x82, 0xd3, 0xe4,- 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,- 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76,- 0x69, 0x65, 0x77, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x7b,- 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12,- 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65,- 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65,- 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,- 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a,- 0x01, 0x2a, 0x22, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72,- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73,- 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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,+ 0x22, 0x4b, 0xda, 0x41, 0x12, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x2c, 0x75, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, 0x06, 0x72,+ 0x65, 0x76, 0x69, 0x65, 0x77, 0x32, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x76, 0x69,+ 0x65, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73,+ 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb5, 0x01,+ 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f,+ 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,+ 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77,+ 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a,+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76,+ 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x59, 0xda, 0x41, 0x15, 0x70,+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6d,+ 0x6d, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x3a, 0x0e, 0x72, 0x65, 0x76, 0x69,+ 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f,+ 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73,+ 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x63, 0x6f,+ 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0xc1, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,+ 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52,+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6d, 0x6d, 0x65,+ 0x6e, 0x74, 0x22, 0x65, 0xda, 0x41, 0x21, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x72, 0x65,+ 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x75, 0x70, 0x64,+ 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x3a, 0x0e,+ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x29,+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a,+ 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x2f, 0x2a,+ 0x7d, 0x3a, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x9d, 0x01, 0x0a, 0x12, 0x42, 0x61,+ 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73,+ 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42,+ 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77,+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,+ 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, 0x01, 0x2a, 0x22, 0x2b, 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, 0x76, 0x69, 0x65, 0x77, 0x73, 0x3a, 0x62, 0x61,+ 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x7b, 0x0a, 0x0d, 0x41, 0x70, 0x70,+ 0x72, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74,+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65,+ 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69,+ 0x65, 0x77, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a, 0x01, 0x2a, 0x22, 0x27, 0x2f,+ 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,+ 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61,+ 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x12, 0x78, 0x0a, 0x0c, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74,+ 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65,+ 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x31, 0x82,+ 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e,+ 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72,+ 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74,+ 0x12, 0x7b, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65,+ 0x77, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71,+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02,+ 0x2c, 0x3a, 0x01, 0x2a, 0x22, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x65,+ 0x77, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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 (@@ -1664,7 +1924,7 @@ func file_v1_review_service_proto_rawDescGZIP() []byte {}var file_v1_review_service_proto_enumTypes = make([]protoimpl.EnumInfo, 5)-var file_v1_review_service_proto_msgTypes = make([]protoimpl.MessageInfo, 16)+var file_v1_review_service_proto_msgTypes = make([]protoimpl.MessageInfo, 19)var file_v1_review_service_proto_goTypes = []interface{}{(ReviewStatus)(0), // 0: bytebase.v1.ReviewStatus(Review_Approver_Status)(0), // 1: bytebase.v1.Review.Approver.Status@@ -1686,50 +1946,62 @@ var file_v1_review_service_proto_goTypes = []interface{}{(*ApprovalFlow)(nil), // 17: bytebase.v1.ApprovalFlow(*ApprovalStep)(nil), // 18: bytebase.v1.ApprovalStep(*ApprovalNode)(nil), // 19: bytebase.v1.ApprovalNode- (*Review_Approver)(nil), // 20: bytebase.v1.Review.Approver- (*fieldmaskpb.FieldMask)(nil), // 21: google.protobuf.FieldMask- (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp+ (*CreateReviewCommentRequest)(nil), // 20: bytebase.v1.CreateReviewCommentRequest+ (*UpdateReviewCommentRequest)(nil), // 21: bytebase.v1.UpdateReviewCommentRequest+ (*ReviewComment)(nil), // 22: bytebase.v1.ReviewComment+ (*Review_Approver)(nil), // 23: bytebase.v1.Review.Approver+ (*fieldmaskpb.FieldMask)(nil), // 24: google.protobuf.FieldMask+ (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp}var file_v1_review_service_proto_depIdxs = []int32{15, // 0: bytebase.v1.CreateReviewRequest.review:type_name -> bytebase.v1.Review15, // 1: bytebase.v1.ListReviewsResponse.reviews:type_name -> bytebase.v1.Review15, // 2: bytebase.v1.UpdateReviewRequest.review:type_name -> bytebase.v1.Review- 21, // 3: bytebase.v1.UpdateReviewRequest.update_mask:type_name -> google.protobuf.FieldMask+ 24, // 3: bytebase.v1.UpdateReviewRequest.update_mask:type_name -> google.protobuf.FieldMask9, // 4: bytebase.v1.BatchUpdateReviewsRequest.requests:type_name -> bytebase.v1.UpdateReviewRequest15, // 5: bytebase.v1.BatchUpdateReviewsResponse.reviews:type_name -> bytebase.v1.Review0, // 6: bytebase.v1.Review.status:type_name -> bytebase.v1.ReviewStatus16, // 7: bytebase.v1.Review.approval_templates:type_name -> bytebase.v1.ApprovalTemplate- 20, // 8: bytebase.v1.Review.approvers:type_name -> bytebase.v1.Review.Approver- 22, // 9: bytebase.v1.Review.create_time:type_name -> google.protobuf.Timestamp- 22, // 10: bytebase.v1.Review.update_time:type_name -> google.protobuf.Timestamp+ 23, // 8: bytebase.v1.Review.approvers:type_name -> bytebase.v1.Review.Approver+ 25, // 9: bytebase.v1.Review.create_time:type_name -> google.protobuf.Timestamp+ 25, // 10: bytebase.v1.Review.update_time:type_name -> google.protobuf.Timestamp17, // 11: bytebase.v1.ApprovalTemplate.flow:type_name -> bytebase.v1.ApprovalFlow18, // 12: bytebase.v1.ApprovalFlow.steps:type_name -> bytebase.v1.ApprovalStep2, // 13: bytebase.v1.ApprovalStep.type:type_name -> bytebase.v1.ApprovalStep.Type19, // 14: bytebase.v1.ApprovalStep.nodes:type_name -> bytebase.v1.ApprovalNode3, // 15: bytebase.v1.ApprovalNode.type:type_name -> bytebase.v1.ApprovalNode.Type4, // 16: bytebase.v1.ApprovalNode.group_value:type_name -> bytebase.v1.ApprovalNode.GroupValue- 1, // 17: bytebase.v1.Review.Approver.status:type_name -> bytebase.v1.Review.Approver.Status- 5, // 18: bytebase.v1.ReviewService.GetReview:input_type -> bytebase.v1.GetReviewRequest- 6, // 19: bytebase.v1.ReviewService.CreateReview:input_type -> bytebase.v1.CreateReviewRequest- 7, // 20: bytebase.v1.ReviewService.ListReviews:input_type -> bytebase.v1.ListReviewsRequest- 9, // 21: bytebase.v1.ReviewService.UpdateReview:input_type -> bytebase.v1.UpdateReviewRequest- 10, // 22: bytebase.v1.ReviewService.BatchUpdateReviews:input_type -> bytebase.v1.BatchUpdateReviewsRequest- 12, // 23: bytebase.v1.ReviewService.ApproveReview:input_type -> bytebase.v1.ApproveReviewRequest- 13, // 24: bytebase.v1.ReviewService.RejectReview:input_type -> bytebase.v1.RejectReviewRequest- 14, // 25: bytebase.v1.ReviewService.RequestReview:input_type -> bytebase.v1.RequestReviewRequest- 15, // 26: bytebase.v1.ReviewService.GetReview:output_type -> bytebase.v1.Review- 15, // 27: bytebase.v1.ReviewService.CreateReview:output_type -> bytebase.v1.Review- 8, // 28: bytebase.v1.ReviewService.ListReviews:output_type -> bytebase.v1.ListReviewsResponse- 15, // 29: bytebase.v1.ReviewService.UpdateReview:output_type -> bytebase.v1.Review- 11, // 30: bytebase.v1.ReviewService.BatchUpdateReviews:output_type -> bytebase.v1.BatchUpdateReviewsResponse- 15, // 31: bytebase.v1.ReviewService.ApproveReview:output_type -> bytebase.v1.Review- 15, // 32: bytebase.v1.ReviewService.RejectReview:output_type -> bytebase.v1.Review- 15, // 33: bytebase.v1.ReviewService.RequestReview:output_type -> bytebase.v1.Review- 26, // [26:34] is the sub-list for method output_type- 18, // [18:26] is the sub-list for method input_type- 18, // [18:18] is the sub-list for extension type_name- 18, // [18:18] is the sub-list for extension extendee- 0, // [0:18] is the sub-list for field type_name+ 22, // 17: bytebase.v1.CreateReviewCommentRequest.review_comment:type_name -> bytebase.v1.ReviewComment+ 22, // 18: bytebase.v1.UpdateReviewCommentRequest.review_comment:type_name -> bytebase.v1.ReviewComment+ 24, // 19: bytebase.v1.UpdateReviewCommentRequest.update_mask:type_name -> google.protobuf.FieldMask+ 25, // 20: bytebase.v1.ReviewComment.create_time:type_name -> google.protobuf.Timestamp+ 25, // 21: bytebase.v1.ReviewComment.update_time:type_name -> google.protobuf.Timestamp+ 1, // 22: bytebase.v1.Review.Approver.status:type_name -> bytebase.v1.Review.Approver.Status+ 5, // 23: bytebase.v1.ReviewService.GetReview:input_type -> bytebase.v1.GetReviewRequest+ 6, // 24: bytebase.v1.ReviewService.CreateReview:input_type -> bytebase.v1.CreateReviewRequest+ 7, // 25: bytebase.v1.ReviewService.ListReviews:input_type -> bytebase.v1.ListReviewsRequest+ 9, // 26: bytebase.v1.ReviewService.UpdateReview:input_type -> bytebase.v1.UpdateReviewRequest+ 20, // 27: bytebase.v1.ReviewService.CreateReviewComment:input_type -> bytebase.v1.CreateReviewCommentRequest+ 21, // 28: bytebase.v1.ReviewService.UpdateReviewComment:input_type -> bytebase.v1.UpdateReviewCommentRequest+ 10, // 29: bytebase.v1.ReviewService.BatchUpdateReviews:input_type -> bytebase.v1.BatchUpdateReviewsRequest+ 12, // 30: bytebase.v1.ReviewService.ApproveReview:input_type -> bytebase.v1.ApproveReviewRequest+ 13, // 31: bytebase.v1.ReviewService.RejectReview:input_type -> bytebase.v1.RejectReviewRequest+ 14, // 32: bytebase.v1.ReviewService.RequestReview:input_type -> bytebase.v1.RequestReviewRequest+ 15, // 33: bytebase.v1.ReviewService.GetReview:output_type -> bytebase.v1.Review+ 15, // 34: bytebase.v1.ReviewService.CreateReview:output_type -> bytebase.v1.Review+ 8, // 35: bytebase.v1.ReviewService.ListReviews:output_type -> bytebase.v1.ListReviewsResponse+ 15, // 36: bytebase.v1.ReviewService.UpdateReview:output_type -> bytebase.v1.Review+ 22, // 37: bytebase.v1.ReviewService.CreateReviewComment:output_type -> bytebase.v1.ReviewComment+ 22, // 38: bytebase.v1.ReviewService.UpdateReviewComment:output_type -> bytebase.v1.ReviewComment+ 11, // 39: bytebase.v1.ReviewService.BatchUpdateReviews:output_type -> bytebase.v1.BatchUpdateReviewsResponse+ 15, // 40: bytebase.v1.ReviewService.ApproveReview:output_type -> bytebase.v1.Review+ 15, // 41: bytebase.v1.ReviewService.RejectReview:output_type -> bytebase.v1.Review+ 15, // 42: bytebase.v1.ReviewService.RequestReview:output_type -> bytebase.v1.Review+ 33, // [33:43] is the sub-list for method output_type+ 23, // [23:33] is the sub-list for method input_type+ 23, // [23:23] is the sub-list for extension type_name+ 23, // [23:23] is the sub-list for extension extendee+ 0, // [0:23] is the sub-list for field type_name}func init() { file_v1_review_service_proto_init() }@@ -1919,6 +2191,42 @@ func file_v1_review_service_proto_init() {}}file_v1_review_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*CreateReviewCommentRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_review_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*UpdateReviewCommentRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_review_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*ReviewComment); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_review_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {switch v := v.(*Review_Approver); i {case 0:return &v.state@@ -1942,7 +2250,7 @@ func file_v1_review_service_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: file_v1_review_service_proto_rawDesc,NumEnums: 5,- NumMessages: 16,+ NumMessages: 19,NumExtensions: 0,NumServices: 1,},diff --git a/proto/generated-go/v1/review_service.pb.gw.go b/proto/generated-go/v1/review_service.pb.gw.goindex 9cf8442e2f..93a019b09e 100644--- a/proto/generated-go/v1/review_service.pb.gw.go+++ b/proto/generated-go/v1/review_service.pb.gw.go@@ -321,6 +321,174 @@ func local_request_ReviewService_UpdateReview_0(ctx context.Context, marshaler r}+func request_ReviewService_CreateReviewComment_0(ctx context.Context, marshaler runtime.Marshaler, client ReviewServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq CreateReviewCommentRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.ReviewComment); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["parent"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")+ }++ protoReq.Parent, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)+ }++ msg, err := client.CreateReviewComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_ReviewService_CreateReviewComment_0(ctx context.Context, marshaler runtime.Marshaler, server ReviewServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq CreateReviewCommentRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.ReviewComment); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["parent"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")+ }++ protoReq.Parent, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)+ }++ msg, err := server.CreateReviewComment(ctx, &protoReq)+ return msg, metadata, err++}++var (+ filter_ReviewService_UpdateReviewComment_0 = &utilities.DoubleArray{Encoding: map[string]int{"review_comment": 0, "reviewComment": 1, "parent": 2}, Base: []int{1, 1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4, 4}}+)++func request_ReviewService_UpdateReviewComment_0(ctx context.Context, marshaler runtime.Marshaler, client ReviewServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq UpdateReviewCommentRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.ReviewComment); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.ReviewComment); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ } else {+ protoReq.UpdateMask = fieldMask+ }+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["parent"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")+ }++ protoReq.Parent, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)+ }++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ReviewService_UpdateReviewComment_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := client.UpdateReviewComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_ReviewService_UpdateReviewComment_0(ctx context.Context, marshaler runtime.Marshaler, server ReviewServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq UpdateReviewCommentRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.ReviewComment); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.ReviewComment); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ } else {+ protoReq.UpdateMask = fieldMask+ }+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["parent"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")+ }++ protoReq.Parent, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)+ }++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ReviewService_UpdateReviewComment_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := server.UpdateReviewComment(ctx, &protoReq)+ return msg, metadata, err++}+func request_ReviewService_BatchUpdateReviews_0(ctx context.Context, marshaler runtime.Marshaler, client ReviewServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {var protoReq BatchUpdateReviewsRequestvar metadata runtime.ServerMetadata@@ -699,6 +867,56 @@ func RegisterReviewServiceHandlerServer(ctx context.Context, mux *runtime.ServeM})+ mux.Handle("POST", pattern_ReviewService_CreateReviewComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.ReviewService/CreateReviewComment", runtime.WithHTTPPathPattern("/v1/{parent=projects/*/reviews/*}:comment"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_ReviewService_CreateReviewComment_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_ReviewService_CreateReviewComment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("PATCH", pattern_ReviewService_UpdateReviewComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.ReviewService/UpdateReviewComment", runtime.WithHTTPPathPattern("/v1/{parent=projects/*/reviews/*}:comment"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_ReviewService_UpdateReviewComment_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_ReviewService_UpdateReviewComment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })+mux.Handle("POST", pattern_ReviewService_BatchUpdateReviews_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()@@ -928,6 +1146,50 @@ func RegisterReviewServiceHandlerClient(ctx context.Context, mux *runtime.ServeM})+ mux.Handle("POST", pattern_ReviewService_CreateReviewComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.ReviewService/CreateReviewComment", runtime.WithHTTPPathPattern("/v1/{parent=projects/*/reviews/*}:comment"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_ReviewService_CreateReviewComment_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_ReviewService_CreateReviewComment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("PATCH", pattern_ReviewService_UpdateReviewComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.ReviewService/UpdateReviewComment", runtime.WithHTTPPathPattern("/v1/{parent=projects/*/reviews/*}:comment"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_ReviewService_UpdateReviewComment_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_ReviewService_UpdateReviewComment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })+mux.Handle("POST", pattern_ReviewService_BatchUpdateReviews_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()@@ -1028,6 +1290,10 @@ var (pattern_ReviewService_UpdateReview_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "reviews", "review.name"}, ""))+ pattern_ReviewService_CreateReviewComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "reviews", "parent"}, "comment"))++ pattern_ReviewService_UpdateReviewComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "reviews", "parent"}, "comment"))+pattern_ReviewService_BatchUpdateReviews_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "reviews"}, "batchUpdate"))pattern_ReviewService_ApproveReview_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "reviews", "name"}, "approve"))@@ -1046,6 +1312,10 @@ var (forward_ReviewService_UpdateReview_0 = runtime.ForwardResponseMessage+ forward_ReviewService_CreateReviewComment_0 = runtime.ForwardResponseMessage++ forward_ReviewService_UpdateReviewComment_0 = runtime.ForwardResponseMessage+forward_ReviewService_BatchUpdateReviews_0 = runtime.ForwardResponseMessageforward_ReviewService_ApproveReview_0 = runtime.ForwardResponseMessagediff --git a/proto/generated-go/v1/review_service_grpc.pb.go b/proto/generated-go/v1/review_service_grpc.pb.goindex d763e42e3d..5ed57d477e 100644--- a/proto/generated-go/v1/review_service_grpc.pb.go+++ b/proto/generated-go/v1/review_service_grpc.pb.go@@ -19,14 +19,16 @@ import (const _ = grpc.SupportPackageIsVersion7const (- ReviewService_GetReview_FullMethodName = "/bytebase.v1.ReviewService/GetReview"- ReviewService_CreateReview_FullMethodName = "/bytebase.v1.ReviewService/CreateReview"- ReviewService_ListReviews_FullMethodName = "/bytebase.v1.ReviewService/ListReviews"- ReviewService_UpdateReview_FullMethodName = "/bytebase.v1.ReviewService/UpdateReview"- ReviewService_BatchUpdateReviews_FullMethodName = "/bytebase.v1.ReviewService/BatchUpdateReviews"- ReviewService_ApproveReview_FullMethodName = "/bytebase.v1.ReviewService/ApproveReview"- ReviewService_RejectReview_FullMethodName = "/bytebase.v1.ReviewService/RejectReview"- ReviewService_RequestReview_FullMethodName = "/bytebase.v1.ReviewService/RequestReview"+ ReviewService_GetReview_FullMethodName = "/bytebase.v1.ReviewService/GetReview"+ ReviewService_CreateReview_FullMethodName = "/bytebase.v1.ReviewService/CreateReview"+ ReviewService_ListReviews_FullMethodName = "/bytebase.v1.ReviewService/ListReviews"+ ReviewService_UpdateReview_FullMethodName = "/bytebase.v1.ReviewService/UpdateReview"+ ReviewService_CreateReviewComment_FullMethodName = "/bytebase.v1.ReviewService/CreateReviewComment"+ ReviewService_UpdateReviewComment_FullMethodName = "/bytebase.v1.ReviewService/UpdateReviewComment"+ ReviewService_BatchUpdateReviews_FullMethodName = "/bytebase.v1.ReviewService/BatchUpdateReviews"+ ReviewService_ApproveReview_FullMethodName = "/bytebase.v1.ReviewService/ApproveReview"+ ReviewService_RejectReview_FullMethodName = "/bytebase.v1.ReviewService/RejectReview"+ ReviewService_RequestReview_FullMethodName = "/bytebase.v1.ReviewService/RequestReview")// ReviewServiceClient is the client API for ReviewService service.@@ -37,6 +39,8 @@ type ReviewServiceClient interface {CreateReview(ctx context.Context, in *CreateReviewRequest, opts ...grpc.CallOption) (*Review, error)ListReviews(ctx context.Context, in *ListReviewsRequest, opts ...grpc.CallOption) (*ListReviewsResponse, error)UpdateReview(ctx context.Context, in *UpdateReviewRequest, opts ...grpc.CallOption) (*Review, error)+ CreateReviewComment(ctx context.Context, in *CreateReviewCommentRequest, opts ...grpc.CallOption) (*ReviewComment, error)+ UpdateReviewComment(ctx context.Context, in *UpdateReviewCommentRequest, opts ...grpc.CallOption) (*ReviewComment, error)BatchUpdateReviews(ctx context.Context, in *BatchUpdateReviewsRequest, opts ...grpc.CallOption) (*BatchUpdateReviewsResponse, error)ApproveReview(ctx context.Context, in *ApproveReviewRequest, opts ...grpc.CallOption) (*Review, error)RejectReview(ctx context.Context, in *RejectReviewRequest, opts ...grpc.CallOption) (*Review, error)@@ -87,6 +91,24 @@ func (c *reviewServiceClient) UpdateReview(ctx context.Context, in *UpdateReviewreturn out, nil}+func (c *reviewServiceClient) CreateReviewComment(ctx context.Context, in *CreateReviewCommentRequest, opts ...grpc.CallOption) (*ReviewComment, error) {+ out := new(ReviewComment)+ err := c.cc.Invoke(ctx, ReviewService_CreateReviewComment_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++func (c *reviewServiceClient) UpdateReviewComment(ctx context.Context, in *UpdateReviewCommentRequest, opts ...grpc.CallOption) (*ReviewComment, error) {+ out := new(ReviewComment)+ err := c.cc.Invoke(ctx, ReviewService_UpdateReviewComment_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}+func (c *reviewServiceClient) BatchUpdateReviews(ctx context.Context, in *BatchUpdateReviewsRequest, opts ...grpc.CallOption) (*BatchUpdateReviewsResponse, error) {out := new(BatchUpdateReviewsResponse)err := c.cc.Invoke(ctx, ReviewService_BatchUpdateReviews_FullMethodName, in, out, opts...)@@ -131,6 +153,8 @@ type ReviewServiceServer interface {CreateReview(context.Context, *CreateReviewRequest) (*Review, error)ListReviews(context.Context, *ListReviewsRequest) (*ListReviewsResponse, error)UpdateReview(context.Context, *UpdateReviewRequest) (*Review, error)+ CreateReviewComment(context.Context, *CreateReviewCommentRequest) (*ReviewComment, error)+ UpdateReviewComment(context.Context, *UpdateReviewCommentRequest) (*ReviewComment, error)BatchUpdateReviews(context.Context, *BatchUpdateReviewsRequest) (*BatchUpdateReviewsResponse, error)ApproveReview(context.Context, *ApproveReviewRequest) (*Review, error)RejectReview(context.Context, *RejectReviewRequest) (*Review, error)@@ -154,6 +178,12 @@ func (UnimplementedReviewServiceServer) ListReviews(context.Context, *ListReviewfunc (UnimplementedReviewServiceServer) UpdateReview(context.Context, *UpdateReviewRequest) (*Review, error) {return nil, status.Errorf(codes.Unimplemented, "method UpdateReview not implemented")}+func (UnimplementedReviewServiceServer) CreateReviewComment(context.Context, *CreateReviewCommentRequest) (*ReviewComment, error) {+ return nil, status.Errorf(codes.Unimplemented, "method CreateReviewComment not implemented")+}+func (UnimplementedReviewServiceServer) UpdateReviewComment(context.Context, *UpdateReviewCommentRequest) (*ReviewComment, error) {+ return nil, status.Errorf(codes.Unimplemented, "method UpdateReviewComment not implemented")+}func (UnimplementedReviewServiceServer) BatchUpdateReviews(context.Context, *BatchUpdateReviewsRequest) (*BatchUpdateReviewsResponse, error) {return nil, status.Errorf(codes.Unimplemented, "method BatchUpdateReviews not implemented")}@@ -251,6 +281,42 @@ func _ReviewService_UpdateReview_Handler(srv interface{}, ctx context.Context, dreturn interceptor(ctx, in, info, handler)}+func _ReviewService_CreateReviewComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(CreateReviewCommentRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(ReviewServiceServer).CreateReviewComment(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: ReviewService_CreateReviewComment_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(ReviewServiceServer).CreateReviewComment(ctx, req.(*CreateReviewCommentRequest))+ }+ return interceptor(ctx, in, info, handler)+}++func _ReviewService_UpdateReviewComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(UpdateReviewCommentRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(ReviewServiceServer).UpdateReviewComment(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: ReviewService_UpdateReviewComment_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(ReviewServiceServer).UpdateReviewComment(ctx, req.(*UpdateReviewCommentRequest))+ }+ return interceptor(ctx, in, info, handler)+}+func _ReviewService_BatchUpdateReviews_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {in := new(BatchUpdateReviewsRequest)if err := dec(in); err != nil {@@ -346,6 +412,14 @@ var ReviewService_ServiceDesc = grpc.ServiceDesc{MethodName: "UpdateReview",Handler: _ReviewService_UpdateReview_Handler,},+ {+ MethodName: "CreateReviewComment",+ Handler: _ReviewService_CreateReviewComment_Handler,+ },+ {+ MethodName: "UpdateReviewComment",+ Handler: _ReviewService_UpdateReviewComment_Handler,+ },{MethodName: "BatchUpdateReviews",Handler: _ReviewService_BatchUpdateReviews_Handler,diff --git a/proto/v1/review_service.proto b/proto/v1/review_service.protoindex e01d4cc571..271956b266 100644--- a/proto/v1/review_service.proto+++ b/proto/v1/review_service.proto@@ -37,6 +37,22 @@ service ReviewService {option (google.api.method_signature) = "review,update_mask";}+ rpc CreateReviewComment(CreateReviewCommentRequest) returns (ReviewComment) {+ option (google.api.http) = {+ post: "/v1/{parent=projects/*/reviews/*}:comment"+ body: "review_comment"+ };+ option (google.api.method_signature) = "parent,review_comment";+ }++ rpc UpdateReviewComment(UpdateReviewCommentRequest) returns (ReviewComment) {+ option (google.api.http) = {+ patch: "/v1/{parent=projects/*/reviews/*}:comment"+ body: "review_comment"+ };+ option (google.api.method_signature) = "parent,review_comment,update_mask";+ }+rpc BatchUpdateReviews(BatchUpdateReviewsRequest) returns (BatchUpdateReviewsResponse) {option (google.api.http) = {post: "/v1/{parent=projects/*}/reviews:batchUpdate"@@ -287,3 +303,35 @@ message ApprovalNode {string external_node_id = 4;}}++message CreateReviewCommentRequest {+ // The review name+ // Format: projects/{project}/reviews/{review}+ string parent = 1;++ ReviewComment review_comment = 2;+}++message UpdateReviewCommentRequest {+ // The review name+ // Format: projects/{project}/reviews/{review}+ string parent = 1;++ ReviewComment review_comment = 2;++ // The list of fields to update.+ google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED];+}++message ReviewComment {+ string uid = 1 [(google.api.field_behavior) = OUTPUT_ONLY];++ string comment = 2;++ // TODO: use struct message instead.+ string payload = 3;++ google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];++ google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];+}