Skip to content

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

chore: deprecate built-in gitops (#15353)

Danny Xu336427bab9e6
diff --git a/backend/api/gitops/azure.go b/backend/api/gitops/azure.go
deleted file mode 100644
index 4e9b85f09f..0000000000
--- a/backend/api/gitops/azure.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package gitops
-
-import (
- "context"
- "encoding/json"
- "strings"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/azure"
- "github.com/bytebase/bytebase/backend/store"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-func getAzurePullRequestInfo(ctx context.Context, vcsProvider *store.VCSProviderMessage, vcsConnector *store.VCSConnectorMessage, body []byte) (*pullRequestInfo, error) {
- var pushEvent azure.PullRequestEvent
- if err := json.Unmarshal(body, &pushEvent); err != nil {
- return nil, errors.Errorf("failed to unmarshal push event, error %v", err)
- }
-
- var actionType webhookAction
- switch pushEvent.EventType {
- case azure.PullRequestEventCreated, azure.PullRequestEventUpdated:
- actionType = webhookActionSQLReview
- case azure.PullRequestEventMerged:
- if strings.ToLower(pushEvent.Resource.Status) != "completed" {
- return nil, errors.Errorf("invalid pull request status: %v", pushEvent.Resource.Status)
- }
- if strings.ToLower(pushEvent.Resource.MergeStatus) != "succeeded" {
- return nil, errors.Errorf("invalid pull request merge status: %v", pushEvent.Resource.MergeStatus)
- }
- actionType = webhookActionCreateIssue
- default:
- return nil, errors.Errorf(`skip webhook event action "%v"`, pushEvent.EventType)
- }
-
- targetBranch, err := vcs.Branch(pushEvent.Resource.TargetRefName)
- if err != nil {
- return nil, errors.Errorf("failed to get target branch, error %v", err)
- }
-
- if vcsConnector.Payload.Branch != targetBranch {
- return nil, errors.Errorf("committed to branch %q, want branch %q", targetBranch, vcsConnector.Payload.Branch)
- }
-
- azurePlugin, ok := vcs.Get(
- storepb.VCSType_AZURE_DEVOPS,
- vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken},
- ).(*azure.Provider)
- if !ok {
- return nil, errors.Errorf("failed to get azure plugin")
- }
-
- mrFiles, err := azurePlugin.ListPullRequestFileInCommit(
- ctx,
- vcsConnector.Payload.ExternalId,
- pushEvent.Resource.LastMergeCommit.CommitID,
- pushEvent.Resource.PullRequestID,
- )
- if err != nil {
- return nil, errors.Errorf("failed to list merge request files by commit %v, error %v", pushEvent.Resource.LastMergeCommit.CommitID, err)
- }
-
- prInfo := &pullRequestInfo{
- action: actionType,
- // TODO(ed): get the email.
- url: pushEvent.Resource.Links.Web.Href,
- title: pushEvent.Resource.Title,
- description: pushEvent.Resource.Description,
- changes: getChangesByFileList(mrFiles, vcsConnector.Payload.BaseDirectory),
- }
-
- for _, file := range prInfo.changes {
- content, err := azurePlugin.ReadFileContent(
- ctx,
- vcsConnector.Payload.ExternalId,
- file.path,
- vcs.RefInfo{RefType: vcs.RefTypeCommit, RefName: pushEvent.Resource.LastMergeCommit.CommitID})
- if err != nil {
- return nil, errors.Errorf("failed read file content, merge request %q, file %q, error %v", pushEvent.Resource.Links.Web, file.path, err)
- }
- file.content = convertFileContentToUTF8String(content)
- }
-
- return prInfo, nil
-}
diff --git a/backend/api/gitops/bitbucket.go b/backend/api/gitops/bitbucket.go
deleted file mode 100644
index 3b6fc3fc89..0000000000
--- a/backend/api/gitops/bitbucket.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package gitops
-
-import (
- "context"
- "encoding/json"
- "fmt"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/bitbucket"
- "github.com/bytebase/bytebase/backend/store"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-func getBitBucketPullRequestInfo(ctx context.Context, vcsProvider *store.VCSProviderMessage, vcsConnector *store.VCSConnectorMessage, body []byte) (*pullRequestInfo, error) {
- var pushEvent bitbucket.PullRequestPushEvent
- if err := json.Unmarshal(body, &pushEvent); err != nil {
- return nil, errors.Errorf("failed to unmarshal push event, error %v", err)
- }
-
- if pushEvent.PullRequest.Destination.Branch.Name != vcsConnector.Payload.Branch {
- return nil, errors.Errorf("committed to branch %q, want branch %q", pushEvent.PullRequest.Destination.Branch.Name, vcsConnector.Payload.Branch)
- }
-
- mrFiles, err := vcs.Get(storepb.VCSType_BITBUCKET, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).ListPullRequestFile(ctx, vcsConnector.Payload.ExternalId, fmt.Sprintf("%d", pushEvent.PullRequest.ID))
- if err != nil {
- return nil, errors.Errorf("failed to list merge %q request files, error %v", pushEvent.PullRequest.Links.HTML.Href, err)
- }
-
- prInfo := &pullRequestInfo{
- action: webhookActionCreateIssue,
- // email. How do we determine the user for BitBucket user?
- url: pushEvent.PullRequest.Links.HTML.Href,
- title: pushEvent.PullRequest.Title,
- description: pushEvent.PullRequest.Description,
- changes: getChangesByFileList(mrFiles, vcsConnector.Payload.BaseDirectory),
- }
-
- for _, file := range prInfo.changes {
- content, err := vcs.Get(storepb.VCSType_BITBUCKET, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).ReadFileContent(ctx, vcsConnector.Payload.ExternalId, file.path, vcs.RefInfo{RefType: vcs.RefTypeCommit, RefName: pushEvent.PullRequest.Source.Commit.Hash})
- if err != nil {
- return nil, errors.Errorf("failed read file content, merge request %q, file %q, error %v", pushEvent.PullRequest.Links.HTML.Href, file.path, err)
- }
- file.content = convertFileContentToUTF8String(content)
- }
- return prInfo, nil
-}
diff --git a/backend/api/gitops/common.go b/backend/api/gitops/common.go
deleted file mode 100644
index 410c48605b..0000000000
--- a/backend/api/gitops/common.go
+++ /dev/null
@@ -1,183 +0,0 @@
-package gitops
-
-import (
- "context"
- "fmt"
- "log/slog"
- "path/filepath"
- "regexp"
- "strings"
-
- "github.com/bytebase/bytebase/backend/common/log"
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/utils"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-)
-
-var (
- versionRE = regexp.MustCompile(`^[0-9]+`)
-)
-
-type webhookAction int
-
-const (
- webhookActionCreateIssue webhookAction = iota
- webhookActionSQLReview
- webhookActionCreateRelease
-)
-
-type pullRequestInfo struct {
- action webhookAction
- email string
- title string
- description string
- url string
- changes []*fileChange
-
- // all files directly (non-recursive) under the base directory.
- getAllFiles func(context.Context) ([]*fileChange, error)
-}
-
-type fileChange struct {
- path string
- version string
- changeType v1pb.Plan_ChangeDatabaseConfig_Type
- description string
- content string
- webURL string
-}
-
-func getChangesByFileList(files []*vcs.PullRequestFile, rootDir string) []*fileChange {
- changes := []*fileChange{}
- for _, v := range files {
- if v.IsDeleted {
- continue
- }
- prFilePath := v.Path
- if !strings.HasPrefix(prFilePath, "/") {
- prFilePath = fmt.Sprintf("/%s", prFilePath)
- }
- if filepath.Dir(prFilePath) != rootDir {
- continue
- }
- change, err := getFileChange(v)
- if err != nil {
- slog.Error("failed to get file change info", slog.String("path", v.Path), log.BBError(err))
- }
- if change != nil {
- changes = append(changes, change)
- }
- }
- return changes
-}
-
-func convertVcsFile(f *vcs.File) (*fileChange, error) {
- if filepath.Ext(f.Name) != ".sql" {
- return nil, nil
- }
-
- matches := versionRE.FindAllString(f.Name, -1)
- if len(matches) == 0 {
- return nil, nil
- }
- version := matches[0]
- description := strings.TrimPrefix(f.Name, version)
- description = strings.TrimLeft(description, "_")
- changeType := v1pb.Plan_ChangeDatabaseConfig_MIGRATE
- switch {
- case strings.HasPrefix(description, "ddl"):
- description = strings.TrimPrefix(description, "ddl")
- changeType = v1pb.Plan_ChangeDatabaseConfig_MIGRATE
- case strings.HasPrefix(description, "dml"):
- description = strings.TrimPrefix(description, "dml")
- changeType = v1pb.Plan_ChangeDatabaseConfig_DATA
- case strings.HasPrefix(description, "ghost"):
- description = strings.TrimPrefix(description, "ghost")
- changeType = v1pb.Plan_ChangeDatabaseConfig_MIGRATE_GHOST
- }
- description = strings.TrimLeft(description, "_")
- return &fileChange{
- path: f.Path,
- version: version,
- changeType: changeType,
- description: description,
- content: f.Content,
- webURL: "",
- }, nil
-}
-
-func getFileChange(file *vcs.PullRequestFile) (*fileChange, error) {
- filename := filepath.Base(file.Path)
- if filepath.Ext(filename) != ".sql" {
- return nil, nil
- }
-
- matches := versionRE.FindAllString(filename, -1)
- if len(matches) == 0 {
- return nil, nil
- }
- version := matches[0]
- description := strings.TrimPrefix(filename, version)
- description = strings.TrimLeft(description, "_")
- changeType := v1pb.Plan_ChangeDatabaseConfig_MIGRATE
- switch {
- case strings.HasPrefix(description, "ddl"):
- description = strings.TrimPrefix(description, "ddl")
- changeType = v1pb.Plan_ChangeDatabaseConfig_MIGRATE
- case strings.HasPrefix(description, "dml"):
- description = strings.TrimPrefix(description, "dml")
- changeType = v1pb.Plan_ChangeDatabaseConfig_DATA
- case strings.HasPrefix(description, "ghost"):
- description = strings.TrimPrefix(description, "ghost")
- changeType = v1pb.Plan_ChangeDatabaseConfig_MIGRATE_GHOST
- }
- description = strings.TrimLeft(description, "_")
- return &fileChange{
- path: file.Path,
- version: version,
- changeType: changeType,
- description: description,
- webURL: file.WebURL,
- }, nil
-}
-
-func getPullRequestID(url string) string {
- fields := strings.Split(url, "/")
- if len(fields) == 0 {
- return ""
- }
- return fields[len(fields)-1]
-}
-
-const (
- commentPrefixBytebaseBot = "**[Bytebase Bot]**"
- commentPrefixSQLReview = "**[Bytebase SQL Review]**"
- commentPrefixSQLReviewPassed = "SQL Review Check Passed"
-)
-
-func getPullRequestComment(externalURL, issue string) string {
- return fmt.Sprintf("This pull request has triggered a Bytebase rollout 🚀. Check out the status at %s/%s", externalURL, issue)
-}
-
-func convertFileContentToUTF8String(content string) string {
- convertedContent, err := utils.ConvertBytesToUTF8String([]byte(content))
- if err != nil {
- // After failed to convert to UTF-8, we will try to convert to valid UTF-8.
- convertedContent = strings.ToValidUTF8(content, "")
- }
- return convertedContent
-}
-
-func getFileWebURLInPR(webURL string, line int32, vcsType storepb.VCSType) string {
- switch vcsType {
- case storepb.VCSType_GITHUB:
- return fmt.Sprintf("%sR%d", webURL, line)
- case storepb.VCSType_GITLAB:
- return fmt.Sprintf("%s_0_%d", webURL, line)
- case storepb.VCSType_BITBUCKET:
- return fmt.Sprintf("%sT%d", webURL, line)
- default:
- return webURL
- }
-}
diff --git a/backend/api/gitops/github.go b/backend/api/gitops/github.go
deleted file mode 100644
index 778056fe27..0000000000
--- a/backend/api/gitops/github.go
+++ /dev/null
@@ -1,97 +0,0 @@
-package gitops
-
-import (
- "context"
- "encoding/json"
- "fmt"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/component/config"
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/github"
- "github.com/bytebase/bytebase/backend/store"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-func getGitHubPullRequestInfo(ctx context.Context, vcsProvider *store.VCSProviderMessage, vcsConnector *store.VCSConnectorMessage, body []byte, profile *config.Profile) (*pullRequestInfo, error) {
- var pushEvent github.PullRequestPushEvent
- if err := json.Unmarshal(body, &pushEvent); err != nil {
- return nil, errors.Errorf("failed to unmarshal push event, error %v", err)
- }
-
- var actionType webhookAction
- switch pushEvent.Action {
- case github.PullRequestEventOpened, github.PullRequestEventSynchronize:
- actionType = webhookActionSQLReview
- case github.PullRequestEventClosed:
- if !pushEvent.PullRequest.Merged {
- return nil, errors.Errorf("skip pull request close action, pull request is not merged")
- }
- if common.IsDev() && profile.DevelopmentVersioned {
- actionType = webhookActionCreateRelease
- } else {
- actionType = webhookActionCreateIssue
- }
- default:
- return nil, errors.Errorf(`skip webhook event action "%s"`, pushEvent.Action)
- }
-
- if pushEvent.PullRequest.Base.Ref != vcsConnector.Payload.Branch {
- return nil, errors.Errorf("skip branch, got %q, want %q", pushEvent.PullRequest.Base.Ref, vcsConnector.Payload.Branch)
- }
-
- mrFiles, err := vcs.Get(storepb.VCSType_GITHUB, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).ListPullRequestFile(ctx, vcsConnector.Payload.ExternalId, fmt.Sprintf("%d", pushEvent.Number))
- if err != nil {
- return nil, errors.Errorf("failed to list merge %q request files, error %v", pushEvent.PullRequest.HTMLURL, err)
- }
-
- prInfo := &pullRequestInfo{
- action: actionType,
- // email. How do we determine the user for GitHub user?
- url: pushEvent.PullRequest.HTMLURL,
- title: pushEvent.PullRequest.Title,
- description: pushEvent.PullRequest.Body,
- changes: getChangesByFileList(mrFiles, vcsConnector.Payload.BaseDirectory),
- }
-
- for _, file := range prInfo.changes {
- content, err := vcs.Get(storepb.VCSType_GITHUB, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).ReadFileContent(ctx, vcsConnector.Payload.ExternalId, file.path, vcs.RefInfo{RefType: vcs.RefTypeCommit, RefName: pushEvent.PullRequest.Head.SHA})
- if err != nil {
- return nil, errors.Errorf("failed read file content, merge request %q, file %q, error %v", pushEvent.PullRequest.HTMLURL, file.path, err)
- }
- file.content = convertFileContentToUTF8String(content)
- }
-
- if actionType == webhookActionCreateRelease {
- prInfo.getAllFiles = func(ctx context.Context) ([]*fileChange, error) {
- p, ok := vcs.Get(storepb.VCSType_GITHUB, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).(*github.Provider)
- if !ok {
- return nil, errors.Errorf("expect github.Provider, got %T", p)
- }
-
- mergeCommitSha, err := p.GetPullRequestMergedCommit(ctx, vcsConnector.Payload.ExternalId, fmt.Sprintf("%d", pushEvent.Number))
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get pull request %d", pushEvent.Number)
- }
-
- dirFiles, err := p.GetDirectoryFiles(ctx, vcsConnector.Payload.ExternalId, mergeCommitSha, vcsConnector.Payload.BaseDirectory)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get directory files")
- }
- var allFiles []*fileChange
- for _, f := range dirFiles {
- f.Content = convertFileContentToUTF8String(f.Content)
- converted, err := convertVcsFile(f)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to convert vcs file")
- }
- allFiles = append(allFiles, converted)
- }
- return allFiles, nil
- }
- }
-
- return prInfo, nil
-}
diff --git a/backend/api/gitops/gitlab.go b/backend/api/gitops/gitlab.go
deleted file mode 100644
index 34b39ea4f8..0000000000
--- a/backend/api/gitops/gitlab.go
+++ /dev/null
@@ -1,65 +0,0 @@
-package gitops
-
-import (
- "context"
- "encoding/json"
- "fmt"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/gitlab"
- "github.com/bytebase/bytebase/backend/store"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-const (
- mergeRequestObjectKind = "merge_request"
-)
-
-func getGitLabPullRequestInfo(ctx context.Context, vcsProvider *store.VCSProviderMessage, vcsConnector *store.VCSConnectorMessage, body []byte) (*pullRequestInfo, error) {
- var pushEvent gitlab.MergeRequestPushEvent
- if err := json.Unmarshal(body, &pushEvent); err != nil {
- return nil, errors.Errorf("failed to unmarshal push event, error %v", err)
- }
- if pushEvent.ObjectKind != mergeRequestObjectKind {
- return nil, errors.Errorf("skip webhook event type, got %s, want %s", pushEvent.ObjectKind, mergeRequestObjectKind)
- }
-
- var actionType webhookAction
- switch pushEvent.ObjectAttributes.Action {
- case gitlab.MergeRequestOpen, gitlab.MergeRequestUpdate:
- actionType = webhookActionSQLReview
- case gitlab.MergeRequestMerge:
- actionType = webhookActionCreateIssue
- default:
- return nil, errors.Errorf("skip webhook event action %v", pushEvent.ObjectAttributes.Action)
- }
-
- if pushEvent.ObjectAttributes.TargetBranch != vcsConnector.Payload.Branch {
- return nil, errors.Errorf("skip branch got %q, want %q", pushEvent.ObjectAttributes.TargetBranch, vcsConnector.Payload.Branch)
- }
-
- mrFiles, err := vcs.Get(storepb.VCSType_GITLAB, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).ListPullRequestFile(ctx, vcsConnector.Payload.ExternalId, fmt.Sprintf("%d", pushEvent.ObjectAttributes.IID))
- if err != nil {
- return nil, errors.Errorf("failed to list merge %q request files, error %v", pushEvent.ObjectAttributes.URL, err)
- }
-
- prInfo := &pullRequestInfo{
- action: actionType,
- email: pushEvent.User.Email,
- url: pushEvent.ObjectAttributes.URL,
- title: pushEvent.ObjectAttributes.Title,
- description: pushEvent.ObjectAttributes.Description,
- changes: getChangesByFileList(mrFiles, vcsConnector.Payload.BaseDirectory),
- }
-
- for _, file := range prInfo.changes {
- content, err := vcs.Get(storepb.VCSType_GITLAB, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).ReadFileContent(ctx, vcsConnector.Payload.ExternalId, file.path, vcs.RefInfo{RefType: vcs.RefTypeCommit, RefName: pushEvent.ObjectAttributes.LastCommit.ID})
- if err != nil {
- return nil, errors.Errorf("failed read file content, merge request %q, file %q, error %v", pushEvent.ObjectAttributes.URL, file.path, err)
- }
- file.content = convertFileContentToUTF8String(content)
- }
- return prInfo, nil
-}
diff --git a/backend/api/gitops/gitops.go b/backend/api/gitops/gitops.go
deleted file mode 100644
index ff52c2a37f..0000000000
--- a/backend/api/gitops/gitops.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// Package gitops is the package for GitOps APIs.
-package gitops
-
-import (
- v1pb "github.com/bytebase/bytebase/backend/api/v1"
- "github.com/bytebase/bytebase/backend/component/config"
- "github.com/bytebase/bytebase/backend/component/sheet"
- enterprise "github.com/bytebase/bytebase/backend/enterprise/api"
- "github.com/bytebase/bytebase/backend/store"
-)
-
-// Service is the API endpoint for handling GitOps requests.
-type Service struct {
- store *store.Store
- licenseService enterprise.LicenseService
- releaseService *v1pb.ReleaseService
- planService *v1pb.PlanService
- rolloutService *v1pb.RolloutService
- issueService *v1pb.IssueService
- sqlService *v1pb.SQLService
- sheetManager *sheet.Manager
- profile *config.Profile
-}
-
-// NewService creates a GitOps service.
-func NewService(
- store *store.Store,
- licenseService enterprise.LicenseService,
- releaseService *v1pb.ReleaseService,
- planService *v1pb.PlanService,
- rolloutService *v1pb.RolloutService,
- issueService *v1pb.IssueService,
- sqlService *v1pb.SQLService,
- sheetManager *sheet.Manager,
- profile *config.Profile,
-) *Service {
- return &Service{
- store: store,
- licenseService: licenseService,
- releaseService: releaseService,
- planService: planService,
- rolloutService: rolloutService,
- issueService: issueService,
- sqlService: sqlService,
- sheetManager: sheetManager,
- profile: profile,
- }
-}
diff --git a/backend/api/gitops/webhook.go b/backend/api/gitops/webhook.go
deleted file mode 100644
index ca795f2421..0000000000
--- a/backend/api/gitops/webhook.go
+++ /dev/null
@@ -1,701 +0,0 @@
-package gitops
-
-import (
- "context"
- "crypto/hmac"
- "crypto/sha256"
- "crypto/subtle"
- "encoding/hex"
- "fmt"
- "io"
- "log/slog"
- "net/http"
- "sort"
- "strings"
-
- "github.com/google/uuid"
- "github.com/labstack/echo/v4"
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/utils"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/common/log"
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/bitbucket"
-
- "github.com/bytebase/bytebase/backend/store"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-)
-
-type createReleaseContext struct {
- user *store.UserMessage
- setting *storepb.WorkspaceProfileSetting
- project *store.ProjectMessage
- vcsConnector *store.VCSConnectorMessage
- vcsProvider *store.VCSProviderMessage
- prInfo *pullRequestInfo
-}
-
-func (s *Service) RegisterWebhookRoutes(g *echo.Group) {
- g.POST(":id", func(c echo.Context) error {
- ctx := c.Request().Context()
- // The id start with "/".
- setting, err := s.store.GetWorkspaceGeneralSetting(ctx)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to get setting, error %v", err))
- }
- if setting.ExternalUrl == "" {
- return c.String(http.StatusOK, "external URL is empty")
- }
-
- url := strings.TrimPrefix(c.Param("id"), "/")
- workspaceID, projectID, vcsConnectorID, err := common.GetWorkspaceProjectVCSConnectorID(url)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("invalid id %q", url))
- }
- myWorkspaceID, err := s.store.GetWorkspaceID(ctx)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to get workspace ID, error %v", err))
- }
- if myWorkspaceID != workspaceID {
- return c.String(http.StatusOK, fmt.Sprintf("invalid workspace id %q, my ID %q", workspaceID, myWorkspaceID))
- }
- project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{ResourceID: &projectID})
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to get project %q, error %v", projectID, err))
- }
- if project == nil || project.Deleted {
- return c.String(http.StatusOK, fmt.Sprintf("project %q does not exist or has been deleted", projectID))
- }
- vcsConnector, err := s.store.GetVCSConnector(ctx, &store.FindVCSConnectorMessage{ProjectID: &projectID, ResourceID: &vcsConnectorID})
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to get project %q VCS connector %q, error %v", projectID, vcsConnectorID, err))
- }
- if vcsConnector == nil {
- return c.String(http.StatusOK, fmt.Sprintf("project %q VCS connector %q does not exist or has been deleted", projectID, vcsConnectorID))
- }
- vcsProvider, err := s.store.GetVCSProvider(ctx, &store.FindVCSProviderMessage{ResourceID: &vcsConnector.VCSID})
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to get VCS provider %q, error %v", vcsConnector.VCSID, err))
- }
- if vcsProvider == nil {
- return c.String(http.StatusOK, fmt.Sprintf("VCS provider %q does not exist or has been deleted", vcsConnector.VCSID))
- }
-
- body, err := io.ReadAll(c.Request().Body)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to read body, error %v", err))
- }
-
- var prInfo *pullRequestInfo
- switch vcsProvider.Type {
- case storepb.VCSType_GITHUB:
- secretToken := c.Request().Header.Get("X-Hub-Signature-256")
- ok, err := validateGitHubWebhookSignature256(secretToken, vcsConnector.Payload.WebhookSecretToken, body)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to validate webhook signature %q, error %v", secretToken, err))
- }
- if !ok {
- return c.String(http.StatusOK, fmt.Sprintf("invalid webhook secret token %q", secretToken))
- }
- eventType := c.Request().Header.Get("X-GitHub-Event")
- // https://docs.github.com/en/developers/webhooks-and-events/webhooks/about-webhooks#ping-event
- // When we create a new webhook, GitHub will send us a simple ping event to let us know we've set up the webhook correctly.
- // We respond to this event so as not to mislead users.
- switch eventType {
- case "ping":
- return c.String(http.StatusOK, "OK")
- case "pull_request":
- default:
- return c.String(http.StatusOK, fmt.Sprintf(`skip webhook event "%v"`, eventType))
- }
-
- prInfo, err = getGitHubPullRequestInfo(ctx, vcsProvider, vcsConnector, body, s.profile)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to get pr info from pull request, error %v", err))
- }
- case storepb.VCSType_GITLAB:
- secretToken := c.Request().Header.Get("X-Gitlab-Token")
- if secretToken != vcsConnector.Payload.WebhookSecretToken {
- return c.String(http.StatusOK, fmt.Sprintf("invalid webhook secret token %q", secretToken))
- }
-
- prInfo, err = getGitLabPullRequestInfo(ctx, vcsProvider, vcsConnector, body)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to get pr info from pull request, error %v", err))
- }
- case storepb.VCSType_BITBUCKET:
- eventType := c.Request().Header.Get("X-Event-Key")
- var action webhookAction
- switch bitbucket.PullRequestEventType(eventType) {
- case bitbucket.PullRequestEventCreated, bitbucket.PullRequestEventUpdated:
- action = webhookActionSQLReview
- case bitbucket.PullRequestEventFulfilled:
- action = webhookActionCreateIssue
- default:
- return c.String(http.StatusOK, fmt.Sprintf(`skip webhook event "%v"`, eventType))
- }
-
- prInfo, err = getBitBucketPullRequestInfo(ctx, vcsProvider, vcsConnector, body)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to get pr info from pull request, error %v", err))
- }
- prInfo.action = action
- case storepb.VCSType_AZURE_DEVOPS:
- secretToken := c.Request().Header.Get("X-Azure-Token")
- if secretToken != vcsConnector.Payload.WebhookSecretToken {
- return c.String(http.StatusOK, fmt.Sprintf("invalid webhook secret token %q", secretToken))
- }
-
- prInfo, err = getAzurePullRequestInfo(ctx, vcsProvider, vcsConnector, body)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to get pr info from pull request, error %v", err))
- }
- default:
- return nil
- }
- if len(prInfo.changes) == 0 {
- return c.String(http.StatusOK, fmt.Sprintf("no relevant file change directly under the base directory %q for pull request %q", vcsConnector.Payload.BaseDirectory, prInfo.url))
- }
-
- user := func() *store.UserMessage {
- user, err := s.store.GetUserByEmail(ctx, prInfo.email)
- if err != nil {
- slog.Error("failed to find user by email", slog.String("email", prInfo.email), log.BBError(err))
- return s.store.GetSystemBotUser(ctx)
- }
- if user == nil {
- return s.store.GetSystemBotUser(ctx)
- }
- return user
- }()
- childCtx := context.WithValue(ctx, common.PrincipalIDContextKey, user.ID)
- childCtx = context.WithValue(childCtx, common.UserContextKey, user)
-
- var comment string
- var commentPrefix string
- var createCommentIfNotExist bool
- switch prInfo.action {
- case webhookActionCreateRelease:
- go s.createRelease(&createReleaseContext{
- user: user,
- setting: setting,
- project: project,
- vcsConnector: vcsConnector,
- vcsProvider: vcsProvider,
- prInfo: prInfo,
- })
-
- case webhookActionCreateIssue:
- issue, err := s.createIssueFromPRInfo(childCtx, project, vcsProvider, vcsConnector, prInfo)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to create issue from pull request %s, error %v", prInfo.url, err))
- }
- comment = getPullRequestComment(setting.ExternalUrl, issue.Name)
- commentPrefix = commentPrefixBytebaseBot
- createCommentIfNotExist = true
- case webhookActionSQLReview:
- comment, err = s.sqlReviewWithPRInfo(childCtx, project, vcsConnector, vcsProvider.Type, prInfo)
- if err != nil {
- return c.String(http.StatusOK, fmt.Sprintf("failed to exec sql review for pull request %s, error %v", prInfo.url, err))
- }
- if comment != "" {
- comment = fmt.Sprintf("%s\n\n---\n\nClick [here](%s) to check the SQL review config", comment, fmt.Sprintf("%s/sql-review", setting.ExternalUrl))
- }
- commentPrefix = commentPrefixSQLReview
- // We don't have the "Enable SQL review" option for VCS connection.
- // It's confused that projects may not have the active SQL review policy but will get "SQL Reivew Check Passed" comment.
- // So in order to not to always trigger the SQL review comment for PRs,
- // we will not create the comment for "SQL Reivew Check Passed" comment, but we can still update existed comment (from errors/warnings to passed).
- createCommentIfNotExist = !strings.HasPrefix(comment, commentPrefixSQLReviewPassed)
- default:
- }
-
- if comment != "" {
- if err := upsertPullRequestComment(
- ctx,
- vcsProvider,
- vcsConnector,
- prInfo,
- fmt.Sprintf("%s\n\n%s", commentPrefix, comment),
- func(content string) bool { return strings.HasPrefix(content, commentPrefix) },
- createCommentIfNotExist,
- ); err != nil {
- slog.Error("failed to upsert comment", slog.String("pr", prInfo.url), log.BBError(err))
- return c.String(http.StatusOK, fmt.Sprintf("failed to create pull request comment, error %v", err))
- }
- }
-
- return c.String(http.StatusOK, fmt.Sprintf("successfully handle the pull request %v", prInfo.url))
- })
-}
-
-func (s *Service) createRelease(t *createReleaseContext) {
- ctx := context.Background()
- ctx = context.WithValue(ctx, common.PrincipalIDContextKey, t.user.ID)
- ctx = context.WithValue(ctx, common.UserContextKey, t.user)
-
- err := func() error {
- release, err := s.createReleaseFromPRInfo(ctx, t.project, t.vcsProvider, t.prInfo)
- if err != nil {
- return errors.Wrapf(err, "failed to create release from pull request %s", t.prInfo.url)
- }
- comment := fmt.Sprintf("This pull request has created a Bytebase release 🚀. Check out at %s/%s", t.setting.ExternalUrl, release.Name)
- commentPrefix := commentPrefixBytebaseBot
- createCommentIfNotExist := true
-
- if err := upsertPullRequestComment(
- ctx,
- t.vcsProvider,
- t.vcsConnector,
- t.prInfo,
- fmt.Sprintf("%s\n\n%s", commentPrefix, comment),
- func(content string) bool { return strings.HasPrefix(content, commentPrefix) },
- createCommentIfNotExist,
- ); err != nil {
- return errors.Wrapf(err, "failed to upsert comment")
- }
- return nil
- }()
- if err != nil {
- slog.Error("failed to create release from pull request", log.BBError(err))
- }
-}
-
-// validateGitHubWebhookSignature256 returns true if the signature matches the
-// HMAC hex digested SHA256 hash of the body using the given key.
-func validateGitHubWebhookSignature256(signature, key string, body []byte) (bool, error) {
- signature = strings.TrimPrefix(signature, "sha256=")
- m := hmac.New(sha256.New, []byte(key))
- if _, err := m.Write(body); err != nil {
- return false, err
- }
- got := hex.EncodeToString(m.Sum(nil))
-
- // NOTE: Use constant time string comparison helps mitigate certain timing
- // attacks against regular equality operators, see
- // https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks#validating-payloads-from-github
- return subtle.ConstantTimeCompare([]byte(signature), []byte(got)) == 1, nil
-}
-
-func (s *Service) sqlReviewWithPRInfo(ctx context.Context, project *store.ProjectMessage, vcsConnector *store.VCSConnectorMessage, vcsType storepb.VCSType, prInfo *pullRequestInfo) (string, error) {
- instance, database, err := s.getDatabaseSample(ctx, project, vcsConnector)
- if err != nil {
- return "", errors.Wrapf(err, "failed to get database sample")
- }
-
- content := []string{}
- errorCount := 0
- warnCount := 0
- maximumCount := 30
-
- for i, change := range prInfo.changes {
- changeType := storepb.PlanCheckRunConfig_DDL
- switch change.changeType {
- case v1pb.Plan_ChangeDatabaseConfig_DATA:
- changeType = storepb.PlanCheckRunConfig_DML
- case v1pb.Plan_ChangeDatabaseConfig_MIGRATE_GHOST:
- changeType = storepb.PlanCheckRunConfig_DDL_GHOST
- }
- adviceStatus, advices, err := s.sqlService.SQLReviewCheck(
- ctx,
- change.content,
- changeType,
- instance,
- database,
- )
- if err != nil {
- slog.Error("failed to exec sql review", slog.String("instance", instance.ResourceID), slog.String("database", database.DatabaseName), log.BBError(err))
- continue
- }
- if adviceStatus == storepb.Advice_SUCCESS || adviceStatus == storepb.Advice_STATUS_UNSPECIFIED {
- continue
- }
-
- adviceMessage := []string{}
- for _, advice := range advices {
- if advice.Status == v1pb.Advice_SUCCESS {
- continue
- }
- if advice.Status == v1pb.Advice_ERROR {
- errorCount++
- } else if advice.Status == v1pb.Advice_WARNING {
- warnCount++
- }
- if errorCount+warnCount >= maximumCount {
- break
- }
- message := fmt.Sprintf("- **[%s]** %s ([line%d](%s))", advice.Status.String(), advice.Title, advice.Line, getFileWebURLInPR(change.webURL, advice.Line, vcsType))
- adviceMessage = append(adviceMessage, message)
- }
-
- if len(adviceMessage) > 0 {
- if len(content) > 0 {
- content = append(content, "\n")
- }
- content = append(content, fmt.Sprintf("SQL review for [%s](%s)\n", change.path, change.webURL))
- // We have to use at least 2 \n for Bitbucket.
- // The API docs for Bitbucket sucks.
- // https://community.atlassian.com/t5/Bitbucket-questions/How-to-post-html-comments-on-pull-request-via-2-0-api/qaq-p/1066809
- content = append(content, strings.Join(adviceMessage, "\n\n"))
- }
-
- if errorCount+warnCount >= maximumCount && i < len(prInfo.changes)-1 {
- content = append(content, "\nSQL review output reaches the maximum limit")
- break
- }
- }
-
- if len(content) == 0 {
- return commentPrefixSQLReviewPassed, nil
- }
-
- return fmt.Sprintf("\n%d errors, %d warnings\n\n---\n\n%s", errorCount, warnCount, strings.Join(content, "\n")), nil
-}
-
-func (s *Service) createReleaseFromPRInfo(ctx context.Context, project *store.ProjectMessage, vcsProvider *store.VCSProviderMessage, prInfo *pullRequestInfo) (*v1pb.Release, error) {
- user, ok := ctx.Value(common.UserContextKey).(*store.UserMessage)
- if !ok {
- return nil, errors.Errorf("cannot found user in context")
- }
-
- if prInfo.getAllFiles == nil {
- return nil, errors.Errorf("getAllFiles is nil")
- }
-
- allFiles, err := prInfo.getAllFiles(ctx)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get all files")
- }
-
- var sheetNames []string
- for _, f := range allFiles {
- sheet, err := s.store.CreateSheet(ctx, &store.SheetMessage{
- ProjectID: project.ResourceID,
- CreatorID: user.ID,
- Title: "",
- Statement: f.content,
- })
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create sheet")
- }
-
- sheetNames = append(sheetNames, common.FormatSheet(project.ResourceID, sheet.UID))
- }
-
- var files []*v1pb.Release_File
- for i, f := range allFiles {
- file := &v1pb.Release_File{
- Id: "",
- Path: f.path,
- Sheet: sheetNames[i],
- SheetSha256: "",
- Type: v1pb.ReleaseFileType_VERSIONED,
- Version: f.version,
- }
- files = append(files, file)
- }
-
- release1 := &v1pb.Release{
- Title: fmt.Sprintf("release for PR %s", prInfo.title),
- Files: files,
- VcsSource: &v1pb.Release_VCSSource{
- VcsType: v1pb.VCSType(vcsProvider.Type),
- Url: prInfo.url,
- },
- }
-
- release, err := s.releaseService.CreateRelease(ctx, &v1pb.CreateReleaseRequest{
- Parent: common.FormatProject(project.ResourceID),
- Release: release1,
- })
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create release")
- }
-
- return release, nil
-}
-
-func (s *Service) createIssueFromPRInfo(ctx context.Context, project *store.ProjectMessage, vcsProvider *store.VCSProviderMessage, vcsConnector *store.VCSConnectorMessage, prInfo *pullRequestInfo) (*v1pb.Issue, error) {
- user, ok := ctx.Value(common.UserContextKey).(*store.UserMessage)
- if !ok {
- return nil, errors.Errorf("cannot found user in context")
- }
- creatorID := user.ID
- creatorName := common.FormatUserUID(user.ID)
-
- instance, _, err := s.getDatabaseSample(ctx, project, vcsConnector)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get database sample")
- }
-
- var sheets []int
- for _, change := range prInfo.changes {
- sheet, err := s.sheetManager.CreateSheet(ctx, &store.SheetMessage{
- CreatorID: creatorID,
- ProjectID: project.ResourceID,
- Title: change.path,
- Statement: change.content,
-
- Payload: &storepb.SheetPayload{
- Engine: instance.Engine,
- },
- })
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create sheet for file %s", change.path)
- }
- sheets = append(sheets, sheet.UID)
- }
-
- steps, err := s.getChangeSteps(ctx, project, vcsConnector, prInfo.changes, sheets)
- if err != nil {
- return nil, err
- }
-
- plan, err := s.planService.CreatePlan(ctx, &v1pb.CreatePlanRequest{
- Parent: common.FormatProject(project.ResourceID),
- Plan: &v1pb.Plan{
- Title: prInfo.title,
- Steps: steps,
- VcsSource: &v1pb.Plan_VCSSource{
- VcsConnector: fmt.Sprintf("%s/%s%s", common.FormatProject(vcsConnector.ProjectID), common.VCSConnectorPrefix, vcsConnector.ResourceID),
- PullRequestUrl: prInfo.url,
- VcsType: v1pb.VCSType(vcsProvider.Type),
- },
- },
- })
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create plan")
- }
- issue, err := s.issueService.CreateIssue(ctx, &v1pb.CreateIssueRequest{
- Parent: common.FormatProject(project.ResourceID),
- Issue: &v1pb.Issue{
- Title: prInfo.title,
- Description: prInfo.description,
- Type: v1pb.Issue_DATABASE_CHANGE,
- Plan: plan.Name,
- },
- })
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create issue")
- }
- if _, err := s.rolloutService.CreateRollout(ctx, &v1pb.CreateRolloutRequest{
- Parent: common.FormatProject(project.ResourceID),
- Rollout: &v1pb.Rollout{
- Plan: plan.Name,
- },
- }); err != nil {
- return nil, errors.Wrapf(err, "failed to create rollout")
- }
-
- issueUID, err := common.GetIssueID(issue.Name)
- if err != nil {
- return nil, err
- }
- // Create audit log after successfully creating the issue from the push event.
- if err := s.store.CreateAuditLog(ctx, &storepb.AuditLog{
- Parent: project.GetName(),
- Method: store.AuditLogMethodProjectRepositoryPush.String(),
- Resource: issue.Name,
- User: creatorName,
- Severity: storepb.AuditLog_INFO,
- Request: "",
- Response: "",
- Status: nil,
- }); err != nil {
- slog.Error("failed to create audit log after creating issue from push event", slog.Int("issue", issueUID), log.BBError(err))
- }
-
- return issue, nil
-}
-
-type isTargetComment func(string) bool
-
-func getCommentIDByContent(ctx context.Context, provider vcs.Provider, repositoryID, pullRequestID string, checkComment isTargetComment) (string, error) {
- comments, err := provider.ListPullRequestComments(ctx, repositoryID, pullRequestID)
- if err != nil {
- return "", errors.Wrapf(err, "failed to list comments for PR %s", pullRequestID)
- }
-
- for _, comment := range comments {
- if checkComment(comment.Content) {
- return comment.ID, nil
- }
- }
- return "", nil
-}
-
-func upsertPullRequestComment(
- ctx context.Context,
- vcsProvider *store.VCSProviderMessage,
- vcsConnector *store.VCSConnectorMessage,
- prInfo *pullRequestInfo,
- comment string,
- checkComment isTargetComment,
- createIfNotExist bool,
-) error {
- pullRequestID := getPullRequestID(prInfo.url)
- provider := vcs.Get(
- vcsProvider.Type,
- vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken},
- )
-
- existedCommentID, err := getCommentIDByContent(ctx, provider, vcsConnector.Payload.ExternalId, pullRequestID, checkComment)
- if err != nil {
- return err
- }
- if existedCommentID != "" {
- if err := provider.UpdatePullRequestComment(ctx, vcsConnector.Payload.ExternalId, pullRequestID, &vcs.PullRequestComment{
- ID: existedCommentID,
- Content: comment,
- }); err != nil {
- return errors.Wrapf(err, `failed to update comment for PR "%s"`, prInfo.url)
- }
- return nil
- }
-
- if !createIfNotExist {
- return nil
- }
-
- if err := provider.CreatePullRequestComment(ctx, vcsConnector.Payload.ExternalId, pullRequestID, comment); err != nil {
- return errors.Wrapf(err, `failed to create comment for PR "%s"`, prInfo.url)
- }
- return nil
-}
-
-func (s *Service) getDatabaseSample(
- ctx context.Context,
- project *store.ProjectMessage,
- vcsConnector *store.VCSConnectorMessage,
-) (*store.InstanceMessage, *store.DatabaseMessage, error) {
- sample, err := func() (*store.DatabaseMessage, error) {
- if dbg := vcsConnector.Payload.GetDatabaseGroup(); dbg != "" {
- projectID, databaseGroupID, err := common.GetProjectIDDatabaseGroupID(dbg)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get project id and database group id from %q", dbg)
- }
- if projectID != project.ResourceID {
- return nil, errors.Errorf("project id %q in databaseGroup %q does not match project id %q in plan config", projectID, dbg, project.ResourceID)
- }
- databaseGroup, err := s.store.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{ProjectID: &project.ResourceID, ResourceID: &databaseGroupID})
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get database group %q", databaseGroupID)
- }
- if databaseGroup == nil {
- return nil, errors.Errorf("database group %q not found", databaseGroupID)
- }
- allDatabases, err := s.store.ListDatabases(ctx, &store.FindDatabaseMessage{ProjectID: &project.ResourceID})
- if err != nil {
- return nil, errors.Wrapf(err, "failed to list databases for project %q", project.ResourceID)
- }
-
- matchedDatabases, _, err := utils.GetMatchedAndUnmatchedDatabasesInDatabaseGroup(ctx, databaseGroup, allDatabases)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get matched and unmatched databases in database group %q", databaseGroupID)
- }
- if len(matchedDatabases) == 0 {
- return nil, errors.Errorf("no matched databases found in database group %q", databaseGroupID)
- }
- return matchedDatabases[0], nil
- }
- allDatabases, err := s.store.ListDatabases(ctx, &store.FindDatabaseMessage{ProjectID: &project.ResourceID})
- if err != nil {
- return nil, errors.Wrapf(err, "failed to list databases for project %q", project.ResourceID)
- }
- if len(allDatabases) == 0 {
- return nil, errors.Errorf("no database in the project %q", project.ResourceID)
- }
- return allDatabases[0], nil
- }()
- if err != nil {
- return nil, nil, errors.Wrapf(err, "failed to get sample database")
- }
-
- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &sample.InstanceID})
- if err != nil {
- return nil, nil, errors.Wrapf(err, "failed to get instance")
- }
- if instance == nil {
- return nil, nil, errors.Errorf("instance not found")
- }
- return instance, sample, nil
-}
-
-func (s *Service) getChangeSteps(
- ctx context.Context,
- project *store.ProjectMessage,
- vcsConnector *store.VCSConnectorMessage,
- changes []*fileChange,
- sheetUIDList []int,
-) ([]*v1pb.Plan_Step, error) {
- if vcsConnector.Payload.DatabaseGroup != "" {
- step := &v1pb.Plan_Step{}
- for i, change := range changes {
- step.Specs = append(step.Specs, &v1pb.Plan_Spec{
- Id: uuid.NewString(),
- Config: &v1pb.Plan_Spec_ChangeDatabaseConfig{
- ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{
- Type: change.changeType,
- Target: vcsConnector.Payload.DatabaseGroup,
- Sheet: fmt.Sprintf("projects/%s/sheets/%d", project.ResourceID, sheetUIDList[i]),
- SchemaVersion: change.version,
- },
- },
- })
- }
- return []*v1pb.Plan_Step{
- step,
- }, nil
- }
-
- databases, err := s.listDatabases(ctx, project)
- if err != nil {
- return nil, err
- }
-
- var steps []*v1pb.Plan_Step
- for i, database := range databases {
- if i == 0 || databases[i].EffectiveEnvironmentID != databases[i-1].EffectiveEnvironmentID {
- steps = append(steps, &v1pb.Plan_Step{})
- }
- step := steps[len(steps)-1]
- for i, change := range changes {
- step.Specs = append(step.Specs, &v1pb.Plan_Spec{
- Id: uuid.NewString(),
- Config: &v1pb.Plan_Spec_ChangeDatabaseConfig{
- ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{
- Type: change.changeType,
- Target: common.FormatDatabase(database.InstanceID, database.DatabaseName),
- Sheet: fmt.Sprintf("projects/%s/sheets/%d", project.ResourceID, sheetUIDList[i]),
- SchemaVersion: change.version,
- },
- },
- })
- }
- }
-
- return steps, nil
-}
-
-func (s *Service) listDatabases(ctx context.Context, project *store.ProjectMessage) ([]*store.DatabaseMessage, error) {
- databases, err := s.store.ListDatabases(ctx, &store.FindDatabaseMessage{ProjectID: &project.ResourceID})
- if err != nil {
- return nil, err
- }
- environments, err := s.store.ListEnvironmentV2(ctx, &store.FindEnvironmentMessage{})
- if err != nil {
- return nil, err
- }
- environmentOrders := make(map[string]int32)
- for _, environment := range environments {
- environmentOrders[environment.ResourceID] = environment.Order
- }
- sort.Slice(databases, func(i, j int) bool {
- return environmentOrders[databases[i].EffectiveEnvironmentID] < environmentOrders[databases[j].EffectiveEnvironmentID]
- })
-
- return databases, nil
-}
diff --git a/backend/api/gitops/webhook_test.go b/backend/api/gitops/webhook_test.go
deleted file mode 100644
index b662ec77d9..0000000000
--- a/backend/api/gitops/webhook_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package gitops
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestValidateGitHubWebhookSignature256(t *testing.T) {
- // nolint:misspell
- const payload = `{"ref":"refs/heads/main","before":"07da1e122bdbb81da8499b6d82c6b6302581a5a7","after":"5a96148ac5ef11a53b838b8cc0d9c929420657f3","repository":{"id":470746482,"node_id":"R_kgDOHA8Fcg","name":"bytebase-test","full_name":"unknwon/bytebase-test","private":true,"owner":{"name":"unknwon","email":"[email protected]","login":"unknwon","id":2946214,"node_id":"MDQ6VXNlcjI5NDYyMTQ=","avatar_url":"https://avatars.githubusercontent.com/u/2946214?v=4","gravatar_id":"","url":"https://api.github.com/users/unknwon","html_url":"https://github.com/unknwon","followers_url":"https://api.github.com/users/unknwon/followers","following_url":"https://api.github.com/users/unknwon/following{/other_user}","gists_url":"https://api.github.com/users/unknwon/gists{/gist_id}","starred_url":"https://api.github.com/users/unknwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unknwon/subscriptions","organizations_url":"https://api.github.com/users/unknwon/orgs","repos_url":"https://api.github.com/users/unknwon/repos","events_url":"https://api.github.com/users/unknwon/events{/privacy}","received_events_url":"https://api.github.com/users/unknwon/received_events","type":"User","site_admin":false},"html_url":"https://github.com/unknwon/bytebase-test","description":null,"fork":false,"url":"https://github.com/unknwon/bytebase-test","forks_url":"https://api.github.com/repos/unknwon/bytebase-test/forks","keys_url":"https://api.github.com/repos/unknwon/bytebase-test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unknwon/bytebase-test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unknwon/bytebase-test/teams","hooks_url":"https://api.github.com/repos/unknwon/bytebase-test/hooks","issue_events_url":"https://api.github.com/repos/unknwon/bytebase-test/issues/events{/number}","events_url":"https://api.github.com/repos/unknwon/bytebase-test/events","assignees_url":"https://api.github.com/repos/unknwon/bytebase-test/assignees{/user}","branches_url":"https://api.github.com/repos/unknwon/bytebase-test/branches{/branch}","tags_url":"https://api.github.com/repos/unknwon/bytebase-test/tags","blobs_url":"https://api.github.com/repos/unknwon/bytebase-test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unknwon/bytebase-test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unknwon/bytebase-test/git/refs{/sha}","trees_url":"https://api.github.com/repos/unknwon/bytebase-test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unknwon/bytebase-test/statuses/{sha}","languages_url":"https://api.github.com/repos/unknwon/bytebase-test/languages","stargazers_url":"https://api.github.com/repos/unknwon/bytebase-test/stargazers","contributors_url":"https://api.github.com/repos/unknwon/bytebase-test/contributors","subscribers_url":"https://api.github.com/repos/unknwon/bytebase-test/subscribers","subscription_url":"https://api.github.com/repos/unknwon/bytebase-test/subscription","commits_url":"https://api.github.com/repos/unknwon/bytebase-test/commits{/sha}","git_commits_url":"https://api.github.com/repos/unknwon/bytebase-test/git/commits{/sha}","comments_url":"https://api.github.com/repos/unknwon/bytebase-test/comments{/number}","issue_comment_url":"https://api.github.com/repos/unknwon/bytebase-test/issues/comments{/number}","contents_url":"https://api.github.com/repos/unknwon/bytebase-test/contents/{+path}","compare_url":"https://api.github.com/repos/unknwon/bytebase-test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unknwon/bytebase-test/merges","archive_url":"https://api.github.com/repos/unknwon/bytebase-test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unknwon/bytebase-test/downloads","issues_url":"https://api.github.com/repos/unknwon/bytebase-test/issues{/number}","pulls_url":"https://api.github.com/repos/unknwon/bytebase-test/pulls{/number}","milestones_url":"https://api.github.com/repos/unknwon/bytebase-test/milestones{/number}","notifications_url":"https://api.github.com/repos/unknwon/bytebase-test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unknwon/bytebase-test/labels{/name}","releases_url":"https://api.github.com/repos/unknwon/bytebase-test/releases{/id}","deployments_url":"https://api.github.com/repos/unknwon/bytebase-test/deployments","created_at":1647463607,"updated_at":"2022-03-16T20:46:47Z","pushed_at":1658671596,"git_url":"git://github.com/unknwon/bytebase-test.git","ssh_url":"[email protected]:unknwon/bytebase-test.git","clone_url":"https://github.com/unknwon/bytebase-test.git","svn_url":"https://github.com/unknwon/bytebase-test","homepage":null,"size":20,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"private","forks":0,"open_issues":0,"watchers":0,"default_branch":"main","stargazers":0,"master_branch":"main"},"pusher":{"name":"unknwon","email":"[email protected]"},"sender":{"login":"unknwon","id":2946214,"node_id":"MDQ6VXNlcjI5NDYyMTQ=","avatar_url":"https://avatars.githubusercontent.com/u/2946214?v=4","gravatar_id":"","url":"https://api.github.com/users/unknwon","html_url":"https://github.com/unknwon","followers_url":"https://api.github.com/users/unknwon/followers","following_url":"https://api.github.com/users/unknwon/following{/other_user}","gists_url":"https://api.github.com/users/unknwon/gists{/gist_id}","starred_url":"https://api.github.com/users/unknwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unknwon/subscriptions","organizations_url":"https://api.github.com/users/unknwon/orgs","repos_url":"https://api.github.com/users/unknwon/repos","events_url":"https://api.github.com/users/unknwon/events{/privacy}","received_events_url":"https://api.github.com/users/unknwon/received_events","type":"User","site_admin":false},"created":false,"deleted":false,"forced":false,"base_ref":null,"compare":"https://github.com/unknwon/bytebase-test/compare/07da1e122bdb...5a96148ac5ef","commits":[{"id":"5a96148ac5ef11a53b838b8cc0d9c929420657f3","tree_id":"8a842b23b62886d2ee12c152eda741cf39b1ceef","distinct":true,"message":"Create testdb_dev__202101131000__baseline__create_tablefoo_for_bar.sql","timestamp":"2022-07-24T22:06:36+08:00","url":"https://github.com/unknwon/bytebase-test/commit/5a96148ac5ef11a53b838b8cc0d9c929420657f3","author":{"name":"Joe Chen","email":"[email protected]","username":"unknwon"},"committer":{"name":"GitHub","email":"[email protected]","username":"web-flow"},"added":["Dev/testdb_dev__202101131000__baseline__create_tablefoo_for_bar.sql"],"removed":[],"modified":[]}],"head_commit":{"id":"5a96148ac5ef11a53b838b8cc0d9c929420657f3","tree_id":"8a842b23b62886d2ee12c152eda741cf39b1ceef","distinct":true,"message":"Create testdb_dev__202101131000__baseline__create_tablefoo_for_bar.sql","timestamp":"2022-07-24T22:06:36+08:00","url":"https://github.com/unknwon/bytebase-test/commit/5a96148ac5ef11a53b838b8cc0d9c929420657f3","author":{"name":"Joe Chen","email":"[email protected]","username":"unknwon"},"committer":{"name":"GitHub","email":"[email protected]","username":"web-flow"},"added":["Dev/testdb_dev__202101131000__baseline__create_tablefoo_for_bar.sql"],"removed":[],"modified":[]}}`
-
- t.Run("wrong key", func(t *testing.T) {
- got, err := validateGitHubWebhookSignature256(
- "sha256=6bf313c917fd04a3c6c85270bab6c2a6ae40b7ab37767107bf80ad5c6a0a0deb",
- "abadkey",
- []byte(payload),
- )
- assert.False(t, got)
- assert.NoError(t, err)
- })
-
- t.Run("wrong signature", func(t *testing.T) {
- got, err := validateGitHubWebhookSignature256(
- "sha256=8335bc69262e94b20753316d844e155ae4d7826a6c89f12e98083ed0dce8d057",
- "bZovosSKsJ8QKCG9",
- []byte(payload),
- )
- assert.False(t, got)
- assert.NoError(t, err)
- })
-
- t.Run("success", func(t *testing.T) {
- got, err := validateGitHubWebhookSignature256(
- "sha256=6bf313c917fd04a3c6c85270bab6c2a6ae40b7ab37767107bf80ad5c6a0a0deb",
- "bZovosSKsJ8QKCG9",
- []byte(payload),
- )
- assert.True(t, got)
- assert.NoError(t, err)
- })
-}
diff --git a/backend/api/v1/audit.go b/backend/api/v1/audit.go
index 623affbfb5..ce9f67e195 100644
--- a/backend/api/v1/audit.go
+++ b/backend/api/v1/audit.go
@@ -284,27 +284,6 @@ func getRequestString(request any) (string, error) {
case *v1pb.UpdateSecretRequest:
r.Secret = redactSecret(r.Secret)
return r
- case *v1pb.CreateVCSProviderRequest:
- return &v1pb.CreateVCSProviderRequest{
- VcsProvider: &v1pb.VCSProvider{
- Name: r.VcsProvider.Name,
- Title: r.VcsProvider.Title,
- Type: r.VcsProvider.Type,
- Url: r.VcsProvider.Url,
- AccessToken: maskedString,
- },
- }
- case *v1pb.UpdateVCSProviderRequest:
- return &v1pb.UpdateVCSProviderRequest{
- VcsProvider: &v1pb.VCSProvider{
- Name: r.VcsProvider.Name,
- Title: r.VcsProvider.Title,
- Type: r.VcsProvider.Type,
- Url: r.VcsProvider.Url,
- AccessToken: maskedString,
- },
- UpdateMask: r.UpdateMask,
- }
default:
if p, ok := r.(protoreflect.ProtoMessage); ok {
return p
diff --git a/backend/api/v1/project_service.go b/backend/api/v1/project_service.go
index e0d96e00b3..179e6d8dd2 100644
--- a/backend/api/v1/project_service.go
+++ b/backend/api/v1/project_service.go
@@ -1228,10 +1228,6 @@ func convertToStoreIamPolicyMember(ctx context.Context, stores *store.Store, mem
}
func convertToProject(projectMessage *store.ProjectMessage) *v1pb.Project {
- workflow := v1pb.Workflow_UI
- if projectMessage.VCSConnectorsCount > 0 {
- workflow = v1pb.Workflow_VCS
- }
var projectWebhooks []*v1pb.Webhook
for _, webhook := range projectMessage.Webhooks {
projectWebhooks = append(projectWebhooks, &v1pb.Webhook{
@@ -1257,7 +1253,6 @@ func convertToProject(projectMessage *store.ProjectMessage) *v1pb.Project {
Name: common.FormatProject(projectMessage.ResourceID),
State: convertDeletedToState(projectMessage.Deleted),
Title: projectMessage.Title,
- Workflow: workflow,
Webhooks: projectWebhooks,
DataClassificationConfigId: projectMessage.DataClassificationConfigID,
IssueLabels: issueLabels,
diff --git a/backend/api/v1/vcs_connector_service.go b/backend/api/v1/vcs_connector_service.go
deleted file mode 100644
index 842c7d8021..0000000000
--- a/backend/api/v1/vcs_connector_service.go
+++ /dev/null
@@ -1,506 +0,0 @@
-package v1
-
-import (
- "context"
- "encoding/json"
- "fmt"
- "log/slog"
- "strings"
-
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
- "google.golang.org/protobuf/types/known/emptypb"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/common/log"
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/azure"
- "github.com/bytebase/bytebase/backend/plugin/vcs/bitbucket"
- "github.com/bytebase/bytebase/backend/plugin/vcs/github"
- "github.com/bytebase/bytebase/backend/plugin/vcs/gitlab"
- "github.com/bytebase/bytebase/backend/store"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-)
-
-// VCSConnectorService implements the vcs connector service.
-type VCSConnectorService struct {
- v1pb.UnimplementedVCSConnectorServiceServer
- store *store.Store
-}
-
-// NewVCSConnectorService creates a new VCSConnectorService.
-func NewVCSConnectorService(store *store.Store) *VCSConnectorService {
- return &VCSConnectorService{
- store: store,
- }
-}
-
-// CreateVCSConnector creates a vcs connector.
-func (s *VCSConnectorService) CreateVCSConnector(ctx context.Context, request *v1pb.CreateVCSConnectorRequest) (*v1pb.VCSConnector, error) {
- if request.VcsConnector == nil {
- return nil, status.Errorf(codes.InvalidArgument, "vcs connector must be set")
- }
-
- setting, err := s.store.GetWorkspaceGeneralSetting(ctx)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to find workspace setting: %v", err)
- }
- if setting.ExternalUrl == "" {
- return nil, status.Errorf(codes.FailedPrecondition, setupExternalURLError)
- }
-
- projectResourceID, err := common.GetProjectID(request.Parent)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{
- ResourceID: &projectResourceID,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get project with resource id %q, err: %v", projectResourceID, err)
- }
- if project == nil {
- return nil, status.Errorf(codes.NotFound, "project with resource id %q not found", projectResourceID)
- }
- if project.Deleted {
- return nil, status.Errorf(codes.NotFound, "project with resource id %q had deleted", projectResourceID)
- }
-
- vcsConnector, err := s.store.GetVCSConnector(ctx, &store.FindVCSConnectorMessage{ProjectID: &project.ResourceID, ResourceID: &request.VcsConnectorId})
- if err != nil {
- return nil, err
- }
- if vcsConnector != nil {
- return nil, status.Errorf(codes.AlreadyExists, "vcs connector %q already exists", request.VcsConnectorId)
- }
-
- vcsResourceID, err := common.GetVCSProviderID(request.GetVcsConnector().GetVcsProvider())
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- vcsProvider, err := s.store.GetVCSProvider(ctx, &store.FindVCSProviderMessage{ResourceID: &vcsResourceID})
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to find vcs: %s", err.Error())
- }
- if vcsProvider == nil {
- return nil, status.Errorf(codes.NotFound, "vcs %s not found", vcsResourceID)
- }
-
- // Check branch existence.
- if err := checkBranchExistence(
- ctx,
- vcsProvider,
- request.GetVcsConnector().ExternalId,
- request.GetVcsConnector().Branch,
- ); err != nil {
- return nil, err
- }
-
- baseDirectory := request.GetVcsConnector().BaseDirectory
- if !strings.HasPrefix(baseDirectory, "/") {
- return nil, status.Errorf(codes.InvalidArgument, `base directory should start with "/"`)
- }
- if strings.HasSuffix(baseDirectory, "/") {
- return nil, status.Errorf(codes.InvalidArgument, `base directory should not end with "/"`)
- }
-
- workspaceID, err := s.store.GetWorkspaceID(ctx)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to find workspace id with error: %v", err.Error())
- }
- secretToken, err := common.RandomString(gitlab.SecretTokenLength)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to generate random secret token for vcs with error: %v", err.Error())
- }
- vcsConnectorCreate := &store.VCSConnectorMessage{
- ProjectID: project.ResourceID,
- ResourceID: request.VcsConnectorId,
- VCSID: vcsProvider.ResourceID,
- Payload: &storepb.VCSConnector{
- Title: request.GetVcsConnector().Title,
- FullPath: request.GetVcsConnector().FullPath,
- WebUrl: request.GetVcsConnector().WebUrl,
- Branch: request.GetVcsConnector().Branch,
- BaseDirectory: request.GetVcsConnector().BaseDirectory,
- ExternalId: request.GetVcsConnector().ExternalId,
- WebhookSecretToken: secretToken,
- DatabaseGroup: request.GetVcsConnector().DatabaseGroup,
- },
- }
-
- // Create the webhook.
- bytebaseEndpointURL := setting.GitopsWebhookUrl
- if bytebaseEndpointURL == "" {
- bytebaseEndpointURL = setting.ExternalUrl
- }
- webhookEndpointID := fmt.Sprintf("workspaces/%s/projects/%s/vcsConnectors/%s", workspaceID, project.ResourceID, request.VcsConnectorId)
- webhookID, err := createVCSWebhook(
- ctx,
- vcsProvider,
- webhookEndpointID,
- secretToken,
- vcsConnectorCreate.Payload.ExternalId,
- bytebaseEndpointURL,
- )
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to create webhook for project %s with error: %v", vcsConnectorCreate.ProjectID, err.Error())
- }
- vcsConnectorCreate.Payload.ExternalWebhookId = webhookID
-
- vcsConnector, err = s.store.CreateVCSConnector(ctx, vcsConnectorCreate)
- if err != nil {
- return nil, err
- }
- v1VCSConnector, err := convertStoreVCSConnector(vcsConnector)
- if err != nil {
- return nil, err
- }
- return v1VCSConnector, nil
-}
-
-// GetVCSConnector gets a vcs connector.
-func (s *VCSConnectorService) GetVCSConnector(ctx context.Context, request *v1pb.GetVCSConnectorRequest) (*v1pb.VCSConnector, error) {
- projectID, vcsConnectorID, err := common.GetProjectVCSConnectorID(request.Name)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{
- ResourceID: &projectID,
- })
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- if project == nil {
- return nil, status.Errorf(codes.NotFound, "project %q not found", projectID)
- }
-
- vcsConnector, err := s.store.GetVCSConnector(ctx, &store.FindVCSConnectorMessage{ProjectID: &project.ResourceID, ResourceID: &vcsConnectorID})
- if err != nil {
- return nil, err
- }
- if vcsConnector == nil {
- return nil, status.Errorf(codes.NotFound, "vcs connector %q not found", vcsConnectorID)
- }
- v1VCSConnector, err := convertStoreVCSConnector(vcsConnector)
- if err != nil {
- return nil, err
- }
- return v1VCSConnector, nil
-}
-
-// GetVCSConnector gets a vcs connector.
-func (s *VCSConnectorService) ListVCSConnectors(ctx context.Context, request *v1pb.ListVCSConnectorsRequest) (*v1pb.ListVCSConnectorsResponse, error) {
- projectID, err := common.GetProjectID(request.Parent)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{
- ResourceID: &projectID,
- })
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- if project == nil {
- return nil, status.Errorf(codes.NotFound, "project %q not found", projectID)
- }
-
- vcsConnectors, err := s.store.ListVCSConnectors(ctx, &store.FindVCSConnectorMessage{ProjectID: &project.ResourceID})
- if err != nil {
- return nil, err
- }
-
- resp := &v1pb.ListVCSConnectorsResponse{}
- for _, vcsConnector := range vcsConnectors {
- v1VCSConnector, err := convertStoreVCSConnector(vcsConnector)
- if err != nil {
- return nil, err
- }
- resp.VcsConnectors = append(resp.VcsConnectors, v1VCSConnector)
- }
- return resp, nil
-}
-
-// UpdateVCSConnector updates a vcs connector.
-func (s *VCSConnectorService) UpdateVCSConnector(ctx context.Context, request *v1pb.UpdateVCSConnectorRequest) (*v1pb.VCSConnector, error) {
- if request.VcsConnector == nil {
- return nil, status.Errorf(codes.InvalidArgument, "vcs connector must be set")
- }
- if request.UpdateMask == nil {
- return nil, status.Errorf(codes.InvalidArgument, "update_mask must be set")
- }
-
- projectID, vcsConnectorID, err := common.GetProjectVCSConnectorID(request.GetVcsConnector().GetName())
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{
- ResourceID: &projectID,
- })
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- if project == nil {
- return nil, status.Errorf(codes.NotFound, "project %q not found", projectID)
- }
-
- vcsConnector, err := s.store.GetVCSConnector(ctx, &store.FindVCSConnectorMessage{ProjectID: &project.ResourceID, ResourceID: &vcsConnectorID})
- if err != nil {
- return nil, err
- }
- if vcsConnector == nil {
- return nil, status.Errorf(codes.NotFound, "vcs connector %q not found", vcsConnectorID)
- }
-
- vcsProvider, err := s.store.GetVCSProvider(ctx, &store.FindVCSProviderMessage{ResourceID: &vcsConnector.VCSID})
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to find vcs: %s", err.Error())
- }
- if vcsProvider == nil {
- return nil, status.Errorf(codes.NotFound, "vcs provider %s not found", vcsConnector.VCSID)
- }
-
- update := &store.UpdateVCSConnectorMessage{
- ProjectID: project.ResourceID,
- ResourceID: vcsConnector.ResourceID,
- }
-
- for _, path := range request.UpdateMask.Paths {
- switch path {
- case "branch":
- update.Branch = &request.GetVcsConnector().Branch
- case "base_directory":
- baseDir := request.GetVcsConnector().BaseDirectory
- if !strings.HasPrefix(baseDir, "/") {
- return nil, status.Errorf(codes.InvalidArgument, `base directory should start with "/"`)
- }
- update.BaseDirectory = &baseDir
- case "database_group":
- update.DatabaseGroup = &request.GetVcsConnector().DatabaseGroup
- }
- }
-
- // Check branch existence.
- if v := update.Branch; v != nil {
- if err := checkBranchExistence(
- ctx,
- vcsProvider,
- vcsConnector.Payload.ExternalId,
- *v,
- ); err != nil {
- return nil, err
- }
- }
-
- if err := s.store.UpdateVCSConnector(ctx, update); err != nil {
- return nil, err
- }
- vcsConnector, err = s.store.GetVCSConnector(ctx, &store.FindVCSConnectorMessage{ProjectID: &project.ResourceID, ResourceID: &vcsConnectorID})
- if err != nil {
- return nil, err
- }
-
- v1VCSConnector, err := convertStoreVCSConnector(vcsConnector)
- if err != nil {
- return nil, err
- }
- return v1VCSConnector, nil
-}
-
-// DeleteVCSConnector deletes a vcs connector.
-func (s *VCSConnectorService) DeleteVCSConnector(ctx context.Context, request *v1pb.DeleteVCSConnectorRequest) (*emptypb.Empty, error) {
- projectID, vcsConnectorID, err := common.GetProjectVCSConnectorID(request.GetName())
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{
- ResourceID: &projectID,
- })
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- if project == nil {
- return nil, status.Errorf(codes.NotFound, "project %q not found", projectID)
- }
-
- vcsConnector, err := s.store.GetVCSConnector(ctx, &store.FindVCSConnectorMessage{ProjectID: &project.ResourceID, ResourceID: &vcsConnectorID})
- if err != nil {
- return nil, err
- }
- if vcsConnector == nil {
- return nil, status.Errorf(codes.NotFound, "vcs connector %q not found", vcsConnectorID)
- }
-
- vcsProvider, err := s.store.GetVCSProvider(ctx, &store.FindVCSProviderMessage{ResourceID: &vcsConnector.VCSID})
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to find vcs: %s", err.Error())
- }
- if vcsProvider == nil {
- return nil, status.Errorf(codes.NotFound, "vcs provider %s not found", vcsConnector.VCSID)
- }
-
- if err := s.store.DeleteVCSConnector(ctx, project.ResourceID, vcsConnectorID); err != nil {
- return nil, err
- }
-
- // Delete the webhook, and fail-open.
- webhookIDs := strings.Split(vcsConnector.Payload.ExternalWebhookId, ",")
- vcsPlugin := vcs.Get(
- vcsProvider.Type,
- vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken},
- )
- for _, webhookID := range webhookIDs {
- if err = vcsPlugin.DeleteWebhook(
- ctx,
- vcsConnector.Payload.ExternalId,
- webhookID,
- ); err != nil {
- slog.Error("failed to delete webhook for VCS connector", slog.String("project", projectID), slog.String("VCS connector", vcsConnector.ResourceID), log.BBError(err))
- }
- }
-
- return &emptypb.Empty{}, nil
-}
-
-func convertStoreVCSConnector(vcsConnector *store.VCSConnectorMessage) (*v1pb.VCSConnector, error) {
- v1VCSConnector := &v1pb.VCSConnector{
- Name: fmt.Sprintf("%s/%s%s", common.FormatProject(vcsConnector.ProjectID), common.VCSConnectorPrefix, vcsConnector.ResourceID),
- Title: vcsConnector.Payload.Title,
- VcsProvider: fmt.Sprintf("%s%s", common.VCSProviderPrefix, vcsConnector.VCSID),
- ExternalId: vcsConnector.Payload.ExternalId,
- BaseDirectory: vcsConnector.Payload.BaseDirectory,
- Branch: vcsConnector.Payload.Branch,
- FullPath: vcsConnector.Payload.FullPath,
- WebUrl: vcsConnector.Payload.WebUrl,
- DatabaseGroup: vcsConnector.Payload.DatabaseGroup,
- }
- return v1VCSConnector, nil
-}
-
-func checkBranchExistence(ctx context.Context, vcsProvider *store.VCSProviderMessage, externalID, branch string) error {
- if branch == "" {
- return status.Errorf(codes.InvalidArgument, "branch name is required")
- }
- if _, err := vcs.Get(vcsProvider.Type, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).GetBranch(ctx, externalID, branch); err != nil {
- if common.ErrorCode(err) == common.NotFound {
- return status.Errorf(codes.NotFound, "branch %s not found in repository %s", branch, externalID)
- }
- return status.Errorf(codes.Internal, "failed to check branch: %v", err)
- }
- return nil
-}
-
-func createVCSWebhook(ctx context.Context, vcsProvider *store.VCSProviderMessage, webhookEndpointID, webhookSecretToken, externalRepoID, bytebaseEndpointURL string) (string, error) {
- // Create a new webhook and retrieve the created webhook ID
- var webhookCreatePayloads [][]byte
- switch vcsProvider.Type {
- case storepb.VCSType_GITLAB:
- // https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#push-events
- webhookCreate := gitlab.WebhookCreate{
- URL: fmt.Sprintf("%s/hook/%s", bytebaseEndpointURL, webhookEndpointID),
- SecretToken: webhookSecretToken,
- MergeRequestsEvents: true,
- NoteEvents: true,
- EnableSSLVerification: false,
- }
- createPayload, err := json.Marshal(webhookCreate)
- if err != nil {
- return "", errors.Wrap(err, "failed to marshal request body for creating webhook")
- }
- webhookCreatePayloads = append(webhookCreatePayloads, createPayload)
- case storepb.VCSType_GITHUB:
- webhookPost := github.WebhookCreateOrUpdate{
- Config: github.WebhookConfig{
- URL: fmt.Sprintf("%s/hook/%s", bytebaseEndpointURL, webhookEndpointID),
- ContentType: "json",
- Secret: webhookSecretToken,
- InsecureSSL: 1,
- },
- // https://docs.github.com/en/webhooks/webhook-events-and-payloads
- Events: []string{"pull_request", "pull_request_review_comment"},
- }
- createPayload, err := json.Marshal(webhookPost)
- if err != nil {
- return "", errors.Wrap(err, "failed to marshal request body for creating webhook")
- }
- webhookCreatePayloads = append(webhookCreatePayloads, createPayload)
- case storepb.VCSType_BITBUCKET:
- webhookPost := bitbucket.WebhookCreateOrUpdate{
- Description: "Bytebase GitOps",
- URL: fmt.Sprintf("%s/hook/%s", bytebaseEndpointURL, webhookEndpointID),
- Active: true,
- // https://support.atlassian.com/bitbucket-cloud/docs/event-payloads
- Events: []string{
- string(bitbucket.PullRequestEventCreated),
- string(bitbucket.PullRequestEventUpdated),
- string(bitbucket.PullRequestEventFulfilled),
- "pullrequest:comment_created",
- },
- }
- createPayload, err := json.Marshal(webhookPost)
- if err != nil {
- return "", errors.Wrap(err, "failed to marshal request body for creating webhook")
- }
- webhookCreatePayloads = append(webhookCreatePayloads, createPayload)
- case storepb.VCSType_AZURE_DEVOPS:
- part := strings.Split(externalRepoID, "/")
- if len(part) != 3 {
- return "", errors.Errorf("invalid external repo id %q", externalRepoID)
- }
- projectID, repositoryID := part[1], part[2]
-
- // https://learn.microsoft.com/en-us/azure/devops/service-hooks/events?view=azure-devops
- // Azure doesn't support multiply events in a single webhook, but we need:
- // - git.pullrequest.merged: A merge commit was created on a pull request.
- // - git.pullrequest.created: A pull request is created in a Git repository.
- // - git.pullrequest.updated: A pull request is updated; status, review list, reviewer vote changed, or the source branch is updated with a push.
- events := []azure.PullRequestEventType{
- azure.PullRequestEventCreated,
- azure.PullRequestEventUpdated,
- azure.PullRequestEventMerged,
- }
- for _, event := range events {
- publisherInputs := azure.WebhookCreatePublisherInputs{
- Repository: repositoryID,
- Branch: "", /* Any branches */
- ProjectID: projectID,
- }
- if event == azure.PullRequestEventMerged {
- publisherInputs.MergeResult = azure.WebhookMergeResultSucceeded
- }
- webhookPost := azure.WebhookCreateOrUpdate{
- ConsumerActionID: "httpRequest",
- ConsumerID: "webHooks",
- ConsumerInputs: azure.WebhookCreateConsumerInputs{
- URL: fmt.Sprintf("%s/hook/%s", bytebaseEndpointURL, webhookEndpointID),
- AcceptUntrustedCerts: true,
- HTTPHeaders: fmt.Sprintf("X-Azure-Token: %s", webhookSecretToken),
- },
- EventType: string(event),
- PublisherID: "tfs",
- PublisherInputs: publisherInputs,
- }
- createPayload, err := json.Marshal(webhookPost)
- if err != nil {
- return "", errors.Wrap(err, "failed to marshal request body for creating webhook")
- }
- webhookCreatePayloads = append(webhookCreatePayloads, createPayload)
- }
- }
-
- var webhookIDs []string
- for _, webhookCreatePayload := range webhookCreatePayloads {
- webhookID, err := vcs.Get(vcsProvider.Type, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).CreateWebhook(
- ctx,
- externalRepoID,
- webhookCreatePayload,
- )
- if err != nil {
- return "", errors.Wrap(err, "failed to create webhook")
- }
- webhookIDs = append(webhookIDs, webhookID)
- }
- return strings.Join(webhookIDs, ","), nil
-}
diff --git a/backend/api/v1/vcs_provider_service.go b/backend/api/v1/vcs_provider_service.go
deleted file mode 100644
index ce1157015d..0000000000
--- a/backend/api/v1/vcs_provider_service.go
+++ /dev/null
@@ -1,247 +0,0 @@
-package v1
-
-import (
- "context"
- "fmt"
- "strings"
-
- "github.com/pkg/errors"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
- "google.golang.org/protobuf/types/known/emptypb"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/store"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-)
-
-// VCSProviderService represents a service for managing vcs provider.
-type VCSProviderService struct {
- v1pb.UnimplementedVCSProviderServiceServer
- store *store.Store
-}
-
-// NewVCSProviderService returns a new instance of VCSProviderService.
-func NewVCSProviderService(store *store.Store) *VCSProviderService {
- return &VCSProviderService{store: store}
-}
-
-// GetVCSProvider get a single vcs provider.
-func (s *VCSProviderService) GetVCSProvider(ctx context.Context, request *v1pb.GetVCSProviderRequest) (*v1pb.VCSProvider, error) {
- vcs, err := s.getVCS(ctx, request.Name)
- if err != nil {
- return nil, err
- }
-
- return convertVCSProvider(vcs), nil
-}
-
-// ListVCSProviders lists vcs providers.
-func (s *VCSProviderService) ListVCSProviders(ctx context.Context, _ *v1pb.ListVCSProvidersRequest) (*v1pb.ListVCSProvidersResponse, error) {
- vcsProviders, err := s.store.ListVCSProviders(ctx)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "Failed to retrieve vcs provider: %v", err)
- }
- return &v1pb.ListVCSProvidersResponse{VcsProviders: convertToVCSProviders(vcsProviders)}, nil
-}
-
-// CreateVCSProvider creates a new vcs provider.
-func (s *VCSProviderService) CreateVCSProvider(ctx context.Context, request *v1pb.CreateVCSProviderRequest) (*v1pb.VCSProvider, error) {
- vcsProvider, err := s.store.GetVCSProvider(ctx, &store.FindVCSProviderMessage{ResourceID: &request.VcsProviderId})
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- if vcsProvider != nil {
- return nil, status.Errorf(codes.AlreadyExists, "vcs provider %s already exists", request.VcsProviderId)
- }
-
- if !isValidResourceID(request.VcsProviderId) {
- return nil, status.Errorf(codes.InvalidArgument, "invalid vcs provider ID %v", request.VcsProviderId)
- }
- vcsProvider, err = convertV1VCSProvider(request)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- if err := checkAccessTokenPermission(ctx, vcsProvider.Type, vcsProvider.InstanceURL, vcsProvider.AccessToken); err != nil {
- return nil, err
- }
-
- storeVCSProvider, err := s.store.CreateVCSProvider(ctx, vcsProvider)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "Failed to create vcs provider: %v", err)
- }
- return convertVCSProvider(storeVCSProvider), nil
-}
-
-// UpdateVCSProvider updates an existing vcs provider.
-func (s *VCSProviderService) UpdateVCSProvider(ctx context.Context, request *v1pb.UpdateVCSProviderRequest) (*v1pb.VCSProvider, error) {
- if request.UpdateMask == nil {
- return nil, status.Errorf(codes.InvalidArgument, "update_mask must be set")
- }
- vcsProvider, err := s.getVCS(ctx, request.VcsProvider.Name)
- if err != nil {
- return nil, err
- }
-
- update := &store.UpdateVCSProviderMessage{}
- for _, path := range request.UpdateMask.Paths {
- switch path {
- case "title":
- if request.VcsProvider.Title == "" {
- return nil, status.Errorf(codes.InvalidArgument, "title should not be empty")
- }
- update.Name = &request.VcsProvider.Title
- case "access_token":
- if request.VcsProvider.AccessToken == "" {
- return nil, status.Errorf(codes.InvalidArgument, "secret should not be empty")
- }
- update.AccessToken = &request.VcsProvider.AccessToken
- if err := checkAccessTokenPermission(ctx, vcsProvider.Type, vcsProvider.InstanceURL, request.VcsProvider.AccessToken); err != nil {
- return nil, err
- }
- }
- }
-
- vcsProvider, err = s.store.UpdateVCSProvider(ctx, vcsProvider.ResourceID, update)
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- return convertVCSProvider(vcsProvider), nil
-}
-
-// DeleteVCSProvider deletes an existing vcs provider.
-func (s *VCSProviderService) DeleteVCSProvider(ctx context.Context, request *v1pb.DeleteVCSProviderRequest) (*emptypb.Empty, error) {
- vcsProvider, err := s.getVCS(ctx, request.Name)
- if err != nil {
- return nil, err
- }
-
- if err := s.store.DeleteVCSProvider(ctx, vcsProvider.ResourceID); err != nil {
- return nil, status.Errorf(codes.Internal, "Failed to delete vcs provider: %v", err)
- }
- return &emptypb.Empty{}, nil
-}
-
-// SearchVCSProviderRepositories searches vcs provider repositories, for example, GitHub repository.
-func (s *VCSProviderService) SearchVCSProviderRepositories(ctx context.Context, request *v1pb.SearchVCSProviderRepositoriesRequest) (*v1pb.SearchVCSProviderRepositoriesResponse, error) {
- vcsProvider, err := s.getVCS(ctx, request.Name)
- if err != nil {
- return nil, err
- }
-
- apiExternalProjectList, err := vcs.Get(
- vcsProvider.Type,
- vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken},
- ).FetchRepositoryList(ctx, true)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "Failed to fetch external project list: %v", err)
- }
-
- var repositories []*v1pb.VCSRepository
- for _, apiExternalProject := range apiExternalProjectList {
- repositories = append(repositories, &v1pb.VCSRepository{
- Id: apiExternalProject.ID,
- Title: apiExternalProject.Name,
- FullPath: apiExternalProject.FullPath,
- WebUrl: apiExternalProject.WebURL,
- })
- }
-
- return &v1pb.SearchVCSProviderRepositoriesResponse{
- Repositories: repositories,
- }, nil
-}
-
-// ListVCSConnectorsInProvider lists GitOps connectors for the provider.
-func (s *VCSProviderService) ListVCSConnectorsInProvider(ctx context.Context, request *v1pb.ListVCSConnectorsInProviderRequest) (*v1pb.ListVCSConnectorsInProviderResponse, error) {
- vcs, err := s.getVCS(ctx, request.Name)
- if err != nil {
- return nil, err
- }
- vcsConnectors, err := s.store.ListVCSConnectors(ctx, &store.FindVCSConnectorMessage{
- VCSID: &vcs.ResourceID,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to fetch external repository list: %v", err)
- }
-
- resp := &v1pb.ListVCSConnectorsInProviderResponse{}
- for _, vcsConnector := range vcsConnectors {
- v1VCSConnector, err := convertStoreVCSConnector(vcsConnector)
- if err != nil {
- return nil, err
- }
- resp.VcsConnectors = append(resp.VcsConnectors, v1VCSConnector)
- }
- return resp, nil
-}
-
-func (s *VCSProviderService) getVCS(ctx context.Context, name string) (*store.VCSProviderMessage, error) {
- vcsResourceID, err := common.GetVCSProviderID(name)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- vcsProvider, err := s.store.GetVCSProvider(ctx, &store.FindVCSProviderMessage{ResourceID: &vcsResourceID})
- if err != nil {
- return nil, status.Errorf(codes.Internal, "Failed to retrieve vcs provider: %v", err)
- }
- if vcsProvider == nil {
- return nil, status.Errorf(codes.NotFound, "vcs provider %s not found", name)
- }
- return vcsProvider, nil
-}
-
-func checkAccessTokenPermission(ctx context.Context, vcsType storepb.VCSType, instanceURL, token string) error {
- if _, err := vcs.Get(
- vcsType,
- vcs.ProviderConfig{InstanceURL: instanceURL, AuthToken: token},
- ).FetchRepositoryList(ctx, false); err != nil {
- return status.Errorf(codes.InvalidArgument, "failed to fetch repositories, please check if the token has right permissions: %v", err)
- }
- return nil
-}
-
-func convertToVCSProviders(vcsProviders []*store.VCSProviderMessage) []*v1pb.VCSProvider {
- var res []*v1pb.VCSProvider
- for _, vcsProvider := range vcsProviders {
- res = append(res, convertVCSProvider(vcsProvider))
- }
- return res
-}
-
-func convertVCSProvider(vcsProvider *store.VCSProviderMessage) *v1pb.VCSProvider {
- return &v1pb.VCSProvider{
- Name: fmt.Sprintf("%s%s", common.VCSProviderPrefix, vcsProvider.ResourceID),
- Title: vcsProvider.Title,
- Type: v1pb.VCSType(vcsProvider.Type),
- Url: vcsProvider.InstanceURL,
- }
-}
-
-func convertV1VCSProvider(request *v1pb.CreateVCSProviderRequest) (*store.VCSProviderMessage, error) {
- v1VCSProvider := request.GetVcsProvider()
- if v1VCSProvider.GetTitle() == "" {
- return nil, errors.Errorf("Empty VCSProvider.Title")
- }
- if v1VCSProvider.GetType() == v1pb.VCSType_VCS_TYPE_UNSPECIFIED {
- return nil, errors.Errorf("Empty VCSProvider.Type")
- }
- if v1VCSProvider.GetUrl() == "" {
- return nil, errors.Errorf("Empty VCSProvider.Url")
- }
- if v1VCSProvider.GetAccessToken() == "" {
- return nil, errors.Errorf("Empty VCSProvider.Secret")
- }
-
- storeVCSProvider := &store.VCSProviderMessage{
- ResourceID: request.GetVcsProviderId(),
- Title: v1VCSProvider.GetTitle(),
- Type: storepb.VCSType(v1VCSProvider.GetType()),
- InstanceURL: strings.TrimRight(v1VCSProvider.GetUrl(), "/"),
- AccessToken: v1VCSProvider.GetAccessToken(),
- }
-
- return storeVCSProvider, nil
-}
diff --git a/backend/bin/server/cmd/root.go b/backend/bin/server/cmd/root.go
index 3b937554ba..eb033dbbe4 100644
--- a/backend/bin/server/cmd/root.go
+++ b/backend/bin/server/cmd/root.go
@@ -109,11 +109,6 @@ func init() {
// When running the release build in production, most of the time, users would not expose Bytebase directly to the public.
// Instead they would configure a gateway to forward the traffic to Bytebase. Users need to set --external-url to the address
// exposed on that gateway accordingly.
- //
- // It's important to set the correct --external-url. This is used for:
- // 1. Constructing the correct callback URL when configuring the VCS provider. The callback URL points to the frontend.
- // 2. Creating the correct webhook endpoint when configuring the project GitOps workflow. The webhook endpoint points to the backend.
- // Since frontend and backend are bundled and run on the same address in the release build, thus we just need to specify a single external URL.
rootCmd.PersistentFlags().StringVar(&flags.externalURL, "external-url", "", "the external URL where user visits Bytebase, must start with http:// or https://")
// Support environment variable for deploying to render.com using its blueprint file.
// Render blueprint allows to specify a postgres database along with a service.
diff --git a/backend/common/resource_name.go b/backend/common/resource_name.go
index d3941d532b..90076f1ae5 100644
--- a/backend/common/resource_name.go
+++ b/backend/common/resource_name.go
@@ -21,7 +21,6 @@ const (
UserNamePrefix = "users/"
IdentityProviderNamePrefix = "idps/"
SettingNamePrefix = "settings/"
- VCSProviderPrefix = "vcsProviders/"
RiskPrefix = "risks/"
RolloutPrefix = "rollouts/"
StagePrefix = "stages/"
@@ -45,7 +44,6 @@ const (
BranchPrefix = "branches/"
DeploymentConfigPrefix = "deploymentConfigs/"
ChangelistsPrefix = "changelists/"
- VCSConnectorPrefix = "vcsConnectors/"
AuditLogPrefix = "auditLogs/"
GroupPrefix = "groups/"
ReviewConfigPrefix = "reviewConfigs/"
@@ -53,10 +51,9 @@ const (
FileNamePrefix = "files/"
RevisionNamePrefix = "revisions/"
- SchemaSuffix = "/schema"
- MetadataSuffix = "/metadata"
- CatalogSuffix = "/catalog"
- GitOpsInfoSuffix = "/gitOpsInfo"
+ SchemaSuffix = "/schema"
+ MetadataSuffix = "/metadata"
+ CatalogSuffix = "/catalog"
UserBindingPrefix = "user:"
GroupBindingPrefix = "group:"
@@ -256,15 +253,6 @@ func GetIdentityProviderID(name string) (string, error) {
return tokens[0], nil
}
-// GetVCSProviderID returns the VCS provider ID from a resource name.
-func GetVCSProviderID(name string) (string, error) {
- tokens, err := GetNameParentTokens(name, VCSProviderPrefix)
- if err != nil {
- return "", err
- }
- return tokens[0], nil
-}
-
// GetRiskID returns the risk ID from a resource name.
func GetRiskID(name string) (int64, error) {
tokens, err := GetNameParentTokens(name, RiskPrefix)
@@ -578,24 +566,6 @@ func GetProjectAndBranchID(name string) (string, string, error) {
return matches[1], matches[2], nil
}
-// GetProjectVCSConnectorID returns the workspace, project, and VCS connector ID from a resource name.
-func GetProjectVCSConnectorID(name string) (string, string, error) {
- tokens, err := GetNameParentTokens(name, ProjectNamePrefix, VCSConnectorPrefix)
- if err != nil {
- return "", "", err
- }
- return tokens[0], tokens[1], nil
-}
-
-// GetWorkspaceProjectVCSConnectorID returns the workspace, project, and VCS connector ID from a resource name.
-func GetWorkspaceProjectVCSConnectorID(name string) (string, string, string, error) {
- tokens, err := GetNameParentTokens(name, WorkspacePrefix, ProjectNamePrefix, VCSConnectorPrefix)
- if err != nil {
- return "", "", "", err
- }
- return tokens[0], tokens[1], tokens[2], nil
-}
-
// GetGroupEmail returns the group email.
func GetGroupEmail(name string) (string, error) {
tokens, err := GetNameParentTokens(name, GroupPrefix)
diff --git a/backend/component/iam/acl.yaml b/backend/component/iam/acl.yaml
index 9514aede00..c36848b78d 100644
--- a/backend/component/iam/acl.yaml
+++ b/backend/component/iam/acl.yaml
@@ -130,18 +130,6 @@ roles:
- bb.users.delete
- bb.users.undelete
- bb.users.update
- - bb.vcsConnectors.create
- - bb.vcsConnectors.delete
- - bb.vcsConnectors.get
- - bb.vcsConnectors.list
- - bb.vcsConnectors.update
- - bb.vcsProviders.create
- - bb.vcsProviders.delete
- - bb.vcsProviders.get
- - bb.vcsProviders.list
- - bb.vcsProviders.listProjects
- - bb.vcsProviders.searchProjects
- - bb.vcsProviders.update
- bb.worksheets.get
- bb.worksheets.manage
- name: roles/workspaceDBA
@@ -268,18 +256,6 @@ roles:
- bb.taskRuns.list
- bb.groups.get
- bb.groups.list
- - bb.vcsConnectors.create
- - bb.vcsConnectors.delete
- - bb.vcsConnectors.get
- - bb.vcsConnectors.list
- - bb.vcsConnectors.update
- - bb.vcsProviders.create
- - bb.vcsProviders.delete
- - bb.vcsProviders.get
- - bb.vcsProviders.list
- - bb.vcsProviders.listProjects
- - bb.vcsProviders.searchProjects
- - bb.vcsProviders.update
- bb.worksheets.get
- bb.worksheets.manage
- name: roles/workspaceMember
@@ -301,9 +277,6 @@ roles:
- bb.groups.create
- bb.groups.get
- bb.groups.list
- - bb.vcsProviders.get
- - bb.vcsProviders.list
- - bb.vcsProviders.searchProjects
- name: roles/projectOwner
title: Project owner
permissions:
@@ -378,11 +351,6 @@ roles:
- bb.sql.export
- bb.sql.select
- bb.taskRuns.list
- - bb.vcsConnectors.create
- - bb.vcsConnectors.delete
- - bb.vcsConnectors.get
- - bb.vcsConnectors.list
- - bb.vcsConnectors.update
- bb.worksheets.get
- name: roles/projectDeveloper
title: Project developer
@@ -434,8 +402,6 @@ roles:
- bb.sheets.update
- bb.slowQueries.list
- bb.taskRuns.list
- - bb.vcsConnectors.get
- - bb.vcsConnectors.list
- name: roles/sqlEditorUser
title: SQL Editor User
permissions:
diff --git a/backend/component/iam/permission.go b/backend/component/iam/permission.go
index 1221b81c08..b3d4291b58 100644
--- a/backend/component/iam/permission.go
+++ b/backend/component/iam/permission.go
@@ -3,148 +3,136 @@ package iam
type Permission = string
const (
- PermissionAuditLogsExport Permission = "bb.auditLogs.export"
- PermissionAuditLogsSearch Permission = "bb.auditLogs.search"
- PermissionBranchesAdmin Permission = "bb.branches.admin"
- PermissionBranchesCreate Permission = "bb.branches.create"
- PermissionBranchesDelete Permission = "bb.branches.delete"
- PermissionBranchesGet Permission = "bb.branches.get"
- PermissionBranchesList Permission = "bb.branches.list"
- PermissionBranchesUpdate Permission = "bb.branches.update"
- PermissionChangelistsCreate Permission = "bb.changelists.create"
- PermissionChangelistsDelete Permission = "bb.changelists.delete"
- PermissionChangelistsGet Permission = "bb.changelists.get"
- PermissionChangelistsList Permission = "bb.changelists.list"
- PermissionChangelistsUpdate Permission = "bb.changelists.update"
- PermissionChangelogsGet Permission = "bb.changelogs.get"
- PermissionChangelogsList Permission = "bb.changelogs.list"
- PermissionDatabaseCatalogsGet Permission = "bb.databaseCatalogs.get"
- PermissionDatabaseCatalogsUpdate Permission = "bb.databaseCatalogs.update"
- PermissionDatabaseSecretsDelete Permission = "bb.databaseSecrets.delete"
- PermissionDatabaseSecretsList Permission = "bb.databaseSecrets.list"
- PermissionDatabaseSecretsUpdate Permission = "bb.databaseSecrets.update"
- PermissionDatabasesAdviseIndex Permission = "bb.databases.adviseIndex"
- PermissionDatabasesCheck Permission = "bb.databases.check"
- PermissionDatabasesGet Permission = "bb.databases.get"
- PermissionDatabasesGetSchema Permission = "bb.databases.getSchema"
- PermissionDatabasesList Permission = "bb.databases.list"
- PermissionDatabasesSync Permission = "bb.databases.sync"
- PermissionDatabasesUpdate Permission = "bb.databases.update"
- PermissionEnvironmentsCreate Permission = "bb.environments.create"
- PermissionEnvironmentsDelete Permission = "bb.environments.delete"
- PermissionEnvironmentsGet Permission = "bb.environments.get"
- PermissionEnvironmentsList Permission = "bb.environments.list"
- PermissionEnvironmentsUndelete Permission = "bb.environments.undelete"
- PermissionEnvironmentsUpdate Permission = "bb.environments.update"
- PermissionIdentityProvidersCreate Permission = "bb.identityProviders.create"
- PermissionIdentityProvidersDelete Permission = "bb.identityProviders.delete"
- PermissionIdentityProvidersGet Permission = "bb.identityProviders.get"
- PermissionIdentityProvidersUndelete Permission = "bb.identityProviders.undelete"
- PermissionIdentityProvidersUpdate Permission = "bb.identityProviders.update"
- PermissionInstancesCreate Permission = "bb.instances.create"
- PermissionInstancesDelete Permission = "bb.instances.delete"
- PermissionInstancesGet Permission = "bb.instances.get"
- PermissionInstancesList Permission = "bb.instances.list"
- PermissionInstancesSync Permission = "bb.instances.sync"
- PermissionInstancesUndelete Permission = "bb.instances.undelete"
- PermissionInstancesUpdate Permission = "bb.instances.update"
- PermissionInstanceRolesGet Permission = "bb.instanceRoles.get"
- PermissionInstanceRolesList Permission = "bb.instanceRoles.list"
- PermissionIssueCommentsCreate Permission = "bb.issueComments.create"
- PermissionIssueCommentsList Permission = "bb.issueComments.list"
- PermissionIssueCommentsUpdate Permission = "bb.issueComments.update"
- PermissionIssuesCreate Permission = "bb.issues.create"
- PermissionIssuesGet Permission = "bb.issues.get"
- PermissionIssuesList Permission = "bb.issues.list"
- PermissionIssuesUpdate Permission = "bb.issues.update"
- PermissionPlanCheckRunsList Permission = "bb.planCheckRuns.list"
- PermissionPlanCheckRunsRun Permission = "bb.planCheckRuns.run"
- PermissionPlansCreate Permission = "bb.plans.create"
- PermissionPlansGet Permission = "bb.plans.get"
- PermissionPlansList Permission = "bb.plans.list"
- PermissionPlansPreview Permission = "bb.plans.preview"
- PermissionPlansUpdate Permission = "bb.plans.update"
- PermissionPoliciesCreate Permission = "bb.policies.create"
- PermissionPoliciesDelete Permission = "bb.policies.delete"
- PermissionPoliciesGet Permission = "bb.policies.get"
- PermissionPoliciesList Permission = "bb.policies.list"
- PermissionPoliciesUpdate Permission = "bb.policies.update"
- PermissionProjectsCreate Permission = "bb.projects.create"
- PermissionProjectsDelete Permission = "bb.projects.delete"
- PermissionProjectsGet Permission = "bb.projects.get"
- PermissionProjectsGetIAMPolicy Permission = "bb.projects.getIamPolicy"
- PermissionProjectsList Permission = "bb.projects.list"
- PermissionProjectsSetIAMPolicy Permission = "bb.projects.setIamPolicy"
- PermissionProjectsUndelete Permission = "bb.projects.undelete"
- PermissionProjectsUpdate Permission = "bb.projects.update"
- PermissionReleasesCheck Permission = "bb.releases.check"
- PermissionReleasesCreate Permission = "bb.releases.create"
- PermissionReleasesDelete Permission = "bb.releases.delete"
- PermissionReleasesGet Permission = "bb.releases.get"
- PermissionReleasesList Permission = "bb.releases.list"
- PermissionReleasesUndelete Permission = "bb.releases.undelete"
- PermissionReleasesUpdate Permission = "bb.releases.update"
- PermissionReviewConfigsCreate Permission = "bb.reviewConfigs.create"
- PermissionReviewConfigsDelete Permission = "bb.reviewConfigs.delete"
- PermissionReviewConfigsGet Permission = "bb.reviewConfigs.get"
- PermissionReviewConfigsList Permission = "bb.reviewConfigs.list"
- PermissionReviewConfigsUpdate Permission = "bb.reviewConfigs.update"
- PermissionRevisionsCreate Permission = "bb.revisions.create"
- PermissionRevisionsDelete Permission = "bb.revisions.delete"
- PermissionRevisionsGet Permission = "bb.revisions.get"
- PermissionRevisionsList Permission = "bb.revisions.list"
- PermissionRisksCreate Permission = "bb.risks.create"
- PermissionRisksDelete Permission = "bb.risks.delete"
- PermissionRisksList Permission = "bb.risks.list"
- PermissionRisksUpdate Permission = "bb.risks.update"
- PermissionRolesCreate Permission = "bb.roles.create"
- PermissionRolesDelete Permission = "bb.roles.delete"
- PermissionRolesList Permission = "bb.roles.list"
- PermissionRolesGet Permission = "bb.roles.get"
- PermissionRolesUpdate Permission = "bb.roles.update"
- PermissionRolloutsCreate Permission = "bb.rollouts.create"
- PermissionRolloutsGet Permission = "bb.rollouts.get"
- PermissionRolloutsList Permission = "bb.rollouts.list"
- PermissionRolloutsPreview Permission = "bb.rollouts.preview"
- PermissionSettingsGet Permission = "bb.settings.get"
- PermissionSettingsList Permission = "bb.settings.list"
- PermissionSettingsSet Permission = "bb.settings.set"
- PermissionSheetsCreate Permission = "bb.sheets.create"
- PermissionSheetsGet Permission = "bb.sheets.get"
- PermissionSheetsUpdate Permission = "bb.sheets.update"
- PermissionSlowQueriesList Permission = "bb.slowQueries.list"
- PermissionSQLSelect Permission = "bb.sql.select"
- PermissionSQLDdl Permission = "bb.sql.ddl"
- PermissionSQLDml Permission = "bb.sql.dml"
- PermissionSQLExplain Permission = "bb.sql.explain"
- PermissionSQLInfo Permission = "bb.sql.info"
- PermissionSQLExport Permission = "bb.sql.export"
- PermissionSQLAdmin Permission = "bb.sql.admin"
- PermissionTaskRunsCreate Permission = "bb.taskRuns.create"
- PermissionTaskRunsList Permission = "bb.taskRuns.list"
- PermissionGroupsCreate Permission = "bb.groups.create"
- PermissionGroupsDelete Permission = "bb.groups.delete"
- PermissionGroupsGet Permission = "bb.groups.get"
- PermissionGroupsList Permission = "bb.groups.list"
- PermissionGroupsUpdate Permission = "bb.groups.update"
- PermissionUsersCreate Permission = "bb.users.create"
- PermissionUsersDelete Permission = "bb.users.delete"
- PermissionUsersUndelete Permission = "bb.users.undelete"
- PermissionUsersUpdate Permission = "bb.users.update"
- PermissionVCSConnectorsCreate Permission = "bb.vcsConnectors.create"
- PermissionVCSConnectorsDelete Permission = "bb.vcsConnectors.delete"
- PermissionVCSConnectorsGet Permission = "bb.vcsConnectors.get"
- PermissionVCSConnectorsList Permission = "bb.vcsConnectors.list"
- PermissionVCSConnectorsUpdate Permission = "bb.vcsConnectors.update"
- PermissionVCSProvidersCreate Permission = "bb.vcsProviders.create"
- PermissionVCSProvidersDelete Permission = "bb.vcsProviders.delete"
- PermissionVCSProvidersGet Permission = "bb.vcsProviders.get"
- PermissionVCSProvidersList Permission = "bb.vcsProviders.list"
- PermissionVCSProvidersListProjects Permission = "bb.vcsProviders.listProjects"
- PermissionVCSProvidersSearchProjects Permission = "bb.vcsProviders.searchProjects"
- PermissionVCSProvidersUpdate Permission = "bb.vcsProviders.update"
- PermissionWorksheetsGet Permission = "bb.worksheets.get"
- PermissionWorksheetsManage Permission = "bb.worksheets.manage"
+ PermissionAuditLogsExport Permission = "bb.auditLogs.export"
+ PermissionAuditLogsSearch Permission = "bb.auditLogs.search"
+ PermissionBranchesAdmin Permission = "bb.branches.admin"
+ PermissionBranchesCreate Permission = "bb.branches.create"
+ PermissionBranchesDelete Permission = "bb.branches.delete"
+ PermissionBranchesGet Permission = "bb.branches.get"
+ PermissionBranchesList Permission = "bb.branches.list"
+ PermissionBranchesUpdate Permission = "bb.branches.update"
+ PermissionChangelistsCreate Permission = "bb.changelists.create"
+ PermissionChangelistsDelete Permission = "bb.changelists.delete"
+ PermissionChangelistsGet Permission = "bb.changelists.get"
+ PermissionChangelistsList Permission = "bb.changelists.list"
+ PermissionChangelistsUpdate Permission = "bb.changelists.update"
+ PermissionChangelogsGet Permission = "bb.changelogs.get"
+ PermissionChangelogsList Permission = "bb.changelogs.list"
+ PermissionDatabaseCatalogsGet Permission = "bb.databaseCatalogs.get"
+ PermissionDatabaseCatalogsUpdate Permission = "bb.databaseCatalogs.update"
+ PermissionDatabaseSecretsDelete Permission = "bb.databaseSecrets.delete"
+ PermissionDatabaseSecretsList Permission = "bb.databaseSecrets.list"
+ PermissionDatabaseSecretsUpdate Permission = "bb.databaseSecrets.update"
+ PermissionDatabasesAdviseIndex Permission = "bb.databases.adviseIndex"
+ PermissionDatabasesCheck Permission = "bb.databases.check"
+ PermissionDatabasesGet Permission = "bb.databases.get"
+ PermissionDatabasesGetSchema Permission = "bb.databases.getSchema"
+ PermissionDatabasesList Permission = "bb.databases.list"
+ PermissionDatabasesSync Permission = "bb.databases.sync"
+ PermissionDatabasesUpdate Permission = "bb.databases.update"
+ PermissionEnvironmentsCreate Permission = "bb.environments.create"
+ PermissionEnvironmentsDelete Permission = "bb.environments.delete"
+ PermissionEnvironmentsGet Permission = "bb.environments.get"
+ PermissionEnvironmentsList Permission = "bb.environments.list"
+ PermissionEnvironmentsUndelete Permission = "bb.environments.undelete"
+ PermissionEnvironmentsUpdate Permission = "bb.environments.update"
+ PermissionIdentityProvidersCreate Permission = "bb.identityProviders.create"
+ PermissionIdentityProvidersDelete Permission = "bb.identityProviders.delete"
+ PermissionIdentityProvidersGet Permission = "bb.identityProviders.get"
+ PermissionIdentityProvidersUndelete Permission = "bb.identityProviders.undelete"
+ PermissionIdentityProvidersUpdate Permission = "bb.identityProviders.update"
+ PermissionInstancesCreate Permission = "bb.instances.create"
+ PermissionInstancesDelete Permission = "bb.instances.delete"
+ PermissionInstancesGet Permission = "bb.instances.get"
+ PermissionInstancesList Permission = "bb.instances.list"
+ PermissionInstancesSync Permission = "bb.instances.sync"
+ PermissionInstancesUndelete Permission = "bb.instances.undelete"
+ PermissionInstancesUpdate Permission = "bb.instances.update"
+ PermissionInstanceRolesGet Permission = "bb.instanceRoles.get"
+ PermissionInstanceRolesList Permission = "bb.instanceRoles.list"
+ PermissionIssueCommentsCreate Permission = "bb.issueComments.create"
+ PermissionIssueCommentsList Permission = "bb.issueComments.list"
+ PermissionIssueCommentsUpdate Permission = "bb.issueComments.update"
+ PermissionIssuesCreate Permission = "bb.issues.create"
+ PermissionIssuesGet Permission = "bb.issues.get"
+ PermissionIssuesList Permission = "bb.issues.list"
+ PermissionIssuesUpdate Permission = "bb.issues.update"
+ PermissionPlanCheckRunsList Permission = "bb.planCheckRuns.list"
+ PermissionPlanCheckRunsRun Permission = "bb.planCheckRuns.run"
+ PermissionPlansCreate Permission = "bb.plans.create"
+ PermissionPlansGet Permission = "bb.plans.get"
+ PermissionPlansList Permission = "bb.plans.list"
+ PermissionPlansPreview Permission = "bb.plans.preview"
+ PermissionPlansUpdate Permission = "bb.plans.update"
+ PermissionPoliciesCreate Permission = "bb.policies.create"
+ PermissionPoliciesDelete Permission = "bb.policies.delete"
+ PermissionPoliciesGet Permission = "bb.policies.get"
+ PermissionPoliciesList Permission = "bb.policies.list"
+ PermissionPoliciesUpdate Permission = "bb.policies.update"
+ PermissionProjectsCreate Permission = "bb.projects.create"
+ PermissionProjectsDelete Permission = "bb.projects.delete"
+ PermissionProjectsGet Permission = "bb.projects.get"
+ PermissionProjectsGetIAMPolicy Permission = "bb.projects.getIamPolicy"
+ PermissionProjectsList Permission = "bb.projects.list"
+ PermissionProjectsSetIAMPolicy Permission = "bb.projects.setIamPolicy"
+ PermissionProjectsUndelete Permission = "bb.projects.undelete"
+ PermissionProjectsUpdate Permission = "bb.projects.update"
+ PermissionReleasesCheck Permission = "bb.releases.check"
+ PermissionReleasesCreate Permission = "bb.releases.create"
+ PermissionReleasesDelete Permission = "bb.releases.delete"
+ PermissionReleasesGet Permission = "bb.releases.get"
+ PermissionReleasesList Permission = "bb.releases.list"
+ PermissionReleasesUndelete Permission = "bb.releases.undelete"
+ PermissionReleasesUpdate Permission = "bb.releases.update"
+ PermissionReviewConfigsCreate Permission = "bb.reviewConfigs.create"
+ PermissionReviewConfigsDelete Permission = "bb.reviewConfigs.delete"
+ PermissionReviewConfigsGet Permission = "bb.reviewConfigs.get"
+ PermissionReviewConfigsList Permission = "bb.reviewConfigs.list"
+ PermissionReviewConfigsUpdate Permission = "bb.reviewConfigs.update"
+ PermissionRevisionsCreate Permission = "bb.revisions.create"
+ PermissionRevisionsDelete Permission = "bb.revisions.delete"
+ PermissionRevisionsGet Permission = "bb.revisions.get"
+ PermissionRevisionsList Permission = "bb.revisions.list"
+ PermissionRisksCreate Permission = "bb.risks.create"
+ PermissionRisksDelete Permission = "bb.risks.delete"
+ PermissionRisksList Permission = "bb.risks.list"
+ PermissionRisksUpdate Permission = "bb.risks.update"
+ PermissionRolesCreate Permission = "bb.roles.create"
+ PermissionRolesDelete Permission = "bb.roles.delete"
+ PermissionRolesList Permission = "bb.roles.list"
+ PermissionRolesGet Permission = "bb.roles.get"
+ PermissionRolesUpdate Permission = "bb.roles.update"
+ PermissionRolloutsCreate Permission = "bb.rollouts.create"
+ PermissionRolloutsGet Permission = "bb.rollouts.get"
+ PermissionRolloutsList Permission = "bb.rollouts.list"
+ PermissionRolloutsPreview Permission = "bb.rollouts.preview"
+ PermissionSettingsGet Permission = "bb.settings.get"
+ PermissionSettingsList Permission = "bb.settings.list"
+ PermissionSettingsSet Permission = "bb.settings.set"
+ PermissionSheetsCreate Permission = "bb.sheets.create"
+ PermissionSheetsGet Permission = "bb.sheets.get"
+ PermissionSheetsUpdate Permission = "bb.sheets.update"
+ PermissionSlowQueriesList Permission = "bb.slowQueries.list"
+ PermissionSQLSelect Permission = "bb.sql.select"
+ PermissionSQLDdl Permission = "bb.sql.ddl"
+ PermissionSQLDml Permission = "bb.sql.dml"
+ PermissionSQLExplain Permission = "bb.sql.explain"
+ PermissionSQLInfo Permission = "bb.sql.info"
+ PermissionSQLExport Permission = "bb.sql.export"
+ PermissionSQLAdmin Permission = "bb.sql.admin"
+ PermissionTaskRunsCreate Permission = "bb.taskRuns.create"
+ PermissionTaskRunsList Permission = "bb.taskRuns.list"
+ PermissionGroupsCreate Permission = "bb.groups.create"
+ PermissionGroupsDelete Permission = "bb.groups.delete"
+ PermissionGroupsGet Permission = "bb.groups.get"
+ PermissionGroupsList Permission = "bb.groups.list"
+ PermissionGroupsUpdate Permission = "bb.groups.update"
+ PermissionUsersCreate Permission = "bb.users.create"
+ PermissionUsersDelete Permission = "bb.users.delete"
+ PermissionUsersUndelete Permission = "bb.users.undelete"
+ PermissionUsersUpdate Permission = "bb.users.update"
+ PermissionWorksheetsGet Permission = "bb.worksheets.get"
+ PermissionWorksheetsManage Permission = "bb.worksheets.manage"
)
var allPermissions = []Permission{
@@ -276,18 +264,6 @@ var allPermissions = []Permission{
PermissionUsersDelete,
PermissionUsersUndelete,
PermissionUsersUpdate,
- PermissionVCSConnectorsCreate,
- PermissionVCSConnectorsDelete,
- PermissionVCSConnectorsGet,
- PermissionVCSConnectorsList,
- PermissionVCSConnectorsUpdate,
- PermissionVCSProvidersCreate,
- PermissionVCSProvidersDelete,
- PermissionVCSProvidersGet,
- PermissionVCSProvidersList,
- PermissionVCSProvidersListProjects,
- PermissionVCSProvidersSearchProjects,
- PermissionVCSProvidersUpdate,
PermissionWorksheetsGet,
PermissionWorksheetsManage,
}
diff --git a/backend/component/iam/permission.yaml b/backend/component/iam/permission.yaml
index 88d9665852..7188d98787 100644
--- a/backend/component/iam/permission.yaml
+++ b/backend/component/iam/permission.yaml
@@ -127,17 +127,5 @@ permissions:
- bb.users.delete
- bb.users.undelete
- bb.users.update
- - bb.vcsConnectors.create
- - bb.vcsConnectors.delete
- - bb.vcsConnectors.get
- - bb.vcsConnectors.list
- - bb.vcsConnectors.update
- - bb.vcsProviders.create
- - bb.vcsProviders.delete
- - bb.vcsProviders.get
- - bb.vcsProviders.list
- - bb.vcsProviders.listProjects
- - bb.vcsProviders.searchProjects
- - bb.vcsProviders.update
- bb.worksheets.get
- bb.worksheets.manage
diff --git a/backend/plugin/db/driver.go b/backend/plugin/db/driver.go
index 856978c048..01fa8bc72e 100644
--- a/backend/plugin/db/driver.go
+++ b/backend/plugin/db/driver.go
@@ -84,18 +84,6 @@ type DriverConfig struct {
type driverFunc func(DriverConfig) Driver
-// MigrationSource is the migration engine.
-type MigrationSource string
-
-const (
- // UI is the migration source type for UI.
- UI MigrationSource = "UI"
- // VCS is the migration source type for VCS.
- VCS MigrationSource = "VCS"
- // LIBRARY is the migration source type for LIBRARY.
- LIBRARY MigrationSource = "LIBRARY"
-)
-
// MigrationType is the type of a migration.
type MigrationType string
diff --git a/backend/plugin/db/util/statement_parser_test.go b/backend/plugin/db/util/statement_parser_test.go
index cefd243391..2b9c40a7e2 100644
--- a/backend/plugin/db/util/statement_parser_test.go
+++ b/backend/plugin/db/util/statement_parser_test.go
@@ -393,9 +393,6 @@ CREATE TABLE migration_history (
-- Used to detect out of order migration together with 'namespace' and 'version' column.
sequence INT64 NOT NULL,
CONSTRAINT sequence_is_non_negative CHECK (sequence >= 0),
- -- We call it source because maybe we could load history from other migration tool.
- -- Current allowed values are UI, VCS, LIBRARY.
- source STRING(MAX) NOT NULL,
-- Current allowed values are BASELINE, MIGRATE, MIGRATE_SDL, BRANCH, DATA.
type STRING(MAX) NOT NULL,
-- Current allowed values are PENDING, DONE, FAILED.
@@ -442,9 +439,6 @@ CREATE INDEX bytebase_idx_migration_history_namespace_created ON migration_histo
sequence INT64 NOT NULL,
CONSTRAINT sequence_is_non_negative CHECK (sequence >= 0),
-
- source STRING(MAX) NOT NULL,
-
type STRING(MAX) NOT NULL,
diff --git a/backend/plugin/vcs/azure/azure.go b/backend/plugin/vcs/azure/azure.go
deleted file mode 100644
index f337fda2c2..0000000000
--- a/backend/plugin/vcs/azure/azure.go
+++ /dev/null
@@ -1,611 +0,0 @@
-// Package azure is the plugin for Azure DevOps.
-package azure
-
-import (
- "context"
- "encoding/base64"
- "encoding/json"
- "fmt"
- "log/slog"
- "net/http"
- "net/url"
- "sort"
- "strings"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/internal"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-func init() {
- vcs.Register(storepb.VCSType_AZURE_DEVOPS, newProvider)
-}
-
-var _ vcs.Provider = (*Provider)(nil)
-
-// Provider is a Azure DevOps VCS provider.
-type Provider struct {
- instanceURL string
- authToken string
- RootAPIURL string
-}
-
-func newProvider(config vcs.ProviderConfig) vcs.Provider {
- return &Provider{
- instanceURL: config.InstanceURL,
- authToken: config.AuthToken,
- }
-}
-
-// APIURL returns the API URL path of Azure DevOps.
-func (*Provider) APIURL(instanceURL string) string {
- return instanceURL
-}
-
-func (p *Provider) rootAPIURL() string {
- if strings.HasPrefix(p.instanceURL, "http://localhost:") {
- // This is used for mock vcs server in test.
- // TODO: find better ways without changing the code.
- return p.instanceURL
- }
- return "https://app.vssps.visualstudio.com"
-}
-
-type Project struct {
- ID string `json:"id"`
- Name string `json:"name"`
- State string `json:"state"`
-}
-
-// Repository is the API message for Azure repository.
-type Repository struct {
- ID string `json:"id"`
- Name string `json:"name"`
- // RemoteURL is the repo url in https://{org name}@dev.azure.com/{org name}/{project name}/_git/{repo name}
- // The pipeline ci will use this url, so we need this url
- RemoteURL string `json:"remoteUrl"`
- // WebURL is the repo url in https://dev.azure.com/{org name}/{project name}/_git/{repo name}
- WebURL string `json:"webUrl"`
- Project *Project `json:"project"`
-}
-
-// CommitChangeItem represents a Azure DevOps changes response change item.
-type CommitChangeItem struct {
- GitObjectType string `json:"gitObjectType"`
- Path string `json:"path"`
- CommitID string `json:"commitId"`
-}
-
-// CommitChange represents a Azure DevOps changes response change.
-type CommitChange struct {
- Item *CommitChangeItem `json:"item"`
- ChangeType string `json:"changeType"`
-}
-
-type changesResponse struct {
- Changes []*CommitChange `json:"changes"`
-}
-
-// getChangesByCommit gets the changes by commit ID, and returns the list of blob files changed in the specify commit.
-//
-// Docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/git/commits/get-changes?view=azure-devops-rest-7.0&tabs=HTTP
-// TODO(zp): We should GET the changes pagenated, otherwise it may hit the Azure DevOps API limit.
-func (p *Provider) getChangesByCommit(ctx context.Context, externalRepositoryID, commitID string) (*changesResponse, error) {
- apiURL, err := p.getRepositoryAPIURL(externalRepositoryID)
- if err != nil {
- return nil, err
- }
-
- values := &url.Values{}
- values.Set("api-version", "7.0")
- url := fmt.Sprintf("%s/commits/%s/changes?%s", apiURL, url.PathEscape(commitID), values.Encode())
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "commit %q does not exist in the repository %s", commitID, externalRepositoryID)
- }
- if code != http.StatusOK {
- return nil, errors.Errorf("non-200 GET %s status code %d with body %q", url, code, string(body))
- }
-
- changes := new(changesResponse)
- if err := json.Unmarshal([]byte(body), changes); err != nil {
- return nil, errors.Wrapf(err, "unmarshal body")
- }
-
- var result changesResponse
- for _, change := range changes.Changes {
- if change.Item.GitObjectType == "blob" {
- result.Changes = append(result.Changes, change)
- }
- }
-
- return &result, nil
-}
-
-// FetchRepositoryList fetches all projects where the authenticated use has permissions, which is required
-// to create webhook in the repository.
-//
-// NOTE: Azure DevOps does not support listing all projects cross all organizations API yet, thus we need
-// to follow the https://stackoverflow.com/questions/53608013/get-all-organizations-via-rest-api-for-azure-devops
-// to get all projects.
-// The request included in this function requires the following scopes:
-// vso.profile, vso.project.
-// Docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/git/repositories/list?view=azure-devops-rest-7.0&tabs=HTTP
-func (p *Provider) FetchRepositoryList(ctx context.Context, listAll bool) ([]*vcs.Repository, error) {
- publicAlias, err := p.getAuthenticatedProfilePublicAlias(ctx)
- if err != nil {
- return nil, errors.Wrap(err, "failed to get authenticated profile public alias")
- }
-
- organizations, err := p.listOrganizationsForMember(ctx, publicAlias)
- if err != nil {
- return nil, errors.Wrap(err, "failed to list organizations for member")
- }
-
- var result []*vcs.Repository
-
- type listRepositoriesResponse struct {
- Count int `json:"count"`
- Value []Repository `json:"value"`
- }
-
- urlParams := &url.Values{}
- urlParams.Set("api-version", "7.0")
- for _, organization := range organizations {
- if err := func() error {
- url := fmt.Sprintf("%s/%s/_apis/git/repositories?%s", p.APIURL(p.instanceURL), url.PathEscape(organization), urlParams.Encode())
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return errors.Wrapf(err, "GET %s", url)
- }
- // If users do not have permission to list repositories, for example, do not open the switch of
- // `Third party application access via OAuth` in the organization settings, Azure DevOps will return
- // 401 Unauthorized.
- if code == http.StatusUnauthorized {
- return nil
- }
-
- if code != http.StatusOK {
- return errors.Errorf("non-200 GET %s status code %d with body %q", url, code, string(body))
- }
-
- l := new(listRepositoriesResponse)
- if err := json.Unmarshal([]byte(body), l); err != nil {
- return errors.Wrapf(err, "failed to unmarshal list organizations for member response body %v, code %v", body, code)
- }
-
- for _, r := range l.Value {
- if r.Project.State != "wellFormed" {
- slog.Debug("Skip the repository whose project is not wellFormed", slog.String("organization", organization), slog.String("project", r.Project.Name), slog.String("repository", r.Name))
- }
-
- result = append(result, &vcs.Repository{
- ID: fmt.Sprintf("%s/%s/%s", organization, r.Project.ID, r.ID),
- Name: r.Name,
- FullPath: fmt.Sprintf("%s/%s/%s", organization, r.Project.Name, r.Name),
- WebURL: r.WebURL,
- })
- }
- return nil
- }(); err != nil {
- return nil, errors.Wrapf(err, "failed to list repositories under the organization %s", organization)
- }
- if !listAll {
- break
- }
- }
-
- // Sort result by FullPath.
- sort.Slice(result, func(i, j int) bool {
- return result[i].FullPath < result[j].FullPath
- })
-
- return result, nil
-}
-
-type Profile struct {
- PublicAlias string `json:"publicAlias"`
-}
-
-// getAuthenticatedProfilePublicAlias gets the authenticated user's profile, and returns the public alias in the
-// profile response.
-//
-// Docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/profile/profiles/get?view=azure-devops-rest-7.0&tabs=HTTP
-func (p *Provider) getAuthenticatedProfilePublicAlias(ctx context.Context) (string, error) {
- values := &url.Values{}
- values.Set("api-version", "7.0")
- url := fmt.Sprintf("%s/_apis/profile/profiles/me?%s", p.rootAPIURL(), values.Encode())
-
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return "", errors.Wrapf(err, "GET %s", url)
- }
- if code != http.StatusOK {
- return "", errors.Errorf("non-200 GET %s status code %d with body %q", url, code, string(body))
- }
-
- r := new(Profile)
- if err := json.Unmarshal([]byte(body), r); err != nil {
- return "", errors.Wrapf(err, "failed to unmarshal profile response body, code %v", code)
- }
-
- return r.PublicAlias, nil
-}
-
-type Organization struct {
- AccountName string `json:"accountName"`
-}
-
-// listOrganizationsForMember lists all organization for a given member.
-//
-// Docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/account/accounts/list?view=azure-devops-rest-7.0&tabs=HTTP
-func (p *Provider) listOrganizationsForMember(ctx context.Context, memberID string) ([]string, error) {
- urlParams := &url.Values{}
- urlParams.Set("memberId", memberID)
- urlParams.Set("api-version", "7.0")
- url := fmt.Sprintf("%s/_apis/accounts?%s", p.rootAPIURL(), urlParams.Encode())
-
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
- if code != http.StatusOK {
- return nil, errors.Errorf("non-200 GET %s status code %d with body %q", url, code, string(body))
- }
-
- type accountsResponse struct {
- Count int `json:"count"`
- Value []*Organization `json:"value"`
- }
-
- r := new(accountsResponse)
- if err := json.Unmarshal([]byte(body), r); err != nil {
- return nil, errors.Wrapf(err, "failed to unmarshal list organizations for member response body, code %v", code)
- }
-
- result := make([]string, 0, len(r.Value))
- for _, v := range r.Value {
- result = append(result, v.AccountName)
- }
-
- return result, nil
-}
-
-// ReadFileContent reads the content of the given file in the repository.
-//
-// Docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/git/items/get?view=azure-devops-rest-7.0&tabs=HTTP
-func (p *Provider) ReadFileContent(ctx context.Context, repositoryID, filePath string, refInfo vcs.RefInfo) (string, error) {
- apiURL, err := p.getRepositoryAPIURL(repositoryID)
- if err != nil {
- return "", err
- }
-
- values := &url.Values{}
- values.Set("api-version", "7.0")
- values.Set("download", "false")
- values.Set("resolveLfs", "true")
- values.Set("includeContent", "true")
- values.Set("path", filePath)
- var refType string
- switch refInfo.RefType {
- case vcs.RefTypeBranch:
- refType = "branch"
- case vcs.RefTypeTag:
- refType = "tag"
- case vcs.RefTypeCommit:
- refType = "commit"
- default:
- return "", errors.Errorf("invalid ref type %q", refInfo.RefType)
- }
- values.Set("versionDescriptor.versionType", refType)
- values.Set("versionDescriptor.version", refInfo.RefName)
- url := fmt.Sprintf("%s/items?%s", apiURL, values.Encode())
-
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return "", errors.Wrapf(err, "GET %s", url)
- }
- if code != http.StatusOK {
- return "", errors.Errorf("non-200 GET %s status code %d with body %q", url, code, string(body))
- }
- return string(body), nil
-}
-
-type BranchCommit struct {
- CommitID string `json:"commitId"`
-}
-
-type Branch struct {
- Name string `json:"name"`
- Commit *BranchCommit `json:"commit"`
-}
-
-// GetBranch try to retrieve the branch from the repository, and returns the last commit ID of the branch, if the branch
-// does not exist, it returns common.NotFound.
-// Args:
-// - repositoryID: The repository ID in the format of <organization>/<repository>.
-// - branchName: The branch name.
-//
-// Docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/git/stats/get?view=azure-devops-rest-7.0&tabs=HTTP
-func (p *Provider) GetBranch(ctx context.Context, repositoryID, branchName string) (*vcs.BranchInfo, error) {
- apiURL, err := p.getRepositoryAPIURL(repositoryID)
- if err != nil {
- return nil, err
- }
-
- urlParams := &url.Values{}
- urlParams.Set("name", branchName)
- urlParams.Set("api-version", "7.0")
- url := fmt.Sprintf("%s/stats/branches?%s", apiURL, urlParams.Encode())
-
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
- if code >= 300 {
- return nil, errors.Errorf("non-200 GET %s status code %d with body %q", url, code, string(body))
- }
-
- r := new(Branch)
- if err := json.Unmarshal([]byte(body), r); err != nil {
- return nil, errors.Wrapf(err, "failed to unmarshal get the static of the branch %s of the repository %s with response body, body: %s", branchName, repositoryID, string(body))
- }
- return &vcs.BranchInfo{
- Name: r.Name,
- LastCommitID: r.Commit.CommitID,
- }, nil
-}
-
-// ListPullRequestFileInCommit lists the changed files by last merge commit id.
-func (p *Provider) ListPullRequestFileInCommit(ctx context.Context, repositoryID, lastMergeCommitID string, pullRequestID int) ([]*vcs.PullRequestFile, error) {
- organizationName, projectName, repoID, err := getAzureRepositoryIDs(repositoryID)
- if err != nil {
- return nil, err
- }
-
- var prURL string
- if pullRequestID != 0 {
- prURL = fmt.Sprintf("%s/%s/%s/_git/%s/pullrequest/%d", p.instanceURL, organizationName, projectName, repoID, pullRequestID)
- }
- changeResponse, err := p.getChangesByCommit(ctx, repositoryID, lastMergeCommitID)
- if err != nil {
- return nil, err
- }
- files := []*vcs.PullRequestFile{}
- for _, change := range changeResponse.Changes {
- var webURL string
- if prURL != "" {
- // Web URL for file in PR:
- // {PR web URL}?_a=files&path={file path}
- webURL = fmt.Sprintf("%s?_a=files&path=%s", webURL, url.QueryEscape(change.Item.Path))
- }
- files = append(files, &vcs.PullRequestFile{
- Path: change.Item.Path,
- LastCommitID: change.Item.CommitID,
- IsDeleted: change.ChangeType == "delete",
- WebURL: webURL,
- })
- }
- return files, nil
-}
-
-// ListPullRequestFile lists the changed files by last merge commit id.
-func (p *Provider) ListPullRequestFile(ctx context.Context, repositoryID, lastMergeCommitID string) ([]*vcs.PullRequestFile, error) {
- return p.ListPullRequestFileInCommit(ctx, repositoryID, lastMergeCommitID, 0)
-}
-
-type Comment struct {
- Content string `json:"content"`
- CommentType string `json:"commentType"`
-}
-
-type PullRequestThread struct {
- ID int64 `json:"id"`
- Comments []*Comment `json:"comments"`
- // https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-request-threads/list?view=azure-devops-rest-7.1&tabs=HTTP#commentthreadstatus
- Status string `json:"status"`
-}
-
-// CreatePullRequestComment creates a pull request comment.
-// We will create a thread in Azure pull request instead of a comment.
-//
-// Docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-request-threads/create?view=azure-devops-rest-7.1&tabs=HTTP
-func (p *Provider) CreatePullRequestComment(ctx context.Context, repositoryID, pullRequestID, comment string) error {
- thread := &PullRequestThread{
- Status: "active",
- Comments: []*Comment{
- {
- Content: comment,
- CommentType: "text",
- },
- },
- }
- commentCreatePayload, err := json.Marshal(thread)
- if err != nil {
- return errors.Wrap(err, "failed to marshal request body for creating pull request comment")
- }
-
- apiURL, err := p.getRepositoryAPIURL(repositoryID)
- if err != nil {
- return err
- }
-
- values := &url.Values{}
- values.Set("api-version", "7.0")
- url := fmt.Sprintf("%s/pullRequests/%s/threads?%s", apiURL, pullRequestID, values.Encode())
- code, body, err := internal.Post(ctx, url, p.getAuthorization(), commentCreatePayload)
- if err != nil {
- return errors.Wrapf(err, "POST %s", url)
- }
- if code != http.StatusOK {
- return errors.Errorf("failed to create thread, code: %v, body: %s", code, string(body))
- }
-
- return nil
-}
-
-// ListPullRequestComments lists comments in a pull request.
-//
-// https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-request-threads/list?view=azure-devops-rest-7.1&tabs=HTTP
-func (p *Provider) ListPullRequestComments(ctx context.Context, repositoryID, pullRequestID string) ([]*vcs.PullRequestComment, error) {
- apiURL, err := p.getRepositoryAPIURL(repositoryID)
- if err != nil {
- return nil, err
- }
-
- values := &url.Values{}
- values.Set("api-version", "7.0")
- url := fmt.Sprintf("%s/pullRequests/%s/threads?%s", apiURL, pullRequestID, values.Encode())
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
- if code != http.StatusOK {
- return nil, errors.Errorf("failed to list thread, code: %v, body: %s", code, string(body))
- }
-
- var resp struct {
- Value []*PullRequestThread `json:"value"`
- }
- if err := json.Unmarshal([]byte(body), &resp); err != nil {
- return nil, err
- }
-
- var res []*vcs.PullRequestComment
- for _, thread := range resp.Value {
- if len(thread.Comments) != 1 {
- continue
- }
- res = append(res, &vcs.PullRequestComment{
- ID: fmt.Sprintf("%d", thread.ID),
- Content: thread.Comments[0].Content,
- })
- }
- return res, nil
-}
-
-// UpdatePullRequestComment updates a comment in a pull request.
-//
-// https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-request-threads/update?view=azure-devops-rest-7.1
-func (p *Provider) UpdatePullRequestComment(ctx context.Context, repositoryID, pullRequestID string, comment *vcs.PullRequestComment) error {
- thread := &PullRequestThread{
- Status: "active",
- Comments: []*Comment{
- {
- Content: comment.Content,
- CommentType: "text",
- },
- },
- }
- commentCreatePayload, err := json.Marshal(thread)
- if err != nil {
- return errors.Wrap(err, "failed to marshal request body for creating pull request comment")
- }
-
- apiURL, err := p.getRepositoryAPIURL(repositoryID)
- if err != nil {
- return err
- }
-
- values := &url.Values{}
- values.Set("api-version", "7.0")
- url := fmt.Sprintf("%s/pullRequests/%s/threads/%s?%s", apiURL, pullRequestID, comment.ID, values.Encode())
- code, body, err := internal.Patch(ctx, url, p.getAuthorization(), commentCreatePayload)
- if err != nil {
- return errors.Wrapf(err, "PATCH %s", url)
- }
- if code != http.StatusOK {
- return errors.Errorf("failed to update thread, code: %v, body: %s", code, string(body))
- }
-
- return nil
-}
-
-// CreateWebhook creates a webhook in the organization, and returns the webhook ID which can be used in PatchWebhook.
-// API Version 7.0 do not specify the OAuth scope for creating webhook explicitly, but it works.
-//
-// Docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/hooks/subscriptions/create?view=azure-devops-rest-7.0&tabs=HTTP
-func (p *Provider) CreateWebhook(ctx context.Context, externalRepositoryID string, payload []byte) (string, error) {
- parts := strings.Split(externalRepositoryID, "/")
- if len(parts) != 3 {
- return "", errors.Errorf("invalid repository ID %q", externalRepositoryID)
- }
- organizationName, _, _ := parts[0], parts[1], parts[2]
- urlParams := &url.Values{}
- urlParams.Set("api-version", "7.0")
- url := fmt.Sprintf("%s/%s/_apis/hooks/subscriptions?%s", p.APIURL(p.instanceURL), url.PathEscape(organizationName), urlParams.Encode())
- code, body, err := internal.Post(ctx, url, p.getAuthorization(), payload)
- if err != nil {
- return "", errors.Wrapf(err, "failed to create webhook")
- }
- if code >= 300 {
- return "", errors.Errorf("failed to create webhook, code: %v, body: %s", code, string(body))
- }
-
- type createServiceResponse struct {
- ID string `json:"id"`
- }
- c := new(createServiceResponse)
- if err := json.Unmarshal([]byte(body), c); err != nil {
- return "", errors.Wrapf(err, "failed to unmarshal create webhook response body, code %v", code)
- }
- return fmt.Sprintf("%s/%s", organizationName, c.ID), nil
-}
-
-// DeleteWebhook deletes the webhook in the repository.
-//
-// Docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/hooks/subscriptions/delete?view=azure-devops-rest-7.0&tabs=HTTP
-func (p *Provider) DeleteWebhook(ctx context.Context, _, webhookID string) error {
- // By design, we encode the webhook ID as <organization>/<webhookID> for Azure DevOps.
- parts := strings.Split(webhookID, "/")
- if len(parts) != 2 {
- return errors.Errorf("invalid webhook ID %q", webhookID)
- }
- organizationName, webhookID := parts[0], parts[1]
-
- values := &url.Values{}
- values.Set("api-version", "7.0")
- url := fmt.Sprintf("%s/%s/_apis/hooks/subscriptions/%s?%s", p.APIURL(p.instanceURL), url.PathEscape(organizationName), url.PathEscape(webhookID), values.Encode())
-
- code, body, err := internal.Delete(ctx, url, p.getAuthorization())
- if err != nil {
- return errors.Wrapf(err, "failed to send delete webhook request")
- }
- if code != http.StatusNoContent {
- return errors.Errorf("failed to delete webhook, code: %v, body: %s", code, string(body))
- }
-
- return nil
-}
-
-func getAzureRepositoryIDs(repositoryID string) (string, string, string, error) {
- // By design, we encode the repository ID as <organization>/<projectID>/<repositoryID> for Azure DevOps.
- parts := strings.Split(repositoryID, "/")
- if len(parts) != 3 {
- return "", "", "", errors.Errorf("invalid repository ID %q", repositoryID)
- }
- organizationName, projectName, repositoryID := parts[0], parts[1], parts[2]
- return organizationName, projectName, repositoryID, nil
-}
-
-func (p *Provider) getRepositoryAPIURL(repositoryID string) (string, error) {
- organizationName, projectName, repositoryID, err := getAzureRepositoryIDs(repositoryID)
- if err != nil {
- return "", err
- }
-
- return fmt.Sprintf("%s/%s/%s/_apis/git/repositories/%s", p.APIURL(p.instanceURL), url.PathEscape(organizationName), url.PathEscape(projectName), url.PathEscape(repositoryID)), nil
-}
-
-// getAuthorization returns the encoded azure token for authorization.
-// Docs: https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows
-func (p *Provider) getAuthorization() string {
- encoded := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf(":%s", p.authToken)))
- return fmt.Sprintf("Basic %s", encoded)
-}
diff --git a/backend/plugin/vcs/azure/bytebase-sql-review.yml b/backend/plugin/vcs/azure/bytebase-sql-review.yml
deleted file mode 100644
index 934dcb50cd..0000000000
--- a/backend/plugin/vcs/azure/bytebase-sql-review.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-variables:
- - name: api
- value: "%s"
-
-trigger:
- - "%s"
-
-pr:
- paths:
- include:
- - "**/*.sql"
-
-pool:
- vmImage: ubuntu-latest
-
-jobs:
- - job: SQL_Review
- steps:
- - bash: |
- echo "Start request ${{ variables.api }}"
-
- if [[ $SYSTEM_PULLREQUEST_PULLREQUESTID == "" ]]; then exit 0; fi
-
- request_body=$(jq -n \
- --arg 'repositoryId' "$BUILD_REPOSITORY_ID" \
- --arg 'pullRequestId' "$SYSTEM_PULLREQUEST_PULLREQUESTID" \
- --arg 'webURL' "$BUILD_REPOSITORY_URI" \
- '$ARGS.named')
-
- response=$(curl -s --show-error -X POST ${{ variables.api }} \
- -H "X-SQL-Review-Token: $(%s)" \
- -H "Content-Type: application/json" \
- -d "$request_body")
-
- echo "response: $response"
-
- content=$(echo "$response" | jq -r '.content')
- len=$(echo "$content" | jq '. | length')
- if [[ $len == 0 ]]; then exit 0; fi
-
- msg=$(echo "$content" | jq -r '.[0]')
- echo $msg >> bytebase-sql-review.xml
-
- result=$(echo "$response" | jq -r '.status')
- echo "##vso[task.setvariable variable=status]$result"
- displayName: SQL Review
- - task: PublishTestResults@2
- inputs:
- testResultsFormat: "JUnit"
- testResultsFiles: "**/bytebase-sql-review.xml"
- displayName: Upload artifacts
- - bash: |
- if [[ "$STATUS" != "SUCCESS" ]]; then exit 1; fi
- displayName: Check SQL Review Result
diff --git a/backend/plugin/vcs/azure/webhook_events.go b/backend/plugin/vcs/azure/webhook_events.go
deleted file mode 100644
index c942042a1e..0000000000
--- a/backend/plugin/vcs/azure/webhook_events.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package azure
-
-// PullRequestEventLastMergeCommit is the API message for PR merge commit.
-type PullRequestEventLastMergeCommit struct {
- CommitID string `json:"commitId"`
- URL string `json:"url"`
-}
-
-type PullRequestCreatedBy struct {
- DisplayName string `json:"displayName"`
- UniqueName string `json:"uniqueName"`
-}
-
-type PullRequestWeb struct {
- Href string `json:"href"`
-}
-
-type PullRequestLinks struct {
- Web *PullRequestWeb `json:"web"`
-}
-
-// PullRequestResource is the API message for pull request.
-type PullRequestResource struct {
- Repository *Repository `json:"repository"`
- Links *PullRequestLinks `json:"_links"`
- PullRequestID int `json:"pullRequestId"`
- // The pull request status, could be active, completed, etc. We only care the "completed" status.
- Status string `json:"status"`
- Title string `json:"title"`
- Description string `json:"description"`
- SourceRefName string `json:"sourceRefName"`
- TargetRefName string `json:"targetRefName"`
- // PR merge status, we only care the "succeeded".
- MergeStatus string `json:"mergeStatus"`
- LastMergeCommit *PullRequestEventLastMergeCommit `json:"lastMergeCommit"`
- CreatedBy *PullRequestCreatedBy `json:"createdBy"`
-}
-
-type PullRequestEventType string
-
-const (
- // A pull request is created in a Git repository.
- PullRequestEventCreated PullRequestEventType = "git.pullrequest.created"
- // A pull request is updated; status, review list, reviewer vote changed, or the source branch is updated with a push.
- PullRequestEventUpdated PullRequestEventType = "git.pullrequest.updated"
- // A merge commit was created on a pull request.
- PullRequestEventMerged PullRequestEventType = "git.pullrequest.merged"
-)
-
-// PullRequestEvent is the API message for pull request webhook event.
-//
-// Docs: https://learn.microsoft.com/en-us/azure/devops/service-hooks/events?view=azure-devops#pull-request-merge-commit-created
-type PullRequestEvent struct {
- // ID is the webhook message id.
- ID string `json:"id"`
- EventType PullRequestEventType `json:"eventType"`
- Resource *PullRequestResource `json:"resource"`
-}
-
-// WebhookCreateConsumerInputs represents the consumer inputs for creating a webhook.
-type WebhookCreateConsumerInputs struct {
- URL string `json:"url"`
- AcceptUntrustedCerts bool `json:"acceptUntrustedCerts"`
- HTTPHeaders string `json:"httpHeaders"`
-}
-
-// WebhookMergeResult is the status for pull request merge result.
-type WebhookMergeResult string
-
-// WebhookMergeResultSucceeded is succeeded status for merge result.
-const WebhookMergeResultSucceeded WebhookMergeResult = "Succeeded"
-
-// WebhookCreatePublisherInputs represents the publisher inputs for creating a webhook.
-type WebhookCreatePublisherInputs struct {
- Repository string `json:"repository"`
- // The target branch for PR without "refs/heads/" prefix.
- Branch string `json:"branch"`
- // The merge result for PR, we only need the "Succeeded".
- MergeResult WebhookMergeResult `json:"mergeResult,omitempty"`
- ProjectID string `json:"projectId"`
-}
-
-// WebhookCreateOrUpdate represents a Bitbucket API request for creating or updating a webhook.
-type WebhookCreateOrUpdate struct {
- ConsumerActionID string `json:"consumerActionId"`
- ConsumerID string `json:"consumerId"`
- ConsumerInputs WebhookCreateConsumerInputs `json:"consumerInputs"`
- EventType string `json:"eventType"`
- PublisherID string `json:"publisherId"`
- PublisherInputs WebhookCreatePublisherInputs `json:"publisherInputs"`
-}
diff --git a/backend/plugin/vcs/bitbucket/bitbucket.go b/backend/plugin/vcs/bitbucket/bitbucket.go
deleted file mode 100644
index 7a461b59e3..0000000000
--- a/backend/plugin/vcs/bitbucket/bitbucket.go
+++ /dev/null
@@ -1,558 +0,0 @@
-// Package bitbucket is the plugin for Bitbucket Cloud.
-package bitbucket
-
-import (
- "context"
- "encoding/base64"
- "encoding/json"
- "fmt"
- "net/http"
- "net/url"
- "strconv"
- "strings"
- "time"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/internal"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-const (
- // bitbucketCloudURL is URL for the Bitbucket Cloud.
- bitbucketCloudURL = "https://bitbucket.org"
-
- // apiPageSize is the default page size when making API requests.
- apiPageSize = 100
-)
-
-func init() {
- vcs.Register(storepb.VCSType_BITBUCKET, newProvider)
-}
-
-var _ vcs.Provider = (*Provider)(nil)
-
-// Provider is a Bitbucket Cloud VCS provider.
-type Provider struct {
- client *http.Client
- instanceURL string
- authToken string
-}
-
-func newProvider(config vcs.ProviderConfig) vcs.Provider {
- return &Provider{
- client: &http.Client{},
- instanceURL: config.InstanceURL,
- authToken: config.AuthToken,
- }
-}
-
-// APIURL returns the API URL path of Bitbucket Cloud.
-func (*Provider) APIURL(instanceURL string) string {
- if instanceURL == bitbucketCloudURL {
- return "https://api.bitbucket.org/2.0"
- }
- return fmt.Sprintf("%s/2.0", instanceURL)
-}
-
-// User represents a Bitbucket Cloud API response for a user.
-type User struct {
- DisplayName string `json:"display_name"`
- Nickname string `json:"nickname"`
-}
-
-// CommitAuthor represents a Bitbucket Cloud API response for a commit author.
-type CommitAuthor struct {
- User User `json:"user"`
-}
-
-// Commit represents a Bitbucket Cloud API response for a commit.
-type Commit struct {
- Hash string `json:"hash"`
- Author CommitAuthor `json:"author"`
- // Date expects corresponding JSON value is a string in RFC 3339 format,
- // see https://pkg.go.dev/time#Time.MarshalJSON.
- Date time.Time `json:"date"`
-}
-
-// CommitFile represents a Bitbucket Cloud API response for a file at a commit.
-type CommitFile struct {
- Path string `json:"path"`
- Links Links `json:"links"`
-}
-
-// CommitDiffStat represents a Bitbucket Cloud API response for commit diff stat.
-type CommitDiffStat struct {
- // The status of the diff stat object, possible values are "added", "removed",
- // "modified", "renamed".
- Status string `json:"status"`
- New CommitFile `json:"new"`
-}
-
-type PullRequestResponse struct {
- Values []*CommitDiffStat `json:"values"`
- Next string `json:"next"`
-}
-
-func (p *Provider) fetchPaginatedDiffFileList(ctx context.Context, url string) (diffs []*CommitDiffStat, next string, err error) {
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, "", errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, "", common.Errorf(common.NotFound, "failed to get file diff list from URL %s", url)
- } else if code >= 300 {
- return nil, "", errors.Errorf("failed to get file diff list from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- var resp PullRequestResponse
- if err := json.Unmarshal([]byte(body), &resp); err != nil {
- return nil, "", errors.Wrapf(err, "failed to unmarshal file diff data from Bitbucket Cloud instance %s", url)
- }
- return resp.Values, resp.Next, nil
-}
-
-// Repository represents a Bitbucket Cloud API response for a repository.
-type Repository struct {
- UUID string `json:"uuid"`
- Name string `json:"name"`
- FullName string `json:"full_name"`
- Links Links `json:"links"`
-}
-
-// RepositoryPermission represents a Bitbucket Cloud API response for a
-// repository permission.
-type RepositoryPermission struct {
- Repository *Repository `json:"repository"`
-}
-
-// FetchRepositoryList fetches all repositories where the authenticated user
-// has admin permissions, which is required to create webhook in the repository.
-//
-// Docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-user-permissions-repositories-get
-func (p *Provider) FetchRepositoryList(ctx context.Context, listAll bool) ([]*vcs.Repository, error) {
- var bbcRepos []*Repository
- params := url.Values{}
- params.Add("q", `permission="admin"`)
- params.Add("pagelen", strconv.Itoa(apiPageSize))
- next := fmt.Sprintf(`%s/user/permissions/repositories?%s`, p.APIURL(p.instanceURL), params.Encode())
- for next != "" {
- var err error
- var repos []*Repository
- repos, next, err = p.fetchPaginatedRepositoryList(ctx, next)
- if err != nil {
- return nil, errors.Wrap(err, "fetch paginated list")
- }
- bbcRepos = append(bbcRepos, repos...)
- if !listAll {
- break
- }
- }
-
- var repos []*vcs.Repository
- for _, r := range bbcRepos {
- repos = append(repos,
- &vcs.Repository{
- ID: r.UUID,
- Name: r.Name,
- FullPath: r.FullName,
- WebURL: fmt.Sprintf("%s/%s", p.instanceURL, r.FullName),
- },
- )
- }
- return repos, nil
-}
-
-// fetchPaginatedRepositoryList fetches repositories in given page. It returns
-// the paginated results along with a string indicating the URL of the next page
-// (if exists).
-func (p *Provider) fetchPaginatedRepositoryList(ctx context.Context, url string) (repos []*Repository, next string, err error) {
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, "", errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, "", common.Errorf(common.NotFound, "failed to fetch repository list from URL %s", url)
- } else if code >= 300 {
- return nil, "",
- errors.Errorf("failed to fetch repository list from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- var resp struct {
- Values []*RepositoryPermission `json:"values"`
- Next string `json:"next"`
- }
- if err := json.Unmarshal([]byte(body), &resp); err != nil {
- return nil, "", errors.Wrap(err, "unmarshal")
- }
-
- for _, v := range resp.Values {
- repos = append(repos,
- &Repository{
- UUID: v.Repository.UUID,
- Name: v.Repository.Name,
- FullName: v.Repository.FullName,
- },
- )
- }
- return repos, resp.Next, nil
-}
-
-// ReadFileContent reads the content of the given file in the repository.
-//
-// Docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#raw-file-contents
-func (p *Provider) ReadFileContent(ctx context.Context, repositoryID, filePath string, refInfo vcs.RefInfo) (string, error) {
- url := fmt.Sprintf("%s/repositories/%s/src/%s/%s", p.APIURL(p.instanceURL), repositoryID, url.PathEscape(refInfo.RefName), url.PathEscape(filePath))
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return "", errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return "", common.Errorf(common.NotFound, "failed to read file from URL %s", url)
- } else if code >= 300 {
- return "",
- errors.Errorf("failed to read file from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
- return body, nil
-}
-
-// Target is the API message for Bitbucket Cloud target.
-type Target struct {
- Hash string `json:"hash"`
-}
-
-// Branch is the API message for Bitbucket Cloud branch.
-type Branch struct {
- Name string `json:"name"`
- Target Target `json:"target"`
-}
-
-// GetBranch gets the given branch in the repository.
-//
-// Docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-name-get
-func (p *Provider) GetBranch(ctx context.Context, repositoryID, branchName string) (*vcs.BranchInfo, error) {
- url := fmt.Sprintf("%s/repositories/%s/refs/branches/%s", p.APIURL(p.instanceURL), repositoryID, branchName)
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "failed to get branch from URL %s", url)
- } else if code >= 300 {
- return nil, errors.Errorf("failed to get branch from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- var branch Branch
- if err := json.Unmarshal([]byte(body), &branch); err != nil {
- return nil, errors.Wrap(err, "unmarshal body")
- }
-
- return &vcs.BranchInfo{
- Name: branch.Name,
- LastCommitID: branch.Target.Hash,
- }, nil
-}
-
-// ListPullRequestFile lists the changed files in the pull request.
-//
-// Docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-diffstat-get
-func (p *Provider) ListPullRequestFile(ctx context.Context, repositoryID, pullRequestID string) ([]*vcs.PullRequestFile, error) {
- var bbcDiffs []*CommitDiffStat
- next := fmt.Sprintf("%s/repositories/%s/pullrequests/%s/diffstat?pagelen=%d", p.APIURL(p.instanceURL), repositoryID, pullRequestID, apiPageSize)
- for next != "" {
- var err error
- var diffs []*CommitDiffStat
- diffs, next, err = p.fetchPaginatedDiffFileList(ctx, next)
- if err != nil {
- return nil, errors.Wrap(err, "fetch paginated list")
- }
- bbcDiffs = append(bbcDiffs, diffs...)
- }
-
- // NOTE: The API response does not guarantee to return the value of the commit
- // ID, so we need to extract it from the link instead.
- extractCommitIDFromLinkSelf := func(href string) string {
- const anchor = "/src/"
- i := strings.Index(href, anchor)
- if i < 0 {
- return "<no commit ID found>"
- }
- fields := strings.SplitN(href[i+len(anchor):], "/", 2)
- return fields[0]
- }
-
- prURL := fmt.Sprintf("%s/%s/pull-requests/%s", p.instanceURL, repositoryID, pullRequestID)
- var files []*vcs.PullRequestFile
- for _, d := range bbcDiffs {
- file := &vcs.PullRequestFile{
- Path: d.New.Path,
- LastCommitID: extractCommitIDFromLinkSelf(d.New.Links.Self.Href),
- IsDeleted: d.Status == "removed",
- // Web URL for file in PR:
- // {PR web URL}/diff#chg-{file path}
- // Web URL for file with a specific line in PR:
- // {PR web URL}/diff#L{file path}T{line}
- WebURL: fmt.Sprintf("%s/diff#L%s", prURL, d.New.Path),
- }
- files = append(files, file)
- }
- return files, nil
-}
-
-type Comment struct {
- ID int64 `json:"id,omitempty"`
- Content CommentContent `json:"content"`
-}
-
-type CommentContent struct {
- Raw string `json:"raw"`
-}
-
-// CreatePullRequestComment creates a pull request comment.
-//
-// Docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-post
-func (p *Provider) CreatePullRequestComment(ctx context.Context, repositoryID, pullRequestID, comment string) error {
- commentMessage := Comment{Content: CommentContent{Raw: comment}}
- commentCreatePayload, err := json.Marshal(commentMessage)
- if err != nil {
- return errors.Wrap(err, "failed to marshal request body for creating pull request comment")
- }
- url := fmt.Sprintf("%s/repositories/%s/pullrequests/%s/comments", p.APIURL(p.instanceURL), repositoryID, pullRequestID)
- code, body, err := internal.Post(ctx, url, p.getAuthorization(), commentCreatePayload)
- if err != nil {
- return errors.Wrapf(err, "POST %s", url)
- }
-
- if code == http.StatusNotFound {
- return common.Errorf(common.NotFound, "failed to create pull request comment through URL %s", url)
- }
-
- // Bitbucket returns 201 HTTP status codes upon successful issue comment creation
- // https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-post-response
- if code != http.StatusCreated {
- return errors.Errorf("failed to create pull request comment through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
- return nil
-}
-
-// ListPullRequestComments lists comments in a pull request.
-//
-// Docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-get
-func (p *Provider) ListPullRequestComments(ctx context.Context, repositoryID, pullRequestID string) ([]*vcs.PullRequestComment, error) {
- url := fmt.Sprintf("%s/repositories/%s/pullrequests/%s/comments", p.APIURL(p.instanceURL), repositoryID, pullRequestID)
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "failed to list pull request comments through URL %s", url)
- } else if code >= 300 {
- return nil, errors.Errorf("failed to list pull request comments from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- var resp struct {
- Values []*Comment `json:"values"`
- }
-
- if err := json.Unmarshal([]byte(body), &resp); err != nil {
- return nil, errors.Wrap(err, "unmarshal")
- }
-
- var res []*vcs.PullRequestComment
-
- for _, v := range resp.Values {
- res = append(res,
- &vcs.PullRequestComment{
- ID: fmt.Sprintf("%d", v.ID),
- Content: v.Content.Raw,
- },
- )
- }
- return res, nil
-}
-
-// UpdatePullRequestComment updates a comment in a pull request.
-//
-// Docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-put
-func (p *Provider) UpdatePullRequestComment(ctx context.Context, repositoryID, pullRequestID string, comment *vcs.PullRequestComment) error {
- commentMessage := Comment{Content: CommentContent{Raw: comment.Content}}
- commentCreatePayload, err := json.Marshal(commentMessage)
- if err != nil {
- return errors.Wrap(err, "failed to marshal request body for updating pull request comment")
- }
-
- url := fmt.Sprintf("%s/repositories/%s/pullrequests/%s/comments/%s", p.APIURL(p.instanceURL), repositoryID, pullRequestID, comment.ID)
- code, body, err := internal.Put(ctx, url, p.getAuthorization(), commentCreatePayload)
- if err != nil {
- return errors.Wrapf(err, "PUT %s", url)
- }
-
- if code == http.StatusNotFound {
- return common.Errorf(common.NotFound, "cannot found pull request comment through URL %s", url)
- } else if code >= 300 {
- return errors.Errorf("failed to update pull request comment through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- return nil
-}
-
-// Link is the API message for link.
-type Link struct {
- Href string `json:"href"`
-}
-
-// Links is the API message for links.
-type Links struct {
- Self Link `json:"self"`
- HTML Link `json:"html"`
-}
-
-// Author is the API message for author.
-type Author struct {
- Raw string `json:"raw"`
- User User `json:"user"`
-}
-
-// WebhookCommit is the API message for webhook commit.
-type WebhookCommit struct {
- Hash string `json:"hash"`
- Date time.Time `json:"date"`
- Author Author `json:"author"`
- Message string `json:"message"`
- Links Links `json:"links"`
- Parents []Target `json:"parents"`
-}
-
-// WebhookPushChange is the API message for webhook push change.
-type WebhookPushChange struct {
- Old Branch `json:"old"`
- New Branch `json:"new"`
- Commits []WebhookCommit `json:"commits"`
-}
-
-// WebhookPush is the API message for webhook push.
-type WebhookPush struct {
- Changes []WebhookPushChange `json:"changes"`
-}
-
-// WebhookPushEvent is the API message for webhook push event.
-type WebhookPushEvent struct {
- Push WebhookPush `json:"push"`
- Repository Repository `json:"repository"`
- Actor User `json:"actor"`
-}
-
-// WebhookCreateOrUpdate represents a Bitbucket API request for creating or
-// updating a webhook.
-type WebhookCreateOrUpdate struct {
- Description string `json:"description"`
- URL string `json:"url"`
- Active bool `json:"active"`
- // Docs for pr events: https://support.atlassian.com/bitbucket-cloud/docs/event-payloads/#Pull-request-events
- // - pullrequest:created: A user creates a pull request for a repository.
- // - pullrequest:updated: A user updates a pull request for a repository.
- // - pullrequest:changes_request_created: A user requests a change for a pull request for a repository.
- // - pullrequest:fulfilled: A user merges a pull request for a repository.
- // - pullrequest:comment_created: A user comments on a pull request.
- // - pullrequest:comment_updated: A user updates a comment on a pull request.
- Events []string `json:"events"`
-}
-
-// Webhook represents a Bitbucket Cloud API response for the webhook
-// information.
-type Webhook struct {
- UUID string `json:"uuid"`
-}
-
-// CreateWebhook creates a webhook in the repository with given payload.
-//
-// Docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-hooks-post
-func (p *Provider) CreateWebhook(ctx context.Context, repositoryID string, payload []byte) (string, error) {
- url := fmt.Sprintf("%s/repositories/%s/hooks", p.APIURL(p.instanceURL), repositoryID)
- code, body, err := internal.Post(ctx, url, p.getAuthorization(), payload)
- if err != nil {
- return "", errors.Wrapf(err, "POST %s", url)
- }
-
- if code == http.StatusNotFound {
- return "", common.Errorf(common.NotFound, "failed to create webhook through URL %s", url)
- }
-
- // Bitbucket Cloud returns 201 HTTP status codes upon successful webhook creation,
- // see https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-hooks-post-responses for details.
- if code != http.StatusCreated {
- return "", errors.Errorf("failed to create webhook through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- var resp Webhook
- if err = json.Unmarshal([]byte(body), &resp); err != nil {
- return "", errors.Wrap(err, "unmarshal body")
- }
- return resp.UUID, nil
-}
-
-// DeleteWebhook deletes the webhook from the repository.
-//
-// Docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-hooks-uid-delete
-func (p *Provider) DeleteWebhook(ctx context.Context, repositoryID, webhookID string) error {
- url := fmt.Sprintf("%s/repositories/%s/hooks/%s", p.APIURL(p.instanceURL), repositoryID, webhookID)
- code, body, err := internal.Delete(ctx, url, p.getAuthorization())
- if err != nil {
- return errors.Wrapf(err, "DELETE %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil // It is OK if the webhook has already gone
- } else if code >= 300 {
- return errors.Errorf("failed to delete webhook through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
- return nil
-}
-
-func (p *Provider) getAuthorization() string {
- encoded := base64.StdEncoding.EncodeToString([]byte(p.authToken))
- return fmt.Sprintf("Basic %s", encoded)
-}
diff --git a/backend/plugin/vcs/bitbucket/bytebase-sql-review.sh b/backend/plugin/vcs/bitbucket/bytebase-sql-review.sh
deleted file mode 100644
index c7f12958ea..0000000000
--- a/backend/plugin/vcs/bitbucket/bytebase-sql-review.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-# File: bytebase-sql-review.sh
-# Description: usage: ./bytebase-sql-review.sh --pull-request-id=[pr id] --repo-id=[repo id] --repo-url=[repo URL] --api=[API URL] --token=[API token]
-# ===========================================================================
-
-# Get parameters
-for i in "$@"
-do
-case $i in
- --pull-request-id=*)
- PR_ID="${i#*=}"
- shift
- ;;
- --repo-id=*)
- REPO_ID="${i#*=}"
- shift
- ;;
- --repo-url=*)
- REPO_URL="${i#*=}"
- shift
- ;;
- --token=*)
- API_TOKEN="${i#*=}"
- shift
- ;;
- --api=*)
- API_URL="${i#*=}"
- shift
- ;;
- *) # unknown option
- ;;
-esac
-done
-
-echo "Start request $API_URL"
-
-if [[ $PR_ID == "" ]]; then exit 0; fi
-
-request_body=$(jq -n \
---arg 'repositoryId' "$REPO_ID" \
---arg 'pullRequestId' "$PR_ID" \
---arg 'webURL' "$REPO_URL" \
-'$ARGS.named')
-
-response=$(curl -s --show-error -X POST $API_URL \
--H "X-SQL-Review-Token: $API_TOKEN" \
--H "Content-Type: application/json" \
--d "$request_body")
-
-echo "response: $response"
-
-content=$(echo "$response" | jq -r '.content')
-status=$(echo "$response" | jq -r '.status')
-
-len=$(echo "$content" | jq '. | length')
-if [[ $len == 0 ]]; then exit 0; fi
-
-msg=$(echo "$content" | jq -r '.[0]')
-mkdir test-results
-echo $msg >> test-results/bytebase-sql-review.xml
-
-if [ "$status" != "SUCCESS" ]; then exit 1; fi
diff --git a/backend/plugin/vcs/bitbucket/pipeline-step.yml b/backend/plugin/vcs/bitbucket/pipeline-step.yml
deleted file mode 100644
index d7a53d9b0c..0000000000
--- a/backend/plugin/vcs/bitbucket/pipeline-step.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-name: %s
-image: atlassian/default-image:4
-script:
- - bash %s --pull-request-id="$BITBUCKET_PR_ID" --repo-id="$BITBUCKET_REPO_FULL_NAME" --repo-url="$BITBUCKET_GIT_HTTP_ORIGIN" --api="%s" --token="$%s"
diff --git a/backend/plugin/vcs/bitbucket/webhook_events.go b/backend/plugin/vcs/bitbucket/webhook_events.go
deleted file mode 100644
index 2cd6b65061..0000000000
--- a/backend/plugin/vcs/bitbucket/webhook_events.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package bitbucket
-
-// Header X-Event-Key: pullrequest:created, pullrequest:updated, pullrequest:fulfilled.
-//
-// https://support.atlassian.com/bitbucket-cloud/docs/event-payloads
-type PullRequestEventType string
-
-const (
- // A pull request is created in a Git repository.
- PullRequestEventCreated PullRequestEventType = "pullrequest:created"
- // A pull request is updated.
- PullRequestEventUpdated PullRequestEventType = "pullrequest:updated"
- // A pull request is merged.
- PullRequestEventFulfilled PullRequestEventType = "pullrequest:fulfilled"
-)
-
-// PullRequestPushEvent is the json message for pull request push event.
-type PullRequestPushEvent struct {
- // Actor: does not include email.
- PullRequest EventPullRequest `json:"pullrequest"`
-}
-
-type EventPullRequest struct {
- ID int `json:"id"`
- Title string `json:"title"`
- Description string `json:"description"`
- Destination EventBranch `json:"destination"`
- Source EventBranch `json:"source"`
- Links EventLinks `json:"links"`
-}
-
-type EventBranch struct {
- Branch EventBranchName `json:"branch"`
- Commit EventCommit `json:"commit"`
-}
-
-type EventBranchName struct {
- Name string `json:"name"`
-}
-
-type EventCommit struct {
- Hash string `json:"hash"`
-}
-
-type EventLinks struct {
- HTML EventHTML `json:"html"`
-}
-
-type EventHTML struct {
- Href string `json:"href"`
-}
diff --git a/backend/plugin/vcs/github/bytebase-sql-review.yml b/backend/plugin/vcs/github/bytebase-sql-review.yml
deleted file mode 100644
index e0d697477f..0000000000
--- a/backend/plugin/vcs/github/bytebase-sql-review.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-on: [pull_request]
-jobs:
- bytebase-sql-review:
- runs-on: ubuntu-latest
- name: SQL Review
- steps:
- - name: SQL advise
- run: |
- API="%s"
- TOKEN="${{ secrets.%s }}"
- echo "Start request $API"
-
- pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
- repository=`echo $GITHUB_REPOSITORY`
- request_body=$(jq -n \
- --arg repositoryId "$repository" \
- --arg pullRequestId $pull_number \
- --arg webURL "$GITHUB_SERVER_URL" \
- '$ARGS.named')
-
- response=$(curl -s -w "%%{http_code}" -X POST $API \
- -H "X-SQL-Review-Token: $TOKEN" \
- -H "Content-Type: application/json" \
- -d "$request_body")
- echo "::debug::response $response"
-
- http_code=$(tail -n1 <<< "$response")
- body=$(sed '$ d' <<< "$response")
-
- if [ $http_code != 200 ]; then
- echo ":error::Failed to check SQL with response code $http_code and body $body"
- exit 1
- fi
-
- status=$(echo $body | jq -r '.status')
- content=$(echo $body | jq -r '.content')
-
- while read message; do
- echo $message
- done <<< "$(echo $content | jq -r '.[]')"
-
- if [ "$status" != "SUCCESS" ]; then exit 1; fi
diff --git a/backend/plugin/vcs/github/github.go b/backend/plugin/vcs/github/github.go
deleted file mode 100644
index 0f01add829..0000000000
--- a/backend/plugin/vcs/github/github.go
+++ /dev/null
@@ -1,695 +0,0 @@
-// Package github is the plugin for GitHub.
-package github
-
-import (
- "context"
- "crypto/sha256"
- "encoding/hex"
- "encoding/json"
- "fmt"
- "log/slog"
- "net/http"
- "net/url"
- "strconv"
- "strings"
- "time"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/common/log"
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/internal"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-const (
- // githubComURL is URL for the GitHub.com.
- githubComURL = "https://github.com"
-
- // apiPageSize is the default page size when making API requests.
- apiPageSize = 100
-)
-
-func init() {
- vcs.Register(storepb.VCSType_GITHUB, newProvider)
-}
-
-var _ vcs.Provider = (*Provider)(nil)
-
-// Provider is a GitHub VCS provider.
-type Provider struct {
- client *http.Client
- instanceURL string
- authToken string
-}
-
-func newProvider(config vcs.ProviderConfig) vcs.Provider {
- return &Provider{
- client: &http.Client{},
- instanceURL: config.InstanceURL,
- authToken: config.AuthToken,
- }
-}
-
-// APIURL returns the API URL path of GitHub.
-func (*Provider) APIURL(instanceURL string) string {
- if instanceURL == githubComURL {
- return "https://api.github.com"
- }
-
- // If it's not the GitHub.com, we use the API URL for the GitHub Enterprise Server.
- return fmt.Sprintf("%s/api/v3", instanceURL)
-}
-
-// Repository represents a GitHub API response for a repository.
-type Repository struct {
- ID int64 `json:"id"`
- Name string `json:"name"`
- FullName string `json:"full_name"`
- HTMLURL string `json:"html_url"`
- Permissions struct {
- Admin bool `json:"admin"`
- } `json:"permissions"`
-}
-
-// WebhookInfo represents a GitHub API response for the webhook information.
-type WebhookInfo struct {
- ID int `json:"id"`
-}
-
-// WebhookConfig represents the GitHub API message for webhook configuration.
-type WebhookConfig struct {
- // URL is the URL to which the payloads will be delivered.
- URL string `json:"url"`
- // ContentType is the media type used to serialize the payloads. Supported
- // values include "json" and "form". The default is "form".
- ContentType string `json:"content_type"`
- // Secret is the secret will be used as the key to generate the HMAC hex digest
- // value for delivery signature headers.
- Secret string `json:"secret"`
- // InsecureSSL determines whether the SSL certificate of the host for url will
- // be verified when delivering payloads. Supported values include 0
- // (verification is performed) and 1 (verification is not performed). The
- // default is 0.
- InsecureSSL int `json:"insecure_ssl"`
-}
-
-// WebhookCreateOrUpdate represents a GitHub API request for creating or
-// updating a webhook.
-//
-// NOTE: GitHub uses different API payloads for creating and updating webhooks
-// (the latter has more options), but we are not using any differentiated parts
-// so it makes sense to have a combined struct until we needed.
-type WebhookCreateOrUpdate struct {
- // Config contains settings for the webhook.
- Config WebhookConfig `json:"config"`
- // Events determines what events the hook is triggered for. The default is
- // ["push"]. The full list of events can be viewed at
- // https://docs.github.com/webhooks/event-payloads.
- Events []string `json:"events"`
-}
-
-// WebhookRepository is the API message for webhook repository.
-type WebhookRepository struct {
- ID int `json:"id"`
- FullName string `json:"full_name"`
- HTMLURL string `json:"html_url"`
-}
-
-// CommitAuthor represents a GitHub API response for a commit author.
-type CommitAuthor struct {
- // Date expects corresponding JSON value is a string in RFC 3339 format,
- // see https://pkg.go.dev/time#Time.MarshalJSON.
- Date time.Time `json:"date"`
- Name string `json:"name"`
- Email string `json:"email"`
-}
-
-// Commit represents a GitHub API response for a commit.
-type Commit struct {
- SHA string `json:"sha"`
- Author CommitAuthor `json:"author"`
-}
-
-// FileCommit represents a GitHub API request for committing a file.
-type FileCommit struct {
- Message string `json:"message"`
- Content string `json:"content"`
- SHA string `json:"sha,omitempty"`
- Branch string `json:"branch,omitempty"`
- Author *CommitAuthor `json:"author,omitempty"`
-}
-
-// FetchRepositoryList fetches all repositories where the authenticated user
-// has admin permissions, which is required to create webhook in the repository.
-//
-// NOTE: GitHub API does not provide a native filter for admin permissions, thus
-// we need to first fetch all repositories and then filter down the list using
-// the `permissions.admin` field.
-//
-// Docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-the-authenticated-user
-func (p *Provider) FetchRepositoryList(ctx context.Context, listAll bool) ([]*vcs.Repository, error) {
- var githubRepos []Repository
- page := 1
- for {
- repos, hasNextPage, err := p.fetchPaginatedRepositoryList(ctx, page)
- if err != nil {
- return nil, errors.Wrap(err, "fetch paginated list")
- }
- githubRepos = append(githubRepos, repos...)
-
- if !hasNextPage || !listAll {
- break
- }
- page++
- }
-
- var allRepos []*vcs.Repository
- for _, r := range githubRepos {
- if !r.Permissions.Admin {
- continue
- }
- allRepos = append(allRepos,
- &vcs.Repository{
- ID: strconv.FormatInt(r.ID, 10),
- Name: r.Name,
- FullPath: r.FullName,
- WebURL: r.HTMLURL,
- },
- )
- }
- return allRepos, nil
-}
-
-// fetchPaginatedRepositoryList fetches repositories where the authenticated
-// user has access to in given page. It returns the paginated results along
-// with a boolean indicating whether the next page exists.
-func (p *Provider) fetchPaginatedRepositoryList(ctx context.Context, page int) (repos []Repository, hasNextPage bool, err error) {
- url := fmt.Sprintf("%s/user/repos?page=%d&per_page=%d", p.APIURL(p.instanceURL), page, apiPageSize)
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, false, errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, false, common.Errorf(common.NotFound, "failed to fetch repository list from URL %s", url)
- } else if code >= 300 {
- return nil, false,
- errors.Errorf("failed to fetch repository list from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- if err := json.Unmarshal([]byte(body), &repos); err != nil {
- return nil, false, errors.Wrap(err, "unmarshal")
- }
-
- // NOTE: We deliberately choose to not use the Link header for checking the next
- // page to avoid introducing a new dependency, see
- // https://github.com/bytebase/bytebase/pull/1423#discussion_r884278534 for the
- // discussion.
- return repos, len(repos) >= apiPageSize, nil
-}
-
-// ReadFileContent reads the content of the given file in the repository.
-//
-// Docs: https://docs.github.com/en/rest/repos/contents#get-repository-content
-func (p *Provider) ReadFileContent(ctx context.Context, repositoryID, filePath string, refInfo vcs.RefInfo) (string, error) {
- url := fmt.Sprintf("%s/repos/%s/contents/%s?ref=%s", p.APIURL(p.instanceURL), repositoryID, url.QueryEscape(filePath), refInfo.RefName)
- code, body, err := internal.GetWithHeader(ctx, url, p.getAuthorization(),
- map[string]string{
- "Accept": "application/vnd.github.raw",
- },
- )
- if err != nil {
- return "", errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return "", common.Errorf(common.NotFound, "failed to read file content from URL %s", url)
- } else if code >= 300 {
- return "",
- errors.Errorf("failed to read file content from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
- return body, nil
-}
-
-// PullRequestFile is the API message for files in GitHub pull request.
-type PullRequestFile struct {
- FileName string `json:"filename"`
- SHA string `json:"sha"`
- // The file status in GitHub PR.
- // Available values: "added", "removed", "modified", "renamed", "copied", "changed", "unchanged"
- Status string `json:"status"`
- // The file content API URL, which contains the ref value in the query.
- // Example: https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e
- ContentsURL string `json:"contents_url"`
-}
-
-// ListPullRequestFile lists the changed files in the pull request.
-//
-// Docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests-files
-func (p *Provider) ListPullRequestFile(ctx context.Context, repositoryID, pullRequestID string) ([]*vcs.PullRequestFile, error) {
- var allPRFiles []PullRequestFile
- page := 1
- for {
- fileList, err := p.listPaginatedPullRequestFile(ctx, repositoryID, pullRequestID, page)
- if err != nil {
- return nil, errors.Wrap(err, "Failed to list pull request file")
- }
-
- if len(fileList) == 0 {
- break
- }
- allPRFiles = append(allPRFiles, fileList...)
- page++
- }
-
- prURL := fmt.Sprintf("%s/%s/pull/%s", p.instanceURL, repositoryID, pullRequestID)
- var res []*vcs.PullRequestFile
- for _, file := range allPRFiles {
- u, err := url.Parse(file.ContentsURL)
- if err != nil {
- slog.Debug("Failed to parse content url for file",
- slog.String("content_url", file.ContentsURL),
- slog.String("file", file.FileName),
- log.BBError(err),
- )
- continue
- }
-
- m, err := url.ParseQuery(u.RawQuery)
- if err != nil {
- slog.Debug("Failed to parse query for file",
- slog.String("content_url", file.ContentsURL),
- slog.String("file", file.FileName),
- log.BBError(err),
- )
- continue
- }
- refs, ok := m["ref"]
- if !ok || len(refs) != 1 {
- continue
- }
-
- // Get web url for changed file in the PR.
- // https://github.com/orgs/community/discussions/55764
- var fileHash string
- hash := sha256.New()
- if _, err := hash.Write([]byte(file.FileName)); err == nil {
- fileHash = hex.EncodeToString(hash.Sum(nil))
- }
-
- res = append(res, &vcs.PullRequestFile{
- Path: file.FileName,
- LastCommitID: refs[0],
- IsDeleted: file.Status == "removed",
- // Web URL for file in PR:
- // {PR web URL}/files#diff-{sha256 for file path}
- // Web URL for file with a specific line in PR:
- // {PR web URL}/files#diff-{sha256 for file path}R{line}
- WebURL: fmt.Sprintf("%s/files#diff-%s", prURL, fileHash),
- })
- }
-
- return res, nil
-}
-
-// listPaginatedPullRequestFile lists the changed files in the pull request with pagination.
-func (p *Provider) listPaginatedPullRequestFile(ctx context.Context, repositoryID, pullRequestID string, page int) ([]PullRequestFile, error) {
- requestURL := fmt.Sprintf("%s/repos/%s/pulls/%s/files?per_page=%d&page=%d", p.APIURL(p.instanceURL), repositoryID, pullRequestID, apiPageSize, page)
- code, body, err := internal.Get(ctx, requestURL, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", requestURL)
- }
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "failed to list pull request file from URL %s", requestURL)
- } else if code >= 300 {
- return nil, errors.Errorf("failed to list pull request file from URL %s, status code: %d, body: %s",
- requestURL,
- code,
- body,
- )
- }
-
- var prFiles []PullRequestFile
- if err := json.Unmarshal([]byte(body), &prFiles); err != nil {
- return nil, err
- }
- return prFiles, nil
-}
-
-type Comment struct {
- ID int `json:"id,omitempty"`
- Body string `json:"body"`
-}
-
-// CreatePullRequestComment creates a comment on the pull request.
-//
-// Issue comment makes comment on the pull request (Yes, you read it right).
-// Pull request comment makes a pull request comment on the line.
-// Pull request review makes a pull request review such as approval.
-// Docs: https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#create-an-issue-comment
-func (p *Provider) CreatePullRequestComment(ctx context.Context, repositoryID, pullRequestID, comment string) error {
- commentMessage := Comment{Body: comment}
- commentCreatePayload, err := json.Marshal(commentMessage)
- if err != nil {
- return errors.Wrap(err, "failed to marshal request body for creating pull request comment")
- }
- url := fmt.Sprintf("%s/repos/%s/issues/%s/comments", p.APIURL(p.instanceURL), repositoryID, pullRequestID)
- code, body, err := internal.Post(ctx, url, p.getAuthorization(), commentCreatePayload)
- if err != nil {
- return errors.Wrapf(err, "POST %s", url)
- }
-
- if code == http.StatusNotFound {
- return common.Errorf(common.NotFound, "failed to create pull request comment through URL %s", url)
- }
-
- // GitHub returns 201 HTTP status codes upon successful issue comment creation,
- if code != http.StatusCreated {
- return errors.Errorf("failed to create pull request comment through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
- return nil
-}
-
-// ListPullRequestComments lists comments in a pull request.
-//
-// Docs: https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#list-issue-comments-for-a-repository
-func (p *Provider) ListPullRequestComments(ctx context.Context, repositoryID, pullRequestID string) ([]*vcs.PullRequestComment, error) {
- // No need to fetch comments page by page.
- url := fmt.Sprintf("%s/repos/%s/issues/%s/comments?per_page=100", p.APIURL(p.instanceURL), repositoryID, pullRequestID)
-
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "failed to list pull request comments from URL %s", url)
- } else if code >= 300 {
- return nil, errors.Errorf("failed to list pull request comments from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- var comments []Comment
- if err := json.Unmarshal([]byte(body), &comments); err != nil {
- return nil, err
- }
-
- var res []*vcs.PullRequestComment
- for _, comment := range comments {
- res = append(res, &vcs.PullRequestComment{
- ID: fmt.Sprintf("%d", comment.ID),
- Content: comment.Body,
- })
- }
- return res, nil
-}
-
-// UpdatePullRequestComment updates a comment in a pull request.
-//
-// Docs: https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#update-an-issue-comment
-func (p *Provider) UpdatePullRequestComment(ctx context.Context, repositoryID, _ string, comment *vcs.PullRequestComment) error {
- url := fmt.Sprintf("%s/repos/%s/issues/comments/%s", p.APIURL(p.instanceURL), repositoryID, comment.ID)
- commentMessage := Comment{Body: comment.Content}
- commentCreatePayload, err := json.Marshal(commentMessage)
- if err != nil {
- return errors.Wrap(err, "failed to marshal request body for creating pull request comment")
- }
-
- code, body, err := internal.Patch(ctx, url, p.getAuthorization(), commentCreatePayload)
- if err != nil {
- return errors.Wrapf(err, "PATCH %s", url)
- }
-
- if code == http.StatusNotFound {
- return common.Errorf(common.NotFound, "cannot found pull request comment through URL %s", url)
- } else if code >= 300 {
- return errors.Errorf("failed to update pull request comment through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- return nil
-}
-
-// Branch is the API message for GitHub branch.
-type Branch struct {
- Ref string `json:"ref"`
- Object ReferenceObject `json:"object"`
-}
-
-// ReferenceObject is the reference for the GitHub branch.
-type ReferenceObject struct {
- SHA string `json:"sha"`
-}
-
-// GetBranch gets the given branch in the repository.
-//
-// Docs: https://docs.github.com/en/rest/git/refs#get-a-reference
-func (p *Provider) GetBranch(ctx context.Context, repositoryID, branchName string) (*vcs.BranchInfo, error) {
- url := fmt.Sprintf("%s/repos/%s/git/ref/heads/%s", p.APIURL(p.instanceURL), repositoryID, branchName)
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "failed to get branch from URL %s", url)
- } else if code >= 300 {
- return nil, errors.Errorf("failed to get branch from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- res := new(Branch)
- if err := json.Unmarshal([]byte(body), res); err != nil {
- return nil, err
- }
-
- name, err := vcs.Branch(res.Ref)
- if err != nil {
- return nil, err
- }
-
- return &vcs.BranchInfo{
- Name: name,
- LastCommitID: res.Object.SHA,
- }, nil
-}
-
-// PullRequest is the API message for GitHub pull request.
-type PullRequest struct {
- HTMLURL string `json:"html_url"`
-}
-
-// CreateWebhook creates a webhook in the repository with given payload.
-//
-// Docs: https://docs.github.com/en/rest/webhooks/repos#create-a-repository-webhook
-func (p *Provider) CreateWebhook(ctx context.Context, repositoryID string, payload []byte) (string, error) {
- url := fmt.Sprintf("%s/repos/%s/hooks", p.APIURL(p.instanceURL), repositoryID)
- code, body, err := internal.Post(ctx, url, p.getAuthorization(), payload)
- if err != nil {
- return "", errors.Wrapf(err, "POST %s", url)
- }
-
- if code == http.StatusNotFound {
- return "", common.Errorf(common.NotFound, "failed to create webhook through URL %s", url)
- }
-
- // GitHub returns 201 HTTP status codes upon successful webhook creation,
- // see https://docs.github.com/en/rest/webhooks/repos#create-a-repository-webhook for details.
- if code != http.StatusCreated {
- return "", errors.Errorf("failed to create webhook through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- var webhookInfo WebhookInfo
- if err = json.Unmarshal([]byte(body), &webhookInfo); err != nil {
- return "", errors.Wrap(err, "unmarshal body")
- }
- return strconv.Itoa(webhookInfo.ID), nil
-}
-
-// DeleteWebhook deletes the webhook from the repository.
-//
-// Docs: https://docs.github.com/en/rest/webhooks/repos#delete-a-repository-webhook
-func (p *Provider) DeleteWebhook(ctx context.Context, repositoryID, webhookID string) error {
- url := fmt.Sprintf("%s/repos/%s/hooks/%s", p.APIURL(p.instanceURL), repositoryID, webhookID)
- code, body, err := internal.Delete(ctx, url, p.getAuthorization())
- if err != nil {
- return errors.Wrapf(err, "DELETE %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil // It is OK if the webhook has already gone
- } else if code >= 300 {
- return errors.Errorf("failed to delete webhook through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
- return nil
-}
-
-func (p *Provider) getAuthorization() string {
- return fmt.Sprintf("Bearer %s", p.authToken)
-}
-
-// https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request
-func (p *Provider) GetPullRequestMergedCommit(ctx context.Context, repoID string, prID string) (string, error) {
- url := fmt.Sprintf("%s/repos/%s/pulls/%s", p.APIURL(p.instanceURL), repoID, prID)
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return "", errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return "", common.Errorf(common.NotFound, "failed to get pull request from URL %s", url)
- } else if code >= 300 {
- return "", errors.Errorf("failed to get pull request from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- var pr struct {
- MergeCommitSha string `json:"merge_commit_sha"`
- }
-
- if err := json.Unmarshal([]byte(body), &pr); err != nil {
- return "", errors.Wrapf(err, "failed to unmarshal")
- }
-
- return pr.MergeCommitSha, nil
-}
-
-func (p *Provider) GetDirectoryFiles(ctx context.Context, repoID string, commitSha string, path string) ([]*vcs.File, error) {
- path = strings.TrimLeft(path, "/")
- path = url.PathEscape(path)
-
- files, err := p.getDirectory(ctx, repoID, commitSha, path)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get directory")
- }
-
- for _, f := range files {
- content, err := p.getBlob(ctx, repoID, f.Sha)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get blob")
- }
- f.Content = content
- }
-
- return files, nil
-}
-
-// https://docs.github.com/en/rest/git/blobs?apiVersion=2022-11-28#get-a-blob
-func (p *Provider) getBlob(ctx context.Context, repoID string, sha string) (string, error) {
- url := fmt.Sprintf("%s/repos/%s/git/blobs/%s", p.APIURL(p.instanceURL), repoID, sha)
- code, body, err := internal.GetWithHeader(ctx, url, p.getAuthorization(),
- map[string]string{
- "Accept": "application/vnd.github.raw+json",
- },
- )
- if err != nil {
- return "", errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return "", common.Errorf(common.NotFound, "failed to get blob from URL %s", url)
- } else if code >= 300 {
- return "",
- errors.Errorf("failed to get blob from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- return body, nil
-}
-
-// https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#get-repository-content
-func (p *Provider) getDirectory(ctx context.Context, repoID string, commitSha string, path string) ([]*vcs.File, error) {
- path = strings.TrimLeft(path, "/")
- path = url.PathEscape(path)
-
- url := fmt.Sprintf("%s/repos/%s/contents/%s?ref=%s", p.APIURL(p.instanceURL), repoID, path, commitSha)
- code, body, err := internal.GetWithHeader(ctx, url, p.getAuthorization(),
- map[string]string{
- "Accept": "application/vnd.github.object+json",
- },
- )
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "failed to get directory from URL %s", url)
- } else if code >= 300 {
- return nil,
- errors.Errorf("failed to get directory from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- var dir struct {
- Type string `json:"type"`
- Name string `json:"name"`
- Path string `json:"path"`
- Sha string `json:"sha"`
- Entries []struct {
- Type string `json:"type"`
- Name string `json:"name"`
- Path string `json:"path"`
- Sha string `json:"sha"`
- } `json:"entries"`
- }
-
- if err := json.Unmarshal([]byte(body), &dir); err != nil {
- return nil, errors.Wrapf(err, "failed to unmarshal")
- }
-
- if dir.Type != "dir" {
- return nil, errors.Errorf("expecting %q to be of type `dir`, but found %s", path, dir.Type)
- }
-
- var files []*vcs.File
- for _, e := range dir.Entries {
- if e.Type == "file" {
- files = append(files, &vcs.File{
- Path: e.Path,
- Name: e.Name,
- Sha: e.Sha,
- })
- }
- }
-
- return files, nil
-}
diff --git a/backend/plugin/vcs/github/webhook_events.go b/backend/plugin/vcs/github/webhook_events.go
deleted file mode 100644
index 70b0fbe1f7..0000000000
--- a/backend/plugin/vcs/github/webhook_events.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package github
-
-type PullRequestEventType string
-
-const (
- // A pull request was created.
- PullRequestEventOpened PullRequestEventType = "opened"
- // A pull request was closed. If merged is false in the webhook payload, the pull request was closed with unmerged commits. If merged is true in the webhook payload, the pull request was merged.
- PullRequestEventClosed PullRequestEventType = "closed"
- // A pull request's head branch was updated. For example, the head branch was updated from the base branch or new commits were pushed to the head branch.
- PullRequestEventSynchronize PullRequestEventType = "synchronize"
-)
-
-// PullRequestPushEvent is the json message for pull request push event.
-// Docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request
-type PullRequestPushEvent struct {
- Action PullRequestEventType `json:"action"`
- Number int `json:"number"`
- // PR close will also send webhook event with "closed" action, so we need to check the "merged" field in "pull_request".
- PullRequest EventPullRequest `json:"pull_request"`
-}
-
-type EventPullRequest struct {
- HTMLURL string `json:"html_url"`
- Title string `json:"title"`
- Body string `json:"body"`
- Base EventBranch `json:"base"`
- Head EventBranch `json:"head"`
- Merged bool `json:"merged"`
-}
-
-type EventBranch struct {
- // The branch name, e.g. main.
- Ref string `json:"ref"`
- SHA string `json:"sha"`
-}
diff --git a/backend/plugin/vcs/gitlab/bytebase-sql-review.yml b/backend/plugin/vcs/gitlab/bytebase-sql-review.yml
deleted file mode 100644
index 4fc3549ecc..0000000000
--- a/backend/plugin/vcs/gitlab/bytebase-sql-review.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-bytebase-sql-review:
- only:
- refs:
- - merge_requests
- image: docker:stable
- variables:
- API: "%s" # This is the API for SQL reivew.
- before_script:
- - apk update && apk add curl
- - apk update && apk add jq
- script:
- - echo "Start request $API"
- - request_body=$(jq -n --arg repositoryId "$CI_PROJECT_ID" --arg pullRequestId $CI_MERGE_REQUEST_IID --arg webURL "$CI_SERVER_URL" '$ARGS.named')
- - 'response=$(curl -s --show-error -X POST "$API" -H "Content-type: application/json" -H "X-SQL-Review-Token: $%s" -d "$request_body")'
- - echo $response
- - content=$(echo "$response" | jq -r '.content')
- - len=$(echo "$content" | jq '. | length')
- - if [ $len == 0 ]; then exit 0; fi
- - msg=$(echo "$content" | jq -r '.[0]')
- - echo $msg >> bytebase-sql-review.xml
- - status=$(echo "$response" | jq -r '.status')
- - if [ "$status" != "SUCCESS" ]; then exit 1; fi
- artifacts:
- when: always
- reports:
- junit:
- - bytebase-sql-review.xml
diff --git a/backend/plugin/vcs/gitlab/gitlab.go b/backend/plugin/vcs/gitlab/gitlab.go
deleted file mode 100644
index 8934620a96..0000000000
--- a/backend/plugin/vcs/gitlab/gitlab.go
+++ /dev/null
@@ -1,545 +0,0 @@
-// Package gitlab is the plugin for GitLab.
-package gitlab
-
-import (
- "context"
- "crypto/sha1"
- "encoding/hex"
- "encoding/json"
- "fmt"
- "net/http"
- "net/url"
- "strconv"
- "time"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/internal"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-var _ vcs.Provider = (*Provider)(nil)
-
-func init() {
- vcs.Register(storepb.VCSType_GITLAB, newProvider)
-}
-
-const (
- // SecretTokenLength is the length of secret token.
- SecretTokenLength = 16
-
- // apiPath is the API path.
- apiPath = "api/v4"
- // apiPageSize is the default page size when making API requests.
- apiPageSize = 100
-)
-
-// WebhookType is the GitLab webhook type.
-type WebhookType string
-
-const (
- // WebhookPush is the webhook type for push.
- WebhookPush WebhookType = "push"
-)
-
-// WebhookInfo represents a GitLab API response for the webhook information.
-type WebhookInfo struct {
- ID int `json:"id"`
-}
-
-// WebhookCreate represents a GitLab API request for creating a new webhook.
-type WebhookCreate struct {
- URL string `json:"url"`
- SecretToken string `json:"token"`
- // This is set to true
- PushEvents bool `json:"push_events"`
- NoteEvents bool `json:"note_events"`
- MergeRequestsEvents bool `json:"merge_requests_events"`
- // For now, there is no native dry run DDL support in mysql/postgres. One may wonder if we could wrap the DDL
- // in a transaction and just not commit at the end, unfortunately there are side effects which are hard to control.
- // See https://www.postgresql.org/message-id/CAMsr%2BYGiYQ7PYvYR2Voio37YdCpp79j5S%2BcmgVJMOLM2LnRQcA%40mail.gmail.com
- // So we can't possibly display useful info when reviewing a MR, thus we don't enable this event.
- // Saying that, delivering a souding dry run solution would be great and hopefully we can achieve that one day.
- // MergeRequestsEvents bool `json:"merge_requests_events"`
- EnableSSLVerification bool `json:"enable_ssl_verification"`
-}
-
-// WebhookProject is the API message for webhook project.
-type WebhookProject struct {
- ID int `json:"id"`
- WebURL string `json:"web_url"`
- FullPath string `json:"path_with_namespace"`
-}
-
-// WebhookCommitAuthor is the API message for webhook commit author.
-type WebhookCommitAuthor struct {
- Name string `json:"name"`
- Email string `json:"email"`
-}
-
-// WebhookCommit is the API message for webhook commit.
-type WebhookCommit struct {
- ID string `json:"id"`
- Title string `json:"title"`
- Message string `json:"message"`
- Timestamp string `json:"timestamp"`
- URL string `json:"url"`
- Author WebhookCommitAuthor `json:"author"`
- AddedList []string `json:"added"`
- ModifiedList []string `json:"modified"`
-}
-
-// WebhookPushEvent is the API message for webhook push event.
-type WebhookPushEvent struct {
- ObjectKind WebhookType `json:"object_kind"`
- Ref string `json:"ref"`
- Before string `json:"before"`
- After string `json:"after"`
- AuthorName string `json:"user_name"`
- Project WebhookProject `json:"project"`
- CommitList []WebhookCommit `json:"commits"`
-}
-
-// Commit is the API message for commit.
-type Commit struct {
- ID string `json:"id"`
- AuthorName string `json:"author_name"`
- // CreatedAt expects corresponding JSON value is a string in RFC 3339 format,
- // see https://pkg.go.dev/time#Time.MarshalJSON.
- CreatedAt time.Time `json:"created_at"`
-}
-
-// FileCommit represents a GitLab API request for committing a file.
-type FileCommit struct {
- Branch string `json:"branch"`
- Content string `json:"content"`
- CommitMessage string `json:"commit_message"`
- LastCommitID string `json:"last_commit_id,omitempty"`
- AuthorName string `json:"author_name,omitempty"`
- AuthorEmail string `json:"author_email,omitempty"`
-}
-
-// RepositoryTreeNode represents a GitLab API response for a repository tree
-// node.
-type RepositoryTreeNode struct {
- Path string `json:"path"`
- Type string `json:"type"`
-}
-
-// File represents a GitLab API response for a repository file.
-type File struct {
- Content string
-}
-
-// Repository represents a GitLab API response for a repository.
-type Repository struct {
- ID int64 `json:"id"`
- Name string `json:"name"`
- PathWithNamespace string `json:"path_with_namespace"`
- WebURL string `json:"web_url"`
-}
-
-// Provider is a GitLab self host VCS provider.
-type Provider struct {
- client *http.Client
- instanceURL string
- authToken string
-}
-
-func newProvider(config vcs.ProviderConfig) vcs.Provider {
- return &Provider{
- client: &http.Client{},
- instanceURL: config.InstanceURL,
- authToken: config.AuthToken,
- }
-}
-
-// APIURL returns the API URL path of a GitLab instance.
-func (*Provider) APIURL(instanceURL string) string {
- return fmt.Sprintf("%s/%s", instanceURL, apiPath)
-}
-
-// FetchRepositoryList fetches all repositories where the authenticated user
-// has a maintainer role, which is required to create webhook in the project.
-//
-// Docs: https://docs.gitlab.com/ee/api/projects.html#list-all-projects
-func (p *Provider) FetchRepositoryList(ctx context.Context, listAll bool) ([]*vcs.Repository, error) {
- var gitlabRepos []Repository
- page := 1
- for {
- repos, hasNextPage, err := p.fetchPaginatedRepositoryList(ctx, page)
- if err != nil {
- return nil, errors.Wrap(err, "fetch paginated list")
- }
- gitlabRepos = append(gitlabRepos, repos...)
-
- if !hasNextPage || !listAll {
- break
- }
- page++
- }
-
- var allRepos []*vcs.Repository
- for _, r := range gitlabRepos {
- allRepos = append(allRepos,
- &vcs.Repository{
- ID: strconv.FormatInt(r.ID, 10),
- Name: r.Name,
- FullPath: r.PathWithNamespace,
- WebURL: r.WebURL,
- },
- )
- }
- return allRepos, nil
-}
-
-// fetchPaginatedRepositoryList fetches repositories where the authenticated
-// user has a maintainer role in given page. It return the paginated results
-// along with a boolean indicating whether the next page exists.
-func (p *Provider) fetchPaginatedRepositoryList(ctx context.Context, page int) (repos []Repository, hasNextPage bool, err error) {
- // We will use user's token to create webhook in the project, which requires the
- // token owner to be at least the project maintainer(40).
- url := fmt.Sprintf("%s/projects?membership=true&simple=true&min_access_level=40&page=%d&per_page=%d", p.APIURL(p.instanceURL), page, apiPageSize)
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, false, errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, false, common.Errorf(common.NotFound, "failed to fetch repository list from URL %s", url)
- } else if code >= 300 {
- return nil, false,
- errors.Errorf("failed to fetch repository list from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- if err := json.Unmarshal([]byte(body), &repos); err != nil {
- return nil, false, errors.Wrap(err, "unmarshal")
- }
-
- // NOTE: We deliberately choose to not use the Link header for checking the next
- // page to avoid introducing a new dependency, see
- // https://github.com/bytebase/bytebase/pull/1423#discussion_r884278534 for the
- // discussion.
- return repos, len(repos) >= apiPageSize, nil
-}
-
-// ReadFileContent reads the content of the given file in the repository.
-//
-// Docs: https://docs.gitlab.com/ee/api/repository_files.html#get-file-from-repository
-func (p *Provider) ReadFileContent(ctx context.Context, repositoryID, filePath string, refInfo vcs.RefInfo) (string, error) {
- file, err := p.readFile(ctx, repositoryID, filePath, refInfo)
- if err != nil {
- return "", errors.Wrap(err, "read file")
- }
- return file.Content, nil
-}
-
-// MergeRequestChange is the API message for GitLab merge request changes.
-type MergeRequestChange struct {
- SHA string `json:"sha"`
- Changes []MergeRequestFile `json:"changes"`
- WebURL string `json:"web_url"`
-}
-
-// MergeRequestFile is the API message for files in GitLab merge request.
-type MergeRequestFile struct {
- NewPath string `json:"new_path"`
- NewFile bool `json:"new_file"`
- RenamedFile bool `json:"renamed_file"`
- DeletedFile bool `json:"deleted_file"`
-}
-
-// ListPullRequestFile lists the changed files in the pull request.
-//
-// TODO(d): migrate to diff API.
-// Docs: https://docs.gitlab.com/ee/api/merge_requests.html#get-single-mr-changes
-func (p *Provider) ListPullRequestFile(ctx context.Context, repositoryID, pullRequestID string) ([]*vcs.PullRequestFile, error) {
- url := fmt.Sprintf("%s/projects/%s/merge_requests/%s/changes", p.APIURL(p.instanceURL), repositoryID, pullRequestID)
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "failed to list merge request file from URL %s", url)
- } else if code >= 300 {
- return nil, errors.Errorf("failed to list merge request file from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- pr := new(MergeRequestChange)
- if err := json.Unmarshal([]byte(body), pr); err != nil {
- return nil, err
- }
-
- var res []*vcs.PullRequestFile
- for _, file := range pr.Changes {
- // Get web url for changed file in the PR.
- // https://web.archive.org/web/20200922103150/https://github.community/t/getting-the-anchor-to-files-diffs-in-a-pull-request/14235
- var fileHash string
- hash := sha1.New()
- if _, err := hash.Write([]byte(file.NewPath)); err == nil {
- fileHash = hex.EncodeToString(hash.Sum(nil))
- }
-
- res = append(res, &vcs.PullRequestFile{
- Path: file.NewPath,
- LastCommitID: pr.SHA,
- IsDeleted: file.DeletedFile,
- // Web URL for file in PR:
- // {PR web URL}/diffs#diff-content-{sha1 for file path}
- // Web URL for file with a specific line in PR:
- // {PR web URL}/diffs#{sha1 for file path}_0_{line}
- WebURL: fmt.Sprintf("%s/diffs#%s", pr.WebURL, fileHash),
- })
- }
-
- return res, nil
-}
-
-type Comment struct {
- ID int64 `json:"id"`
- Body string `json:"body"`
-}
-
-// CreatePullRequestComment creates a pull request comment.
-//
-// Docs: https://docs.gitlab.com/ee/api/notes.html#create-new-merge-request-note
-func (p *Provider) CreatePullRequestComment(ctx context.Context, repositoryID, pullRequestID, comment string) error {
- url := fmt.Sprintf("%s/projects/%s/merge_requests/%s/notes?body=%s", p.APIURL(p.instanceURL), repositoryID, pullRequestID, url.QueryEscape(comment))
- code, body, err := internal.Post(ctx, url, p.getAuthorization(), nil)
- if err != nil {
- return errors.Wrapf(err, "POST %s", url)
- }
-
- if code == http.StatusNotFound {
- return common.Errorf(common.NotFound, "failed to create pull request comment through URL %s", url)
- }
-
- // GitLab returns 201 HTTP status codes upon successful issue comment creation,
- if code != http.StatusCreated {
- return errors.Errorf("failed to create pull request comment through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
- return nil
-}
-
-// ListPullRequestComments lists comments in a pull request.
-//
-// Docs: https://docs.gitlab.com/ee/api/notes.html#list-all-merge-request-notes
-func (p *Provider) ListPullRequestComments(ctx context.Context, repositoryID, pullRequestID string) ([]*vcs.PullRequestComment, error) {
- url := fmt.Sprintf("%s/projects/%s/merge_requests/%s/notes", p.APIURL(p.instanceURL), repositoryID, pullRequestID)
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "failed to list pull request comments through URL %s", url)
- } else if code >= 300 {
- return nil, errors.Errorf("failed to list pull request comments from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- var repos []*Comment
- if err := json.Unmarshal([]byte(body), &repos); err != nil {
- return nil, errors.Wrap(err, "unmarshal pull request comments failed")
- }
-
- var resp []*vcs.PullRequestComment
- for _, v := range repos {
- resp = append(resp,
- &vcs.PullRequestComment{
- ID: fmt.Sprintf("%d", v.ID),
- Content: v.Body,
- },
- )
- }
- return resp, nil
-}
-
-// UpdatePullRequestComment updates a comment in a pull request.
-//
-// Docs: https://docs.gitlab.com/ee/api/notes.html#modify-existing-merge-request-note
-func (p *Provider) UpdatePullRequestComment(ctx context.Context, repositoryID, pullRequestID string, comment *vcs.PullRequestComment) error {
- url := fmt.Sprintf("%s/projects/%s/merge_requests/%s/notes/%s?body=%s", p.APIURL(p.instanceURL), repositoryID, pullRequestID, comment.ID, url.QueryEscape(comment.Content))
- code, body, err := internal.Put(ctx, url, p.getAuthorization(), nil)
- if err != nil {
- return errors.Wrapf(err, "PUT %s", url)
- }
-
- if code == http.StatusNotFound {
- return common.Errorf(common.NotFound, "cannot found pull request comment through URL %s", url)
- } else if code >= 300 {
- return errors.Errorf("failed to update pull request comment through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- return nil
-}
-
-// Branch is the API message for GitLab branch.
-type Branch struct {
- Name string `json:"name"`
- Commit Commit `json:"commit"`
-}
-
-// BranchCreate is the API message to create the branch.
-type BranchCreate struct {
- Branch string `json:"branch"`
- Ref string `json:"ref"`
-}
-
-// MergeRequestCreate is the API message to create the merge request.
-type MergeRequestCreate struct {
- Title string `json:"title"`
- Description string `json:"description"`
- SourceBranch string `json:"source_branch"`
- TargetBranch string `json:"target_branch"`
- RemoveSourceBranch bool `json:"remove_source_branch"`
-}
-
-// GetBranch gets the given branch in the repository.
-//
-// Docs: https://docs.gitlab.com/ee/api/branches.html#get-single-repository-branch
-func (p *Provider) GetBranch(ctx context.Context, repositoryID, branchName string) (*vcs.BranchInfo, error) {
- url := fmt.Sprintf("%s/projects/%s/repository/branches/%s", p.APIURL(p.instanceURL), repositoryID, branchName)
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "failed to get branch from URL %s", url)
- } else if code >= 300 {
- return nil, errors.Errorf("failed to get branch from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- branch := new(Branch)
- if err := json.Unmarshal([]byte(body), branch); err != nil {
- return nil, err
- }
-
- return &vcs.BranchInfo{
- Name: branch.Name,
- LastCommitID: branch.Commit.ID,
- }, nil
-}
-
-// MergeRequest is the API message for GitLab merge request.
-type MergeRequest struct {
- WebURL string `json:"web_url"`
-}
-
-// CreateWebhook creates a webhook in the repository with given payload.
-//
-// Docs: https://docs.gitlab.com/ee/api/projects.html#add-project-hook
-func (p *Provider) CreateWebhook(ctx context.Context, repositoryID string, payload []byte) (string, error) {
- url := fmt.Sprintf("%s/projects/%s/hooks", p.APIURL(p.instanceURL), repositoryID)
- code, body, err := internal.Post(ctx, url, p.getAuthorization(), payload)
- if err != nil {
- return "", errors.Wrapf(err, "POST %s", url)
- }
-
- if code == http.StatusNotFound {
- return "", common.Errorf(common.NotFound, "failed to create webhook through URL %s", url)
- }
- // GitLab returns 201 HTTP status codes upon successful webhook creation,
- // see https://docs.gitlab.com/ee/api/#status-codes for details.
- if code != http.StatusCreated {
- reason := fmt.Sprintf("failed to create webhook through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- // Add helper tips if the status code is 422, refer to https://github.com/bytebase/bytebase/issues/101 for more context.
- if code == http.StatusUnprocessableEntity {
- reason += ".\n\nIf GitLab and Bytebase are in the same private network, " +
- "please follow the instructions in https://docs.gitlab.com/ee/security/webhooks.html"
- }
- return "", errors.New(reason)
- }
-
- var webhookInfo WebhookInfo
- if err = json.Unmarshal([]byte(body), &webhookInfo); err != nil {
- return "", errors.Wrap(err, "unmarshal body")
- }
- return strconv.Itoa(webhookInfo.ID), nil
-}
-
-// DeleteWebhook deletes the webhook from the repository.
-//
-// Docs: https://docs.gitlab.com/ee/api/projects.html#delete-project-hook
-func (p *Provider) DeleteWebhook(ctx context.Context, repositoryID, webhookID string) error {
- url := fmt.Sprintf("%s/projects/%s/hooks/%s", p.APIURL(p.instanceURL), repositoryID, webhookID)
- code, body, err := internal.Delete(ctx, url, p.getAuthorization())
- if err != nil {
- return errors.Wrapf(err, "DELETE %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil // It is OK if the webhook has already gone
- } else if code >= 300 {
- return errors.Errorf("failed to delete webhook through URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
- return nil
-}
-
-// readFile reads the given file in the repository.
-//
-// TODO: The same GitLab API endpoint supports using the HEAD request to only
-// get the file metadata.
-func (p *Provider) readFile(ctx context.Context, repositoryID, filePath string, refInfo vcs.RefInfo) (*File, error) {
- // GitLab is often deployed behind a reverse proxy, which may have compression enabled that is transparent to the GitLab instance.
- // In such cases, the HTTP header "Content-Encoding" will, for example, be changed to "gzip" and makes the value of "Content-Length" untrustworthy.
- // We can avoid dealing with this type of problem by using the raw API instead of the typical JSON API.
- url := fmt.Sprintf("%s/projects/%s/repository/files/%s/raw?ref=%s", p.APIURL(p.instanceURL), repositoryID, url.QueryEscape(filePath), url.QueryEscape(refInfo.RefName))
- code, body, err := internal.Get(ctx, url, p.getAuthorization())
- if err != nil {
- return nil, errors.Wrapf(err, "GET %s", url)
- }
-
- if code == http.StatusNotFound {
- return nil, common.Errorf(common.NotFound, "failed to read file from URL %s", url)
- } else if code >= 300 {
- return nil,
- errors.Errorf("failed to read file from URL %s, status code: %d, body: %s",
- url,
- code,
- body,
- )
- }
-
- return &File{
- Content: body,
- }, nil
-}
-
-func (p *Provider) getAuthorization() string {
- return fmt.Sprintf("Bearer %s", p.authToken)
-}
diff --git a/backend/plugin/vcs/gitlab/webhook_events.go b/backend/plugin/vcs/gitlab/webhook_events.go
deleted file mode 100644
index 82f7cf05dd..0000000000
--- a/backend/plugin/vcs/gitlab/webhook_events.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package gitlab
-
-// MergeRequestPushEvent is the json message for merge request push event.
-// Docs: https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#merge-request-events
-type MergeRequestPushEvent struct {
- ObjectKind string `json:"object_kind"`
- User EventUser `json:"user"`
- ObjectAttributes EventObjectAttributes `json:"object_attributes"`
-}
-
-type EventUser struct {
- Email string `json:"email"`
-}
-
-// The available values for object_attributes.action in the payload are:
-// open, close, reopen, update, approved, unapproved, approval, unapproval, merge.
-// Docs: https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#merge-request-events
-type MergeRequestAction string
-
-const (
- MergeRequestOpen MergeRequestAction = "open"
- MergeRequestUpdate MergeRequestAction = "update"
- MergeRequestMerge MergeRequestAction = "merge"
-)
-
-type EventObjectAttributes struct {
- IID int `json:"iid"`
- URL string `json:"url"`
- TargetBranch string `json:"target_branch"`
- Action MergeRequestAction `json:"action"`
- Title string `json:"title"`
- Description string `json:"description"`
- LastCommit LastCommit `json:"last_commit"`
-}
-
-type LastCommit struct {
- ID string `json:"id"`
-}
diff --git a/backend/plugin/vcs/internal/request.go b/backend/plugin/vcs/internal/request.go
deleted file mode 100644
index f59f066cbc..0000000000
--- a/backend/plugin/vcs/internal/request.go
+++ /dev/null
@@ -1,68 +0,0 @@
-// Package internal provides library for VCS plugins.
-package internal
-
-import (
- "bytes"
- "context"
- "io"
- "net/http"
-
- "github.com/pkg/errors"
-)
-
-// Post makes a HTTP POST request to the given URL.
-func Post(ctx context.Context, url string, authorization string, body []byte) (code int, respBody string, err error) {
- return request(ctx, http.MethodPost, url, authorization, nil, bytes.NewReader(body))
-}
-
-// Patch makes a HTTP PATCH request to the given URL.
-func Patch(ctx context.Context, url string, authorization string, body []byte) (code int, respBody string, err error) {
- return request(ctx, http.MethodPatch, url, authorization, nil, bytes.NewReader(body))
-}
-
-// Put makes a HTTP PUT request to the given URL.
-func Put(ctx context.Context, url string, authorization string, body []byte) (code int, respBody string, err error) {
- return request(ctx, http.MethodPut, url, authorization, nil, bytes.NewReader(body))
-}
-
-// Get makes a HTTP GET request to the given URL.
-func Get(ctx context.Context, url string, authorization string) (code int, respBody string, err error) {
- return request(ctx, http.MethodGet, url, authorization, nil, bytes.NewReader(nil))
-}
-
-// GetWithHeader makes a HTTP GET request to the given URL wit additional header.
-func GetWithHeader(ctx context.Context, url string, authorization string, header map[string]string) (code int, respBody string, err error) {
- return request(ctx, http.MethodGet, url, authorization, header, bytes.NewReader(nil))
-}
-
-// Delete makes a HTTP DELETE request to the given URL.
-func Delete(ctx context.Context, url string, authorization string) (code int, respBody string, err error) {
- return request(ctx, http.MethodDelete, url, authorization, nil, bytes.NewReader(nil))
-}
-
-func request(ctx context.Context, method, url string, authorization string, header map[string]string, requestBody *bytes.Reader) (int, string, error) {
- req, err := http.NewRequestWithContext(ctx, method, url, requestBody)
- if err != nil {
- return 0, "", errors.Wrapf(err, "failed to build delete request for url %s", url)
- }
- req.Header.Set("Content-Type", "application/json")
- req.Header.Add("Authorization", authorization)
- for k, v := range header {
- req.Header.Set(k, v)
- }
- client := &http.Client{}
- resp, err := client.Do(req)
- if err != nil {
- return 0, "", errors.Wrapf(err, "failed to send delete request for url %s", url)
- }
- defer resp.Body.Close()
-
- respBody, err := io.ReadAll(resp.Body)
- if err != nil {
- return 0, "", errors.Wrapf(err, "read delete %s response body with status code %d", url, resp.StatusCode)
- }
- if err := resp.Body.Close(); err != nil {
- return 0, "", errors.Wrapf(err, "failed to close delete %s response body with status code %d", url, resp.StatusCode)
- }
- return resp.StatusCode, string(respBody), nil
-}
diff --git a/backend/plugin/vcs/util.go b/backend/plugin/vcs/util.go
deleted file mode 100644
index eb8175fd49..0000000000
--- a/backend/plugin/vcs/util.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// Package vcs provides the utilities for VCS plugins.
-package vcs
-
-import (
- "strings"
-
- "github.com/pkg/errors"
-)
-
-// Branch is the helper function returns the branch name from reference name.
-// For now, this method only supports branch reference.
-// https://git-scm.com/book/en/v2/Git-Internals-Git-References
-func Branch(ref string) (string, error) {
- if strings.HasPrefix(ref, "refs/heads/") {
- return strings.TrimPrefix(ref, "refs/heads/"), nil
- }
-
- return "", errors.Errorf("invalid Git ref: %s", ref)
-}
diff --git a/backend/plugin/vcs/util_test.go b/backend/plugin/vcs/util_test.go
deleted file mode 100644
index 1597169f61..0000000000
--- a/backend/plugin/vcs/util_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package vcs
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
-)
-
-func TestBranch(t *testing.T) {
- tests := []struct {
- ref string
- want string
- wantErr bool
- }{
- {
- ref: "refs/heads/master",
- want: "master",
- wantErr: false,
- },
- {
- ref: "refs/heads/feature/foo",
- want: "feature/foo",
- wantErr: false,
- },
- {
- ref: "refs/heads/feature/foo",
- want: "feature/foo",
- wantErr: false,
- },
- }
-
- for _, test := range tests {
- result, err := Branch(test.ref)
- if test.wantErr {
- require.Error(t, err)
- }
- assert.Equal(t, result, test.want)
- }
-}
diff --git a/backend/plugin/vcs/vcs.go b/backend/plugin/vcs/vcs.go
deleted file mode 100644
index f58ed256e7..0000000000
--- a/backend/plugin/vcs/vcs.go
+++ /dev/null
@@ -1,156 +0,0 @@
-package vcs
-
-import (
- "context"
- "fmt"
- "sync"
-
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-// RefType is the type of a ref.
-type RefType string
-
-const (
- // RefTypeBranch is the branch ref type.
- RefTypeBranch RefType = "branch"
- // RefTypeTag is the tag ref type.
- RefTypeTag RefType = "tag"
- // RefTypeCommit is the commit ref type.
- RefTypeCommit RefType = "commit"
-)
-
-// RefInfo is the API message for a VCS ref.
-type RefInfo struct {
- RefType RefType
- RefName string
-}
-
-// FileDiffType is the type of file diff.
-type FileDiffType int
-
-const (
- // FileDiffTypeUnknown means the file is an unknown diff type.
- FileDiffTypeUnknown FileDiffType = iota
- // FileDiffTypeAdded means the file is newly added.
- FileDiffTypeAdded
- // FileDiffTypeModified means the file is modified.
- FileDiffTypeModified
- // FileDiffTypeRemoved means the file is removed.
- FileDiffTypeRemoved
-)
-
-// FileDiff contains file diffs between two commits.
-// It's obtained by comparing the base and head commits of a PR/MR so that we know the real changes.
-type FileDiff struct {
- Path string
- Type FileDiffType
-}
-
-// Repository is the API message for repository info.
-type Repository struct {
- ID string `json:"id"`
- Name string `json:"name"`
- FullPath string `json:"fullPath"`
- WebURL string `json:"webUrl"`
-}
-
-// PullRequestFile is the API message for file in the pull request.
-type PullRequestFile struct {
- Path string
- LastCommitID string
- IsDeleted bool
- // WebURL is the changed file web url in the pull request.
- WebURL string
-}
-
-// BranchInfo is the API message for repository branch.
-type BranchInfo struct {
- Name string
- LastCommitID string
-}
-
-type PullRequestComment struct {
- ID string
- Content string
-}
-
-type File struct {
- Path string
- Name string
- Sha string
- Content string
-}
-
-// Provider is the interface for VCS provider.
-type Provider interface {
- // Returns the API URL for a given VCS instance URL
- APIURL(instanceURL string) string
-
- // Fetch repositories within a given user's scope
- FetchRepositoryList(ctx context.Context, listAll bool) ([]*Repository, error)
-
- // Reads the file content
- ReadFileContent(ctx context.Context, repositoryID, filePath string, refInfo RefInfo) (string, error)
-
- // GetBranch gets the given branch in the repository.
- GetBranch(ctx context.Context, repositoryID, branchName string) (*BranchInfo, error)
-
- // ListPullRequestFile lists changed files in a pull request.
- ListPullRequestFile(ctx context.Context, repositoryID, pullRequestID string) ([]*PullRequestFile, error)
-
- // CreatePullRequestComment creates a pull request comment.
- CreatePullRequestComment(ctx context.Context, repositoryID, pullRequestID, comment string) error
-
- // UpdatePullRequestComment updates a pull request comment.
- UpdatePullRequestComment(ctx context.Context, repositoryID, pullRequestID string, comment *PullRequestComment) error
-
- // ListPullRequestComments lists comments in a pull request.
- ListPullRequestComments(ctx context.Context, repositoryID, pullRequestID string) ([]*PullRequestComment, error)
-
- // Creates a webhook. Returns the created webhook ID on success.
- CreateWebhook(ctx context.Context, repositoryID string, payload []byte) (string, error)
-
- // Deletes a webhook.
- DeleteWebhook(ctx context.Context, repositoryID, webhookID string) error
-}
-
-var (
- providerMu sync.RWMutex
- providers = make(map[storepb.VCSType]providerFunc)
-)
-
-// ProviderConfig is the provider configuration.
-type ProviderConfig struct {
- InstanceURL string
- AuthToken string
-}
-
-type providerFunc func(ProviderConfig) Provider
-
-// Register makes a vcs provider available by the provided type.
-// If Register is called twice with the same name or if provider is nil,
-// it panics.
-func Register(vcsType storepb.VCSType, f providerFunc) {
- providerMu.Lock()
- defer providerMu.Unlock()
- if f == nil {
- panic("vcs: Register provider is nil")
- }
- if _, dup := providers[vcsType]; dup {
- panic(fmt.Sprintf("vcs: Register called twice for provider %q", vcsType.String()))
- }
- providers[vcsType] = f
-}
-
-// Get returns a vcs provider specified by its vcs type.
-func Get(vcsType storepb.VCSType, providerConfig ProviderConfig) Provider {
- providerMu.RLock()
- f, ok := providers[vcsType]
- providerMu.RUnlock()
- if !ok {
- panic(fmt.Sprintf("vcs: unknown provider %q", vcsType.String()))
- }
-
- return f(providerConfig)
-}
diff --git a/backend/plugin/webhook/webhook.go b/backend/plugin/webhook/webhook.go
index c776839321..100359da5a 100644
--- a/backend/plugin/webhook/webhook.go
+++ b/backend/plugin/webhook/webhook.go
@@ -123,10 +123,6 @@ func (c *Context) GetMetaList() []Meta {
Name: "Issue Creator",
Value: fmt.Sprintf("%s (%s)", c.Issue.Creator.Name, c.Issue.Creator.Email),
})
- // For VCS workflow, the generated issue description is composed of file names in the push event.
- // So the description could be long, which is hard to display if merged into the issue name.
- // We also trim it to 200 bytes to limit the message size in the webhook body, so that users can
- // view it easily in the corresponding webhook client.
m = append(m, Meta{
Name: "Issue Description",
Value: common.TruncateStringWithDescription(c.Issue.Description),
@@ -188,10 +184,6 @@ func (c *Context) GetMetaListZh() []Meta {
Name: "工单创建者",
Value: fmt.Sprintf("%s (%s)", c.Issue.Creator.Name, c.Issue.Creator.Email),
})
- // For VCS workflow, the generated issue description is composed of file names in the push event.
- // So the description could be long, which is hard to display if merged into the issue name.
- // We also trim it to 200 bytes to limit the message size in the webhook body, so that users can
- // view it easily in the corresponding webhook client.
m = append(m, Meta{
Name: "工单描述",
Value: common.TruncateStringWithDescription(c.Issue.Description),
diff --git a/backend/server/grpc_routes.go b/backend/server/grpc_routes.go
index 52e9ca5518..04401ae4f2 100644
--- a/backend/server/grpc_routes.go
+++ b/backend/server/grpc_routes.go
@@ -78,7 +78,6 @@ func configureGrpcRouters(
v1pb.RegisterAnomalyServiceServer(grpcServer, apiv1.NewAnomalyService(stores))
sqlService := apiv1.NewSQLService(stores, sheetManager, schemaSyncer, dbFactory, licenseService, profile, iamManager)
v1pb.RegisterSQLServiceServer(grpcServer, sqlService)
- v1pb.RegisterVCSProviderServiceServer(grpcServer, apiv1.NewVCSProviderService(stores))
v1pb.RegisterRiskServiceServer(grpcServer, apiv1.NewRiskService(stores, licenseService))
releaseService := apiv1.NewReleaseService(stores, sheetManager, schemaSyncer, dbFactory)
v1pb.RegisterReleaseServiceServer(grpcServer, releaseService)
@@ -94,7 +93,6 @@ func configureGrpcRouters(
v1pb.RegisterCelServiceServer(grpcServer, apiv1.NewCelService())
v1pb.RegisterDatabaseGroupServiceServer(grpcServer, apiv1.NewDatabaseGroupService(stores, profile, iamManager, licenseService))
v1pb.RegisterChangelistServiceServer(grpcServer, apiv1.NewChangelistService(stores, profile, iamManager))
- v1pb.RegisterVCSConnectorServiceServer(grpcServer, apiv1.NewVCSConnectorService(stores))
v1pb.RegisterGroupServiceServer(grpcServer, apiv1.NewGroupService(stores, iamManager, licenseService))
v1pb.RegisterReviewConfigServiceServer(grpcServer, apiv1.NewReviewConfigService(stores, licenseService))
@@ -193,12 +191,6 @@ func configureGrpcRouters(
if err := v1pb.RegisterSubscriptionServiceHandler(ctx, mux, grpcConn); err != nil {
return nil, nil, nil, nil, nil, err
}
- if err := v1pb.RegisterVCSConnectorServiceHandler(ctx, mux, grpcConn); err != nil {
- return nil, nil, nil, nil, nil, err
- }
- if err := v1pb.RegisterVCSProviderServiceHandler(ctx, mux, grpcConn); err != nil {
- return nil, nil, nil, nil, nil, err
- }
if err := v1pb.RegisterWorksheetServiceHandler(ctx, mux, grpcConn); err != nil {
return nil, nil, nil, nil, nil, err
}
diff --git a/backend/server/routers.go b/backend/server/routers.go
index c0a3834c94..0e4b3dbdd9 100644
--- a/backend/server/routers.go
+++ b/backend/server/routers.go
@@ -15,7 +15,6 @@ import (
"google.golang.org/grpc"
directorysync "github.com/bytebase/bytebase/backend/api/directory-sync"
- "github.com/bytebase/bytebase/backend/api/gitops"
"github.com/bytebase/bytebase/backend/api/lsp"
"github.com/bytebase/bytebase/backend/common/log"
"github.com/bytebase/bytebase/backend/component/config"
@@ -25,7 +24,6 @@ func configureEchoRouters(
e *echo.Echo,
grpcServer *grpc.Server,
lspServer *lsp.Server,
- gitOpsServer *gitops.Service,
directorySyncServer *directorysync.Service,
mux *grpcruntime.ServeMux,
profile *config.Profile,
@@ -96,11 +94,8 @@ func configureEchoRouters(
// LSP server.
e.GET(lspAPI, lspServer.Router)
- // GitOps Webhook server.
- webhookGroup := e.Group(webhookAPIPrefix)
- gitOpsServer.RegisterWebhookRoutes(webhookGroup)
-
- scimGroup := webhookGroup.Group(scimAPIPrefix)
+ hookGroup := e.Group(webhookAPIPrefix)
+ scimGroup := hookGroup.Group(scimAPIPrefix)
directorySyncServer.RegisterDirectorySyncRoutes(scimGroup)
}
diff --git a/backend/server/server.go b/backend/server/server.go
index f79e6d8f4f..de53a686f1 100644
--- a/backend/server/server.go
+++ b/backend/server/server.go
@@ -25,7 +25,6 @@ import (
"github.com/bytebase/bytebase/backend/api/auth"
directorysync "github.com/bytebase/bytebase/backend/api/directory-sync"
- "github.com/bytebase/bytebase/backend/api/gitops"
"github.com/bytebase/bytebase/backend/api/lsp"
apiv1 "github.com/bytebase/bytebase/backend/api/v1"
"github.com/bytebase/bytebase/backend/common/log"
@@ -358,17 +357,15 @@ func NewServer(ctx context.Context, profile *config.Profile) (*Server, error) {
}
return nil
}
- releaseService, planService, rolloutService, issueService, sqlService, err := configureGrpcRouters(ctx, mux, s.grpcServer, s.store, s.sheetManager, s.dbFactory, s.licenseService, s.profile, s.metricReporter, s.stateCfg, s.schemaSyncer, s.webhookManager, s.iamManager, postCreateUser, s.secret)
+ _, planService, rolloutService, issueService, _, err := configureGrpcRouters(ctx, mux, s.grpcServer, s.store, s.sheetManager, s.dbFactory, s.licenseService, s.profile, s.metricReporter, s.stateCfg, s.schemaSyncer, s.webhookManager, s.iamManager, postCreateUser, s.secret)
if err != nil {
return nil, err
}
s.planService, s.rolloutService, s.issueService = planService, rolloutService, issueService
- // GitOps webhook server.
- gitOpsServer := gitops.NewService(s.store, s.licenseService, releaseService, planService, rolloutService, issueService, sqlService, s.sheetManager, profile)
directorySyncServer := directorysync.NewService(s.store, s.licenseService, s.iamManager)
// Configure echo server routes.
- configureEchoRouters(s.echoServer, s.grpcServer, s.lspServer, gitOpsServer, directorySyncServer, mux, profile)
+ configureEchoRouters(s.echoServer, s.grpcServer, s.lspServer, directorySyncServer, mux, profile)
serverStarted = true
return s, nil
diff --git a/backend/store/project.go b/backend/store/project.go
index 42bd503230..ea991de58c 100644
--- a/backend/store/project.go
+++ b/backend/store/project.go
@@ -22,7 +22,6 @@ type ProjectMessage struct {
Webhooks []*ProjectWebhookMessage
DataClassificationConfigID string
Setting *storepb.Project
- VCSConnectorsCount int
Deleted bool
}
@@ -251,7 +250,6 @@ func (s *Store) listProjectImplV2(ctx context.Context, tx *Tx, find *FindProject
resource_id,
name,
data_classification_config_id,
- (SELECT COUNT(1) FROM vcs_connector WHERE project.resource_id = vcs_connector.project) AS connectors,
setting,
deleted
FROM project
@@ -271,7 +269,6 @@ func (s *Store) listProjectImplV2(ctx context.Context, tx *Tx, find *FindProject
&projectMessage.ResourceID,
&projectMessage.Title,
&projectMessage.DataClassificationConfigID,
- &projectMessage.VCSConnectorsCount,
&payload,
&projectMessage.Deleted,
); err != nil {
diff --git a/backend/store/store.go b/backend/store/store.go
index 4f8cf5e396..32c9f4d615 100644
--- a/backend/store/store.go
+++ b/backend/store/store.go
@@ -33,7 +33,6 @@ type Store struct {
idpCache *lru.Cache[string, *IdentityProviderMessage]
risksCache *lru.Cache[int, []*RiskMessage] // Use 0 as the key.
databaseGroupCache *lru.Cache[string, *DatabaseGroupMessage]
- vcsCache *lru.Cache[string, *VCSProviderMessage]
rolesCache *lru.Cache[string, *RoleMessage]
groupCache *lru.Cache[string, *GroupMessage]
sheetCache *lru.Cache[int, *SheetMessage]
@@ -105,10 +104,6 @@ func New(db *DB, profile *config.Profile) (*Store, error) {
if err != nil {
return nil, err
}
- vcsIDCache, err := lru.New[string, *VCSProviderMessage](1024)
- if err != nil {
- return nil, err
- }
rolesCache, err := lru.New[string, *RoleMessage](64)
if err != nil {
return nil, err
@@ -150,7 +145,6 @@ func New(db *DB, profile *config.Profile) (*Store, error) {
idpCache: idpCache,
risksCache: risksCache,
databaseGroupCache: databaseGroupCache,
- vcsCache: vcsIDCache,
rolesCache: rolesCache,
sheetCache: sheetCache,
sheetStatementCache: sheetStatementCache,
diff --git a/backend/store/vcs_connector.go b/backend/store/vcs_connector.go
deleted file mode 100644
index 89abae777a..0000000000
--- a/backend/store/vcs_connector.go
+++ /dev/null
@@ -1,226 +0,0 @@
-package store
-
-import (
- "context"
- "database/sql"
- "fmt"
- "strings"
-
- "github.com/pkg/errors"
- "google.golang.org/protobuf/encoding/protojson"
-
- "github.com/bytebase/bytebase/backend/common"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-// VCSConnectorMessage is the message for a VCS connector.
-type VCSConnectorMessage struct {
- // Related fields
- VCSID string
- ProjectID string
- ResourceID string
-
- Payload *storepb.VCSConnector
-}
-
-// FindVCSConnectorMessage is the API message for finding VCS connectors.
-type FindVCSConnectorMessage struct {
- VCSID *string
- ProjectID *string
- ResourceID *string
-}
-
-// UpdateVCSConnectorMessage is the message to update a VCS connector.
-type UpdateVCSConnectorMessage struct {
- ProjectID string
- ResourceID string
-
- // Domain specific fields
- Branch *string
- BaseDirectory *string
- DatabaseGroup *string
-}
-
-// GetVCSConnector gets a VCS connector.
-func (s *Store) GetVCSConnector(ctx context.Context, find *FindVCSConnectorMessage) (*VCSConnectorMessage, error) {
- vcsConnectors, err := s.ListVCSConnectors(ctx, find)
- if err != nil {
- return nil, err
- }
- if len(vcsConnectors) == 0 {
- return nil, nil
- }
- if len(vcsConnectors) > 1 {
- return nil, errors.Errorf("expected 1 VCS connector, got %d", len(vcsConnectors))
- }
- return vcsConnectors[0], nil
-}
-
-// ListVCSConnectors returns a list of VCS connectors.
-func (s *Store) ListVCSConnectors(ctx context.Context, find *FindVCSConnectorMessage) ([]*VCSConnectorMessage, error) {
- where, args := []string{"TRUE"}, []any{}
-
- if v := find.VCSID; v != nil {
- where, args = append(where, fmt.Sprintf("vcs = $%d", len(args)+1)), append(args, *v)
- }
- if v := find.ResourceID; v != nil {
- where, args = append(where, fmt.Sprintf("resource_id = $%d", len(args)+1)), append(args, *v)
- }
- if v := find.ProjectID; v != nil {
- where, args = append(where, fmt.Sprintf("project = $%d", len(args)+1)), append(args, *v)
- }
-
- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})
- if err != nil {
- return nil, err
- }
- defer tx.Rollback()
-
- rows, err := tx.QueryContext(ctx, `
- SELECT
- vcs,
- project,
- resource_id,
- payload
- FROM vcs_connector
- WHERE `+strings.Join(where, " AND "),
- args...,
- )
- if err != nil {
- return nil, err
- }
- defer rows.Close()
-
- var vcsConnectors []*VCSConnectorMessage
- for rows.Next() {
- var vcsConnector VCSConnectorMessage
- var payloadStr string
- if err := rows.Scan(
- &vcsConnector.VCSID,
- &vcsConnector.ProjectID,
- &vcsConnector.ResourceID,
- &payloadStr,
- ); err != nil {
- return nil, err
- }
- var payload storepb.VCSConnector
- if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(payloadStr), &payload); err != nil {
- return nil, err
- }
- vcsConnector.Payload = &payload
- vcsConnectors = append(vcsConnectors, &vcsConnector)
- }
- if err := rows.Err(); err != nil {
- return nil, err
- }
- if err := tx.Commit(); err != nil {
- return nil, err
- }
-
- return vcsConnectors, nil
-}
-
-// CreateVCSConnector creates a VCS connector.
-func (s *Store) CreateVCSConnector(ctx context.Context, create *VCSConnectorMessage) (*VCSConnectorMessage, error) {
- project, err := s.GetProjectV2(ctx, &FindProjectMessage{ResourceID: &create.ProjectID})
- if err != nil {
- return nil, err
- }
-
- payload, err := protojson.Marshal(create.Payload)
- if err != nil {
- return nil, err
- }
-
- tx, err := s.db.BeginTx(ctx, nil)
- if err != nil {
- return nil, err
- }
- defer tx.Rollback()
-
- query := `
- INSERT INTO vcs_connector (
- vcs,
- project,
- resource_id,
- payload
- )
- VALUES ($1, $2, $3, $4)
- `
- if _, err := tx.ExecContext(ctx, query,
- create.VCSID,
- project.ResourceID,
- create.ResourceID,
- payload,
- ); err != nil {
- return nil, err
- }
-
- if err := tx.Commit(); err != nil {
- return nil, err
- }
-
- s.removeProjectCache(create.ProjectID)
- return create, nil
-}
-
-// UpdateVCSConnector updates a VCS connector.
-func (s *Store) UpdateVCSConnector(ctx context.Context, update *UpdateVCSConnectorMessage) error {
- set, args := []string{}, []any{}
-
- var payloadSet []string
- if v := update.Branch; v != nil {
- payloadSet, args = append(payloadSet, fmt.Sprintf("jsonb_build_object('branch', $%d::TEXT)", len(args)+1)), append(args, *v)
- }
- if v := update.BaseDirectory; v != nil {
- payloadSet, args = append(payloadSet, fmt.Sprintf("jsonb_build_object('baseDirectory', $%d::TEXT)", len(args)+1)), append(args, *v)
- }
- if v := update.DatabaseGroup; v != nil {
- payloadSet, args = append(payloadSet, fmt.Sprintf("jsonb_build_object('databaseGroup', $%d::TEXT)", len(args)+1)), append(args, *v)
- }
- if len(payloadSet) != 0 {
- set = append(set, fmt.Sprintf(`payload = payload || %s`, strings.Join(payloadSet, "||")))
- }
-
- where := []string{}
- where, args = append(where, fmt.Sprintf("resource_id = $%d", len(args)+1)), append(args, update.ResourceID)
-
- tx, err := s.db.BeginTx(ctx, nil)
- if err != nil {
- return errors.Wrapf(err, "failed to begin transaction")
- }
-
- query := `
- UPDATE vcs_connector
- SET ` + strings.Join(set, ", ") + `
- WHERE ` + strings.Join(where, " AND ")
-
- if _, err := tx.ExecContext(ctx, query, args...); err != nil {
- return err
- }
-
- return tx.Commit()
-}
-
-// DeleteVCSConnector deletes a VCS connector.
-func (s *Store) DeleteVCSConnector(ctx context.Context, projectID, resourceID string) error {
- tx, err := s.db.BeginTx(ctx, nil)
- if err != nil {
- return err
- }
- defer tx.Rollback()
-
- if _, err := tx.ExecContext(ctx, `
- DELETE FROM vcs_connector
- WHERE project = $1 AND resource_id = $2;`,
- projectID, resourceID); err != nil {
- return err
- }
-
- if err := tx.Commit(); err != nil {
- return err
- }
-
- s.removeProjectCache(projectID)
- return nil
-}
diff --git a/backend/store/vcs_provider.go b/backend/store/vcs_provider.go
deleted file mode 100644
index 542b739e28..0000000000
--- a/backend/store/vcs_provider.go
+++ /dev/null
@@ -1,244 +0,0 @@
-package store
-
-import (
- "context"
- "database/sql"
- "fmt"
- "strings"
-
- "github.com/pkg/errors"
-
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-// VCSProviderMessage is a message for VCS provider.
-type VCSProviderMessage struct {
- // ResourceID is the unique resource ID.
- ResourceID string
- // Type is the type of the VCS provider.
- Type storepb.VCSType
- // InstanceURL is the URL for the VCS provider instance.
- InstanceURL string
- // Title is the name of the VCS provider.
- Title string
- // AccessToken is the access token for the VCS provider.
- AccessToken string
-}
-
-// UpdateVCSProviderMessage is a message for updating an VCS provider.
-type UpdateVCSProviderMessage struct {
- // Name is the name of the VCS provider.
- Name *string
- // AccessToken is the secret for the VCS provider.
- AccessToken *string
-}
-
-type FindVCSProviderMessage struct {
- ResourceID *string
-}
-
-// GetVCSProvider gets an VCS provider by ID.
-func (s *Store) GetVCSProvider(ctx context.Context, find *FindVCSProviderMessage) (*VCSProviderMessage, error) {
- if find.ResourceID != nil {
- if v, ok := s.vcsCache.Get(*find.ResourceID); ok {
- return v, nil
- }
- }
-
- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})
- if err != nil {
- return nil, errors.Wrapf(err, "failed to begin transaction")
- }
- defer tx.Rollback()
-
- vcsProviders, err := s.findVCSProvidersImpl(ctx, tx, find)
- if err != nil {
- return nil, err
- }
- if err := tx.Commit(); err != nil {
- return nil, errors.Wrapf(err, "failed to commit transaction")
- }
- if len(vcsProviders) == 0 {
- return nil, nil
- } else if len(vcsProviders) > 1 {
- return nil, errors.Errorf("expected 1 VCS provider with find %+v, got %d", find, len(vcsProviders))
- }
-
- vcs := vcsProviders[0]
- s.vcsCache.Add(vcs.ResourceID, vcs)
- return vcs, nil
-}
-
-// ListVCSProviders lists all VCS providers.
-func (s *Store) ListVCSProviders(ctx context.Context) ([]*VCSProviderMessage, error) {
- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})
- if err != nil {
- return nil, errors.Wrapf(err, "failed to begin transaction")
- }
- defer tx.Rollback()
-
- vcsProviders, err := s.findVCSProvidersImpl(ctx, tx, &FindVCSProviderMessage{})
- if err != nil {
- return nil, err
- }
- if err := tx.Commit(); err != nil {
- return nil, errors.Wrapf(err, "failed to commit transaction")
- }
-
- for _, vcs := range vcsProviders {
- s.vcsCache.Add(vcs.ResourceID, vcs)
- }
- return vcsProviders, nil
-}
-
-// CreateVCSProvider creates an VCS provider.
-func (s *Store) CreateVCSProvider(ctx context.Context, create *VCSProviderMessage) (*VCSProviderMessage, error) {
- tx, err := s.db.BeginTx(ctx, nil)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to begin transaction")
- }
- defer tx.Rollback()
-
- query := `
- INSERT INTO vcs (
- resource_id,
- name,
- type,
- instance_url,
- access_token
- )
- VALUES ($1, $2, $3, $4, $5)
- RETURNING id
- `
- if _, err := tx.ExecContext(ctx, query,
- create.ResourceID,
- create.Title,
- create.Type.String(),
- create.InstanceURL,
- create.AccessToken,
- ); err != nil {
- return nil, err
- }
-
- if err := tx.Commit(); err != nil {
- return nil, errors.Wrapf(err, "failed to commit transaction")
- }
-
- s.vcsCache.Add(create.ResourceID, create)
- return create, nil
-}
-
-// UpdateVCSProvider updates an VCS provider.
-func (s *Store) UpdateVCSProvider(ctx context.Context, vcsProviderID string, update *UpdateVCSProviderMessage) (*VCSProviderMessage, error) {
- set, args := []string{}, []any{}
- if v := update.Name; v != nil {
- set, args = append(set, fmt.Sprintf("name = $%d", len(args)+1)), append(args, *v)
- }
- if v := update.AccessToken; v != nil {
- set, args = append(set, fmt.Sprintf("access_token = $%d", len(args)+1)), append(args, *v)
- }
- args = append(args, vcsProviderID)
-
- tx, err := s.db.BeginTx(ctx, nil)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to begin transaction")
- }
- defer tx.Rollback()
-
- var vcsProvider VCSProviderMessage
- var vcsType string
- if err := tx.QueryRowContext(ctx, fmt.Sprintf(`
- UPDATE vcs
- SET `+strings.Join(set, ", ")+`
- WHERE resource_id = $%d
- RETURNING resource_id, name, type, instance_url, access_token
- `, len(args)),
- args...,
- ).Scan(
- &vcsProvider.ResourceID,
- &vcsProvider.Title,
- &vcsType,
- &vcsProvider.InstanceURL,
- &vcsProvider.AccessToken,
- ); err != nil {
- return nil, err
- }
- vcsTypeValue, ok := storepb.VCSType_value[vcsType]
- if !ok {
- return nil, errors.Errorf("invalid vcs type %s", vcsType)
- }
- vcsProvider.Type = storepb.VCSType(vcsTypeValue)
-
- if err := tx.Commit(); err != nil {
- return nil, errors.Wrapf(err, "failed to commit transaction")
- }
- s.vcsCache.Add(vcsProvider.ResourceID, &vcsProvider)
- return &vcsProvider, nil
-}
-
-// DeleteVCSProvider deletes an VCS provider.
-func (s *Store) DeleteVCSProvider(ctx context.Context, vcsProviderID string) error {
- tx, err := s.db.BeginTx(ctx, nil)
- if err != nil {
- return errors.Wrapf(err, "failed to begin transaction")
- }
- defer tx.Rollback()
-
- if _, err := tx.ExecContext(ctx, `DELETE FROM vcs WHERE resource_id = $1`, vcsProviderID); err != nil {
- return err
- }
-
- if err := tx.Commit(); err != nil {
- return errors.Wrapf(err, "failed to commit transaction")
- }
-
- s.vcsCache.Remove(vcsProviderID)
- return nil
-}
-
-func (*Store) findVCSProvidersImpl(ctx context.Context, tx *Tx, find *FindVCSProviderMessage) ([]*VCSProviderMessage, error) {
- where, args := []string{"TRUE"}, []any{}
- if v := find.ResourceID; v != nil {
- where, args = append(where, fmt.Sprintf("resource_id = $%d", len(args)+1)), append(args, *v)
- }
-
- rows, err := tx.QueryContext(ctx, `
- SELECT
- resource_id,
- name,
- type,
- instance_url,
- access_token
- FROM vcs
- WHERE `+strings.Join(where, " AND "),
- args...,
- )
- if err != nil {
- return nil, err
- }
- defer rows.Close()
- var vcsProviders []*VCSProviderMessage
- for rows.Next() {
- var vcsProvider VCSProviderMessage
- var vcsType string
- if err := rows.Scan(
- &vcsProvider.ResourceID,
- &vcsProvider.Title,
- &vcsType,
- &vcsProvider.InstanceURL,
- &vcsProvider.AccessToken,
- ); err != nil {
- return nil, err
- }
- vcsTypeValue, ok := storepb.VCSType_value[vcsType]
- if !ok {
- return nil, errors.Errorf("invalid vcs type %s", vcsType)
- }
- vcsProvider.Type = storepb.VCSType(vcsTypeValue)
- vcsProviders = append(vcsProviders, &vcsProvider)
- }
- if err := rows.Err(); err != nil {
- return nil, err
- }
- return vcsProviders, nil
-}
diff --git a/backend/tests/change_history_test.go b/backend/tests/change_history_test.go
index 069913228c..a9aea75797 100644
--- a/backend/tests/change_history_test.go
+++ b/backend/tests/change_history_test.go
@@ -9,7 +9,6 @@ import (
"github.com/stretchr/testify/require"
"github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/tests/fake"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -56,8 +55,7 @@ func TestFilterChangeHistoryByResources(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/data_source_test.go b/backend/tests/data_source_test.go
index 2be1bb566f..4fb4125512 100644
--- a/backend/tests/data_source_test.go
+++ b/backend/tests/data_source_test.go
@@ -19,8 +19,7 @@ func TestDataSource(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
@@ -136,8 +135,7 @@ func TestExternalSecretManager(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/environment_test.go b/backend/tests/environment_test.go
index d92e16a8ab..b57a25ecef 100644
--- a/backend/tests/environment_test.go
+++ b/backend/tests/environment_test.go
@@ -8,7 +8,6 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/types/known/fieldmaskpb"
- "github.com/bytebase/bytebase/backend/tests/fake"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -18,8 +17,7 @@ func TestDatabaseEnvironment(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/fake/azure.go b/backend/tests/fake/azure.go
deleted file mode 100644
index 9491898002..0000000000
--- a/backend/tests/fake/azure.go
+++ /dev/null
@@ -1,410 +0,0 @@
-package fake
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "io"
- "net"
- "net/http"
- "net/url"
- "strings"
-
- "github.com/labstack/echo/v4"
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/azure"
-)
-
-// Azure is a fake implementation of Azure VCS provider.
-type Azure struct {
- port int
- echo *echo.Echo
-
- client *http.Client
-
- nextWebhookID int
- repositories map[string]*azureRepositoryData
-}
-
-type azureRepositoryData struct {
- repository *azure.Repository
- webhooks []*azure.WebhookCreateOrUpdate
- // files is a map that the full file path is the key and the file content is the
- // value.
- files map[string]string
- // refs is the map for repository branch.
- // the map key is the branch ref, like "refs/heads/main".
- refs map[string]*azure.Branch
- commits map[string]struct {
- Changes []*azure.CommitChange
- }
-}
-
-// NewAzure creates a new fake implementation of Azure VCS provider.
-func NewAzure(port int) VCSProvider {
- e := newEchoServer()
- az := &Azure{
- port: port,
- echo: e,
- client: &http.Client{},
- nextWebhookID: 20210113,
- repositories: make(map[string]*azureRepositoryData),
- }
-
- g := e.Group("")
- g.GET("/_apis/profile/profiles/me", az.getProfile)
- g.GET("/_apis/accounts", az.listOrgs)
- g.GET("/:organization/_apis/git/repositories", az.listRepositories)
- g.POST("/:organization/_apis/hooks/subscriptions", az.createRepositoryWebhook)
- g.DELETE("/:organization/_apis/hooks/subscriptions/:subscription", az.deleteRepositoryWebhook)
-
- repo := e.Group("/:organization/:project/_apis/git/repositories/:repo")
- repo.GET("/stats/branches", az.getRepositoryBranch)
- repo.GET("/pullRequests/:pr/threads", az.listIssueComments)
- repo.POST("/pullRequests/:pr/threads", az.createIssueComment)
- repo.PATCH("/pullRequests/:pr/threads/:thread", az.updateIssueComment)
- repo.GET("/commits/:commit/changes", az.getCommitChanges)
- repo.GET("/items", az.readRepositoryFile)
-
- return az
-}
-
-func (*Azure) getResponse(c echo.Context, data any) error {
- buf, err := json.Marshal(data)
- if err != nil {
- return c.String(http.StatusInternalServerError, err.Error())
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (az *Azure) getProfile(c echo.Context) error {
- resp := &azure.Profile{
- PublicAlias: "mock-az-profile",
- }
- return az.getResponse(c, resp)
-}
-
-func (az *Azure) listOrgs(c echo.Context) error {
- type accountsResponse struct {
- Count int `json:"count"`
- Value []*azure.Organization `json:"value"`
- }
-
- resp := &accountsResponse{}
-
- for name := range az.repositories {
- parts := strings.Split(name, "/")
- if len(parts) != 3 {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("invalid repo name: %s", name))
- }
- resp.Value = append(resp.Value, &azure.Organization{
- AccountName: parts[0],
- })
- }
- resp.Count = len(resp.Value)
-
- return az.getResponse(c, resp)
-}
-
-func (az *Azure) listRepositories(c echo.Context) error {
- type listRepositoriesResponse struct {
- Count int `json:"count"`
- Value []*azure.Repository `json:"value"`
- }
-
- orgID := c.Param("organization")
- resp := &listRepositoriesResponse{}
- for name, item := range az.repositories {
- parts := strings.Split(name, "/")
- if len(parts) != 3 {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("invalid repo name: %s", name))
- }
- if parts[0] != orgID {
- continue
- }
- resp.Value = append(resp.Value, item.repository)
- }
- resp.Count = len(resp.Value)
-
- return az.getResponse(c, resp)
-}
-
-func (az *Azure) getCommitChanges(c echo.Context) error {
- r, err := az.validRepository(c)
- if err != nil {
- return err
- }
- commitID := c.Param("commit")
- if _, ok := r.commits[commitID]; !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("commit not found: %v", commitID))
- }
-
- return az.getResponse(c, r.commits[commitID])
-}
-
-func (*Azure) deleteRepositoryWebhook(c echo.Context) error {
- return c.String(http.StatusNoContent, "")
-}
-
-func (az *Azure) createRepositoryWebhook(c echo.Context) error {
- body, err := io.ReadAll(c.Request().Body)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to read request body for creating repository webhook: %v", err))
- }
-
- var webhookCreate azure.WebhookCreateOrUpdate
- if err = json.Unmarshal(body, &webhookCreate); err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to unmarshal request body for creating repository webhook: %v", err))
- }
-
- orgID := c.Param("organization")
- projectID := webhookCreate.PublisherInputs.ProjectID
- repositoryID := webhookCreate.PublisherInputs.Repository
- repositoryName := fmt.Sprintf("%s/%s/%s", orgID, projectID, repositoryID)
- r, ok := az.repositories[repositoryName]
- if !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("Azure repository %q does not exist", repositoryName))
- }
-
- r.webhooks = append(r.webhooks, &webhookCreate)
-
- type createServiceResponse struct {
- ID string `json:"id"`
- }
- buf, err := json.Marshal(createServiceResponse{ID: fmt.Sprintf("%d", az.nextWebhookID)})
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for creating repository webhook: %v", err))
- }
- az.nextWebhookID++
- return c.String(http.StatusCreated, string(buf))
-}
-
-func (az *Azure) readRepositoryFile(c echo.Context) error {
- r, err := az.validRepository(c)
- if err != nil {
- return err
- }
-
- filePathEscaped := c.QueryParam("path")
- filePath, err := url.QueryUnescape(filePathEscaped)
- if err != nil {
- return c.String(http.StatusBadRequest, fmt.Sprintf("failed to unescape file path %q: %v", filePathEscaped, err))
- }
-
- content, ok := r.files[filePath]
- if !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("file %q not found", filePath))
- }
-
- return c.String(http.StatusOK, content)
-}
-
-func (az *Azure) getRepositoryBranch(c echo.Context) error {
- r, err := az.validRepository(c)
- if err != nil {
- return err
- }
-
- branchNameEscaped := c.QueryParam("name")
- branchName, err := url.QueryUnescape(branchNameEscaped)
- if err != nil {
- return c.String(http.StatusBadRequest, fmt.Sprintf("failed to unescape branch %q: %v", branchNameEscaped, err))
- }
- if _, ok := r.refs[fmt.Sprintf("refs/heads/%s", branchName)]; !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("branch not found: %v", branchName))
- }
-
- return az.getResponse(c, r.refs[fmt.Sprintf("refs/heads/%s", branchName)])
-}
-
-func (*Azure) listIssueComments(c echo.Context) error {
- type listComment struct {
- Value []*azure.PullRequestThread `json:"value"`
- }
-
- buf, err := json.Marshal(listComment{})
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for list comments: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (*Azure) createIssueComment(echo.Context) error {
- return nil
-}
-
-func (*Azure) updateIssueComment(echo.Context) error {
- return nil
-}
-
-func (az *Azure) validRepository(c echo.Context) (*azureRepositoryData, error) {
- repositoryID := fmt.Sprintf("%s/%s/%s", c.Param("organization"), c.Param("project"), c.Param("repo"))
- r, ok := az.repositories[repositoryID]
- if !ok {
- return nil, c.String(http.StatusNotFound, fmt.Sprintf("Azure repository %q does not exist", repositoryID))
- }
-
- return r, nil
-}
-
-// Run starts the Azure VCS provider server.
-func (az *Azure) Run() error {
- return az.echo.Start(fmt.Sprintf(":%d", az.port))
-}
-
-// Close shuts down the Azure VCS provider server.
-func (az *Azure) Close() error {
- return az.echo.Close()
-}
-
-// ListenerAddr returns the Azure VCS provider server listener address.
-func (az *Azure) ListenerAddr() net.Addr {
- return az.echo.ListenerAddr()
-}
-
-// CreateRepository creates a Azure repository with given ID.
-func (az *Azure) CreateRepository(repository *vcs.Repository) error {
- parts := strings.Split(repository.ID, "/")
- if len(parts) != 3 {
- return errors.Errorf("invalid repo id: %s", repository.ID)
- }
- az.repositories[repository.FullPath] = &azureRepositoryData{
- repository: &azure.Repository{
- ID: parts[2],
- Name: repository.Name,
- Project: &azure.Project{
- State: "wellFormed",
- },
- },
- files: make(map[string]string),
- refs: map[string]*azure.Branch{},
- commits: make(map[string]struct{ Changes []*azure.CommitChange }),
- }
- return nil
-}
-
-// CreateBranch creates a new branch with the given name.
-func (az *Azure) CreateBranch(id, branchName string) error {
- pd, ok := az.repositories[id]
- if !ok {
- return errors.Errorf("repo %q doesn't exist", id)
- }
-
- if _, ok := pd.refs[fmt.Sprintf("refs/heads/%s", branchName)]; ok {
- return errors.Errorf("branch %q already exists", branchName)
- }
-
- pd.refs[fmt.Sprintf("refs/heads/%s", branchName)] = &azure.Branch{
- Name: branchName,
- Commit: &azure.BranchCommit{
- CommitID: "fake_azure_commit_sha",
- },
- }
-
- return nil
-}
-
-// SendWebhookPush sends out a webhook for a push event for the Azure
-// repository using given payload.
-func (az *Azure) SendWebhookPush(repositoryID string, payload []byte) error {
- r, ok := az.repositories[repositoryID]
- if !ok {
- return errors.Errorf("Azure repository %q does not exist", repositoryID)
- }
-
- var event azure.PullRequestEvent
- if err := json.Unmarshal(payload, &event); err != nil {
- return errors.Wrapf(err, "failed to unmarshal event")
- }
-
- // Trigger all webhooks
- for _, webhook := range r.webhooks {
- if event.EventType != azure.PullRequestEventType(webhook.EventType) {
- continue
- }
- if err := func() error {
- url := webhook.ConsumerInputs.URL
- req, err := http.NewRequest("POST", url, bytes.NewReader(payload))
- if err != nil {
- return errors.Wrapf(err, "failed to create a new POST request to %q", url)
- }
-
- headers := strings.Split(webhook.ConsumerInputs.HTTPHeaders, ": ")
- req.Header.Set(headers[0], headers[1])
-
- resp, err := az.client.Do(req)
- if err != nil {
- return errors.Wrapf(err, "failed to send POST request to %q", url)
- }
- defer resp.Body.Close()
- body, err := io.ReadAll(resp.Body)
- if err != nil {
- return errors.Wrap(err, "failed to read response body")
- }
- if resp.StatusCode != http.StatusOK {
- return errors.Errorf("unexpected response status code %d, body: %s", resp.StatusCode, body)
- }
- az.echo.Logger.Infof("SendWebhookPush response body %s\n", body)
- return nil
- }(); err != nil {
- return err
- }
- }
- return nil
-}
-
-// AddFiles adds given files to the Azure repository.
-func (az *Azure) AddFiles(repositoryID string, files map[string]string) error {
- r, ok := az.repositories[repositoryID]
- if !ok {
- return errors.Errorf("Azure repository %q does not exist", repositoryID)
- }
-
- // Save or overwrite files
- for path, content := range files {
- filePath := az.validFilePath(path)
- r.files[filePath] = content
- }
- return nil
-}
-
-// AddPullRequest creates a new pull request and add changed files to it.
-func (az *Azure) AddPullRequest(repositoryID string, commitID int, files []*vcs.PullRequestFile) error {
- r, ok := az.repositories[repositoryID]
- if !ok {
- return errors.Errorf("repository %q does not exist", repositoryID)
- }
-
- changes := []*azure.CommitChange{}
- for _, file := range files {
- changeType := ""
- if file.IsDeleted {
- changeType = "delete"
- }
- changes = append(changes, &azure.CommitChange{
- ChangeType: changeType,
- Item: &azure.CommitChangeItem{
- CommitID: fmt.Sprintf("%d", commitID),
- Path: az.validFilePath(file.Path),
- GitObjectType: "blob",
- },
- })
- }
-
- r.commits[fmt.Sprintf("%d", commitID)] = struct {
- Changes []*azure.CommitChange
- }{
- Changes: changes,
- }
-
- return nil
-}
-
-func (*Azure) validFilePath(filePath string) string {
- if !strings.HasPrefix(filePath, "/") {
- return fmt.Sprintf("/%s", filePath)
- }
- return filePath
-}
diff --git a/backend/tests/fake/bitbucket.go b/backend/tests/fake/bitbucket.go
deleted file mode 100644
index a3ec2d2f5d..0000000000
--- a/backend/tests/fake/bitbucket.go
+++ /dev/null
@@ -1,364 +0,0 @@
-package fake
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "io"
- "net"
- "net/http"
- "net/url"
- "strconv"
- "time"
-
- "github.com/labstack/echo/v4"
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/bitbucket"
-)
-
-// Bitbucket is a fake implementation of Bitbucket VCS provider.
-type Bitbucket struct {
- port int
- echo *echo.Echo
-
- client *http.Client
-
- nextWebhookID int
- repositories map[string]*bitbucketRepositoryData
-}
-
-type bitbucketRepositoryData struct {
- repository *bitbucket.Repository
- webhooks []*bitbucket.WebhookCreateOrUpdate
- // files is a map that the full file path is the key and the file content is the
- // value.
- files map[string]string
- // refs is the map for repository branch. The map key is the branch ref, like
- // "refs/heads/main".
- refs map[string]*bitbucket.Branch
- // pullRequests is the map for repository pull request.
- // the map key is the pull request id.
- pullRequests map[int]struct {
- Files []*bitbucket.CommitDiffStat
- }
-}
-
-// NewBitbucket creates a new fake implementation of Bitbucket VCS provider.
-func NewBitbucket(port int) VCSProvider {
- e := newEchoServer()
- bb := &Bitbucket{
- port: port,
- echo: e,
- client: &http.Client{},
- nextWebhookID: 20210113,
- repositories: make(map[string]*bitbucketRepositoryData),
- }
-
- g := e.Group("/2.0")
- g.GET("/user/permissions/repositories", bb.listRepositories)
- g.POST("/repositories/:owner/:repo/hooks", bb.createRepositoryWebhook)
- g.DELETE("/repositories/:owner/:repo/hooks/:hook", bb.deleteRepositoryWebhook)
- g.GET("/repositories/:owner/:repo/commit/:commitID", bb.getRepositoryCommit)
- g.GET("/repositories/:owner/:repo/src/:ref/:filepath", bb.getRepositoryContent)
- g.GET("/repositories/:owner/:repo/refs/branches/:branchName", bb.getRepositoryBranch)
- g.GET("/repositories/:owner/:repo/pullrequests/:prID/diffstat", bb.listPullRequestFile)
- g.GET("/repositories/:owner/:repo/pullrequests/:prID/comments", bb.listPullRequestComment)
- g.POST("/repositories/:owner/:repo/pullrequests/:prID/comments", bb.createPullRequestComment)
- g.PUT("/repositories/:owner/:repo/pullrequests/:prID/comments/:comment", bb.updatePullRequestComment)
- return bb
-}
-
-func (bb *Bitbucket) listRepositories(c echo.Context) error {
- var resp struct {
- Values []*bitbucket.RepositoryPermission `json:"values"`
- Next string `json:"next"`
- }
-
- for _, repoData := range bb.repositories {
- resp.Values = append(resp.Values, &bitbucket.RepositoryPermission{
- Repository: repoData.repository,
- })
- }
- buf, err := json.Marshal(resp)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for list repository: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (*Bitbucket) deleteRepositoryWebhook(c echo.Context) error {
- return c.String(http.StatusOK, "")
-}
-
-func (bb *Bitbucket) createRepositoryWebhook(c echo.Context) error {
- r, err := bb.validRepository(c)
- if err != nil {
- return err
- }
-
- body, err := io.ReadAll(c.Request().Body)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to read request body for creating repository webhook: %v", err))
- }
-
- var webhookCreate bitbucket.WebhookCreateOrUpdate
- if err = json.Unmarshal(body, &webhookCreate); err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to unmarshal request body for creating repository webhook: %v", err))
- }
- r.webhooks = append(r.webhooks, &webhookCreate)
-
- buf, err := json.Marshal(bitbucket.Webhook{UUID: strconv.Itoa(bb.nextWebhookID)})
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for creating repository webhook: %v", err))
- }
- bb.nextWebhookID++
- return c.String(http.StatusCreated, string(buf))
-}
-
-func (bb *Bitbucket) getRepositoryCommit(c echo.Context) error {
- if _, err := bb.validRepository(c); err != nil {
- return err
- }
-
- buf, err := json.Marshal(
- bitbucket.Commit{
- Hash: "fake_bitbucket_commit_sha",
- Author: bitbucket.CommitAuthor{
- User: bitbucket.User{
- Nickname: "fake_bitbucket_author",
- },
- },
- Date: time.Now(),
- },
- )
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for getting repository commit: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (bb *Bitbucket) getRepositoryContent(c echo.Context) error {
- r, err := bb.validRepository(c)
- if err != nil {
- return err
- }
-
- filePathEscaped := c.Param("filepath")
- filePath, err := url.QueryUnescape(filePathEscaped)
- if err != nil {
- return c.String(http.StatusBadRequest, fmt.Sprintf("failed to unescape file path %q: %v", filePathEscaped, err))
- }
-
- content, ok := r.files[filePath]
- if !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("file %q not found", filePath))
- }
- return c.String(http.StatusOK, content)
-}
-
-func (bb *Bitbucket) getRepositoryBranch(c echo.Context) error {
- r, err := bb.validRepository(c)
- if err != nil {
- return err
- }
-
- branchName := c.Param("branchName")
- if _, ok := r.refs[fmt.Sprintf("refs/heads/%s", branchName)]; !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("branch not found: %v", branchName))
- }
-
- buf, err := json.Marshal(r.refs[fmt.Sprintf("refs/heads/%s", branchName)])
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for getting repository branch: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (bb *Bitbucket) validRepository(c echo.Context) (*bitbucketRepositoryData, error) {
- repositoryID := fmt.Sprintf("%s/%s", c.Param("owner"), c.Param("repo"))
- r, ok := bb.repositories[repositoryID]
- if !ok {
- return nil, c.String(http.StatusNotFound, fmt.Sprintf("Bitbucket repository %q does not exist", repositoryID))
- }
-
- return r, nil
-}
-
-// Run starts the Bitbucket VCS provider server.
-func (bb *Bitbucket) Run() error {
- return bb.echo.Start(fmt.Sprintf(":%d", bb.port))
-}
-
-// Close shuts down the Bitbucket VCS provider server.
-func (bb *Bitbucket) Close() error {
- return bb.echo.Close()
-}
-
-// ListenerAddr returns the Bitbucket VCS provider server listener address.
-func (bb *Bitbucket) ListenerAddr() net.Addr {
- return bb.echo.ListenerAddr()
-}
-
-// CreateRepository creates a Bitbucket repository with given ID.
-func (bb *Bitbucket) CreateRepository(repository *vcs.Repository) error {
- bb.repositories[repository.ID] = &bitbucketRepositoryData{
- repository: &bitbucket.Repository{
- UUID: repository.ID,
- Name: repository.Name,
- FullName: repository.FullPath,
- },
- files: make(map[string]string),
- refs: map[string]*bitbucket.Branch{},
- pullRequests: map[int]struct {
- Files []*bitbucket.CommitDiffStat
- }{},
- }
- return nil
-}
-
-// CreateBranch creates a new branch with the given name.
-func (bb *Bitbucket) CreateBranch(id, branchName string) error {
- pd, ok := bb.repositories[id]
- if !ok {
- return errors.Errorf("bitbucket project %q doesn't exist", id)
- }
-
- if _, ok := pd.refs[fmt.Sprintf("refs/heads/%s", branchName)]; ok {
- return errors.Errorf("branch %q already exists", branchName)
- }
-
- pd.refs[fmt.Sprintf("refs/heads/%s", branchName)] = &bitbucket.Branch{
- Name: branchName,
- Target: bitbucket.Target{
- Hash: "fake_bitbucket_commit_sha",
- },
- }
- return nil
-}
-
-// SendWebhookPush sends out a webhook for a push event for the Bitbucket
-// repository using given payload.
-func (bb *Bitbucket) SendWebhookPush(repositoryID string, payload []byte) error {
- r, ok := bb.repositories[repositoryID]
- if !ok {
- return errors.Errorf("Bitbucket repository %q does not exist", repositoryID)
- }
-
- // Trigger all webhooks
- for _, webhook := range r.webhooks {
- if err := func() error {
- req, err := http.NewRequest("POST", webhook.URL, bytes.NewReader(payload))
- if err != nil {
- return errors.Wrapf(err, "failed to create a new POST request to %q", webhook.URL)
- }
- req.Header.Set("X-Event-Key", "pullrequest:fulfilled")
- resp, err := bb.client.Do(req)
- if err != nil {
- return errors.Wrapf(err, "failed to send POST request to %q", webhook.URL)
- }
- defer resp.Body.Close()
- body, err := io.ReadAll(resp.Body)
- if err != nil {
- return errors.Wrap(err, "failed to read response body")
- }
- if resp.StatusCode != http.StatusOK {
- return errors.Errorf("unexpected response status code %d, body: %s", resp.StatusCode, body)
- }
- bb.echo.Logger.Infof("SendWebhookPush response body %s\n", body)
- return nil
- }(); err != nil {
- return err
- }
- }
- return nil
-}
-
-// AddFiles adds given files to the Bitbucket repository.
-func (bb *Bitbucket) AddFiles(repositoryID string, files map[string]string) error {
- r, ok := bb.repositories[repositoryID]
- if !ok {
- return errors.Errorf("Bitbucket repository %q does not exist", repositoryID)
- }
-
- // Save or overwrite files
- for path, content := range files {
- r.files[path] = content
- }
- return nil
-}
-
-// AddPullRequest creates a new pull request and add changed files to it.
-func (bb *Bitbucket) AddPullRequest(repositoryID string, prID int, files []*vcs.PullRequestFile) error {
- r, ok := bb.repositories[repositoryID]
- if !ok {
- return errors.Errorf("Bitbucket repository %q does not exist", repositoryID)
- }
- var pullRequestFiles []*bitbucket.CommitDiffStat
- for _, file := range files {
- status := "added"
- if file.IsDeleted {
- status = "removed"
- }
- pullRequestFiles = append(pullRequestFiles, &bitbucket.CommitDiffStat{
- Status: status,
- New: bitbucket.CommitFile{
- Path: file.Path,
- },
- })
- }
-
- r.pullRequests[prID] = struct {
- Files []*bitbucket.CommitDiffStat
- }{
- Files: pullRequestFiles,
- }
- return nil
-}
-
-func (bb *Bitbucket) listPullRequestFile(c echo.Context) error {
- r, err := bb.validRepository(c)
- if err != nil {
- return err
- }
-
- prNumber, err := strconv.Atoi(c.Param("prID"))
- if err != nil {
- return c.String(http.StatusBadRequest, fmt.Sprintf("The pull request id is invalid: %v", c.Param("prID")))
- }
-
- pullRequest, ok := r.pullRequests[prNumber]
- if !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("Cannot found the pull request: %v", c.Param("prID")))
- }
-
- rep := bitbucket.PullRequestResponse{
- Values: pullRequest.Files,
- }
-
- buf, err := json.Marshal(rep)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (*Bitbucket) createPullRequestComment(echo.Context) error {
- return nil
-}
-
-func (*Bitbucket) updatePullRequestComment(echo.Context) error {
- return nil
-}
-
-func (*Bitbucket) listPullRequestComment(c echo.Context) error {
- type listComment struct {
- Values []*bitbucket.Comment `json:"values"`
- }
- buf, err := json.Marshal(listComment{})
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
diff --git a/backend/tests/fake/github.go b/backend/tests/fake/github.go
deleted file mode 100644
index 3552de7ec8..0000000000
--- a/backend/tests/fake/github.go
+++ /dev/null
@@ -1,385 +0,0 @@
-package fake
-
-import (
- "bytes"
- "crypto/hmac"
- "crypto/sha256"
- "encoding/hex"
- "encoding/json"
- "fmt"
- "io"
- "net"
- "net/http"
- "net/url"
- "strconv"
- "time"
-
- "github.com/labstack/echo/v4"
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/github"
-)
-
-// GitHub is a fake implementation of GitHub VCS provider.
-type GitHub struct {
- port int
- echo *echo.Echo
-
- client *http.Client
-
- nextWebhookID int
- repositories map[string]*githubRepositoryData
-}
-
-type githubRepositoryData struct {
- repository *github.Repository
- webhooks []*github.WebhookCreateOrUpdate
- // files is a map that the full file path is the key and the file content is the
- // value.
- files map[string]string
- // refs is the map for repository branch.
- // the map key is the branch ref, like "refs/heads/main".
- refs map[string]*github.Branch
- // pullRequests is the map for repository pull request.
- // the map key is the pull request id.
- pullRequests map[int]struct {
- Files []*github.PullRequestFile
- *github.PullRequest
- }
-}
-
-// NewGitHub creates a new fake implementation of GitHub VCS provider.
-func NewGitHub(port int) VCSProvider {
- e := newEchoServer()
- gh := &GitHub{
- port: port,
- echo: e,
- client: &http.Client{},
- nextWebhookID: 20210113,
- repositories: make(map[string]*githubRepositoryData),
- }
-
- g := e.Group("/api/v3")
- g.GET("/user/repos", gh.listRepositories)
- g.POST("/repos/:owner/:repo/hooks", gh.createRepositoryWebhook)
- g.DELETE("/repos/:owner/:repo/hooks/:hook", gh.deleteRepositoryWebhook)
- g.GET("/repos/:owner/:repo/git/commits/:commitID", gh.getRepositoryCommit)
- g.GET("/repos/:owner/:repo/contents/:filePath", gh.readRepositoryFile)
- g.GET("/repos/:owner/:repo/git/ref/heads/:branchName", gh.getRepositoryBranch)
- g.GET("/repos/:owner/:repo/pulls/:prID/files", gh.listPullRequestFile)
- g.GET("/repos/:owner/:repo/issues/:prID/comments", gh.listIssueComment)
- g.POST("/repos/:owner/:repo/issues/:prID/comments", gh.createIssueComment)
- g.PATCH("/repos/:owner/:repo/issues/:prID/comments", gh.updateIssueComment)
- return gh
-}
-
-func (gh *GitHub) listRepositories(c echo.Context) error {
- repoList := []*github.Repository{}
- for _, repoData := range gh.repositories {
- repoList = append(repoList, repoData.repository)
- }
- buf, err := json.Marshal(repoList)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for list repository: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (*GitHub) deleteRepositoryWebhook(c echo.Context) error {
- return c.String(http.StatusOK, "")
-}
-
-func (gh *GitHub) createRepositoryWebhook(c echo.Context) error {
- r, err := gh.validRepository(c)
- if err != nil {
- return err
- }
-
- body, err := io.ReadAll(c.Request().Body)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to read request body for creating repository webhook: %v", err))
- }
-
- var webhookCreate github.WebhookCreateOrUpdate
- if err = json.Unmarshal(body, &webhookCreate); err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to unmarshal request body for creating repository webhook: %v", err))
- }
- r.webhooks = append(r.webhooks, &webhookCreate)
-
- buf, err := json.Marshal(github.WebhookInfo{ID: gh.nextWebhookID})
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for creating repository webhook: %v", err))
- }
- gh.nextWebhookID++
- return c.String(http.StatusCreated, string(buf))
-}
-
-func (gh *GitHub) getRepositoryCommit(c echo.Context) error {
- if _, err := gh.validRepository(c); err != nil {
- return err
- }
-
- buf, err := json.Marshal(
- github.Commit{
- SHA: "fake_github_commit_sha",
- Author: github.CommitAuthor{
- Date: time.Now(),
- Name: "fake_github_author",
- },
- },
- )
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for getting repository commit: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (gh *GitHub) readRepositoryFile(c echo.Context) error {
- r, err := gh.validRepository(c)
- if err != nil {
- return err
- }
-
- filePathEscaped := c.Param("filePath")
- filePath, err := url.QueryUnescape(filePathEscaped)
- if err != nil {
- return c.String(http.StatusBadRequest, fmt.Sprintf("failed to unescape file path %q: %v", filePathEscaped, err))
- }
-
- content, ok := r.files[filePath]
- if !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("file %q not found", filePath))
- }
-
- if c.Request().Header.Get("Accept") == "application/vnd.github.raw" {
- return c.String(http.StatusOK, content)
- }
-
- return c.String(http.StatusBadRequest, "must accept vnd.github.raw")
-}
-
-func (gh *GitHub) getRepositoryBranch(c echo.Context) error {
- r, err := gh.validRepository(c)
- if err != nil {
- return err
- }
-
- branchName := c.Param("branchName")
- if _, ok := r.refs[fmt.Sprintf("refs/heads/%s", branchName)]; !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("branch not found: %v", branchName))
- }
-
- buf, err := json.Marshal(r.refs[fmt.Sprintf("refs/heads/%s", branchName)])
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for getting repository branch: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (gh *GitHub) listPullRequestFile(c echo.Context) error {
- r, err := gh.validRepository(c)
- if err != nil {
- return err
- }
-
- prNumber, err := strconv.Atoi(c.Param("prID"))
- if err != nil {
- return c.String(http.StatusBadRequest, fmt.Sprintf("The pull request id is invalid: %v", c.Param("prID")))
- }
-
- pullRequest, ok := r.pullRequests[prNumber]
- if !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("Cannot found the pull request: %v", c.Param("prID")))
- }
-
- page, err := strconv.Atoi(c.QueryParam("page"))
- if err != nil {
- return c.String(http.StatusBadRequest, fmt.Sprintf("Invalid page parameter %v", c.Param("page")))
- }
-
- prFiles := []*github.PullRequestFile{}
- if page == 1 {
- prFiles = pullRequest.Files
- }
-
- buf, err := json.Marshal(prFiles)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (*GitHub) createIssueComment(echo.Context) error {
- return nil
-}
-
-func (*GitHub) updateIssueComment(echo.Context) error {
- return nil
-}
-
-func (*GitHub) listIssueComment(c echo.Context) error {
- comments := []github.Comment{}
- buf, err := json.Marshal(comments)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (gh *GitHub) validRepository(c echo.Context) (*githubRepositoryData, error) {
- repositoryID := fmt.Sprintf("%s/%s", c.Param("owner"), c.Param("repo"))
- r, ok := gh.repositories[repositoryID]
- if !ok {
- return nil, c.String(http.StatusNotFound, fmt.Sprintf("GitHub repository %q does not exist", repositoryID))
- }
-
- return r, nil
-}
-
-// Run starts the GitHub VCS provider server.
-func (gh *GitHub) Run() error {
- return gh.echo.Start(fmt.Sprintf(":%d", gh.port))
-}
-
-// Close shuts down the GitHub VCS provider server.
-func (gh *GitHub) Close() error {
- return gh.echo.Close()
-}
-
-// ListenerAddr returns the GitHub VCS provider server listener address.
-func (gh *GitHub) ListenerAddr() net.Addr {
- return gh.echo.ListenerAddr()
-}
-
-// CreateRepository creates a GitHub repository with given ID.
-func (gh *GitHub) CreateRepository(repository *vcs.Repository) error {
- gh.repositories[repository.FullPath] = &githubRepositoryData{
- repository: &github.Repository{
- ID: int64(len(gh.repositories) + 1),
- Name: repository.Name,
- FullName: repository.FullPath,
- },
- files: make(map[string]string),
- refs: map[string]*github.Branch{},
- pullRequests: map[int]struct {
- Files []*github.PullRequestFile
- *github.PullRequest
- }{},
- }
- return nil
-}
-
-// CreateBranch creates a new branch with the given name.
-func (gh *GitHub) CreateBranch(id, branchName string) error {
- pd, ok := gh.repositories[id]
- if !ok {
- return errors.Errorf("github project %q doesn't exist", id)
- }
-
- if _, ok := pd.refs[fmt.Sprintf("refs/heads/%s", branchName)]; ok {
- return errors.Errorf("branch %q already exists", branchName)
- }
-
- pd.refs[fmt.Sprintf("refs/heads/%s", branchName)] = &github.Branch{
- Ref: fmt.Sprintf("refs/heads/%s", branchName),
- Object: github.ReferenceObject{
- SHA: "fake_github_commit_sha",
- },
- }
-
- return nil
-}
-
-// SendWebhookPush sends out a webhook for a push event for the GitHub
-// repository using given payload.
-func (gh *GitHub) SendWebhookPush(repositoryID string, payload []byte) error {
- r, ok := gh.repositories[repositoryID]
- if !ok {
- return errors.Errorf("GitHub repository %q does not exist", repositoryID)
- }
-
- // Trigger all webhooks
- for _, webhook := range r.webhooks {
- if err := func() error {
- req, err := http.NewRequest("POST", webhook.Config.URL, bytes.NewReader(payload))
- if err != nil {
- return errors.Wrapf(err, "failed to create a new POST request to %q", webhook.Config.URL)
- }
-
- m := hmac.New(sha256.New, []byte(webhook.Config.Secret))
- if _, err := m.Write(payload); err != nil {
- return errors.Wrap(err, "failed to calculate SHA256 of the webhook secret")
- }
- signature := "sha256=" + hex.EncodeToString(m.Sum(nil))
- req.Header.Set("X-Hub-Signature-256", signature)
- req.Header.Set("X-GitHub-Event", "pull_request")
-
- resp, err := gh.client.Do(req)
- if err != nil {
- return errors.Wrapf(err, "failed to send POST request to %q", webhook.Config.URL)
- }
- defer resp.Body.Close()
- body, err := io.ReadAll(resp.Body)
- if err != nil {
- return errors.Wrap(err, "failed to read response body")
- }
- if resp.StatusCode != http.StatusOK {
- return errors.Errorf("unexpected response status code %d, body: %s", resp.StatusCode, body)
- }
- gh.echo.Logger.Infof("SendWebhookPush response body %s\n", body)
- return nil
- }(); err != nil {
- return err
- }
- }
- return nil
-}
-
-// AddFiles adds given files to the GitHub repository.
-func (gh *GitHub) AddFiles(repositoryID string, files map[string]string) error {
- r, ok := gh.repositories[repositoryID]
- if !ok {
- return errors.Errorf("GitHub repository %q does not exist", repositoryID)
- }
-
- // Save or overwrite files
- for path, content := range files {
- r.files[path] = content
- }
- return nil
-}
-
-// AddPullRequest creates a new pull request and add changed files to it.
-func (gh *GitHub) AddPullRequest(repositoryID string, prID int, files []*vcs.PullRequestFile) error {
- r, ok := gh.repositories[repositoryID]
- if !ok {
- return errors.Errorf("github repository %q does not exist", repositoryID)
- }
-
- pullRequestFiles := []*github.PullRequestFile{}
- for _, file := range files {
- status := ""
- if file.IsDeleted {
- status = "removed"
- }
- pullRequestFiles = append(pullRequestFiles, &github.PullRequestFile{
- FileName: file.Path,
- Status: status,
- SHA: file.LastCommitID,
- ContentsURL: fmt.Sprintf("https://github.com/%s/%s?ref=%s", repositoryID, url.QueryEscape(file.Path), file.LastCommitID),
- })
- }
-
- r.pullRequests[prID] = struct {
- Files []*github.PullRequestFile
- *github.PullRequest
- }{
- Files: pullRequestFiles,
- PullRequest: &github.PullRequest{
- HTMLURL: fmt.Sprintf("https://github.com/%s/pull/%d", repositoryID, prID),
- },
- }
-
- return nil
-}
diff --git a/backend/tests/fake/gitlab.go b/backend/tests/fake/gitlab.go
deleted file mode 100644
index 8d294906e8..0000000000
--- a/backend/tests/fake/gitlab.go
+++ /dev/null
@@ -1,460 +0,0 @@
-package fake
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "io"
- "net"
- "net/http"
- "net/url"
- "path/filepath"
- "strconv"
- "time"
-
- "github.com/labstack/echo/v4"
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/gitlab"
-)
-
-// GitLab is a fake implementation of GitLab VCS provider.
-type GitLab struct {
- port int
- echo *echo.Echo
-
- client *http.Client
-
- nextWebhookID int
- projects map[string]*projectData
-}
-
-type projectData struct {
- repository *gitlab.Repository
- webhooks []*gitlab.WebhookCreate
- // files is a map that the full file path is the key and the file content is the
- // value.
- files map[string]string
- // branches is the map for project branch.
- // the map key is the project name, like "refs/heads/main".
- branches map[string]*gitlab.Branch
- // mergeRequests is the map for project merge request.
- // the map key is the merge request id.
- mergeRequests map[int]struct {
- *gitlab.MergeRequestChange
- *gitlab.MergeRequest
- }
-}
-
-// NewGitLab creates a new fake implementation of GitLab VCS provider.
-func NewGitLab(port int) VCSProvider {
- e := newEchoServer()
- gl := &GitLab{
- port: port,
- echo: e,
- client: &http.Client{},
- nextWebhookID: 20210113,
- projects: map[string]*projectData{},
- }
-
- // Routes
- projectGroup := e.Group("/api/v4")
- projectGroup.GET("/projects", gl.listRepositories)
- projectGroup.POST("/projects/:id/hooks", gl.createProjectHook)
- projectGroup.DELETE("/projects/:id/hooks/:hook", gl.deleteRepositoryWebhook)
- projectGroup.GET("/projects/:id/repository/commits/:commitID", gl.getFakeCommit)
- projectGroup.GET("/projects/:id/repository/files/:filePath/raw", gl.readProjectFile)
- projectGroup.GET("/projects/:id/repository/branches/:branchName", gl.getProjectBranch)
- projectGroup.POST("/projects/:id/repository/branches", gl.createProjectBranch)
- projectGroup.POST("/projects/:id/merge_requests", gl.createProjectPullRequest)
- projectGroup.GET("/projects/:id/merge_requests/:mrID/changes", gl.getMergeRequestChanges)
- projectGroup.GET("/projects/:id/merge_requests/:mrID/notes", gl.listMergeRequestComment)
- projectGroup.POST("/projects/:id/merge_requests/:mrID/notes", gl.createMergeRequestComment)
- projectGroup.PUT("/projects/:id/merge_requests/:mrID/notes/:note", gl.updateMergeRequestComment)
-
- return gl
-}
-
-// Run starts the GitLab VCS provider server.
-func (gl *GitLab) Run() error {
- return gl.echo.Start(fmt.Sprintf(":%d", gl.port))
-}
-
-// Close shuts down the GitLab VCS provider server.
-func (gl *GitLab) Close() error {
- return gl.echo.Close()
-}
-
-// ListenerAddr returns the GitLab VCS provider server listener address.
-func (gl *GitLab) ListenerAddr() net.Addr {
- return gl.echo.ListenerAddr()
-}
-
-// CreateRepository creates a GitLab project with given ID.
-func (gl *GitLab) CreateRepository(repository *vcs.Repository) error {
- // GitLab repo id should be int64.
- id, err := strconv.ParseInt(repository.ID, 10, 64)
- if err != nil {
- return err
- }
- gl.projects[repository.ID] = &projectData{
- repository: &gitlab.Repository{
- ID: id,
- Name: repository.Name,
- PathWithNamespace: repository.FullPath,
- },
- files: map[string]string{},
- branches: map[string]*gitlab.Branch{},
- mergeRequests: map[int]struct {
- *gitlab.MergeRequestChange
- *gitlab.MergeRequest
- }{},
- }
- return nil
-}
-
-// CreateBranch creates a new branch with the given name.
-func (gl *GitLab) CreateBranch(id, branchName string) error {
- pd, ok := gl.projects[id]
- if !ok {
- return errors.Errorf("gitlab project %q doesn't exist", id)
- }
-
- if _, ok := pd.branches[fmt.Sprintf("refs/heads/%s", branchName)]; ok {
- return errors.Errorf("branch %q already exists", branchName)
- }
-
- pd.branches[fmt.Sprintf("refs/heads/%s", branchName)] = &gitlab.Branch{
- Name: branchName,
- Commit: gitlab.Commit{
- ID: "fake_gitlab_commit_id",
- AuthorName: "fake_gitlab_bot",
- CreatedAt: time.Now(),
- },
- }
- return nil
-}
-
-func (gl *GitLab) listRepositories(c echo.Context) error {
- repoList := []*gitlab.Repository{}
- for _, repoData := range gl.projects {
- repoList = append(repoList, repoData.repository)
- }
- buf, err := json.Marshal(repoList)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for list repository: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (*GitLab) deleteRepositoryWebhook(c echo.Context) error {
- return c.String(http.StatusOK, "")
-}
-
-// createProjectHook creates a project webhook.
-func (gl *GitLab) createProjectHook(c echo.Context) error {
- pd, err := gl.validProject(c)
- if err != nil {
- return err
- }
-
- c.Logger().Infof("Create webhook for project %q", c.Param("id"))
- b, err := io.ReadAll(c.Request().Body)
- if err != nil {
- return errors.Wrap(err, "failed to read create project hook request body")
- }
- webhookCreate := &gitlab.WebhookCreate{}
- if err := json.Unmarshal(b, webhookCreate); err != nil {
- return errors.Wrap(err, "failed to unmarshal create project hook request body")
- }
-
- pd.webhooks = append(pd.webhooks, webhookCreate)
-
- gl.nextWebhookID++
-
- return c.JSON(http.StatusCreated, &gitlab.WebhookInfo{
- ID: gl.nextWebhookID,
- })
-}
-
-// readProjectFile reads a project file.
-func (gl *GitLab) readProjectFile(c echo.Context) error {
- pd, err := gl.validProject(c)
- if err != nil {
- return err
- }
-
- filePathEscaped := c.Param("filePath")
- filePath, err := url.QueryUnescape(filePathEscaped)
- if err != nil {
- return c.String(http.StatusBadRequest, fmt.Sprintf("failed to query unescape %q, error: %v", filePathEscaped, err))
- }
-
- fileName := filepath.Base(filePath)
-
- content, ok := pd.files[filePath]
- if !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("file %q not found", filePath))
- }
-
- c.Response().Header().Set("x-gitlab-file-name", fileName)
- c.Response().Header().Set("x-gitlab-file-path", filePath)
- c.Response().Header().Set("x-gitlab-size", strconv.Itoa(len([]byte(content))))
- c.Response().Header().Set("x-gitlab-last-commit-id", "fake_gitlab_commit_id")
-
- return c.String(http.StatusOK, content)
-}
-
-// getFakeCommit get a fake commit data.
-func (gl *GitLab) getFakeCommit(c echo.Context) error {
- projectID := c.Param("id")
- _, ok := gl.projects[projectID]
- if !ok {
- return c.String(http.StatusBadRequest, fmt.Sprintf("gitlab project %q doesn't exist", projectID))
- }
-
- commit := gitlab.Commit{
- ID: "fake_gitlab_commit_id",
- AuthorName: "fake_gitlab_bot",
- CreatedAt: time.Now(),
- }
- buf, err := json.Marshal(commit)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal commit, error: %v", err))
- }
-
- return c.String(http.StatusOK, string(buf))
-}
-
-func (gl *GitLab) validProject(c echo.Context) (*projectData, error) {
- projectID := c.Param("id")
- project, ok := gl.projects[projectID]
- if !ok {
- return nil, c.String(http.StatusBadRequest, fmt.Sprintf("gitlab project %q doesn't exist", projectID))
- }
-
- return project, nil
-}
-
-func (gl *GitLab) getProjectBranch(c echo.Context) error {
- pd, err := gl.validProject(c)
- if err != nil {
- return err
- }
-
- branchName := c.Param("branchName")
- if _, ok := pd.branches[fmt.Sprintf("refs/heads/%s", branchName)]; !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("branch not found: %v", branchName))
- }
-
- buf, err := json.Marshal(pd.branches[fmt.Sprintf("refs/heads/%s", branchName)])
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for getting project branch: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (gl *GitLab) createProjectBranch(c echo.Context) error {
- pd, err := gl.validProject(c)
- if err != nil {
- return err
- }
-
- body, err := io.ReadAll(c.Request().Body)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to read request body for creating project branch: %v", err))
- }
-
- var branchCreate gitlab.BranchCreate
- if err = json.Unmarshal(body, &branchCreate); err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to unmarshal request body for creating project branch: %v", err))
- }
-
- if _, ok := pd.branches[branchCreate.Branch]; ok {
- return c.String(http.StatusBadRequest, fmt.Sprintf("the branch already exists: %v", branchCreate.Ref))
- }
-
- pd.branches[branchCreate.Branch] = &gitlab.Branch{
- Name: branchCreate.Branch,
- Commit: gitlab.Commit{
- ID: branchCreate.Ref,
- AuthorName: "fake_gitlab_bot",
- CreatedAt: time.Now(),
- },
- }
-
- return c.String(http.StatusOK, "")
-}
-
-func (gl *GitLab) createProjectPullRequest(c echo.Context) error {
- pd, err := gl.validProject(c)
- if err != nil {
- return err
- }
-
- body, err := io.ReadAll(c.Request().Body)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to read request body for creating project merge request: %v", err))
- }
-
- var mergeRequestCreate gitlab.MergeRequestCreate
- if err = json.Unmarshal(body, &mergeRequestCreate); err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to unmarshal request body for creating project merge request: %v", err))
- }
-
- if _, ok := pd.branches[mergeRequestCreate.SourceBranch]; !ok {
- return c.String(http.StatusBadRequest, fmt.Sprintf("the source branch not exists: %v", mergeRequestCreate.SourceBranch))
- }
-
- mrID := len(pd.mergeRequests) + 1
- pd.mergeRequests[mrID] = struct {
- *gitlab.MergeRequestChange
- *gitlab.MergeRequest
- }{
- MergeRequestChange: &gitlab.MergeRequestChange{},
- MergeRequest: &gitlab.MergeRequest{
- // TODO: the URL for merge request is invalid.
- WebURL: fmt.Sprintf("http://gitlab.example.com/my-group/my-project/merge_requests/%d", mrID),
- },
- }
-
- buf, err := json.Marshal(
- pd.mergeRequests[mrID],
- )
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body for creating project merge request: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (gl *GitLab) getMergeRequestChanges(c echo.Context) error {
- pd, err := gl.validProject(c)
- if err != nil {
- return err
- }
-
- mrNumber, err := strconv.Atoi(c.Param("mrID"))
- if err != nil {
- return c.String(http.StatusBadRequest, fmt.Sprintf("The merge request id is invalid: %v", c.Param("mrID")))
- }
-
- mergeRequest, ok := pd.mergeRequests[mrNumber]
- if !ok {
- return c.String(http.StatusNotFound, fmt.Sprintf("Cannot find the merge request: %v", c.Param("mrID")))
- }
-
- buf, err := json.Marshal(mergeRequest.MergeRequestChange)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-func (*GitLab) createMergeRequestComment(echo.Context) error {
- return nil
-}
-
-func (*GitLab) updateMergeRequestComment(echo.Context) error {
- return nil
-}
-
-func (*GitLab) listMergeRequestComment(c echo.Context) error {
- comments := []*gitlab.Comment{}
- buf, err := json.Marshal(comments)
- if err != nil {
- return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to marshal response body: %v", err))
- }
- return c.String(http.StatusOK, string(buf))
-}
-
-// SendWebhookPush sends out a webhook for a push event for the GitLab project
-// using given payload.
-func (gl *GitLab) SendWebhookPush(projectID string, payload []byte) error {
- pd, ok := gl.projects[projectID]
- if !ok {
- return errors.Errorf("gitlab project %q doesn't exist", projectID)
- }
-
- // Trigger webhooks.
- for _, webhook := range pd.webhooks {
- if err := func() error {
- // Send post request.
- req, err := http.NewRequest("POST", webhook.URL, bytes.NewReader(payload))
- if err != nil {
- return errors.Wrapf(err, "fail to create a new POST request(%q)", webhook.URL)
- }
- req.Header.Set("X-Gitlab-Token", webhook.SecretToken)
- resp, err := gl.client.Do(req)
- if err != nil {
- return errors.Wrapf(err, "fail to send a POST request(%q)", webhook.URL)
- }
- defer resp.Body.Close()
- body, err := io.ReadAll(resp.Body)
- if err != nil {
- return errors.Wrap(err, "failed to read http response body")
- }
-
- if resp.StatusCode != http.StatusOK {
- return errors.Errorf("http response error code %v body %q", resp.StatusCode, string(body))
- }
- gl.echo.Logger.Infof("SendWebhookPush response body %s\n", body)
- return nil
- }(); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-// AddFiles adds given files to the GitLab project.
-func (gl *GitLab) AddFiles(projectID string, files map[string]string) error {
- pd, ok := gl.projects[projectID]
- if !ok {
- return errors.Errorf("gitlab project %q doesn't exist", projectID)
- }
-
- // Save files
- for path, content := range files {
- pd.files[path] = content
- }
- return nil
-}
-
-// AddPullRequest creates a new merge request and add changed files to it.
-func (gl *GitLab) AddPullRequest(projectID string, mrID int, files []*vcs.PullRequestFile) error {
- pd, ok := gl.projects[projectID]
- if !ok {
- return errors.Errorf("gitlab project %q doesn't exist", projectID)
- }
-
- if len(files) == 0 {
- return nil
- }
-
- changes := []gitlab.MergeRequestFile{}
- for _, file := range files {
- changes = append(changes, gitlab.MergeRequestFile{
- NewPath: file.Path,
- NewFile: true,
- RenamedFile: false,
- DeletedFile: file.IsDeleted,
- })
- }
-
- pd.mergeRequests[mrID] = struct {
- *gitlab.MergeRequestChange
- *gitlab.MergeRequest
- }{
- MergeRequestChange: &gitlab.MergeRequestChange{
- SHA: files[0].LastCommitID,
- Changes: changes,
- },
- MergeRequest: &gitlab.MergeRequest{
- // TODO: the URL for merge request is invalid.
- WebURL: fmt.Sprintf("http://gitlab.example.com/my-group/my-project/merge_requests/%d", mrID),
- },
- }
- return nil
-}
diff --git a/backend/tests/fake/provider.go b/backend/tests/fake/provider.go
deleted file mode 100644
index 10317aebc3..0000000000
--- a/backend/tests/fake/provider.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package fake
-
-import (
- "net"
-
- "github.com/bytebase/bytebase/backend/plugin/vcs"
-)
-
-// VCSProvider is a fake implementation of a VCS provider.
-type VCSProvider interface {
- // Run starts the server of the VCS provider.
- Run() error
- // Close shuts down the server of the VCS provider.
- Close() error
- // ListenerAddr returns listener address of the server.
- ListenerAddr() net.Addr
-
- // CreateRepository creates a new repository with given ID.
- CreateRepository(repository *vcs.Repository) error
- // CreateBranch creates a new branch in the repository with given ID.
- CreateBranch(id, branchName string) error
- // SendWebhookPush sends out a webhook for a push event for the repository using
- // given payload.
- SendWebhookPush(repositoryID string, payload []byte) error
- // AddFiles adds given files to the repository.
- AddFiles(repositoryID string, files map[string]string) error
- // AddPullRequest creates a new pull request and add changed files to it.
- AddPullRequest(repositoryID string, prID int, files []*vcs.PullRequestFile) error
-}
-
-// VCSProviderCreator a function to create a new VCSProvider.
-type VCSProviderCreator func(port int) VCSProvider
diff --git a/backend/tests/ghost_test.go b/backend/tests/ghost_test.go
index 35ff5f9c66..19e5cbe021 100644
--- a/backend/tests/ghost_test.go
+++ b/backend/tests/ghost_test.go
@@ -6,7 +6,6 @@ import (
"fmt"
"testing"
- "github.com/bytebase/bytebase/backend/tests/fake"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
_ "github.com/go-sql-driver/mysql"
@@ -42,8 +41,7 @@ func TestGhostSchemaUpdate(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/grouping_change_test.go b/backend/tests/grouping_change_test.go
index c1a8eab54b..3377edd1a6 100644
--- a/backend/tests/grouping_change_test.go
+++ b/backend/tests/grouping_change_test.go
@@ -9,7 +9,6 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/genproto/googleapis/type/expr"
- "github.com/bytebase/bytebase/backend/tests/fake"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -129,8 +128,7 @@ func TestCreateDatabaseGroup(t *testing.T) {
ctl := &controller{}
ctx := context.Background()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: t.TempDir(),
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: t.TempDir(),
})
a.NoError(err)
defer func() {
diff --git a/backend/tests/issue.go b/backend/tests/issue.go
deleted file mode 100644
index 954d3cd550..0000000000
--- a/backend/tests/issue.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package tests
-
-import (
- "context"
-
- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-)
-
-func (ctl *controller) getLastOpenIssue(ctx context.Context, project *v1pb.Project) (*v1pb.Issue, error) {
- resp, err := ctl.issueServiceClient.ListIssues(ctx, &v1pb.ListIssuesRequest{
- Parent: project.Name,
- Filter: "status = OPEN",
- })
- if err != nil {
- return nil, err
- }
- if len(resp.Issues) == 0 {
- return nil, nil
- }
- return resp.Issues[0], nil
-}
-
-func (ctl *controller) closeIssue(ctx context.Context, project *v1pb.Project, issueName string) error {
- if _, err := ctl.issueServiceClient.BatchUpdateIssuesStatus(ctx, &v1pb.BatchUpdateIssuesStatusRequest{
- Parent: project.Name,
- Issues: []string{issueName},
- Status: v1pb.IssueStatus_DONE,
- }); err != nil {
- return err
- }
- return nil
-}
diff --git a/backend/tests/project_test.go b/backend/tests/project_test.go
index f9ad3c68c5..0f5a96904b 100644
--- a/backend/tests/project_test.go
+++ b/backend/tests/project_test.go
@@ -7,7 +7,6 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/backend/tests/fake"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -17,8 +16,7 @@ func TestArchiveProject(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/schema_update_test.go b/backend/tests/schema_update_test.go
index 6a8c2cb5a2..980a29c25c 100644
--- a/backend/tests/schema_update_test.go
+++ b/backend/tests/schema_update_test.go
@@ -11,7 +11,6 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/testing/protocmp"
- "github.com/bytebase/bytebase/backend/tests/fake"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -23,8 +22,7 @@ func TestSchemaAndDataUpdate(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
@@ -255,8 +253,7 @@ CREATE TABLE "public"."book" (
ctx := context.Background()
ctl := &controller{}
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: t.TempDir(),
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: t.TempDir(),
})
a.NoError(err)
defer func() {
@@ -370,8 +367,7 @@ func TestMarkTaskAsDone(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/sensitive_data_test.go b/backend/tests/sensitive_data_test.go
index e8cfd2ac39..c46ad87be5 100644
--- a/backend/tests/sensitive_data_test.go
+++ b/backend/tests/sensitive_data_test.go
@@ -10,7 +10,6 @@ import (
"google.golang.org/protobuf/testing/protocmp"
"google.golang.org/protobuf/types/known/durationpb"
- "github.com/bytebase/bytebase/backend/tests/fake"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -102,8 +101,7 @@ func TestSensitiveData(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/sql_editor_test.go b/backend/tests/sql_editor_test.go
index 4994b847ec..1485cc8e32 100644
--- a/backend/tests/sql_editor_test.go
+++ b/backend/tests/sql_editor_test.go
@@ -10,7 +10,6 @@ import (
"google.golang.org/protobuf/testing/protocmp"
"google.golang.org/protobuf/types/known/durationpb"
- "github.com/bytebase/bytebase/backend/tests/fake"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -129,8 +128,7 @@ func TestAdminQueryAffectedRows(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/sql_export_test.go b/backend/tests/sql_export_test.go
index d6bb12c8be..04bb974276 100644
--- a/backend/tests/sql_export_test.go
+++ b/backend/tests/sql_export_test.go
@@ -15,7 +15,6 @@ import (
"google.golang.org/protobuf/testing/protocmp"
"google.golang.org/protobuf/types/known/durationpb"
- "github.com/bytebase/bytebase/backend/tests/fake"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -116,8 +115,7 @@ func TestSQLExport(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/sql_review_test.go b/backend/tests/sql_review_test.go
index 84912c95b6..b8f6a2e868 100644
--- a/backend/tests/sql_review_test.go
+++ b/backend/tests/sql_review_test.go
@@ -24,7 +24,6 @@ import (
"github.com/bytebase/bytebase/backend/common"
api "github.com/bytebase/bytebase/backend/legacyapi"
"github.com/bytebase/bytebase/backend/plugin/advisor"
- "github.com/bytebase/bytebase/backend/tests/fake"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -83,8 +82,7 @@ func TestSQLReviewForPostgreSQL(t *testing.T) {
tests, err := readTestData(filepath)
a.NoError(err)
ctx, err = ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
@@ -259,8 +257,7 @@ func TestSQLReviewForMySQL(t *testing.T) {
a.NoError(err)
dataDir := t.TempDir()
ctx, err = ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/start_test.go b/backend/tests/start_test.go
index f934935a7b..16258aabcd 100644
--- a/backend/tests/start_test.go
+++ b/backend/tests/start_test.go
@@ -11,14 +11,12 @@ import (
"github.com/bytebase/bytebase/backend/resources/mongoutil"
"github.com/bytebase/bytebase/backend/resources/postgres"
- "github.com/bytebase/bytebase/backend/tests/fake"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
func startStopServer(ctx context.Context, a *require.Assertions, ctl *controller, dataDir string) {
ctx, err := ctl.StartServer(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
@@ -42,8 +40,7 @@ func TestServerRestart(t *testing.T) {
dataDir := t.TempDir()
// Start server in non-readonly mode to init schema and register user.
ctx, err := ctl.StartServer(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
err = ctl.Close(ctx)
diff --git a/backend/tests/subscription_test.go b/backend/tests/subscription_test.go
index d475b06ef9..c3b259f4eb 100644
--- a/backend/tests/subscription_test.go
+++ b/backend/tests/subscription_test.go
@@ -6,7 +6,6 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/backend/tests/fake"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -16,8 +15,7 @@ func TestSubscription(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/sync_schema_test.go b/backend/tests/sync_schema_test.go
index 650ac5ef94..68d1a16731 100644
--- a/backend/tests/sync_schema_test.go
+++ b/backend/tests/sync_schema_test.go
@@ -8,8 +8,6 @@ import (
"github.com/stretchr/testify/require"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-
- "github.com/bytebase/bytebase/backend/tests/fake"
)
func TestSyncSchema(t *testing.T) {
@@ -44,8 +42,7 @@ DROP SCHEMA "schema_a";
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/syncer_test.go b/backend/tests/syncer_test.go
index 334c04ead7..02a50abd4b 100644
--- a/backend/tests/syncer_test.go
+++ b/backend/tests/syncer_test.go
@@ -11,7 +11,6 @@ import (
"google.golang.org/protobuf/testing/protocmp"
"github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/tests/fake"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -181,8 +180,7 @@ func TestSyncerForPostgreSQL(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
@@ -468,8 +466,7 @@ func TestSyncerForMySQL(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/tenant_test.go b/backend/tests/tenant_test.go
index 8232be7618..3afc36f1e8 100644
--- a/backend/tests/tenant_test.go
+++ b/backend/tests/tenant_test.go
@@ -12,7 +12,6 @@ import (
"github.com/bytebase/bytebase/backend/common"
api "github.com/bytebase/bytebase/backend/legacyapi"
- "github.com/bytebase/bytebase/backend/tests/fake"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -30,8 +29,7 @@ func TestTenant(t *testing.T) {
ctl := &controller{}
dataDir := t.TempDir()
ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: dataDir,
- vcsProviderCreator: fake.NewGitLab,
+ dataDir: dataDir,
})
a.NoError(err)
defer ctl.Close(ctx)
diff --git a/backend/tests/tests.go b/backend/tests/tests.go
index 5acf209e72..d78e13f830 100644
--- a/backend/tests/tests.go
+++ b/backend/tests/tests.go
@@ -33,7 +33,6 @@ import (
api "github.com/bytebase/bytebase/backend/legacyapi"
"github.com/bytebase/bytebase/backend/resources/postgres"
"github.com/bytebase/bytebase/backend/server"
- "github.com/bytebase/bytebase/backend/tests/fake"
)
var (
@@ -42,18 +41,10 @@ var (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NULL
);`
- migrationStatement2 = `
- CREATE TABLE book2 (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- name TEXT NULL
- );`
//go:embed test-data/book_schema.result
wantBookSchema string
- //go:embed test-data/book_2_schema.result
- want2BookSchema string
-
dataUpdateStatement = `
INSERT INTO book(name) VALUES
("byte"),
@@ -64,15 +55,6 @@ var (
name TEXT NULL
);
`
- dumpedSchema2 = `CREATE TABLE book (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- name TEXT NULL
- );
-CREATE TABLE book2 (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- name TEXT NULL
- );
-`
deploySchedule = &v1pb.Schedule{
Deployments: []*v1pb.ScheduleDeployment{
@@ -128,7 +110,6 @@ type controller struct {
reviewConfigServiceClient v1pb.ReviewConfigServiceClient
projectServiceClient v1pb.ProjectServiceClient
databaseGroupServiceClient v1pb.DatabaseGroupServiceClient
- vcsConnectorServiceClient v1pb.VCSConnectorServiceClient
authServiceClient v1pb.AuthServiceClient
userServiceClient v1pb.UserServiceClient
settingServiceClient v1pb.SettingServiceClient
@@ -137,7 +118,6 @@ type controller struct {
databaseServiceClient v1pb.DatabaseServiceClient
databaseCatalogServiceClient v1pb.DatabaseCatalogServiceClient
sheetServiceClient v1pb.SheetServiceClient
- evcsClient v1pb.VCSProviderServiceClient
sqlServiceClient v1pb.SQLServiceClient
subscriptionServiceClient v1pb.SubscriptionServiceClient
actuatorServiceClient v1pb.ActuatorServiceClient
@@ -145,17 +125,13 @@ type controller struct {
cookie string
project *v1pb.Project
- vcsProvider fake.VCSProvider
-
rootURL string
apiURL string
- vcsURL string
v1APIURL string
}
type config struct {
dataDir string
- vcsProviderCreator fake.VCSProviderCreator
readOnly bool
skipOnboardingData bool
}
@@ -200,10 +176,6 @@ func getTestDatabaseString() string {
// StartServerWithExternalPg starts the main server with external Postgres.
func (ctl *controller) StartServerWithExternalPg(ctx context.Context, config *config) (context.Context, error) {
- if err := ctl.startMockServers(config.vcsProviderCreator); err != nil {
- return nil, err
- }
-
pgMainURL := fmt.Sprintf("postgresql://%s@:%d/%s?host=%s", postgres.TestPgUser, externalPgPort, "postgres", common.GetPostgresSocketDir())
db, err := sql.Open("pgx", pgMainURL)
if err != nil {
@@ -268,9 +240,6 @@ func (ctl *controller) StartServerWithExternalPg(ctx context.Context, config *co
// StartServer starts the main server with embed Postgres.
func (ctl *controller) StartServer(ctx context.Context, config *config) (context.Context, error) {
- if err := ctl.startMockServers(config.vcsProviderCreator); err != nil {
- return nil, err
- }
serverPort := getTestPortForEmbeddedPg()
profile := getTestProfile(config.dataDir, resourceDir, serverPort, config.readOnly)
server, err := server.NewServer(ctx, profile)
@@ -344,27 +313,6 @@ func getTestProfileWithExternalPg(dataDir, resourceDir string, port int, pgUser
}
}
-func (ctl *controller) startMockServers(vcsProviderCreator fake.VCSProviderCreator) error {
- // Set up VCS provider.
- vcsPort := getTestPort()
- ctl.vcsProvider = vcsProviderCreator(vcsPort)
- ctl.vcsURL = fmt.Sprintf("http://localhost:%d", vcsPort)
-
- errChan := make(chan error, 1)
-
- go func() {
- if err := ctl.vcsProvider.Run(); err != nil {
- errChan <- errors.Wrap(err, "failed to run vcsProvider server")
- }
- }()
-
- if err := waitForVCSStart(ctl.vcsProvider, errChan); err != nil {
- return errors.Wrap(err, "failed to wait for vcsProvider to start")
- }
-
- return nil
-}
-
// start only called by StartServer() and StartServerWithExternalPg().
func (ctl *controller) start(ctx context.Context, port int) (context.Context, error) {
ctl.rootURL = fmt.Sprintf("http://localhost:%d", port)
@@ -395,7 +343,6 @@ func (ctl *controller) start(ctx context.Context, port int) (context.Context, er
ctl.reviewConfigServiceClient = v1pb.NewReviewConfigServiceClient(ctl.grpcConn)
ctl.projectServiceClient = v1pb.NewProjectServiceClient(ctl.grpcConn)
ctl.databaseGroupServiceClient = v1pb.NewDatabaseGroupServiceClient(ctl.grpcConn)
- ctl.vcsConnectorServiceClient = v1pb.NewVCSConnectorServiceClient(ctl.grpcConn)
ctl.authServiceClient = v1pb.NewAuthServiceClient(ctl.grpcConn)
ctl.userServiceClient = v1pb.NewUserServiceClient(ctl.grpcConn)
ctl.settingServiceClient = v1pb.NewSettingServiceClient(ctl.grpcConn)
@@ -404,7 +351,6 @@ func (ctl *controller) start(ctx context.Context, port int) (context.Context, er
ctl.databaseServiceClient = v1pb.NewDatabaseServiceClient(ctl.grpcConn)
ctl.databaseCatalogServiceClient = v1pb.NewDatabaseCatalogServiceClient(ctl.grpcConn)
ctl.sheetServiceClient = v1pb.NewSheetServiceClient(ctl.grpcConn)
- ctl.evcsClient = v1pb.NewVCSProviderServiceClient(ctl.grpcConn)
ctl.sqlServiceClient = v1pb.NewSQLServiceClient(ctl.grpcConn)
ctl.subscriptionServiceClient = v1pb.NewSubscriptionServiceClient(ctl.grpcConn)
ctl.actuatorServiceClient = v1pb.NewActuatorServiceClient(ctl.grpcConn)
@@ -423,26 +369,6 @@ func (ctl *controller) start(ctx context.Context, port int) (context.Context, er
)), nil
}
-func waitForVCSStart(p fake.VCSProvider, errChan <-chan error) error {
- ticker := time.NewTicker(100 * time.Millisecond)
- defer ticker.Stop()
-
- for {
- select {
- case <-ticker.C:
- addr := p.ListenerAddr()
- if addr != nil && strings.Contains(addr.String(), ":") {
- return nil // was started
- }
- case err := <-errChan:
- if err == http.ErrServerClosed {
- return nil
- }
- return err
- }
- }
-}
-
func (ctl *controller) waitForHealthz(ctx context.Context) error {
begin := time.Now()
ticker := time.NewTicker(100 * time.Millisecond)
@@ -474,11 +400,6 @@ func (ctl *controller) Close(ctx context.Context) error {
e = multierr.Append(e, err)
}
}
- if ctl.vcsProvider != nil {
- if err := ctl.vcsProvider.Close(); err != nil {
- e = multierr.Append(e, err)
- }
- }
if ctl.grpcConn != nil {
if err := ctl.grpcConn.Close(); err != nil {
e = multierr.Append(e, err)
diff --git a/backend/tests/vcs_test.go b/backend/tests/vcs_test.go
deleted file mode 100644
index f73aced13d..0000000000
--- a/backend/tests/vcs_test.go
+++ /dev/null
@@ -1,303 +0,0 @@
-package tests
-
-import (
- "context"
- "encoding/json"
- "fmt"
- "strings"
- "testing"
-
- "github.com/stretchr/testify/require"
- "google.golang.org/protobuf/types/known/fieldmaskpb"
-
- "github.com/bytebase/bytebase/backend/plugin/vcs"
- "github.com/bytebase/bytebase/backend/plugin/vcs/azure"
- "github.com/bytebase/bytebase/backend/plugin/vcs/bitbucket"
- "github.com/bytebase/bytebase/backend/plugin/vcs/github"
- "github.com/bytebase/bytebase/backend/plugin/vcs/gitlab"
- "github.com/bytebase/bytebase/backend/tests/fake"
- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-)
-
-const baseDirectory = "/bbtest"
-
-func TestVCS(t *testing.T) {
- t.Parallel()
- branchName := "feature/foo"
- pullRequestFiles := []*vcs.PullRequestFile{
- {Path: "bbtest/0001_😊create_table_book1.sql"},
- {Path: "bbtest/0002_新建create_table_book2.sql"},
- }
- fileContentMap := map[string]string{
- pullRequestFiles[0].Path: migrationStatement1,
- pullRequestFiles[1].Path: migrationStatement2,
- }
- pullRequestID := 2250
- pullRequestTitle := "TestVCS"
- pullRequestDescription := "TestVCS fun."
-
- tests := []struct {
- name string
- vcsProviderCreator fake.VCSProviderCreator
- vcsType v1pb.VCSType
- repository *vcs.Repository
- webhookPushEvent any
- }{
- {
- name: "GitLab",
- vcsProviderCreator: fake.NewGitLab,
- vcsType: v1pb.VCSType_GITLAB,
- repository: &vcs.Repository{
- ID: "121",
- Name: "test/vcs",
- FullPath: "test/vcs",
- },
- webhookPushEvent: gitlab.MergeRequestPushEvent{
- ObjectKind: "merge_request",
- ObjectAttributes: gitlab.EventObjectAttributes{
- IID: pullRequestID,
- URL: "https://gitlab.com/test/vcs/-/merge_requests/2250",
- TargetBranch: branchName,
- Action: "merge",
- Title: pullRequestTitle,
- Description: pullRequestDescription,
- LastCommit: gitlab.LastCommit{
- ID: "cc63b0592388a7ab1b05b005ad8c8dc14ce432b1",
- },
- },
- },
- },
- {
- name: "GitHub",
- vcsProviderCreator: fake.NewGitHub,
- vcsType: v1pb.VCSType_GITHUB,
- repository: &vcs.Repository{
- ID: "octocat/Hello-World",
- Name: "octocat/Hello-World",
- FullPath: "octocat/Hello-World",
- },
- webhookPushEvent: github.PullRequestPushEvent{
- Action: "closed",
- Number: pullRequestID,
- PullRequest: github.EventPullRequest{
- HTMLURL: fmt.Sprintf("https://github.com/test/vcs/pull/%d", pullRequestID),
- Title: pullRequestTitle,
- Body: pullRequestDescription,
- Base: github.EventBranch{
- Ref: branchName,
- SHA: "cc63b0592388a7ab1b05b005ad8c8dc14ce432b0",
- },
- Head: github.EventBranch{
- Ref: "test-branch",
- SHA: "cc63b0592388a7ab1b05b005ad8c8dc14ce432b1",
- },
- Merged: true,
- },
- },
- },
- {
- name: "Bitbucket",
- vcsProviderCreator: fake.NewBitbucket,
- vcsType: v1pb.VCSType_BITBUCKET,
- repository: &vcs.Repository{
- ID: "octocat/Hello-World",
- Name: "octocat/Hello-World",
- FullPath: "octocat/Hello-World",
- },
- webhookPushEvent: bitbucket.PullRequestPushEvent{
- PullRequest: bitbucket.EventPullRequest{
- ID: pullRequestID,
- Title: pullRequestTitle,
- Description: pullRequestDescription,
- Destination: bitbucket.EventBranch{
- Branch: bitbucket.EventBranchName{Name: branchName},
- },
- Source: bitbucket.EventBranch{
- Commit: bitbucket.EventCommit{Hash: "cc63b0592388a7ab1b05b005ad8c8dc14ce432b1"},
- },
- Links: bitbucket.EventLinks{HTML: bitbucket.EventHTML{Href: fmt.Sprintf("https://bitbucket.org/test/vcs/pull-requests/%d", pullRequestID)}},
- },
- },
- },
- {
- name: "Azure",
- vcsProviderCreator: fake.NewAzure,
- vcsType: v1pb.VCSType_AZURE_DEVOPS,
- repository: &vcs.Repository{
- ID: "bytebase/project/bb",
- Name: "bytebase/project/bb",
- FullPath: "bytebase/project/bb",
- },
- webhookPushEvent: azure.PullRequestEvent{
- ID: "mock_event_id",
- EventType: "git.pullrequest.merged",
- Resource: &azure.PullRequestResource{
- Repository: &azure.Repository{},
- Links: &azure.PullRequestLinks{
- Web: &azure.PullRequestWeb{
- Href: fmt.Sprintf("https://dev.azure.com/test/vcs/pull-requests/%d", pullRequestID),
- },
- },
- PullRequestID: pullRequestID,
- Status: "completed",
- Title: pullRequestTitle,
- Description: pullRequestDescription,
- SourceRefName: "mock-source-branch",
- TargetRefName: fmt.Sprintf("refs/heads/%s", branchName),
- MergeStatus: "succeeded",
- LastMergeCommit: &azure.PullRequestEventLastMergeCommit{
- CommitID: fmt.Sprintf("%d", pullRequestID),
- },
- },
- },
- },
- }
- for _, test := range tests {
- // Fix the problem that closure in a for loop will always use the last element.
- test := test
- t.Run(test.name, func(t *testing.T) {
- t.Parallel()
-
- a := require.New(t)
- ctx := context.Background()
- ctl := &controller{}
- ctx, err := ctl.StartServerWithExternalPg(ctx, &config{
- dataDir: t.TempDir(),
- vcsProviderCreator: test.vcsProviderCreator,
- })
- a.NoError(err)
- defer func() {
- _ = ctl.Close(ctx)
- }()
-
- err = ctl.vcsProvider.CreateRepository(test.repository)
- a.NoError(err)
-
- evcs, err := ctl.evcsClient.CreateVCSProvider(ctx, &v1pb.CreateVCSProviderRequest{
- VcsProvider: &v1pb.VCSProvider{
- Title: t.Name(),
- Type: test.vcsType,
- Url: ctl.vcsURL,
- AccessToken: "testApplicationSecret",
- },
- VcsProviderId: strings.ToLower(test.name),
- })
- a.NoError(err)
- err = ctl.vcsProvider.CreateBranch(test.repository.ID, branchName)
- a.NoError(err)
-
- oldVcsConnector, err := ctl.vcsConnectorServiceClient.CreateVCSConnector(ctx, &v1pb.CreateVCSConnectorRequest{
- Parent: ctl.project.Name,
- VcsConnector: &v1pb.VCSConnector{
- VcsProvider: evcs.Name,
- Title: "Test VCS Connector",
- FullPath: test.repository.FullPath,
- WebUrl: fmt.Sprintf("%s/%s", ctl.vcsURL, test.repository.FullPath),
- Branch: branchName,
- BaseDirectory: baseDirectory + "+invalid",
- ExternalId: test.repository.ID,
- },
- VcsConnectorId: "default",
- })
- a.NoError(err)
- vcsConnector, err := ctl.vcsConnectorServiceClient.UpdateVCSConnector(ctx, &v1pb.UpdateVCSConnectorRequest{
- VcsConnector: &v1pb.VCSConnector{
- Name: oldVcsConnector.Name,
- BaseDirectory: baseDirectory,
- },
- UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"base_directory"}},
- })
- a.NoError(err)
- a.Equal(baseDirectory, vcsConnector.BaseDirectory)
-
- instanceName := "testInstance"
- instanceDir, err := ctl.provisionSQLiteInstance(t.TempDir(), instanceName)
- a.NoError(err)
-
- instance, err := ctl.instanceServiceClient.CreateInstance(ctx, &v1pb.CreateInstanceRequest{
- InstanceId: generateRandomString("instance", 10),
- Instance: &v1pb.Instance{
- Title: instanceName,
- Engine: v1pb.Engine_SQLITE,
- Environment: "environments/prod",
- Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},
- },
- })
- a.NoError(err)
-
- databaseName := "testVCS"
- err = ctl.createDatabaseV2(ctx, ctl.project, instance, nil /* environment */, databaseName, "", nil /* labelMap */)
- a.NoError(err)
- database, err := ctl.databaseServiceClient.GetDatabase(ctx, &v1pb.GetDatabaseRequest{
- Name: fmt.Sprintf("%s/databases/%s", instance.Name, databaseName),
- })
- a.NoError(err)
-
- err = ctl.vcsProvider.AddPullRequest(test.repository.ID, pullRequestID, pullRequestFiles)
- a.NoError(err)
- err = ctl.vcsProvider.AddFiles(test.repository.ID, fileContentMap)
- a.NoError(err)
-
- payload, err := json.Marshal(test.webhookPushEvent)
- a.NoError(err)
- err = ctl.vcsProvider.SendWebhookPush(test.repository.ID, payload)
- a.NoError(err)
-
- // Get schema update issue.
- issue, err := ctl.getLastOpenIssue(ctx, ctl.project)
- a.NoError(err)
- a.NotNil(issue)
- err = ctl.waitRollout(ctx, issue.Name, issue.Rollout)
- a.NoError(err)
- // TODO(d): use pull requst.
- a.Equal(pullRequestTitle, issue.Title)
- a.Equal(pullRequestDescription, issue.Description)
- err = ctl.closeIssue(ctx, ctl.project, issue.Name)
- a.NoError(err)
-
- // Query schema.
- dbMetadata, err := ctl.databaseServiceClient.GetDatabaseSchema(ctx, &v1pb.GetDatabaseSchemaRequest{Name: fmt.Sprintf("%s/schema", database.Name)})
- a.NoError(err)
- a.Equal(want2BookSchema, dbMetadata.Schema)
-
- resp, err := ctl.databaseServiceClient.ListChangelogs(ctx, &v1pb.ListChangelogsRequest{
- Parent: database.Name,
- View: v1pb.ChangelogView_CHANGELOG_VIEW_FULL,
- })
- a.NoError(err)
- changelogs := resp.Changelogs
- wantChangelogs := []*v1pb.Changelog{
- {
- Type: v1pb.Changelog_MIGRATE,
- Status: v1pb.Changelog_DONE,
- Schema: dumpedSchema2,
- PrevSchema: dumpedSchema,
- Version: "0002",
- },
- {
- Type: v1pb.Changelog_MIGRATE,
- Status: v1pb.Changelog_DONE,
- Schema: dumpedSchema,
- PrevSchema: "",
- Version: "0001",
- },
- }
- a.Equal(len(wantChangelogs), len(changelogs))
- for i, changelog := range changelogs {
- got := &v1pb.Changelog{
- Type: changelog.Type,
- Status: changelog.Status,
- Schema: changelog.Schema,
- PrevSchema: changelog.PrevSchema,
- Version: changelog.Version,
- }
- want := wantChangelogs[i]
- a.Equal(got, want)
- }
-
- _, err = ctl.vcsConnectorServiceClient.DeleteVCSConnector(ctx, &v1pb.DeleteVCSConnectorRequest{Name: vcsConnector.Name})
- a.NoError(err)
- })
- }
-}
diff --git a/frontend/public/help/routeMapList.json b/frontend/public/help/routeMapList.json
index 4308e07163..1a0fcbe20c 100644
--- a/frontend/public/help/routeMapList.json
+++ b/frontend/public/help/routeMapList.json
@@ -71,18 +71,6 @@
"routeName": "workspace.users",
"helpName": "help.member"
},
- {
- "routeName": "setting.workspace.gitops",
- "helpName": ""
- },
- {
- "routeName": "setting.workspace.gitops.create",
- "helpName": ""
- },
- {
- "routeName": "setting.workspace.gitops.detail",
- "helpName": ""
- },
{
"routeName": "setting.workspace.subscription",
"helpName": ""
diff --git a/frontend/src/components/AdvancedSearch/useCommonSearchScopeOptions.ts b/frontend/src/components/AdvancedSearch/useCommonSearchScopeOptions.ts
index 39e75ecf72..11b1b3764d 100644
--- a/frontend/src/components/AdvancedSearch/useCommonSearchScopeOptions.ts
+++ b/frontend/src/components/AdvancedSearch/useCommonSearchScopeOptions.ts
@@ -1,7 +1,6 @@
import type { Ref, VNode } from "vue";
import { computed, h, unref } from "vue";
import { useRoute } from "vue-router";
-import GitIcon from "@/components/GitIcon.vue";
import {
InstanceV1Name,
ProjectV1Name,
@@ -19,7 +18,6 @@ import {
import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
import { UNKNOWN_ID, type MaybeRef } from "@/types";
import { engineToJSON } from "@/types/proto/v1/common";
-import { Workflow } from "@/types/proto/v1/project_service";
import type { SearchParams, SearchScopeId } from "@/utils";
import {
environmentV1Name,
@@ -81,9 +79,6 @@ export const useCommonSearchScopeOptions = (
const children: VNode[] = [
h(ProjectV1Name, { project: project, link: false }),
];
- if (project.workflow === Workflow.VCS) {
- children.push(h(GitIcon, { class: "h-4" }));
- }
return h("div", { class: "flex items-center gap-x-2" }, children);
},
};
diff --git a/frontend/src/components/AuditLog/AuditLogSearch/AuditLogSearch.vue b/frontend/src/components/AuditLog/AuditLogSearch/AuditLogSearch.vue
index 33b1e117c5..42c4a169b2 100644
--- a/frontend/src/components/AuditLog/AuditLogSearch/AuditLogSearch.vue
+++ b/frontend/src/components/AuditLog/AuditLogSearch/AuditLogSearch.vue
@@ -26,7 +26,6 @@ import type {
ScopeOption,
ValueOption,
} from "@/components/AdvancedSearch/types";
-import GitIcon from "@/components/GitIcon.vue";
import SystemBotTag from "@/components/misc/SystemBotTag.vue";
import YouTag from "@/components/misc/YouTag.vue";
import { ProjectV1Name } from "@/components/v2";
@@ -34,7 +33,6 @@ import { ALL_METHODS_WITH_AUDIT } from "@/grpcweb/methods";
import { useCurrentUserV1, useProjectV1List, useUserStore } from "@/store";
import { SYSTEM_BOT_USER_NAME } from "@/types";
import { AuditLog_Severity } from "@/types/proto/v1/audit_log_service";
-import { Workflow } from "@/types/proto/v1/project_service";
import {
extractProjectResourceName,
type SearchParams,
@@ -107,9 +105,6 @@ const scopeOptions = computed((): ScopeOption[] => {
],
render: () => {
const children = [<ProjectV1Name project={project} link={false} />];
- if (project.workflow === Workflow.VCS) {
- children.push(<GitIcon class="h-4" />);
- }
return <div class="flex items-center gap-x-2">{children}</div>;
},
};
diff --git a/frontend/src/components/GitIcon.vue b/frontend/src/components/GitIcon.vue
deleted file mode 100644
index 1d3759ad58..0000000000
--- a/frontend/src/components/GitIcon.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-<template>
- <svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
- <path
- d="M216.29 158.39H137C97 147.9 6.51 150.63 6.51 233.18c0 30.09 15 51.23 35 61-25.1 23-37 33.85-37 49.21 0 11 4.47 21.14 17.89 26.81C8.13 383.61 0 393.35 0 411.65c0 32.11 28.05 50.82 101.63 50.82 70.75 0 111.79-26.42 111.79-73.18 0-58.66-45.16-56.5-151.63-63l13.43-21.55c27.27 7.58 118.7 10 118.7-67.89 0-18.7-7.73-31.71-15-41.07l37.41-2.84zm-63.42 241.9c0 32.06-104.89 32.1-104.89 2.43 0-8.14 5.27-15 10.57-21.54 77.71 5.3 94.32 3.37 94.32 19.11zm-50.81-134.58c-52.8 0-50.46-71.16 1.2-71.16 49.54 0 50.82 71.16-1.2 71.16zm133.3 100.51v-32.1c26.75-3.66 27.24-2 27.24-11V203.61c0-8.5-2.05-7.38-27.24-16.26l4.47-32.92H324v168.71c0 6.51.4 7.32 6.51 8.14l20.73 2.84v32.1zm52.45-244.31c-23.17 0-36.59-13.43-36.59-36.61s13.42-35.77 36.59-35.77c23.58 0 37 12.62 37 35.77s-13.42 36.61-37 36.61zM512 350.46c-17.49 8.53-43.1 16.26-66.28 16.26-48.38 0-66.67-19.5-66.67-65.46V194.75c0-5.42 1.05-4.06-31.71-4.06V154.5c35.78-4.07 50-22 54.47-66.27h38.63c0 65.83-1.34 61.81 3.26 61.81H501v40.65h-60.56v97.15c0 6.92-4.92 51.41 60.57 26.84z"
- />
- </svg>
-</template>
diff --git a/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue b/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
index 7399e02c01..6ea27205c2 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
+++ b/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
@@ -1,6 +1,5 @@
<template>
<div class="flex flex-col gap-y-3 py-2 px-3">
- <VCSInfo />
<ReleaseInfo />
<TaskCheckSummarySection />
<ReviewSection />
@@ -22,5 +21,4 @@ import PreBackupSection from "./PreBackupSection";
import ReleaseInfo from "./ReleaseInfo.vue";
import ReviewSection from "./ReviewSection";
import TaskCheckSummarySection from "./TaskCheckSummarySection";
-import VCSInfo from "./VCSInfo.vue";
</script>
diff --git a/frontend/src/components/IssueV1/components/Sidebar/VCSInfo.vue b/frontend/src/components/IssueV1/components/Sidebar/VCSInfo.vue
deleted file mode 100644
index 5a97cf881f..0000000000
--- a/frontend/src/components/IssueV1/components/Sidebar/VCSInfo.vue
+++ /dev/null
@@ -1,83 +0,0 @@
-<template>
- <div
- v-if="issue.planEntity?.vcsSource?.pullRequestUrl"
- class="text-sm text-control-light flex space-x-1 items-center"
- >
- <VCSIcon custom-class="h-5" :type="issue.planEntity?.vcsSource.vcsType" />
- <EllipsisText>
- <a
- :href="issue.planEntity?.vcsSource.pullRequestUrl"
- target="_blank"
- class="normal-link"
- >
- <span v-if="vcsConnector">
- {{ `${vcsConnector.branch}@${vcsConnector.fullPath}` }}
- </span>
- <span v-else>
- {{ beautifyPullRequestUrl(issue.planEntity?.vcsSource) }}
- </span>
- </a>
- </EllipsisText>
- </div>
-</template>
-
-<script setup lang="ts">
-import { computed } from "vue";
-import { watchEffect } from "vue";
-import EllipsisText from "@/components/EllipsisText.vue";
-import { useIssueContext } from "@/components/IssueV1";
-import { VCSIcon } from "@/components/VCS";
-import { useVCSConnectorStore, useVCSProviderStore } from "@/store";
-import type { Plan_VCSSource } from "@/types/proto/v1/plan_service";
-import { hasWorkspacePermissionV2, hasProjectPermissionV2 } from "@/utils";
-
-const { issue } = useIssueContext();
-const vcsConnectorStore = useVCSConnectorStore();
-const vcsProviderStore = useVCSProviderStore();
-
-const hasGetVCSConnectorPermission = computed(() =>
- hasProjectPermissionV2(issue.value.projectEntity, "bb.vcsConnectors.get")
-);
-
-const hasGetVCSProviderPermission = computed(() =>
- hasWorkspacePermissionV2("bb.vcsProviders.get")
-);
-
-watchEffect(async () => {
- if (!issue.value.planEntity?.vcsSource?.vcsConnector) {
- return;
- }
-
- if (hasGetVCSConnectorPermission.value) {
- const connector = await vcsConnectorStore.getOrFetchConnectorByName(
- issue.value.planEntity?.vcsSource?.vcsConnector
- );
- if (hasGetVCSProviderPermission.value) {
- await vcsProviderStore.getOrFetchVCSByName(connector.vcsProvider);
- }
- }
-});
-
-const vcsConnector = computed(() => {
- if (!issue.value.planEntity?.vcsSource?.vcsConnector) {
- return;
- }
- if (!hasGetVCSConnectorPermission.value) {
- return;
- }
- return vcsConnectorStore.getConnectorByName(
- issue.value.planEntity?.vcsSource?.vcsConnector
- );
-});
-
-// Strip the host to reduce length
-const beautifyPullRequestUrl = (vcs: Plan_VCSSource | undefined) => {
- if (vcs) {
- const parsedUrl = new URL(vcs.pullRequestUrl);
- return parsedUrl.pathname.length > 0
- ? parsedUrl.pathname.substring(1)
- : parsedUrl.pathname;
- }
- return "";
-};
-</script>
diff --git a/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue b/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue
index 1f158ba046..1d9edee2d3 100644
--- a/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue
+++ b/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue
@@ -69,7 +69,6 @@ import { computed } from "vue";
import { InstanceV1Name } from "@/components/v2";
import { isValidDatabaseName } from "@/types";
import { Plan_ChangeDatabaseConfig_Type } from "@/types/proto/v1/plan_service";
-import { Workflow } from "@/types/proto/v1/project_service";
import { Task } from "@/types/proto/v1/rollout_service";
import { Task_Type, task_StatusToJSON } from "@/types/proto/v1/rollout_service";
import { databaseV1Url, extractSchemaVersionFromTask, isDev } from "@/utils";
@@ -84,7 +83,6 @@ const props = defineProps<{
}>();
const { isCreating, issue, selectedTask, events } = useIssueContext();
-const project = computed(() => issue.value.projectEntity);
const selected = computed(() => props.task === selectedTask.value);
const secondaryViewMode = computed((): SecondaryViewMode => {
@@ -105,10 +103,7 @@ const schemaVersion = computed(() => {
if (issue.value.planEntity?.releaseSource?.release) {
return v;
}
- // show the schema version for a task if
- // the project is standard mode and VCS workflow
if (isCreating.value) return "";
- if (project.value.workflow === Workflow.UI) return "";
return v;
});
diff --git a/frontend/src/components/Project/useProjectSidebar.ts b/frontend/src/components/Project/useProjectSidebar.ts
index 02d548794f..16bbafa539 100644
--- a/frontend/src/components/Project/useProjectSidebar.ts
+++ b/frontend/src/components/Project/useProjectSidebar.ts
@@ -23,7 +23,6 @@ import projectV1Routes, {
PROJECT_V1_ROUTE_SYNC_SCHEMA,
PROJECT_V1_ROUTE_SLOW_QUERIES,
PROJECT_V1_ROUTE_ANOMALIES,
- PROJECT_V1_ROUTE_GITOPS,
PROJECT_V1_ROUTE_MEMBERS,
PROJECT_V1_ROUTE_SETTINGS,
PROJECT_V1_ROUTE_WEBHOOKS,
@@ -212,11 +211,6 @@ export const useProjectSidebar = (
databaseChangeMode.value === DatabaseChangeMode.EDITOR,
expand: true,
children: [
- {
- title: t("common.gitops"),
- path: PROJECT_V1_ROUTE_GITOPS,
- type: "div",
- },
{
title: t("common.webhooks"),
path: PROJECT_V1_ROUTE_WEBHOOKS,
diff --git a/frontend/src/components/RepositoryConfigPanel.vue b/frontend/src/components/RepositoryConfigPanel.vue
deleted file mode 100644
index 589eaa0e50..0000000000
--- a/frontend/src/components/RepositoryConfigPanel.vue
+++ /dev/null
@@ -1,20 +0,0 @@
-<template>
- <RepositoryForm
- :create="true"
- :vcs-type="config.vcs.type"
- :vcs-name="config.vcs.title"
- :repository-info="config.repositoryInfo"
- :repository-config="config.repositoryConfig"
- :project="project"
- />
-</template>
-
-<script lang="ts" setup>
-import type { ComposedProject, ProjectRepositoryConfig } from "@/types";
-import RepositoryForm from "./RepositoryForm.vue";
-
-defineProps<{
- config: ProjectRepositoryConfig;
- project: ComposedProject;
-}>();
-</script>
diff --git a/frontend/src/components/RepositoryForm.vue b/frontend/src/components/RepositoryForm.vue
deleted file mode 100644
index 742158f1d1..0000000000
--- a/frontend/src/components/RepositoryForm.vue
+++ /dev/null
@@ -1,214 +0,0 @@
-<!-- eslint-disable vue/no-mutating-props -->
-<template>
- <div class="space-y-4">
- <div>
- <div v-if="!create && getWebhookLink !== ''" class="mb-2">
- <label class="textlabel mt-2">
- <i18n-t keypath="repository.our-webhook-link">
- <template #webhookLink>
- <a class="normal-link" :href="getWebhookLink" target="_blank">
- {{ getWebhookLink }}
- </a>
- </template>
- </i18n-t>
- </label>
- </div>
- <div class="flex flex-row space-x-2 items-center">
- <label for="gitprovider" class="textlabel">
- {{ $t("repository.git-provider") }}
- </label>
- <VCSIcon :type="vcsType" />
- </div>
- <BBTextField
- id="gitprovider"
- name="gitprovider"
- class="mt-2 w-full"
- :disabled="true"
- :value="vcsName"
- />
- </div>
- <div>
- <div class="flex flex-row space-x-2 items-center">
- <label for="repository" class="textlabel">
- {{ $t("common.repository") }}
- </label>
- </div>
- <BBTextField
- id="repository"
- name="repository"
- class="mt-2 w-full"
- :disabled="true"
- :value="repositoryInfo.fullPath"
- />
- <ResourceIdField
- v-model:value="repositoryConfig.resourceId"
- class="max-w-full flex-nowrap mt-1.5"
- editing-class="mt-4"
- resource-type="vcs-connector"
- :resource-title="repositoryInfo.title"
- :validate="validateResourceId"
- :readonly="!create || !allowEdit"
- />
- </div>
- <div>
- <div class="textlabel flex items-center gap-x-1">
- {{ $t("database-group.self") }}
- <FeatureBadge :feature="'bb.feature.database-grouping'" />
- </div>
- <div class="mt-1 textinfolabel">
- {{ $t("repository.database-group-description") }}
- <span
- v-if="hasDatabaseGroupPermission"
- class="cursor-pointer normal-link"
- @click="showDatabaseGroupPanel = true"
- >
- {{ $t("database-group.create") }}
- </span>
- </div>
- <DatabaseGroupSelect
- :selected="repositoryConfig.databaseGroup"
- class="mt-2"
- style="width: 100%"
- :project="project.name"
- :select-first-as-default="false"
- @update:selected="(val) => (repositoryConfig.databaseGroup = val ?? '')"
- />
- </div>
- <div>
- <div class="textlabel">
- {{ $t("common.branch") }}
- </div>
- <div class="mt-1 textinfolabel">
- {{ $t("repository.branch-observe-file-change") }}
- </div>
- <BBTextField
- id="branch"
- v-model:value="repositoryConfig.branch"
- name="branch"
- class="mt-2 w-full"
- placeholder="e.g. main"
- :disabled="!allowEdit"
- :required="true"
- />
- </div>
- <div>
- <div class="textlabel">{{ $t("repository.base-directory") }}</div>
- <div class="mt-1 textinfolabel">
- {{ $t("repository.base-directory-description") }}
- </div>
- <BBTextField
- id="basedirectory"
- v-model:value="repositoryConfig.baseDirectory"
- name="basedirectory"
- class="mt-2 w-full"
- :disabled="!allowEdit"
- />
- </div>
- </div>
-
- <DatabaseGroupPanel
- :show="showDatabaseGroupPanel"
- :project="project"
- :redirect-to-detail-page="false"
- @close="showDatabaseGroupPanel = false"
- />
-</template>
-
-<script lang="ts" setup>
-import { Status } from "nice-grpc-common";
-import { computed, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import { BBTextField } from "@/bbkit";
-import { DatabaseGroupSelect } from "@/components/v2/Select";
-import { useVCSConnectorStore, hasFeature } from "@/store";
-import type {
- RepositoryConfig,
- ComposedProject,
- ResourceId,
- ValidatedMessage,
-} from "@/types";
-import { VCSType } from "@/types/proto/v1/common";
-import type { VCSRepository } from "@/types/proto/v1/vcs_provider_service";
-import { hasProjectPermissionV2 } from "@/utils";
-import { getErrorCode } from "@/utils/grpcweb";
-import DatabaseGroupPanel from "./DatabaseGroup/DatabaseGroupPanel.vue";
-import FeatureBadge from "./FeatureGuard/FeatureBadge.vue";
-import { VCSIcon } from "./VCS";
-import { ResourceIdField } from "./v2";
-
-const props = withDefaults(
- defineProps<{
- allowEdit?: boolean;
- create?: boolean;
- vcsType: VCSType;
- vcsName: string;
- repositoryInfo: VCSRepository;
- repositoryConfig: RepositoryConfig;
- project: ComposedProject;
- }>(),
- {
- allowEdit: true,
- create: false,
- }
-);
-
-const showDatabaseGroupPanel = ref<boolean>(false);
-const { t } = useI18n();
-const vcsConnectorStore = useVCSConnectorStore();
-
-const hasDatabaseGroupPermission = computed(
- () =>
- hasFeature("bb.feature.database-grouping") &&
- hasProjectPermissionV2(props.project, "bb.projects.update")
-);
-
-const getWebhookLink = computed(() => {
- switch (props.vcsType) {
- case VCSType.AZURE_DEVOPS: {
- const parts = props.repositoryInfo.id.split("/");
- if (parts.length !== 3) {
- return "";
- }
- const [organization, project, _] = parts;
- return `https://dev.azure.com/${organization}/${project}/_settings/serviceHooks`;
- }
- case VCSType.GITHUB:
- return `${props.repositoryInfo.webUrl}/settings/hooks`;
- case VCSType.BITBUCKET:
- return `${props.repositoryInfo.webUrl}/admin/webhooks`;
- case VCSType.GITLAB:
- return `${props.repositoryInfo.webUrl}/-/hooks`;
- }
- return "";
-});
-
-const validateResourceId = async (
- resourceId: ResourceId
-): Promise<ValidatedMessage[]> => {
- if (!resourceId) {
- return [];
- }
-
- try {
- const instance = await vcsConnectorStore.getOrFetchConnector(
- props.project.name,
- resourceId
- );
- if (instance) {
- return [
- {
- type: "error",
- message: t("resource-id.validation.duplicated", {
- resource: t("resource.instance"),
- }),
- },
- ];
- }
- } catch (error) {
- if (getErrorCode(error) !== Status.NOT_FOUND) {
- throw error;
- }
- }
- return [];
-};
-</script>
diff --git a/frontend/src/components/RepositoryPanel.vue b/frontend/src/components/RepositoryPanel.vue
deleted file mode 100644
index 37290de23c..0000000000
--- a/frontend/src/components/RepositoryPanel.vue
+++ /dev/null
@@ -1,213 +0,0 @@
-<template>
- <div class="mt-2 textinfolabel">
- <i18n-t keypath="repository.gitops-description-file-path">
- <template #fullPath>
- <a class="normal-link" :href="vcsConnector.webUrl" target="_blank">
- {{ repositoryFormattedFullPath }}
- </a>
- </template>
- <template #naming>
- <a
- class="normal-link"
- href="https://www.bytebase.com/docs/vcs-integration/create-migration-files/?source=console"
- target="_blank"
- >
- {{ $t("repository.gitops-naming-format") }}
- </a>
- </template>
- </i18n-t>
- <span>&nbsp;</span>
- <i18n-t keypath="repository.gitops-description-branch">
- <template #branch>
- <span class="font-medium text-main">
- <template v-if="state.repositoryConfig.branch">
- {{ state.repositoryConfig.branch }}
- </template>
- <template v-else>
- {{ $t("common.default") }}
- </template>
- </span>
- </template>
- </i18n-t>
- <span>&nbsp;</span>
- <TroubleshootLink
- url="https://www.bytebase.com/docs/vcs-integration/troubleshoot/?source=console"
- />
- </div>
- <RepositoryForm
- class="mt-4"
- :allow-edit="allowEdit"
- :vcs-type="vcsProvider.type"
- :vcs-name="vcsProvider.title"
- :repository-info="repositoryInfo"
- :repository-config="state.repositoryConfig"
- :project="project"
- />
- <div
- v-if="allowEdit || allowDelete"
- class="mt-6 pt-4 flex border-t justify-between"
- >
- <BBButtonConfirm
- v-if="allowDelete"
- :type="'DELETE'"
- :button-text="$t('project.gitops-connector.delete')"
- :require-confirm="true"
- :ok-text="$t('common.delete')"
- :confirm-title="$t('project.gitops-connector.delete') + '?'"
- @confirm="deleteConnector"
- />
- <div v-if="allowEdit" class="ml-3 flex items-center space-x-3">
- <NButton
- v-if="allowUpdate"
- :disabled="state.processing"
- @click.prevent="discardChanges"
- >
- {{ $t("common.discard-changes") }}
- </NButton>
- <NButton
- type="primary"
- :disabled="!allowUpdate"
- :loading="state.processing"
- @click.prevent="doUpdate"
- >
- {{ $t("common.update") }}
- </NButton>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import isEmpty from "lodash-es/isEmpty";
-import { NButton } from "naive-ui";
-import { computed, reactive, watch } from "vue";
-import { BBButtonConfirm } from "@/bbkit";
-import { useVCSProviderStore, useVCSConnectorStore } from "@/store";
-import { getVCSConnectorId } from "@/store/modules/v1/common";
-import type { ComposedProject, RepositoryConfig } from "@/types";
-import { VCSType } from "@/types/proto/v1/common";
-import { VCSConnector } from "@/types/proto/v1/vcs_connector_service";
-import { VCSProvider } from "@/types/proto/v1/vcs_provider_service";
-import type { VCSRepository } from "@/types/proto/v1/vcs_provider_service";
-import RepositoryForm from "./RepositoryForm.vue";
-import TroubleshootLink from "./TroubleshootLink.vue";
-
-interface LocalState {
- repositoryConfig: RepositoryConfig;
- processing: boolean;
-}
-
-const props = defineProps<{
- project: ComposedProject;
- vcsConnector: VCSConnector;
- allowEdit: boolean;
- allowDelete: boolean;
-}>();
-
-const emit = defineEmits<{
- (event: "delete"): void;
- (event: "update"): void;
- (event: "cancel"): void;
-}>();
-
-const vcsV1Store = useVCSProviderStore();
-const vcsConnectorStore = useVCSConnectorStore();
-
-const initConfig = computed(
- (): RepositoryConfig => ({
- resourceId: getVCSConnectorId(props.vcsConnector.name).vcsConnectorId,
- baseDirectory: props.vcsConnector.baseDirectory,
- branch: props.vcsConnector.branch,
- databaseGroup: props.vcsConnector.databaseGroup,
- })
-);
-
-const state = reactive<LocalState>({
- repositoryConfig: { ...initConfig.value },
- processing: false,
-});
-
-const discardChanges = () => {
- state.repositoryConfig = { ...initConfig.value };
- state.processing = false;
-};
-
-watch(
- () => props.vcsConnector,
- () => {
- discardChanges();
- },
- { deep: true, immediate: true }
-);
-
-const vcsProvider = computed(
- () =>
- vcsV1Store.getVCSByName(props.vcsConnector.vcsProvider) ??
- VCSProvider.fromPartial({})
-);
-
-const repositoryFormattedFullPath = computed(() => {
- const fullPath = props.vcsConnector.fullPath;
- if (vcsProvider.value.type !== VCSType.AZURE_DEVOPS) {
- return fullPath;
- }
- if (!fullPath.includes("@dev.azure.com")) {
- return fullPath;
- }
- return `https://dev.azure.com${fullPath.split("@dev.azure.com")[1]}`;
-});
-
-const repositoryInfo = computed((): VCSRepository => {
- return {
- id: props.vcsConnector.externalId,
- title: props.vcsConnector.title,
- fullPath: props.vcsConnector.fullPath,
- webUrl: props.vcsConnector.webUrl,
- };
-});
-
-const allowUpdate = computed(() => {
- return (
- !isEmpty(state.repositoryConfig.branch) &&
- (props.vcsConnector.branch !== state.repositoryConfig.branch ||
- props.vcsConnector.baseDirectory !==
- state.repositoryConfig.baseDirectory ||
- props.vcsConnector.databaseGroup !== state.repositoryConfig.databaseGroup)
- );
-});
-
-const deleteConnector = async () => {
- if (state.processing) {
- return;
- }
- state.processing = true;
-
- try {
- await vcsConnectorStore.deleteConnector(props.vcsConnector.name);
- emit("delete");
- } finally {
- state.processing = false;
- }
-};
-
-const doUpdate = async () => {
- if (state.processing) {
- return;
- }
- state.processing = true;
-
- try {
- await vcsConnectorStore.updateConnector(
- VCSConnector.fromPartial({
- ...props.vcsConnector,
- branch: state.repositoryConfig.branch,
- baseDirectory: state.repositoryConfig.baseDirectory,
- databaseGroup: state.repositoryConfig.databaseGroup,
- }),
- ["branch", "base_directory", "database_group"]
- );
- emit("update");
- } finally {
- state.processing = false;
- }
-};
-</script>
diff --git a/frontend/src/components/RepositorySelectionPanel.vue b/frontend/src/components/RepositorySelectionPanel.vue
deleted file mode 100644
index 2e7757be9a..0000000000
--- a/frontend/src/components/RepositorySelectionPanel.vue
+++ /dev/null
@@ -1,127 +0,0 @@
-<template>
- <BBAttention type="warning">
- {{ attentionText }}
- </BBAttention>
- <div class="mt-4 space-y-2">
- <div class="flex justify-between items-center">
- <BBSpin v-if="state.loading" :size="20" />
- <NButton
- v-else
- quaternary
- circle
- :loading="state.loading"
- @click.prevent="refreshRepositoryList"
- >
- <RefreshCwIcon class="w-5 h-5" />
- </NButton>
- <SearchBox
- v-model:value="state.searchText"
- :placeholder="$t('repository.select-repository-search')"
- />
- </div>
- <div
- class="bg-white overflow-hidden rounded-sm border border-control-border"
- >
- <ul class="divide-y divide-control-border">
- <li
- v-for="(repository, index) in repositoryList"
- :key="index"
- class="block hover:bg-control-bg-hover cursor-pointer"
- @click.prevent="selectRepository(repository)"
- >
- <div class="flex items-center px-3 py-2">
- <div class="min-w-0 flex-1 flex items-center">
- {{ repository.fullPath }}
- </div>
- <ChevronRightIcon class="h-5 w-5 text-control" />
- </div>
- </li>
- </ul>
- </div>
- </div>
-</template>
-
-<script setup lang="ts">
-import { RefreshCwIcon, ChevronRightIcon } from "lucide-vue-next";
-import { NButton } from "naive-ui";
-import { reactive, computed, onMounted } from "vue";
-import { useI18n } from "vue-i18n";
-import { BBAttention } from "@/bbkit";
-import BBSpin from "@/bbkit/BBSpin.vue";
-import { pushNotification, useVCSProviderStore } from "@/store";
-import type { ProjectRepositoryConfig } from "@/types";
-import { VCSType } from "@/types/proto/v1/common";
-import type { VCSRepository } from "@/types/proto/v1/vcs_provider_service";
-import { hasWorkspacePermissionV2 } from "@/utils";
-import { SearchBox } from "./v2";
-
-interface LocalState {
- repositoryList: VCSRepository[];
- searchText: string;
- loading: boolean;
-}
-
-const props = defineProps<{ config: ProjectRepositoryConfig }>();
-
-const emit = defineEmits<{
- (event: "next"): void;
- (event: "set-repository", payload: VCSRepository): void;
-}>();
-
-const { t } = useI18n();
-const vcsV1Store = useVCSProviderStore();
-const state = reactive<LocalState>({
- repositoryList: [],
- searchText: "",
- loading: true,
-});
-
-onMounted(() => {
- refreshRepositoryList();
-});
-
-const refreshRepositoryList = async () => {
- if (!hasWorkspacePermissionV2("bb.vcsProviders.searchProjects")) {
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: "Permission denied for searching projects",
- });
- return;
- }
-
- state.loading = true;
- const projects = await vcsV1Store.searchVCSProviderRepositories(
- props.config.vcs.name
- );
- state.repositoryList = projects;
- state.loading = false;
-};
-
-const repositoryList = computed(() => {
- if (state.searchText == "") {
- return state.repositoryList;
- }
- return state.repositoryList.filter((repository: VCSRepository) => {
- return repository.fullPath.toLowerCase().includes(state.searchText);
- });
-});
-
-const attentionText = computed((): string => {
- if (props.config.vcs.type === VCSType.GITLAB) {
- return t("repository.select-repository-attention-gitlab");
- } else if (props.config.vcs.type === VCSType.GITHUB) {
- return t("repository.select-repository-attention-github");
- } else if (props.config.vcs.type === VCSType.BITBUCKET) {
- return t("repository.select-repository-attention-bitbucket");
- } else if (props.config.vcs.type === VCSType.AZURE_DEVOPS) {
- return t("repository.select-repository-attention-azure-devops");
- }
- return "";
-});
-
-const selectRepository = (repository: VCSRepository) => {
- emit("set-repository", repository);
- emit("next");
-};
-</script>
diff --git a/frontend/src/components/RepositorySetupWizard.vue b/frontend/src/components/RepositorySetupWizard.vue
deleted file mode 100644
index 7747182c88..0000000000
--- a/frontend/src/components/RepositorySetupWizard.vue
+++ /dev/null
@@ -1,200 +0,0 @@
-<template>
- <div class="w-full h-full overflow-hidden flex flex-col space-y-4">
- <BBAttention type="info">
- <div class="textinfolabel">
- <i18n-t keypath="repository.setup-wizard-guide">
- <template #guide>
- <a
- href="https://bytebase.com/docs/vcs-integration/add-gitops-connector?source=console"
- target="_blank"
- class="normal-link"
- >
- {{ $t("common.detailed-guide") }}
- </a>
- </template>
- </i18n-t>
- </div>
- </BBAttention>
-
- <StepTab
- class="pt-4 flex-1 overflow-hidden flex flex-col"
- pane-class="flex-1 overflow-y-auto"
- :current-index="state.currentStep"
- :step-list="stepList"
- :allow-next="allowNext"
- @update:current-index="tryChangeStep"
- @finish="tryFinishSetup"
- @cancel="cancel"
- >
- <template #0="{ next }">
- <RepositoryVCSProviderPanel @next="next()" @set-vcs="setVCS" />
- </template>
- <template #1="{ next }">
- <RepositorySelectionPanel
- :config="state.config"
- @next="next()"
- @set-repository="setRepository"
- />
- </template>
- <template #2>
- <RepositoryConfigPanel :config="state.config" :project="project" />
- </template>
- </StepTab>
- </div>
-</template>
-
-<script lang="ts" setup>
-import isEmpty from "lodash-es/isEmpty";
-import { reactive, computed } from "vue";
-import { useI18n } from "vue-i18n";
-import { BBAttention } from "@/bbkit";
-import { StepTab } from "@/components/v2";
-import { pushNotification, useVCSConnectorStore } from "@/store";
-import type { ComposedProject } from "@/types";
-import { VCSType } from "@/types/proto/v1/common";
-import { VCSProvider } from "@/types/proto/v1/vcs_provider_service";
-import { VCSRepository } from "@/types/proto/v1/vcs_provider_service";
-import { hasProjectPermissionV2 } from "@/utils";
-import type { ProjectRepositoryConfig } from "../types";
-import RepositoryConfigPanel from "./RepositoryConfigPanel.vue";
-import RepositorySelectionPanel from "./RepositorySelectionPanel.vue";
-import RepositoryVCSProviderPanel from "./RepositoryVCSProviderPanel.vue";
-
-const CHOOSE_PROVIDER_STEP = 0;
-// const CHOOSE_REPOSITORY_STEP = 1;
-const CONFIGURE_DEPLOY_STEP = 2;
-
-interface LocalState {
- config: ProjectRepositoryConfig;
- currentStep: number;
- showFeatureModal: boolean;
- processing: boolean;
-}
-
-const props = defineProps<{
- project: ComposedProject;
-}>();
-
-const emit = defineEmits<{
- (event: "cancel"): void;
- (event: "finish"): void;
-}>();
-
-const { t } = useI18n();
-const vcsConnectorStore = useVCSConnectorStore();
-
-const stepList = [
- { title: t("repository.choose-git-provider"), hideNext: true },
- { title: t("repository.select-repository"), hideNext: true },
- { title: t("repository.configure-deploy") },
-];
-
-const state = reactive<LocalState>({
- config: {
- vcs: VCSProvider.fromPartial({}),
- repositoryInfo: VCSRepository.fromPartial({}),
- repositoryConfig: {
- baseDirectory: "/bytebase",
- branch: "main",
- resourceId: "",
- databaseGroup: "",
- },
- },
- currentStep: CHOOSE_PROVIDER_STEP,
- showFeatureModal: false,
- processing: false,
-});
-
-const hasPermission = computed(() => {
- return hasProjectPermissionV2(props.project, "bb.vcsConnectors.create");
-});
-
-const allowNext = computed((): boolean => {
- if (state.currentStep == CONFIGURE_DEPLOY_STEP) {
- return (
- !isEmpty(state.config.repositoryConfig.branch.trim()) &&
- !isEmpty(state.config.repositoryConfig.resourceId.trim()) &&
- !state.processing &&
- hasPermission.value
- );
- }
- return true;
-});
-
-const tryChangeStep = (nextStepIndex: number) => {
- if (state.processing) {
- return;
- }
- state.currentStep = nextStepIndex;
-};
-
-const validBaseDirectory = computed(() => {
- let directory = state.config.repositoryConfig.baseDirectory;
- if (directory.endsWith("/")) {
- directory = directory.slice(0, directory.length - 1);
- }
- return directory || "/";
-});
-
-const tryFinishSetup = async () => {
- if (state.processing) {
- return;
- }
- state.processing = true;
-
- const createFunc = async () => {
- let externalId = state.config.repositoryInfo.id;
- if (
- state.config.vcs.type === VCSType.GITHUB ||
- state.config.vcs.type === VCSType.BITBUCKET
- ) {
- externalId = state.config.repositoryInfo.fullPath;
- }
-
- await vcsConnectorStore.createConnector(
- props.project.name,
- state.config.repositoryConfig.resourceId,
- {
- title: state.config.repositoryInfo.title,
- externalId,
- vcsProvider: state.config.vcs.name,
- baseDirectory: validBaseDirectory.value,
- branch: state.config.repositoryConfig.branch.trim(),
- databaseGroup: state.config.repositoryConfig.databaseGroup,
- fullPath: state.config.repositoryInfo.fullPath,
- webUrl: state.config.repositoryInfo.webUrl,
- }
- );
-
- emit("finish");
- };
-
- try {
- await createFunc();
- } catch (error: any) {
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: `Create connector error occurred`,
- description: error.details,
- });
- } finally {
- state.processing = false;
- }
-};
-
-const cancel = () => {
- if (state.processing) {
- return;
- }
- emit("cancel");
-};
-
-const setVCS = (vcs: VCSProvider) => {
- state.config.vcs = vcs;
-};
-
-const setRepository = (repository: VCSRepository) => {
- state.config.repositoryInfo = repository;
-};
-</script>
diff --git a/frontend/src/components/RepositoryVCSProviderPanel.vue b/frontend/src/components/RepositoryVCSProviderPanel.vue
deleted file mode 100644
index ce480c9858..0000000000
--- a/frontend/src/components/RepositoryVCSProviderPanel.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-<template>
- <div class="textlabel">
- {{ $t("repository.choose-git-provider-description") }}
- </div>
- <div class="mt-4 flex flex-wrap space-x-2 gap-y-2">
- <template v-for="(vcs, index) in vcsList" :key="index">
- <NButton type="default" @click.prevent="selectVCS(vcs)">
- <template #icon>
- <VCSIcon custom-class="h-6" :type="vcs.type" />
- </template>
- <span>{{ vcs.title }}</span>
- </NButton>
- </template>
- </div>
- <div class="mt-4 textinfolabel">
- <template v-if="canManageVCSProvider">
- <i18n-t keypath="repository.choose-git-provider-visit-workspace">
- <template #workspace>
- <router-link
- class="normal-link"
- :to="{ name: WORKSPACE_ROUTE_GITOPS }"
- >
- {{ $t("common.workspace") }} - {{ $t("common.gitops") }}
- </router-link>
- </template>
- </i18n-t>
- </template>
- <template v-else>
- {{ $t("repository.choose-git-provider-contact-workspace-admin") }}
- </template>
- </div>
-</template>
-
-<script lang="ts">
-export default { name: "RepositoryVCSProviderPanel" };
-</script>
-
-<script setup lang="ts">
-import { reactive, computed, watchEffect } from "vue";
-import { hasWorkspacePermissionV2 } from "@/utils";
-import { useVCSProviderStore } from "@/store";
-import type { VCSProvider } from "@/types/proto/v1/vcs_provider_service";
-import { WORKSPACE_ROUTE_GITOPS } from "@/router/dashboard/workspaceRoutes";
-import { NButton } from "naive-ui";
-import { VCSIcon } from "./VCS";
-
-interface LocalState {
- selectedVCS?: VCSProvider;
-}
-
-const emit = defineEmits<{
- (event: "next"): void;
- (event: "set-vcs", payload: VCSProvider): void;
-}>();
-
-const vcsV1Store = useVCSProviderStore();
-const state = reactive<LocalState>({});
-
-const prepareVCSList = () => {
- vcsV1Store.getOrFetchVCSList();
-};
-
-watchEffect(prepareVCSList);
-
-const vcsList = computed(() => {
- return vcsV1Store.vcsList;
-});
-
-const canManageVCSProvider = computed(() => {
- return hasWorkspacePermissionV2("bb.vcsProviders.list");
-});
-
-const selectVCS = (vcs: VCSProvider) => {
- state.selectedVCS = vcs;
- emit("set-vcs", vcs);
- emit("next");
-};
-</script>
diff --git a/frontend/src/components/VCS/VCSProviderBasicInfoPanel.vue b/frontend/src/components/VCS/VCSProviderBasicInfoPanel.vue
deleted file mode 100644
index d7f25cdee0..0000000000
--- a/frontend/src/components/VCS/VCSProviderBasicInfoPanel.vue
+++ /dev/null
@@ -1,439 +0,0 @@
-<!-- eslint-disable vue/no-mutating-props -->
-<template>
- <div class="space-y-6">
- <div v-if="create">
- <div class="textlabel">
- {{ $t("gitops.setting.add-git-provider.choose") }}
- <span class="text-red-600">*</span>
- </div>
- <div class="flex flex-wrap pt-4 radio-set-row gap-4">
- <NRadioGroup
- v-model:value="config.uiType"
- class="!flex flex-row justify-start items-center flex-wrap gap-x-2 gap-y-4"
- >
- <NRadio
- v-for="vcsWithUIType in vcsListByUIType"
- :key="vcsWithUIType.uiType"
- :value="vcsWithUIType.uiType"
- @change="changeUIType()"
- >
- <div class="flex space-x-1">
- <VCSIcon custom-class="h-5" :type="vcsWithUIType.type" />
- <span class="whitespace-nowrap">
- {{ vcsWithUIType.title }}
- </span>
- </div>
- </NRadio>
- </NRadioGroup>
- </div>
- </div>
- <div>
- <div class="textlabel">
- {{ $t("gitops.setting.add-git-provider.basic-info.display-name") }}
- <span class="text-red-600">*</span>
- </div>
- <p class="mt-1 textinfolabel">
- {{
- $t("gitops.setting.add-git-provider.basic-info.display-name-label")
- }}
- </p>
- <BBTextField
- v-model:value="config.name"
- class="mt-2 w-full"
- :placeholder="namePlaceholder"
- :required="true"
- />
- <ResourceIdField
- v-model:value="config.resourceId"
- class="max-w-full flex-nowrap mt-1.5"
- editing-class="mt-4"
- resource-type="vcs-provider"
- :suffix="true"
- :resource-title="config.name"
- :validate="validateResourceId"
- :readonly="!create"
- />
- </div>
- <div>
- <div class="textlabel flex items-center">
- <VCSIcon custom-class="h-4 mr-1" :type="config.type" />
- {{ instanceUrlLabel }} <span class="text-red-600">*</span>
- </div>
- <p class="mt-1 textinfolabel">
- {{
- $t(
- "gitops.setting.add-git-provider.basic-info.gitlab-instance-url-label"
- )
- }}
- </p>
- <BBTextField
- class="mt-2 w-full"
- :required="true"
- :value="config.instanceUrl"
- :placeholder="instanceUrlPlaceholder"
- :disabled="instanceUrlDisabled"
- @update:value="changeUrl($event)"
- />
- <p v-if="state.showUrlError" class="mt-2 text-sm text-error">
- {{
- $t("gitops.setting.add-git-provider.basic-info.instance-url-error")
- }}
- </p>
- </div>
- <div>
- <div class="mt-4 textlabel">
- Access Token <span class="text-red-600">*</span>
- </div>
- <ul class="textinfolabel space-y-2 mt-2">
- <template v-if="config.type == VCSType.GITLAB">
- <li>
- <i18n-t
- keypath="gitops.setting.add-git-provider.access-token.gitlab-personal-access-token"
- >
- <template #token>
- <a
- :href="`${config.instanceUrl}/-/user_settings/personal_access_tokens`"
- target="_blank"
- class="normal-link"
- >
- {{
- $t(
- "gitops.setting.add-git-provider.access-token.personal-access-token"
- )
- }}
- </a>
- </template>
- </i18n-t>
- </li>
- <li>• api</li>
- <li>• read repository</li>
- </template>
- <template v-if="config.type === VCSType.GITHUB">
- <li>
- <i18n-t
- keypath="gitops.setting.add-git-provider.access-token.github-personal-access-token"
- >
- <template #token>
- <a
- :href="`${config.instanceUrl}/settings/tokens?type=beta`"
- target="_blank"
- class="normal-link"
- >
- {{
- $t(
- "gitops.setting.add-git-provider.access-token.github-fine-grained-token"
- )
- }}
- </a>
- </template>
- </i18n-t>
- </li>
- <li>• Metadata (Read-only)</li>
- <li>• Contents (Read-only)</li>
- <li>• Pull requests (Read and write)</li>
- <li>• Webhooks (Read and write)</li>
- </template>
- <template v-if="config.type == VCSType.BITBUCKET">
- <li>
- <i18n-t
- keypath="gitops.setting.add-git-provider.access-token.bitbucket-app-access-token"
- >
- <template #app_password>
- <a
- href="https://bitbucket.org/account/settings/app-passwords/"
- target="_blank"
- class="normal-link"
- >
- {{
- $t(
- "gitops.setting.add-git-provider.access-token.bitbucket-app-password"
- )
- }}
- </a>
- </template>
- </i18n-t>
- </li>
- <li>• Account (Read)</li>
- <li>• Workspace membership (Read)</li>
- <li>• Projects (Read)</li>
- <li>• Webhooks (Read and Write)</li>
- <li>• Repositories (Read and Write)</li>
- <li>• Pull requests (Read and Write)</li>
- <li>
- <i18n-t
- tag="span"
- keypath="gitops.setting.add-git-provider.access-token.bitbucket-app-access-token-tips"
- class="textinfolabel"
- >
- <template #secret>
- <span class="font-bold">
- {{ "<bitbucket username>:<generated app password>" }}
- </span>
- </template>
- </i18n-t>
- </li>
- </template>
- <template v-if="config.type == VCSType.AZURE_DEVOPS">
- <li>
- <i18n-t
- keypath="gitops.setting.add-git-provider.access-token.azure-devops-personal-access-token"
- >
- <template #token>
- <!-- Azure DevOps link PAT link is dynamic: https://dev.azure.com/<<account>>/_usersSettings/tokens so we can only use prefix -->
- <a
- href="https://dev.azure.com/"
- target="_blank"
- class="normal-link"
- >
- {{
- $t(
- "gitops.setting.add-git-provider.access-token.personal-access-token"
- )
- }}
- </a>
- </template>
- </i18n-t>
- </li>
- <li>• Code (Read)</li>
- <li>• User Profile (Read)</li>
- <li>• Project and Team (Read)</li>
- <li>• Pull Request Threads (Read and Write)</li>
- </template>
- </ul>
- <BBTextField
- class="mt-2 w-full"
- :required="create"
- :placeholder="accessTokenPlaceholder"
- :value="config.accessToken"
- @update:value="changeAccessToken($event)"
- />
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import isEmpty from "lodash-es/isEmpty";
-import { NRadio, NRadioGroup } from "naive-ui";
-import { Status } from "nice-grpc-common";
-import { computed, onUnmounted, reactive } from "vue";
-import { useI18n } from "vue-i18n";
-import { BBTextField } from "@/bbkit";
-import { useVCSProviderStore } from "@/store";
-import { vcsProviderPrefix } from "@/store/modules/v1/common";
-import type { VCSConfig } from "@/types";
-import { TEXT_VALIDATION_DELAY } from "@/types";
-import type { ResourceId, ValidatedMessage } from "@/types";
-import { VCSType } from "@/types/proto/v1/common";
-import { isUrl } from "@/utils";
-import { getErrorCode } from "@/utils/grpcweb";
-import { ResourceIdField } from "../v2";
-import VCSIcon from "./VCSIcon.vue";
-import { vcsListByUIType } from "./utils";
-
-interface LocalState {
- urlValidationTimer?: ReturnType<typeof setTimeout>;
- showUrlError: boolean;
-}
-
-const props = defineProps<{
- config: VCSConfig;
- create: boolean;
-}>();
-
-const { t } = useI18n();
-const state = reactive<LocalState>({
- showUrlError:
- !isEmpty(props.config.instanceUrl) && !isUrl(props.config.instanceUrl),
-});
-const vcsV1Store = useVCSProviderStore();
-
-onUnmounted(() => {
- if (state.urlValidationTimer) {
- clearInterval(state.urlValidationTimer);
- }
-});
-
-const namePlaceholder = computed((): string => {
- if (props.config.type === VCSType.GITLAB) {
- if (props.config.uiType == "GITLAB_SELF_HOST") {
- return t("gitops.setting.add-git-provider.gitlab-self-host");
- } else if (props.config.uiType == "GITLAB_COM") {
- return "GitLab.com";
- }
- } else if (props.config.type === VCSType.GITHUB) {
- if (props.config.uiType == "GITHUB_COM") {
- return "GitHub.com";
- } else if (props.config.uiType === "GITHUB_ENTERPRISE") {
- return "Self Host GitHub Enterprise";
- }
- } else if (props.config.type === VCSType.BITBUCKET) {
- return "Bitbucket.org";
- } else if (props.config.type === VCSType.AZURE_DEVOPS) {
- return "Azure DevOps";
- }
- return "";
-});
-
-const instanceUrlLabel = computed((): string => {
- switch (props.config.type) {
- case VCSType.GITLAB:
- return t(
- "gitops.setting.add-git-provider.basic-info.gitlab-instance-url"
- );
- case VCSType.GITHUB:
- return t(
- "gitops.setting.add-git-provider.basic-info.github-instance-url"
- );
- case VCSType.BITBUCKET:
- return t(
- "gitops.setting.add-git-provider.basic-info.bitbucket-instance-url"
- );
- case VCSType.AZURE_DEVOPS:
- return t("gitops.setting.add-git-provider.basic-info.azure-instance-url");
- default:
- return "";
- }
-});
-
-const instanceUrlPlaceholder = computed((): string => {
- if (props.config.type === VCSType.GITLAB) {
- if (props.config.uiType == "GITLAB_SELF_HOST") {
- return "https://gitlab.company-name.com";
- } else if (props.config.uiType == "GITLAB_COM") {
- return "https://gitlab.com";
- }
- } else if (props.config.type === VCSType.GITHUB) {
- if (props.config.uiType == "GITHUB_COM") {
- return "https://github.com";
- } else if (props.config.uiType == "GITHUB_ENTERPRISE") {
- return "https://github.company-name.com";
- }
- } else if (props.config.type === VCSType.BITBUCKET) {
- return "https://bitbucket.org";
- }
- return "";
-});
-
-// github.com instance url is always https://github.com
-const instanceUrlDisabled = computed((): boolean => {
- return (
- (props.config.type === VCSType.GITHUB &&
- props.config.uiType == "GITHUB_COM") ||
- props.config.type === VCSType.BITBUCKET ||
- props.config.type === VCSType.AZURE_DEVOPS ||
- (props.config.type === VCSType.GITLAB &&
- props.config.uiType == "GITLAB_COM") ||
- !props.create
- );
-});
-
-const changeUrl = (value: string) => {
- // eslint-disable-next-line vue/no-mutating-props
- props.config.instanceUrl = value;
-
- if (state.urlValidationTimer) {
- clearInterval(state.urlValidationTimer);
- }
- // If text becomes valid, we immediately clear the error.
- // otherwise, we delay TEXT_VALIDATION_DELAY to do the validation in case there is continous keystroke.
- if (isUrl(props.config.instanceUrl)) {
- state.showUrlError = false;
- } else {
- state.urlValidationTimer = setTimeout(() => {
- // If error is already displayed, we hide the error only if there is valid input.
- // Otherwise, we hide the error if input is either empty or valid.
- if (state.showUrlError) {
- state.showUrlError = !isUrl(props.config.instanceUrl);
- } else {
- state.showUrlError =
- !isEmpty(props.config.instanceUrl) &&
- !isUrl(props.config.instanceUrl);
- }
- }, TEXT_VALIDATION_DELAY);
- }
-};
-
-// FIXME: Unexpected mutation of "config" prop. Do we care?
-/* eslint-disable vue/no-mutating-props */
-const changeUIType = () => {
- switch (props.config.uiType) {
- case "GITLAB_SELF_HOST":
- props.config.type = VCSType.GITLAB;
- props.config.instanceUrl = "";
- props.config.name = t("gitops.setting.add-git-provider.gitlab-self-host");
- break;
- case "GITLAB_COM":
- props.config.type = VCSType.GITLAB;
- props.config.instanceUrl = "https://gitlab.com";
- props.config.name = "GitLab.com";
- break;
- case "GITHUB_COM":
- props.config.type = VCSType.GITHUB;
- props.config.instanceUrl = "https://github.com";
- props.config.name = "GitHub.com";
- break;
- case "GITHUB_ENTERPRISE":
- props.config.type = VCSType.GITHUB;
- props.config.instanceUrl = "";
- props.config.name = "Self Host GitHub Enterprise";
- break;
- case "BITBUCKET_ORG":
- props.config.type = VCSType.BITBUCKET;
- props.config.instanceUrl = "https://bitbucket.org";
- props.config.name = "Bitbucket.org";
- break;
- case "AZURE_DEVOPS":
- props.config.type = VCSType.AZURE_DEVOPS;
- props.config.instanceUrl = "https://dev.azure.com";
- props.config.name = "Azure DevOps";
- break;
- default:
- break;
- }
-};
-
-const accessTokenPlaceholder = computed(() => {
- switch (props.config.type) {
- case VCSType.BITBUCKET:
- return "<bitbucket username>:<generated app password>";
- case VCSType.GITHUB:
- return "github_xxxxxxxxxxxxxxxxxxx";
- case VCSType.GITLAB:
- return "glpat-xxxxxxxxxxxxxxxxxxx";
- }
- return "xxxxxxxxxxxxxxxxxxx";
-});
-
-const changeAccessToken = (value: string) => {
- props.config.accessToken = value;
-};
-
-const validateResourceId = async (
- resourceId: ResourceId
-): Promise<ValidatedMessage[]> => {
- if (!resourceId) {
- return [];
- }
-
- try {
- const vcs = await vcsV1Store.getOrFetchVCSByName(
- `${vcsProviderPrefix}${resourceId}`
- );
- if (vcs) {
- return [
- {
- type: "error",
- message: t("resource-id.validation.duplicated", {
- resource: t("resource.instance"),
- }),
- },
- ];
- }
- } catch (error) {
- if (getErrorCode(error) !== Status.NOT_FOUND) {
- throw error;
- }
- }
- return [];
-};
-</script>
diff --git a/frontend/src/components/VCS/VCSSetupWizard.vue b/frontend/src/components/VCS/VCSSetupWizard.vue
deleted file mode 100644
index e3d87955c6..0000000000
--- a/frontend/src/components/VCS/VCSSetupWizard.vue
+++ /dev/null
@@ -1,97 +0,0 @@
-<template>
- <FormLayout>
- <template #body>
- <VCSProviderBasicInfoPanel :create="true" :config="state.config" />
- </template>
- <template #footer>
- <div class="flex justify-end items-center">
- <div class="space-x-3">
- <NButton v-if="showCancel" @click.prevent="cancelSetup">
- {{ $t("common.cancel") }}
- </NButton>
- <NButton
- type="primary"
- :disabled="!allowCreate"
- @click.prevent="tryFinishSetup"
- >
- {{ $t("common.confirm-and-add") }}
- </NButton>
- </div>
- </div>
- </template>
- </FormLayout>
-</template>
-
-<script lang="ts" setup>
-import { NButton } from "naive-ui";
-import { reactive, computed } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
-import FormLayout from "@/components/v2/Form/FormLayout.vue";
-import { WORKSPACE_ROUTE_GITOPS } from "@/router/dashboard/workspaceRoutes";
-import { pushNotification, useVCSProviderStore } from "@/store";
-import type { VCSConfig } from "@/types";
-import { VCSType } from "@/types/proto/v1/common";
-import type { VCSProvider } from "@/types/proto/v1/vcs_provider_service";
-import { hasWorkspacePermissionV2 } from "@/utils";
-import VCSProviderBasicInfoPanel from "./VCSProviderBasicInfoPanel.vue";
-
-defineProps<{
- showCancel: boolean;
-}>();
-
-interface LocalState {
- config: VCSConfig;
-}
-
-const { t } = useI18n();
-const router = useRouter();
-const vcsV1Store = useVCSProviderStore();
-
-const state = reactive<LocalState>({
- config: {
- type: VCSType.GITLAB,
- uiType: "GITLAB_SELF_HOST",
- resourceId: "",
- name: t("gitops.setting.add-git-provider.gitlab-self-host"),
- instanceUrl: "",
- accessToken: "",
- },
-});
-
-const allowCreate = computed(() => {
- return (
- hasWorkspacePermissionV2("bb.vcsProviders.create") &&
- state.config.instanceUrl &&
- state.config.accessToken &&
- state.config.name
- );
-});
-
-const tryFinishSetup = () => {
- vcsV1Store
- .createVCS(state.config.resourceId, {
- name: "",
- title: state.config.name,
- type: state.config.type,
- url: state.config.instanceUrl,
- accessToken: state.config.accessToken,
- })
- .then((vcs: VCSProvider) => {
- router.push({
- name: WORKSPACE_ROUTE_GITOPS,
- });
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: t("gitops.setting.add-git-provider.add-success", {
- vcs: vcs.title,
- }),
- });
- });
-};
-
-const cancelSetup = () => {
- router.back();
-};
-</script>
diff --git a/frontend/src/components/VCS/index.ts b/frontend/src/components/VCS/index.ts
index e72cb84b28..b4468893ae 100644
--- a/frontend/src/components/VCS/index.ts
+++ b/frontend/src/components/VCS/index.ts
@@ -1,5 +1,3 @@
import VCSIcon from "./VCSIcon.vue";
-import VCSProviderBasicInfoPanel from "./VCSProviderBasicInfoPanel.vue";
-import VCSSetupWizard from "./VCSSetupWizard.vue";
-export { VCSIcon, VCSSetupWizard, VCSProviderBasicInfoPanel };
+export { VCSIcon };
diff --git a/frontend/src/components/VCS/utils.ts b/frontend/src/components/VCS/utils.ts
deleted file mode 100644
index 50f6c58211..0000000000
--- a/frontend/src/components/VCS/utils.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { computed } from "vue";
-import { t } from "@/plugins/i18n";
-import type { VCSUIType } from "@/types";
-import { VCSType } from "@/types/proto/v1/common";
-
-export const vcsListByUIType = computed(
- (): {
- type: VCSType;
- uiType: VCSUIType;
- title: string;
- }[] => {
- return [
- {
- type: VCSType.GITLAB,
- uiType: "GITLAB_SELF_HOST",
- title: t("gitops.setting.add-git-provider.gitlab-self-host"),
- },
- {
- type: VCSType.GITLAB,
- uiType: "GITLAB_COM",
- title: "GitLab.com",
- },
- {
- type: VCSType.GITHUB,
- uiType: "GITHUB_COM",
- title: "GitHub.com",
- },
- {
- type: VCSType.GITHUB,
- uiType: "GITHUB_ENTERPRISE",
- title: t("gitops.setting.add-git-provider.github-self-host"),
- },
- {
- type: VCSType.AZURE_DEVOPS,
- uiType: "AZURE_DEVOPS",
- title: t("gitops.setting.add-git-provider.azure-devops-service"),
- },
- {
- type: VCSType.BITBUCKET,
- uiType: "BITBUCKET_ORG",
- title: "Bitbucket.org",
- },
- ];
- }
-);
diff --git a/frontend/src/components/VCSConnectorTable.vue b/frontend/src/components/VCSConnectorTable.vue
deleted file mode 100644
index 4ba3540531..0000000000
--- a/frontend/src/components/VCSConnectorTable.vue
+++ /dev/null
@@ -1,72 +0,0 @@
-<template>
- <BBTable
- :column-list="columnList"
- :data-source="connectorList"
- :show-header="true"
- :left-bordered="true"
- :right-bordered="true"
- @click-row="onClick"
- >
- <template #body="{ rowData: connector }">
- <BBTableCell :left-padding="4" class="w-16">
- {{ projectV1Name(getProject(connector)) }}
- </BBTableCell>
- <BBTableCell class="w-32">
- {{ connector.fullPath }}
- </BBTableCell>
- </template>
- </BBTable>
-</template>
-
-<script lang="ts" setup>
-import { computed } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
-import { BBTable, BBTableCell } from "@/bbkit";
-import { PROJECT_V1_ROUTE_GITOPS_DETAIL } from "@/router/dashboard/projectV1";
-import { useProjectV1Store } from "@/store";
-import { projectNamePrefix } from "@/store/modules/v1/common";
-import { getVCSConnectorId } from "@/store/modules/v1/common";
-import type { VCSConnector } from "@/types/proto/v1/vcs_connector_service";
-import { hasProjectPermissionV2 } from "@/utils";
-import { projectV1Name } from "../utils";
-
-const props = defineProps<{
- connectorList: VCSConnector[];
-}>();
-
-const { t } = useI18n();
-const projectV1Store = useProjectV1Store();
-const router = useRouter();
-
-const columnList = computed(() => [
- {
- title: t("common.project"),
- },
- {
- title: t("common.repository"),
- },
-]);
-
-const getProject = (connector: VCSConnector) => {
- const project = `${projectNamePrefix}${getVCSConnectorId(connector.name).projectId}`;
- return projectV1Store.getProjectByName(project);
-};
-
-const onClick = function (_: number, row: number) {
- const connector = props.connectorList[row];
- const project = getProject(connector);
- if (!hasProjectPermissionV2(project, "bb.vcsConnectors.get")) {
- return;
- }
-
- const { projectId, vcsConnectorId } = getVCSConnectorId(connector.name);
- router.push({
- name: PROJECT_V1_ROUTE_GITOPS_DETAIL,
- params: {
- projectId,
- vcsConnectorId,
- },
- });
-};
-</script>
diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/cells/ProjectNameCell.vue b/frontend/src/components/v2/Model/DatabaseV1Table/cells/ProjectNameCell.vue
index 2c4144012e..e24b592d77 100644
--- a/frontend/src/components/v2/Model/DatabaseV1Table/cells/ProjectNameCell.vue
+++ b/frontend/src/components/v2/Model/DatabaseV1Table/cells/ProjectNameCell.vue
@@ -11,18 +11,6 @@
{{ suffix }}
</slot>
- <NTooltip v-if="project.workflow === Workflow.VCS">
- <template #trigger>
- <GitIcon class="w-4 h-4 text-control" />
- </template>
- <span v-if="mode === 'ALL_SHORT'" class="w-40">
- {{ $t("alter-schema.vcs-info") }}
- </span>
- <span v-else class="tooltip whitespace-nowrap">
- {{ $t("database.gitops-enabled") }}
- </span>
- </NTooltip>
-
<NTooltip v-if="project.state === State.DELETED">
<template #trigger>
<heroicons-outline:archive class="w-4 h-4 text-control" />
@@ -36,11 +24,9 @@
<script setup lang="ts">
import { NTooltip } from "naive-ui";
-import GitIcon from "@/components/GitIcon.vue";
import { ProjectV1Name } from "@/components/v2";
import { State } from "@/types/proto/v1/common";
import type { Project } from "@/types/proto/v1/project_service";
-import { Workflow } from "@/types/proto/v1/project_service";
import type { Mode } from "../DatabaseV1Table.vue";
withDefaults(
diff --git a/frontend/src/components/v2/Select/ProjectSelect.vue b/frontend/src/components/v2/Select/ProjectSelect.vue
index 2c76a70a89..f6b51d9ffb 100644
--- a/frontend/src/components/v2/Select/ProjectSelect.vue
+++ b/frontend/src/components/v2/Select/ProjectSelect.vue
@@ -33,7 +33,6 @@ import {
} from "@/types";
import { State } from "@/types/proto/v1/common";
import type { Project } from "@/types/proto/v1/project_service";
-import { Workflow } from "@/types/proto/v1/project_service";
import { extractProjectResourceName, hasWorkspacePermissionV2 } from "@/utils";
import ResourceSelect from "./ResourceSelect.vue";
@@ -43,7 +42,6 @@ const props = withDefaults(
projectName?: string | undefined | null; // UNKNOWN_PROJECT_NAME to "ALL"
projectNames?: string[] | undefined | null;
allowedProjectRoleList?: string[]; // Empty array([]) to "ALL"
- allowedProjectWorkflowTypeList?: Workflow[];
includeAll?: boolean;
includeDefaultProject?: boolean;
includeArchived?: boolean;
@@ -57,7 +55,6 @@ const props = withDefaults(
projectName: undefined,
projectNames: undefined,
allowedProjectRoleList: () => [],
- allowedProjectWorkflowTypeList: () => [Workflow.UI, Workflow.VCS],
includeAll: false,
includeDefaultProject: false,
includeArchived: false,
@@ -86,7 +83,7 @@ const rawProjectList = computed(() => {
if (project.name === DEFAULT_PROJECT_NAME) {
return false;
}
- return props.allowedProjectWorkflowTypeList.includes(project.workflow);
+ return true;
});
});
diff --git a/frontend/src/grpcweb/index.ts b/frontend/src/grpcweb/index.ts
index 9836bc90d5..de33b08fca 100644
--- a/frontend/src/grpcweb/index.ts
+++ b/frontend/src/grpcweb/index.ts
@@ -33,8 +33,6 @@ import { SettingServiceDefinition } from "@/types/proto/v1/setting_service";
import { SheetServiceDefinition } from "@/types/proto/v1/sheet_service";
import { SQLServiceDefinition } from "@/types/proto/v1/sql_service";
import { SubscriptionServiceDefinition } from "@/types/proto/v1/subscription_service";
-import { VCSConnectorServiceDefinition } from "@/types/proto/v1/vcs_connector_service";
-import { VCSProviderServiceDefinition } from "@/types/proto/v1/vcs_provider_service";
import { WorksheetServiceDefinition } from "@/types/proto/v1/worksheet_service";
import { WorkspaceServiceDefinition } from "@/types/proto/v1/workspace_service";
import {
@@ -189,16 +187,6 @@ export const actuatorServiceClient = clientFactory.create(
channel
);
-export const vcsProviderServiceClient = clientFactory.create(
- VCSProviderServiceDefinition,
- channel
-);
-
-export const vcsConnectorServiceClient = clientFactory.create(
- VCSConnectorServiceDefinition,
- channel
-);
-
export const anomalyServiceClient = clientFactory.create(
AnomalyServiceDefinition,
channel
diff --git a/frontend/src/grpcweb/methods.ts b/frontend/src/grpcweb/methods.ts
index d91d65ffdc..a100025e72 100644
--- a/frontend/src/grpcweb/methods.ts
+++ b/frontend/src/grpcweb/methods.ts
@@ -24,8 +24,6 @@ import { SheetServiceDefinition } from "@/types/proto/v1/sheet_service";
import { SQLServiceDefinition } from "@/types/proto/v1/sql_service";
import { SubscriptionServiceDefinition } from "@/types/proto/v1/subscription_service";
import { UserServiceDefinition } from "@/types/proto/v1/user_service";
-import { VCSConnectorServiceDefinition } from "@/types/proto/v1/vcs_connector_service";
-import { VCSProviderServiceDefinition } from "@/types/proto/v1/vcs_provider_service";
import { WorksheetServiceDefinition } from "@/types/proto/v1/worksheet_service";
import { WorkspaceServiceDefinition } from "@/types/proto/v1/workspace_service";
@@ -64,8 +62,6 @@ export const ALL_METHODS_WITH_AUDIT = [
SQLServiceDefinition,
SubscriptionServiceDefinition,
UserServiceDefinition,
- VCSConnectorServiceDefinition,
- VCSProviderServiceDefinition,
WorksheetServiceDefinition,
WorkspaceServiceDefinition,
]
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index f70302de57..2fc00488e8 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -98,16 +98,12 @@
"detail": "Detail",
"type": "Type",
"language": "Language",
- "repository": "Repository",
"change": "Change",
- "branch": "Branch",
"sensitive-placeholder": "Sensitive - write only",
"enabled": "enabled",
"default": "default",
- "gitops": "GitOps",
"restore": "Restore",
"detailed-guide": "detailed guide",
- "workspace": "Workspace",
"confirm": "Confirm",
"learn-more": "Learn more",
"troubleshoot": "Troubleshoot",
@@ -337,7 +333,6 @@
"iam-and-admin": "IAM & Admin",
"im-integration": "IM",
"sso": "SSO",
- "gitops": "GitOps",
"subscription": "Subscription",
"global-masking": "Global Masking",
"data-classification": "Data Classification",
@@ -987,7 +982,6 @@
}
},
"alter-schema": {
- "vcs-info": "VCS enabled. Selecting this will navigate you to the corresponding Git repository to initiate the change process.",
"no-databases-in-project": "No databases in this project. Click New DB or Transfer in DB to add databases."
},
"quick-action": {
@@ -1363,7 +1357,6 @@
"batch-action-disabled-for-unassigned": "Can not {action} for unassigned database",
"data-export-action-disabled": "Can not export data for more than one database",
"successfully-transferred-databases": "Successfully transferred databases",
- "gitops-enabled": "GitOps enabled",
"nullable": "Nullable",
"expression": "Expression",
"position": "Position",
@@ -1480,34 +1473,6 @@
},
"not-found": "Cannot found the database"
},
- "repository": {
- "our-webhook-link": "The webhook created by Bytebase can be found at {webhookLink}.",
- "branch-observe-file-change": "The branch where Bytebase observes the file change.",
- "database-group-description": "By default, changes will be applied to all databases within the project. Alternatively, they can be applied to the database group.",
- "base-directory": "Base directory",
- "base-directory-description": "The root directory where Bytebase observes the file change. Use \"/\" if files stored in the repository root directory.",
- "git-provider": "Git provider",
- "gitops-naming-format": "naming format",
- "gitops-description-file-path": "Database migration scripts are stored in {fullPath}. To make database changes, a developer would create a migration script conforming to the {naming}.",
- "gitops-description-branch": "After the script is approved and merged into the {branch} branch, Bytebase will automatically create the issue to apply the database change.",
- "setup-wizard-guide": "If you encounter errors during the process, please refer to our {guide}",
- "add-git-provider": "Add Git provider",
- "choose-git-provider": "Choose Git provider",
- "select-repository": "Select repository",
- "configure-deploy": "Configure deploy",
- "choose-git-provider-description": "Choose the Git provider where your database schema scripts (.sql) are hosted. When you push the changed script to the Git repository, Bytebase will automatically create a pipeline to apply the schema change to the database.",
- "choose-git-provider-visit-workspace": "Visit {workspace} setting to add more Git providers.",
- "choose-git-provider-contact-workspace-admin": "Contact your Bytebase workspace admin if you want other Git providers to appear here. Bytebase currently supports self-host GitLab EE/CE, and plan to add GitLab.com, and GitHub Enterprise later.",
- "select-repository-attention-gitlab": "Bytebase only lists GitLab projects granting you at least the 'Maintainer' role, which allows to configure the project webhook to observe the code push event.",
- "select-repository-attention-github": "Bytebase only lists GitHub repositories you have admin permissions, which allows to configure the repository webhook to observe the code push event.",
- "select-repository-attention-bitbucket": "Bytebase only lists Bitbucket repositories you have admin permissions, which allows to configure the repository webhook to observe the code push event.",
- "select-repository-attention-azure-devops": "Bytebase only lists Azure DevOps repositories under the organization which third-party application access via OAuth is granted. If you don't see the repository you want, please go to Organization -> Organization Settings -> Policies to enable third-party application access.",
- "select-repository-search": "Search repository",
- "linked": "Linked repositories"
- },
- "workflow": {
- "gitops-workflow-description": "Database migration scripts are stored in a git repository. To make database changes, a developer would create a migration script and submit for review in the corresponding VCS such as GitLab. After the script is approved and merged into the configured branch, Bytebase will automatically kick off the task to apply the database change."
- },
"anomaly": {
"attention-desc": "Bytebase periodically detects anomalies based on the instance scan interval, and surfaces the findings here.",
"table-placeholder": "Hooray, no {type} anomaly detected!",
@@ -1673,58 +1638,12 @@
},
"select": "Select Project",
"all": "All projects",
- "gitops-connector": {
- "add": "Add GitOps connector",
- "delete": "Delete GitOps connector",
- "update-success": "Successfully updated GitOps connector",
- "create-success": "Successfully created GitOps connector",
- "delete-success": "The GitOps connector is removed"
- },
"masking-exemption": {
"self": "Masking Exemptions",
"grant-exemption": "Grant Exemption",
"revoke-exemption-title": "Remove both export and query masking exemptions for {member}?"
}
},
- "gitops": {
- "setting": {
- "description": "In Bytebase's GitOps workflow, developers store migration scripts in VCS. Pull requests prompt SQL reviews, and merged ones initiate migration plans. Administrators configure VCS providers, while project owners establish VCS connections within projects.",
- "add-git-provider": {
- "self": "Add a Git provider",
- "description": "Before any project can enable GitOps workflow, Bytebase first needs to integrate with the corresponding version control system (VCS) by registering as an OAuth application in that VCS.",
- "gitlab-self-host": "GitLab Self-Hosted",
- "github-self-host": "GitHub Self-Hosted",
- "azure-devops-service": "Azure DevOps Service",
- "add-success": "Successfully added Git provider {vcs}",
- "choose": "Choose Git provider",
- "basic-info": {
- "gitlab-instance-url": "GitLab instance URL",
- "gitlab-instance-url-label": "The VCS instance URL. Make sure this instance and Bytebase are network reachable from each other.",
- "github-instance-url": "GitHub instance URL",
- "bitbucket-instance-url": "Bitbucket instance URL",
- "azure-instance-url": "Azure DevOps instance URL",
- "instance-url-error": "Instance URL must begin with https:// or http://",
- "display-name": "Display name",
- "display-name-label": "An optional display name to help identifying among different configs using the same Git provider."
- },
- "access-token": {
- "personal-access-token": "personal access token",
- "github-fine-grained-token": "fine-grained personal access token",
- "gitlab-personal-access-token": "Create a dedicated service user and generate a {token} with the maintainer role and at least following permissions for the group or projects to be managed. You can generate a project access token for managing a single project, or generate a group access token to manage all projects within the group.",
- "github-personal-access-token": "Create a dedicated service user and generate a {token} with the member role for the organization or all projects to be managed.",
- "bitbucket-app-access-token": "Generate a specific service user and create an {app_password} with at least following permissions for the relevant organizations, projects, or repositories to manage.",
- "bitbucket-app-access-token-tips": "Insert '{secret}' below.",
- "bitbucket-app-password": "app password",
- "azure-devops-personal-access-token": "Create a dedicated service user and generate {token} with the member role for all accessible organizations with the following scopes. The 'Organization' field should be set to 'All accessible organizations'."
- }
- },
- "git-provider": {
- "delete-forbidden": "To delete this provider, unlink all repositories first.",
- "delete": "Delete this Git provider",
- "delete-confirm": "Delete Git provider \"{name}\"?"
- }
- }
- },
"deployment-config": {
"add-selector": "Add selector",
"update-success": "Successfully updated deployment config.",
@@ -2571,7 +2490,6 @@
}
},
"database-group": {
- "self": "Database Group",
"create": "New database group",
"edit": "Edit database group",
"matched-database": "Matched database",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index f5066f307b..453cd79997 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -98,16 +98,12 @@
"detail": "Detalle",
"type": "Tipo",
"language": "Idioma",
- "repository": "Repositorio",
"change": "Cambiar",
- "branch": "Rama",
"sensitive-placeholder": "Sensible - solo escritura",
"enabled": "habilitado",
"default": "predeterminado",
- "gitops": "GitOps",
"restore": "Restaurar",
"detailed-guide": "guía detallada",
- "workspace": "espacio de trabajo",
"confirm": "Confirmar",
"learn-more": "Aprender más",
"troubleshoot": "Solucionar problemas",
@@ -337,7 +333,6 @@
"iam-and-admin": "IAM y administración",
"im-integration": "Integración de IM",
"sso": "SSO",
- "gitops": "GitOps",
"subscription": "Suscripción",
"global-masking": "Enmascaramiento Global",
"data-classification": "Clasificación de datos",
@@ -987,7 +982,6 @@
}
},
"alter-schema": {
- "vcs-info": "VCS habilitado. Seleccionar esto lo llevará al repositorio Git correspondiente para iniciar el proceso de cambio.",
"no-databases-in-project": "No hay bases de datos en este proyecto. Haga clic en Nueva BD o Transferir BD para agregar bases de datos."
},
"quick-action": {
@@ -1363,7 +1357,6 @@
"batch-action-disabled-for-unassigned": "No se puede {action} para una base de datos no asignada",
"data-export-action-disabled": "No se puede exportar datos de más de una base de datos",
"successfully-transferred-databases": "Bases de datos transferidas exitosamente",
- "gitops-enabled": "GitOps habilitado",
"nullable": "Anulable",
"expression": "Expresión",
"position": "Posición",
@@ -1480,34 +1473,6 @@
},
"not-found": "No se puede encontrar la base de datos"
},
- "repository": {
- "our-webhook-link": "El webhook creado por Bytebase se puede encontrar en {webhookLink}.",
- "branch-observe-file-change": "La rama donde Bytebase observa el cambio de archivo.",
- "database-group-description": "Por defecto, los cambios se aplicarán a todas las bases de datos dentro del proyecto. Alternativamente, pueden aplicarse al grupo de bases de datos.",
- "base-directory": "Directorio base",
- "base-directory-description": "El directorio raíz donde Bytebase observa el cambio del archivo. Utilice \"/\" si los archivos están almacenados en el directorio raíz del repositorio.",
- "git-provider": "Proveedor de Git",
- "gitops-naming-format": "formato de nombre",
- "gitops-description-file-path": "Los scripts de migración de bases de datos se almacenan en {fullPath}. Para realizar cambios en la base de datos, un desarrollador crearía un script de migración que se ajuste a {naming}.",
- "gitops-description-branch": "Una vez que el script se aprueba y se fusiona en la rama {branch}, Bytebase creará automáticamente el problema para aplicar el cambio en la base de datos.",
- "setup-wizard-guide": "Si encuentras errores durante el proceso, consulta nuestra {guide}",
- "add-git-provider": "Agregar proveedor de Git",
- "choose-git-provider": "Elegir proveedor de Git",
- "select-repository": "Seleccionar repositorio",
- "configure-deploy": "Configurar implementación",
- "choose-git-provider-description": "Elige el proveedor Git donde se encuentran alojados tus scripts de esquema de base de datos (.sql). Cuando subas el script modificado al repositorio Git, Bytebase creará automáticamente un pipeline para aplicar el cambio de esquema a la base de datos.",
- "choose-git-provider-visit-workspace": "Visita la configuración de {workspace} para agregar más proveedores Git.",
- "choose-git-provider-contact-workspace-admin": "Contacta al administrador de tu espacio de trabajo en Bytebase si deseas que aparezcan otros proveedores de Git aquí. Actualmente, Bytebase admite GitLab EE/CE autohospedado y planea agregar GitLab.com y GitHub Enterprise más adelante.",
- "select-repository-attention-gitlab": "Bytebase solo enumera los proyectos de GitLab que te otorgan al menos el rol de 'Mantenedor', lo que te permite configurar el webhook del proyecto para observar el evento de empuje de código.",
- "select-repository-attention-github": "Bytebase solo enumera los repositorios de GitHub en los que tienes permisos de administrador, lo que te permite configurar el webhook del repositorio para observar el evento de empuje de código.",
- "select-repository-attention-bitbucket": "Bytebase solo enumera los repositorios de Bitbucket en los que tienes permisos de administrador, lo que te permite configurar el webhook del repositorio para observar el evento de empuje de código.",
- "select-repository-attention-azure-devops": "Bytebase solo enumera los repositorios de Azure DevOps en la organización a la que se otorga acceso a aplicaciones de terceros a través de OAuth. \nSi no ve el repositorio que desea, vaya a Organización -> Configuración de la organización -> Políticas para habilitar el acceso a aplicaciones de terceros.",
- "select-repository-search": "Buscar repositorio",
- "linked": "Repositorios vinculados"
- },
- "workflow": {
- "gitops-workflow-description": "Los scripts de migración de bases de datos se almacenan en un repositorio git. Para realizar cambios en la base de datos, un desarrollador crearía un script de migración y lo enviaría para su revisión en el VCS correspondiente, como GitLab. Una vez que el script se aprueba y se fusiona en la rama configurada, Bytebase iniciará automáticamente la tarea para aplicar el cambio en la base de datos."
- },
"anomaly": {
"attention-desc": "Bytebase detecta periódicamente anomalías según el intervalo de escaneo de la instancia y muestra los hallazgos aquí.",
"table-placeholder": "¡Hurra, no se detectaron anomalías de {type}!",
@@ -1673,58 +1638,12 @@
},
"select": "Seleccionar Proyecto",
"all": "Todos los proyectos",
- "gitops-connector": {
- "add": "Agregar conector GitOps",
- "delete": "Eliminar conector GitOps",
- "update-success": "Conector GitOps actualizado correctamente",
- "create-success": "Conector GitOps creado correctamente",
- "delete-success": "Se elimina el conector GitOps"
- },
"masking-exemption": {
"self": "Exenciones de Enmascaramiento",
"grant-exemption": "Conceder Exención",
"revoke-exemption-title": "Eliminar tanto las exenciones de exportación como de consulta de enmascaramiento para {member}?"
}
},
- "gitops": {
- "setting": {
- "description": "En el flujo de trabajo GitOps de Bytebase, los desarrolladores almacenan scripts de migración en VCS. Las solicitudes de extracción provocan revisiones SQL, y las fusionadas inician planes de migración. Los administradores configuran proveedores de VCS, mientras que los propietarios del proyecto establecen conexiones de VCS dentro de los proyectos.",
- "add-git-provider": {
- "self": "Agregar un proveedor de Git",
- "description": "Antes de que cualquier proyecto pueda habilitar el flujo de trabajo de GitOps, Bytebase primero debe integrarse con el sistema de control de versiones (VCS) correspondiente registrándose como una aplicación OAuth en ese VCS.",
- "gitlab-self-host": "GitLab autohospedado",
- "github-self-host": "GitHub autohospedado",
- "azure-devops-service": "Servicio Azure DevOps",
- "add-success": "Proveedor de Git {vcs} agregado exitosamente",
- "choose": "Elige proveedor de Git",
- "basic-info": {
- "gitlab-instance-url": "URL de la instancia de GitLab",
- "gitlab-instance-url-label": "La URL de la instancia VCS. Asegúrate de que esta instancia y Bytebase sean accesibles desde la red.",
- "github-instance-url": "URL de la instancia de GitHub",
- "bitbucket-instance-url": "URL de la instancia de Bitbucket",
- "azure-instance-url": "URL de la instancia de Azure DevOps",
- "instance-url-error": "La URL de la instancia debe comenzar con https:// o http://",
- "display-name": "Nombre para mostrar",
- "display-name-label": "Un nombre opcional para identificar entre diferentes configuraciones que utilizan el mismo proveedor de Git."
- },
- "access-token": {
- "personal-access-token": "ficha de acceso personal",
- "github-fine-grained-token": "token de acceso personal detallado",
- "gitlab-personal-access-token": "Cree un usuario de servicio dedicado y genere un {token} con el rol de mantenedor y al menos los siguientes permisos para el grupo o proyectos que se administrarán. Puede generar un token de acceso al proyecto para administrar un solo proyecto o generar un token de acceso grupal para administrar todos los proyectos dentro del grupo.",
- "github-personal-access-token": "Cree un usuario de servicio dedicado y genere un {token} con el rol de miembro de la organización o de todos los proyectos que se administrarán.",
- "bitbucket-app-access-token": "Genere un usuario de servicio específico y cree una {app_password} con al menos los siguientes permisos para que las organizaciones, proyectos o repositorios relevantes los administren.",
- "bitbucket-app-access-token-tips": "Insertar '{secret}' debajo.",
- "bitbucket-app-password": "contraseña de la aplicación",
- "azure-devops-personal-access-token": "Cree un usuario de servicio dedicado y genere un {token} con el rol de miembro para todas las organizaciones accesibles con los siguientes alcances. El campo \"Organización\" debe estar configurado en \"Todas las organizaciones accesibles\"."
- }
- },
- "git-provider": {
- "delete-forbidden": "Para eliminar este proveedor, primero desenlaza todos los repositorios.",
- "delete": "Eliminar este proveedor de Git",
- "delete-confirm": "¿Eliminar el proveedor de Git \"{name}\"?"
- }
- }
- },
"deployment-config": {
"add-selector": "Agregar selector",
"update-success": "Configuración de implementación actualizada con éxito.",
@@ -2571,7 +2490,6 @@
}
},
"database-group": {
- "self": "Grupo de Bases de Datos",
"create": "Crear grupo de bases de datos",
"edit": "Editar grupo de bases de datos",
"matched-database": "Base de datos coincidente",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 014710b19c..ae160d2f6a 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -98,16 +98,12 @@
"detail": "詳細",
"type": "タイプ",
"language": "言語",
- "repository": "リポジトリ",
"change": "変化",
- "branch": "ブランチ",
"sensitive-placeholder": "機密データ - 書き込みのみ",
"enabled": "オンにする",
"default": "デフォルト",
- "gitops": "GitOps",
"restore": "復元する",
"detailed-guide": "詳細ガイド",
- "workspace": "ワークスペース",
"confirm": "確認する",
"learn-more": "もっと詳しく知る",
"troubleshoot": "トラブルシューティング",
@@ -337,7 +333,6 @@
"iam-and-admin": "IAM と管理",
"im-integration": "IM",
"sso": "SSO",
- "gitops": "GitOps",
"subscription": "サブスクリプション",
"global-masking": "グローバルマスキング",
"data-classification": "データ分類",
@@ -987,7 +982,6 @@
}
},
"alter-schema": {
- "vcs-info": "VCS バージョン管理が有効になっています。データベースを選択すると、対応する Git リポジトリにジャンプし、変更プロセスが開始されます。",
"no-databases-in-project": "このプロジェクトにはデータベースがありません。 「データベースの作成」または「データベースの転送」をクリックしてデータベースを追加します。"
},
"quick-action": {
@@ -1363,7 +1357,6 @@
"batch-action-disabled-for-unassigned": "未割り当てのデータベース {action} にアクセスできません",
"data-export-action-disabled": "複数のデータベースからデータをエクスポートできない",
"successfully-transferred-databases": "データベースの移行が完了しました",
- "gitops-enabled": "GitOps が有効になっている",
"nullable": "null も可能",
"expression": "表現",
"position": "位置",
@@ -1480,34 +1473,6 @@
},
"not-found": "データベースが見つかりません"
},
- "repository": {
- "our-webhook-link": "Bytebase によって作成された Webhook は、{webhookLink} にあります。",
- "branch-observe-file-change": "バイトベースはファイルへのブランチ変更を追跡します。",
- "database-group-description": "デフォルトでは、変更はプロジェクト内のすべてのデータベースに適用されます。あるいは、データベース グループに適用することもできます。",
- "base-directory": "ルートディレクトリ",
- "base-directory-description": "Bytebase は、ファイルの変更を監視するためのルート ディレクトリです。ファイルがリポジトリ ルートに保存されている場合は、「/」を使用します。",
- "git-provider": "Gitプロバイダー",
- "gitops-naming-format": "命名形式",
- "gitops-description-file-path": "データベース変更スクリプトは {fullPath} にあります。変更を加えるには、開発者は {naming} に一致する変更スクリプトを作成する必要があります。",
- "gitops-description-branch": "スクリプトが承認され、{branch} ブランチにマージされると、Bytebase はデータベースを変更するためのイシューを自動的に作成します。",
- "setup-wizard-guide": "プロセス中に問題が発生した場合は、{guide} を参照してください。",
- "add-git-provider": "Gitプロバイダーの追加",
- "choose-git-provider": "Git プロバイダーを選択する",
- "select-repository": "リポジトリを選択してください",
- "configure-deploy": "デプロイ設定",
- "choose-git-provider-description": "データベース スキーマ スクリプトをホストする Git プロバイダーを選択します。変更スクリプトを Git リポジトリにプッシュすると、Bytebase はデータベースの変更をデータベースに適用するためのイシューを自動的に作成します。",
- "choose-git-provider-visit-workspace": "さらに Git プロバイダを追加するには、{workspace} 設定にアクセスしてください。",
- "choose-git-provider-contact-workspace-admin": "他の Git プロバイダーをリストに表示したい場合は、Bytebase ワークスペース管理者に問い合わせてください。現在、Bytebase は独自にホストされた GitLab EE/CE をサポートしていますが、将来的には GitLab.com と GitHub Enterprise もサポートする予定です",
- "select-repository-attention-gitlab": "Bytebase には、少なくとも「Maintainer」権限を持つ GitLab プロジェクトのみがリストされます。少なくともこの権限を持っている場合にのみ、コード プッシュ イベントをリッスンするようにプロジェクトの Webhook を設定できるためです。",
- "select-repository-attention-github": "Bytebase には、管理者権限を持つ GitHub リポジトリのみがリストされます。この権限があればのみ、コード プッシュ イベントをリッスンするようにウェアハウスの Webhook を設定できるためです。",
- "select-repository-attention-bitbucket": "Bytebase には、管理者権限がある Bitbucket リポジトリのみがリストされます。この権限があればのみ、コード プッシュ イベントをリッスンするようにウェアハウスの Webhook を設定できるためです。",
- "select-repository-attention-azure-devops": "Bytebase には、OAuth を介してサードパーティ アプリケーションへのアクセスを許可する組織に属する Azure DevOps リポジトリのみがリストされます。\n必要なリポジトリが表示されない場合は、[組織] -> [組織の設定] -> [ポリシー] に移動して、サードパーティ アプリケーションのアクセスを有効にします。",
- "select-repository-search": "リポジトリを検索する",
- "linked": "関連倉庫"
- },
- "workflow": {
- "gitops-workflow-description": "データベース変更スクリプトは Git リポジトリに保存されます。データベースを変更するには、開発者は変更スクリプトを作成し、レビューのために GitLab などの VCS に送信します。レビューが合格し、設定されたブランチにマージされると、Bytebase はデータベースを変更するためのイシューを自動的に生成します。"
- },
"anomaly": {
"attention-desc": "Bytebase は、インスタンスに設定されたスキャン間隔に基づいて異常を検出し、ここに表示します。",
"table-placeholder": "すばらしいです。{type} 例外は検出されませんでした。",
@@ -1673,58 +1638,12 @@
},
"select": "アイテムを選択",
"all": "全てのアイテム",
- "gitops-connector": {
- "add": "新しい GitOps 接続を追加",
- "delete": "GitOps接続を削除する",
- "update-success": "GitOps 接続が更新されました",
- "create-success": "GitOps 接続が作成されました",
- "delete-success": "GitOps 接続が削除されました"
- },
"masking-exemption": {
"self": "マスキング免除",
"grant-exemption": "免除を付与",
"revoke-exemption-title": "{member} のエクスポートおよびクエリのマスキング免除を両方削除しますか?"
}
},
- "gitops": {
- "setting": {
- "description": "Bytebase GitOps ワークフローでは、開発者は移行スクリプトを VCS に保存します。プル リクエストにより SQL レビューがトリガーされ、マージ時に移行計画が開始されます。管理者は VCS プロバイダーを設定し、プロジェクト所有者はプロジェクト内で VCS 接続を確立します。",
- "add-git-provider": {
- "self": "Gitプロバイダーの追加",
- "description": "プロジェクトで GitOps ワークフローを有効にする前に、まず Bytebase を VCS に OAuth アプリケーションとして登録して VCS と統合する必要があります。",
- "gitlab-self-host": "自己ホスト型 GitLab",
- "github-self-host": "セルフホスト型 GitHub",
- "azure-devops-service": "Azure DevOps サービス",
- "add-success": "Git プロバイダー「{vcs}」が正常に追加されました",
- "choose": "Git プロバイダーを選択する",
- "basic-info": {
- "gitlab-instance-url": "GitLab インスタンスの URL",
- "gitlab-instance-url-label": "VCS インスタンスの URL。このインスタンスと Bytebase の間のネットワークが相互接続されていることを確認してください。",
- "github-instance-url": "GitHub インスタンスの URL",
- "bitbucket-instance-url": "Bitbucket インスタンスの URL",
- "azure-instance-url": "Azure DevOps インスタンスの URL",
- "instance-url-error": "インスタンス URL は https:// または http:// で始まる必要があります",
- "display-name": "表示名",
- "display-name-label": "異なる Git プロバイダーを区別するためのオプションの表示名。"
- },
- "access-token": {
- "personal-access-token": "個人アクセストークン",
- "github-fine-grained-token": "きめ細かい個人アクセス トークン",
- "gitlab-personal-access-token": "専用のサービス ユーザーを作成し、メンテナー ロールと、管理するグループまたはプロジェクトに対する少なくとも次の権限を持つ {token} を生成します。プロジェクト アクセス トークンを生成して単一のプロジェクトを管理することも、グループ アクセス トークンを生成してグループ内のすべてのプロジェクトを管理することもできます。",
- "github-personal-access-token": "専用のサービス ユーザーを作成し、組織または管理する必要があるすべてのプロジェクトのメンバー ロールを持つ {token} を生成します。",
- "bitbucket-app-access-token": "特定のサービス ユーザーを生成し、関連する組織、プロジェクト、またはリポジトリを管理するための少なくとも次の権限を持つ 1 つの {app_password} を作成します。",
- "bitbucket-app-access-token-tips": "以下に「{secret}」を挿入します。",
- "bitbucket-app-password": "アプリケーションパスワード",
- "azure-devops-personal-access-token": "専用のサービス ユーザーを作成し、次のスコープを持つアクセス可能なすべての組織のメンバー ロールを持つ {token} を生成します。 「組織」フィールドは「アクセス可能なすべての組織」に設定する必要があります。"
- }
- },
- "git-provider": {
- "delete-forbidden": "このプロバイダーを削除する前に、すべてのウェアハウスの関連付けを解除する必要があります。",
- "delete": "Git プロバイダーを削除する",
- "delete-confirm": "Git プロバイダー「{name}」を削除しますか?"
- }
- }
- },
"deployment-config": {
"add-selector": "選択基準を追加する",
"update-success": "デプロイ設定が正常に更新されました",
@@ -2571,7 +2490,6 @@
}
},
"database-group": {
- "self": "データベースのグループ化",
"create": "新しいデータベースグループを作成する",
"edit": "データベースグループの編集",
"matched-database": "マッチングデータベース",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 60cd62c686..88ba6ab3a0 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -98,16 +98,12 @@
"detail": "Chi tiết",
"type": "Loại",
"language": "Ngôn ngữ",
- "repository": "Kho lưu trữ",
"change": "Thay đổi",
- "branch": "Nhánh",
"sensitive-placeholder": "Nhạy cảm - Chỉ ghi",
"enabled": "Đã kích hoạt",
"default": "Mặc định",
- "gitops": "GitOps",
"restore": "Khôi phục",
"detailed-guide": "Hướng dẫn chi tiết",
- "workspace": "Không gian làm việc",
"confirm": "Xác nhận",
"learn-more": "Tìm hiểu thêm",
"troubleshoot": "Khắc phục sự cố",
@@ -337,7 +333,6 @@
"iam-and-admin": "IAM & Quản trị",
"im-integration": "Tích hợp",
"sso": "SSO",
- "gitops": "GitOps",
"subscription": "Gói đăng ký",
"global-masking": "Che giấu toàn cục",
"data-classification": "Phân loại dữ liệu",
@@ -987,7 +982,6 @@
}
},
"alter-schema": {
- "vcs-info": "VCS đã được bật. Chọn tùy chọn này sẽ điều hướng bạn đến kho lưu trữ Git tương ứng để bắt đầu quá trình thay đổi.",
"no-databases-in-project": "Không có cơ sở dữ liệu nào trong dự án này. Nhấp vào Cơ sở dữ liệu mới hoặc Chuyển vào Cơ sở dữ liệu để thêm cơ sở dữ liệu."
},
"quick-action": {
@@ -1363,7 +1357,6 @@
"batch-action-disabled-for-unassigned": "Không thể {action} đối với cơ sở dữ liệu chưa được gán",
"data-export-action-disabled": "Không thể xuất dữ liệu cho nhiều hơn một cơ sở dữ liệu",
"successfully-transferred-databases": "Đã chuyển thành công cơ sở dữ liệu",
- "gitops-enabled": "GitOps đã bật",
"nullable": "Có thể null",
"expression": "Biểu thức",
"position": "Vị trí",
@@ -1480,34 +1473,6 @@
},
"not-found": "Không tìm thấy cơ sở dữ liệu"
},
- "repository": {
- "our-webhook-link": "Webhook được tạo bởi Bytebase có thể được tìm thấy tại {webhookLink}.",
- "branch-observe-file-change": "Nhánh mà Bytebase quan sát sự thay đổi tệp.",
- "database-group-description": "Theo mặc định, các thay đổi sẽ được áp dụng cho tất cả cơ sở dữ liệu trong dự án. Ngoài ra, chúng có thể được áp dụng cho nhóm cơ sở dữ liệu.",
- "base-directory": "Thư mục cơ sở",
- "base-directory-description": "Thư mục gốc nơi Bytebase quan sát sự thay đổi tệp. Sử dụng \"/\" nếu các tệp được lưu trữ trong thư mục gốc của kho lưu trữ.",
- "git-provider": "Nhà cung cấp Git",
- "gitops-naming-format": "định dạng đặt tên",
- "gitops-description-file-path": "Tập lệnh di chuyển cơ sở dữ liệu được lưu trữ trong {fullPath}. Để thực hiện thay đổi cơ sở dữ liệu, nhà phát triển sẽ tạo một tập lệnh di chuyển tuân theo {naming}.",
- "gitops-description-branch": "Sau khi tập lệnh được phê duyệt và hợp nhất vào nhánh {branch}, Bytebase sẽ tự động tạo vấn đề để áp dụng thay đổi cơ sở dữ liệu.",
- "setup-wizard-guide": "Nếu bạn gặp lỗi trong quá trình này, vui lòng tham khảo {guide} của chúng tôi",
- "add-git-provider": "Thêm nhà cung cấp Git",
- "choose-git-provider": "Chọn nhà cung cấp Git",
- "select-repository": "Chọn kho lưu trữ",
- "configure-deploy": "Cấu hình triển khai",
- "choose-git-provider-description": "Chọn nhà cung cấp Git nơi lưu trữ tập lệnh lược đồ cơ sở dữ liệu (.sql) của bạn. Khi bạn đẩy tập lệnh đã thay đổi vào kho lưu trữ Git, Bytebase sẽ tự động tạo một quy trình để áp dụng thay đổi lược đồ cho cơ sở dữ liệu.",
- "choose-git-provider-visit-workspace": "Truy cập cài đặt {workspace} để thêm nhiều nhà cung cấp Git.",
- "choose-git-provider-contact-workspace-admin": "Liên hệ với quản trị viên không gian làm việc Bytebase của bạn nếu bạn muốn các nhà cung cấp Git khác xuất hiện ở đây. Bytebase hiện hỗ trợ GitLab EE/CE tự lưu trữ và có kế hoạch thêm GitLab.com và GitHub Enterprise sau này.",
- "select-repository-attention-gitlab": "Bytebase chỉ liệt kê các dự án GitLab cấp cho bạn ít nhất vai trò 'Maintainer', cho phép định cấu hình webhook dự án để quan sát sự kiện đẩy mã.",
- "select-repository-attention-github": "Bytebase chỉ liệt kê các kho lưu trữ GitHub mà bạn có quyền quản trị, cho phép định cấu hình webhook kho lưu trữ để quan sát sự kiện đẩy mã.",
- "select-repository-attention-bitbucket": "Bytebase chỉ liệt kê các kho lưu trữ Bitbucket mà bạn có quyền quản trị, cho phép định cấu hình webhook kho lưu trữ để quan sát sự kiện đẩy mã.",
- "select-repository-attention-azure-devops": "Bytebase chỉ liệt kê các kho lưu trữ Azure DevOps thuộc tổ chức mà quyền truy cập ứng dụng của bên thứ ba thông qua OAuth được cấp. Nếu bạn không thấy kho lưu trữ bạn muốn, vui lòng truy cập Tổ chức -> Cài đặt tổ chức -> Chính sách để bật quyền truy cập ứng dụng của bên thứ ba.",
- "select-repository-search": "Tìm kiếm kho lưu trữ",
- "linked": "Kho lưu trữ được liên kết"
- },
- "workflow": {
- "gitops-workflow-description": "Tập lệnh di chuyển cơ sở dữ liệu được lưu trữ trong kho lưu trữ git. Để thực hiện thay đổi cơ sở dữ liệu, nhà phát triển sẽ tạo một tập lệnh di chuyển và gửi để xem xét trong VCS tương ứng như GitLab. Sau khi tập lệnh được phê duyệt và hợp nhất vào nhánh đã định cấu hình, Bytebase sẽ tự động khởi động tác vụ để áp dụng thay đổi cơ sở dữ liệu."
- },
"anomaly": {
"attention-desc": "Bytebase định kỳ phát hiện các bất thường dựa trên khoảng thời gian quét phiên bản và hiển thị các phát hiện ở đây.",
"table-placeholder": "Hoan hô, không phát hiện thấy bất thường {type} nào!",
@@ -1673,58 +1638,12 @@
},
"select": "Chọn Dự án",
"all": "Tất cả dự án",
- "gitops-connector": {
- "add": "Thêm trình kết nối GitOps",
- "delete": "Xóa trình kết nối GitOps",
- "update-success": "Đã cập nhật thành công trình kết nối GitOps",
- "create-success": "Đã tạo thành công trình kết nối GitOps",
- "delete-success": "Trình kết nối GitOps bị xóa"
- },
"masking-exemption": {
"self": "Miễn trừ Che giấu",
"grant-exemption": "Cấp Miễn trừ",
"revoke-exemption-title": "Xóa cả miễn trừ che giấu xuất và truy vấn cho {member}?"
}
},
- "gitops": {
- "setting": {
- "description": "Trong quy trình GitOps của Bytebase, các nhà phát triển lưu trữ tập lệnh di chuyển trong VCS. Yêu cầu kéo nhắc đánh giá SQL và những yêu cầu được hợp nhất bắt đầu kế hoạch di chuyển. Quản trị viên định cấu hình nhà cung cấp VCS, trong khi chủ sở hữu dự án thiết lập kết nối VCS trong các dự án.",
- "add-git-provider": {
- "self": "Thêm nhà cung cấp Git",
- "description": "Trước khi bất kỳ dự án nào có thể bật quy trình GitOps, trước tiên Bytebase cần tích hợp với hệ thống kiểm soát phiên bản (VCS) tương ứng bằng cách đăng ký làm ứng dụng OAuth trong VCS đó.",
- "gitlab-self-host": "GitLab Tự lưu trữ",
- "github-self-host": "GitHub Tự lưu trữ",
- "azure-devops-service": "Dịch vụ Azure DevOps",
- "add-success": "Đã thêm thành công nhà cung cấp Git {vcs}",
- "choose": "Chọn nhà cung cấp Git",
- "basic-info": {
- "gitlab-instance-url": "URL phiên bản GitLab",
- "gitlab-instance-url-label": "URL phiên bản VCS. Đảm bảo phiên bản này và Bytebase có thể truy cập mạng từ nhau.",
- "github-instance-url": "URL phiên bản GitHub",
- "bitbucket-instance-url": "URL phiên bản Bitbucket",
- "azure-instance-url": "URL phiên bản Azure DevOps",
- "instance-url-error": "URL phiên bản phải bắt đầu bằng https:// hoặc http://",
- "display-name": "Tên hiển thị",
- "display-name-label": "Tên hiển thị tùy chọn để giúp xác định trong số các cấu hình khác nhau sử dụng cùng một nhà cung cấp Git."
- },
- "access-token": {
- "personal-access-token": "mã thông báo truy cập cá nhân",
- "github-fine-grained-token": "mã thông báo truy cập cá nhân chi tiết",
- "gitlab-personal-access-token": "Tạo một người dùng dịch vụ chuyên dụng và tạo một {token} với vai trò người bảo trì và ít nhất các quyền sau cho nhóm hoặc dự án sẽ được quản lý. Bạn có thể tạo mã thông báo truy cập dự án để quản lý một dự án duy nhất hoặc tạo mã thông báo truy cập nhóm để quản lý tất cả các dự án trong nhóm.",
- "github-personal-access-token": "Tạo một tài khoản dịch vụ chuyên dụng và tạo một {token} với vai trò thành viên cho tổ chức hoặc tất cả các dự án cần quản lý.",
- "bitbucket-app-access-token": "Tạo một người dùng dịch vụ cụ thể và tạo {app_password} với ít nhất các quyền sau cho các tổ chức, dự án hoặc kho lưu trữ có liên quan để quản lý.",
- "bitbucket-app-access-token-tips": "Chèn '{secret}' bên dưới.",
- "bitbucket-app-password": "mật khẩu ứng dụng",
- "azure-devops-personal-access-token": "Tạo một người dùng dịch vụ chuyên dụng và tạo {token} với vai trò thành viên cho tất cả các tổ chức có thể truy cập với các phạm vi sau. Trường 'Tổ chức' phải được đặt thành 'Tất cả các tổ chức có thể truy cập'."
- }
- },
- "git-provider": {
- "delete-forbidden": "Để xóa nhà cung cấp này, hãy hủy liên kết tất cả các kho lưu trữ trước.",
- "delete": "Xóa nhà cung cấp Git này",
- "delete-confirm": "Xóa nhà cung cấp Git \"{name}\"?"
- }
- }
- },
"deployment-config": {
"add-selector": "Thêm bộ chọn",
"update-success": "Đã cập nhật thành công cấu hình triển khai.",
@@ -2571,7 +2490,6 @@
}
},
"database-group": {
- "self": "Nhóm cơ sở dữ liệu",
"create": "Nhóm cơ sở dữ liệu mới",
"edit": "Chỉnh sửa nhóm cơ sở dữ liệu",
"matched-database": "Cơ sở dữ liệu phù hợp",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 4bf58a931b..0ad92b0072 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -98,16 +98,12 @@
"detail": "详情",
"type": "类型",
"language": "语言",
- "repository": "仓库",
"change": "变更",
- "branch": "分支",
"sensitive-placeholder": "敏感数据 - 仅写入",
"enabled": "开启",
"default": "默认",
- "gitops": "GitOps",
"restore": "恢复",
"detailed-guide": "详细指南",
- "workspace": "工作空间",
"confirm": "确认",
"learn-more": "了解更多",
"troubleshoot": "排查问题",
@@ -337,7 +333,6 @@
"iam-and-admin": "IAM & 管理",
"im-integration": "IM",
"sso": "SSO",
- "gitops": "GitOps",
"subscription": "订阅",
"global-masking": "全局数据脱敏",
"data-classification": "数据分类",
@@ -987,7 +982,6 @@
}
},
"alter-schema": {
- "vcs-info": "已开启 VCS 版本管理。选择该数据库会跳转到对应的 Git 仓库以发起变更流程。",
"no-databases-in-project": "该项目里没有数据库。点击 创建数据库 或 转移数据库 以添加数据库。"
},
"quick-action": {
@@ -1363,7 +1357,6 @@
"batch-action-disabled-for-unassigned": "无法对未分配的数据库{action}",
"data-export-action-disabled": "无法对多个数据库进行数据导出",
"successfully-transferred-databases": "数据库转移完成",
- "gitops-enabled": "已启用 GitOps",
"nullable": "可为空",
"expression": "表达式",
"position": "位置",
@@ -1480,34 +1473,6 @@
},
"not-found": "找不到数据库"
},
- "repository": {
- "our-webhook-link": "Bytebase 创建的 webhook 可以在 {webhookLink} 中找到。",
- "branch-observe-file-change": "Bytebase 跟踪文件变更的分支。",
- "database-group-description": "默认情况下,更改将应用于项目中的所有数据库。或者,也可以应用于指定的数据库分组。",
- "base-directory": "根目录",
- "base-directory-description": "Bytebase 观察文件变化的根目录。如果文件存储在存储库根目录中,请使用“/”。",
- "git-provider": "Git 提供方",
- "gitops-naming-format": "命名格式",
- "gitops-description-file-path": "数据库变更脚本存放在 {fullPath}。为了进行一次变更,开发者需要创建一个匹配 {naming} 的变更脚本。",
- "gitops-description-branch": "当脚本审核通过并且合并到 {branch} 分支后,Bytebase 将自动创建工单来进行数据库变更。",
- "setup-wizard-guide": "如果您在过程中遇到问题, 请参考 {guide}",
- "add-git-provider": "添加 Git 提供方",
- "choose-git-provider": "选择 Git 提供方",
- "select-repository": "选择仓库",
- "configure-deploy": "配置部署",
- "choose-git-provider-description": "选择存放着您数据库 schema 脚本的 Git 提供方。当您把变更脚本推送到 Git 仓库后,Bytebase 会自动创建工单把数据库变更应用到数据库上。",
- "choose-git-provider-visit-workspace": "访问 {workspace} 设置以添加更多 Git 提供方.",
- "choose-git-provider-contact-workspace-admin": "如果您希望其他 Git 提供方出现在列表中,请联系 Bytebase 工作空间管理员。当前 Bytebase 支持自己托管的 GitLab EE/CE,我们之后也会支持 GitLab.com 和 GitHub Enterprise",
- "select-repository-attention-gitlab": "Bytebase 仅列出您至少拥有 'Maintainer' 权限的 GitLab 项目。因为只有至少拥有该权限,才能够配置项目的 webhook 用来监听代码推送事件。",
- "select-repository-attention-github": "Bytebase 仅列出您拥有管理员权限的 GitHub 仓库。因为只有拥有该权限,才能够配置仓库的 webhook 用来监听代码推送事件。",
- "select-repository-attention-bitbucket": "Bytebase 仅列出您拥有管理员权限的 Bitbucket 仓库。因为只有拥有该权限,才能够配置仓库的 webhook 用来监听代码推送事件。",
- "select-repository-attention-azure-devops": "Bytebase 仅列出授予第三方应用程序通过 OAuth 访问的组织下的 Azure DevOps 存储库。\n如果您没有看到所需的存储库,请转到组织 -> 组织设置 -> 策略 以启用第三方应用程序访问。",
- "select-repository-search": "搜索仓库",
- "linked": "关联的仓库"
- },
- "workflow": {
- "gitops-workflow-description": "数据库变更脚本保存在 Git 仓库中。为了进行一次数据库变更,开发者会创建一个变更脚本并且提交至诸如 GitLab 这样的 VCS 进行审核。 当审核通过并且合并到配置的分支后,Bytebase 会自动生成工单来进行数据库变更。"
- },
"anomaly": {
"attention-desc": "Bytebase 会根据实例配置的扫描间隔检测异常,并且展示在这里。",
"table-placeholder": "很棒,没有检测到{type}异常!",
@@ -1673,58 +1638,12 @@
},
"select": "选择项目",
"all": "所有项目",
- "gitops-connector": {
- "add": "新增 GitOps 连接",
- "delete": "删除 GitOps 连接",
- "update-success": "GitOps 连接已更新",
- "create-success": "GitOps 连接已创建",
- "delete-success": "GitOps 连接已删除"
- },
"masking-exemption": {
"self": "脱敏豁免",
"grant-exemption": "授予豁免",
"revoke-exemption-title": "是否撤销 {member} 的导出和查询脱敏?"
}
},
- "gitops": {
- "setting": {
- "description": "在 Bytebase GitOps 工作流程中,开发人员将迁移脚本存储在 VCS 中。拉取请求触发 SQL 审查,合并后启动迁移计划。管理员配置 VCS 提供商,而项目所有者在项目内建立 VCS 连接。",
- "add-git-provider": {
- "self": "添加 Git 提供方",
- "description": "在项目可以启用 GitOps 工作流前,Bytebase 首先需要以在 VCS 中注册为 OAuth 应用的方式和 VCS 进行集成。",
- "gitlab-self-host": "自托管 GitLab",
- "github-self-host": "自托管 GitHub",
- "azure-devops-service": "Azure DevOps 服务",
- "add-success": "成功添加了 Git 提供方「{vcs}」",
- "choose": "选择 Git 提供方",
- "basic-info": {
- "gitlab-instance-url": "GitLab 实例 URL",
- "gitlab-instance-url-label": "VCS 实例 URL。请确认这个实例和 Bytebase 之间网络是互通的。",
- "github-instance-url": "GitHub 实例 URL",
- "bitbucket-instance-url": "Bitbucket 实例 URL",
- "azure-instance-url": "Azure DevOps 实例 URL",
- "instance-url-error": "实例 URL 必须以 https:// or http:// 开头",
- "display-name": "展示名称",
- "display-name-label": "一个可选的展示名称用以区分不同的 Git 供应方。"
- },
- "access-token": {
- "personal-access-token": "个人访问令牌",
- "github-fine-grained-token": "细粒度的个人访问令牌",
- "gitlab-personal-access-token": "创建专用服务用户并生成具有维护者角色的{token},并且至少具有要管理的组或项目的以下权限。您可以生成项目访问令牌来管理单个项目,或生成组访问令牌来管理组内的所有项目。",
- "github-personal-access-token": "创建一个专用服务用户,并为组织或所有需要管理的项目生成一个具有成员角色的{token}。",
- "bitbucket-app-access-token": "生成特定服务用户并创建一个至少具有以下权限的 {app_password},以便管理相关组织、项目或存储库。",
- "bitbucket-app-access-token-tips": "在下面插入‘{secret}’。",
- "bitbucket-app-password": "应用程序密码",
- "azure-devops-personal-access-token": "创建专用服务用户并为具有以下范围的所有可访问组织生成具有成员角色的{token}。 “组织”字段应设置为“所有可访问的组织”。"
- }
- },
- "git-provider": {
- "delete-forbidden": "删除这个提供方前,需要先解除所有仓库的关联。",
- "delete": "删除 Git 提供方",
- "delete-confirm": "删除 Git 提供方 \"{name}\"?"
- }
- }
- },
"deployment-config": {
"add-selector": "添加选择条件",
"update-success": "成功更新部署配置",
@@ -2571,7 +2490,6 @@
}
},
"database-group": {
- "self": "数据库分组",
"create": "新建数据库分组",
"edit": "编辑数据库分组",
"matched-database": "相匹配的数据库",
diff --git a/frontend/src/router/dashboard/projectV1.ts b/frontend/src/router/dashboard/projectV1.ts
index 388b3b2f35..e4d64f5e1a 100644
--- a/frontend/src/router/dashboard/projectV1.ts
+++ b/frontend/src/router/dashboard/projectV1.ts
@@ -23,9 +23,6 @@ export const PROJECT_V1_ROUTE_SYNC_SCHEMA = `${PROJECT_V1_ROUTE_DASHBOARD}.sync-
export const PROJECT_V1_ROUTE_SLOW_QUERIES = `${PROJECT_V1_ROUTE_DASHBOARD}.slow-queries`;
export const PROJECT_V1_ROUTE_ANOMALIES = `${PROJECT_V1_ROUTE_DASHBOARD}.anomalies`;
export const PROJECT_V1_ROUTE_AUDIT_LOGS = `${PROJECT_V1_ROUTE_DASHBOARD}.audit-logs`;
-export const PROJECT_V1_ROUTE_GITOPS = `${PROJECT_V1_ROUTE_DASHBOARD}.gitops`;
-export const PROJECT_V1_ROUTE_GITOPS_CREATE = `${PROJECT_V1_ROUTE_GITOPS}.create`;
-export const PROJECT_V1_ROUTE_GITOPS_DETAIL = `${PROJECT_V1_ROUTE_GITOPS}.detail`;
export const PROJECT_V1_ROUTE_WEBHOOKS = `${PROJECT_V1_ROUTE_DASHBOARD}.webhook`;
export const PROJECT_V1_ROUTE_WEBHOOK_CREATE = `${PROJECT_V1_ROUTE_DASHBOARD}.webhook.create`;
export const PROJECT_V1_ROUTE_WEBHOOK_DETAIL = `${PROJECT_V1_ROUTE_DASHBOARD}.webhook.detail`;
@@ -271,54 +268,6 @@ const projectV1Routes: RouteRecordRaw[] = [
component: () => import("@/views/project/ProjectAuditLogDashboard.vue"),
props: true,
},
- {
- path: "gitops",
- meta: {
- overrideTitle: true,
- },
- props: true,
- children: [
- {
- path: "",
- name: PROJECT_V1_ROUTE_GITOPS,
- meta: {
- requiredProjectPermissionList: () => [
- "bb.projects.get",
- "bb.vcsConnectors.list",
- ],
- },
- component: () =>
- import("@/views/project/ProjectVersionControlPanel.vue"),
- props: true,
- },
- {
- path: "new",
- name: PROJECT_V1_ROUTE_GITOPS_CREATE,
- meta: {
- requiredProjectPermissionList: () => [
- "bb.projects.get",
- "bb.vcsConnectors.create",
- ],
- },
- component: () =>
- import("@/views/project/ProjectVersionControlCreate.vue"),
- props: true,
- },
- {
- path: ":vcsConnectorId",
- name: PROJECT_V1_ROUTE_GITOPS_DETAIL,
- meta: {
- requiredProjectPermissionList: () => [
- "bb.projects.get",
- "bb.vcsConnectors.get",
- ],
- },
- component: () =>
- import("@/views/project/ProjectVersionControlDetail.vue"),
- props: true,
- },
- ],
- },
{
path: "webhooks",
meta: {
diff --git a/frontend/src/router/dashboard/workspace.ts b/frontend/src/router/dashboard/workspace.ts
index b6e96cf198..57953b7b62 100644
--- a/frontend/src/router/dashboard/workspace.ts
+++ b/frontend/src/router/dashboard/workspace.ts
@@ -19,9 +19,6 @@ import {
WORKSPACE_ROUTE_SEMANTIC_TYPES,
WORKSPACE_ROUTE_DATA_CLASSIFICATION,
WORKSPACE_ROUTE_AUDIT_LOG,
- WORKSPACE_ROUTE_GITOPS,
- WORKSPACE_ROUTE_GITOPS_CREATE,
- WORKSPACE_ROUTE_GITOPS_DETAIL,
WORKSPACE_ROUTE_SSO,
WORKSPACE_ROUTE_SSO_CREATE,
WORKSPACE_ROUTE_SSO_DETAIL,
@@ -182,50 +179,6 @@ const workspaceRoutes: RouteRecordRaw[] = [
},
],
},
- {
- path: "gitops",
- meta: {
- title: () => t("settings.sidebar.gitops"),
- },
- components: {
- content: () => import("@/layouts/SettingLayout.vue"),
- leftSidebar: () => import("@/views/DashboardSidebar.vue"),
- },
- props: {
- content: true,
- leftSidebar: true,
- },
- children: [
- {
- path: "",
- name: WORKSPACE_ROUTE_GITOPS,
- meta: {
- requiredWorkspacePermissionList: () => ["bb.vcsProviders.list"],
- },
- component: () => import("@/views/SettingWorkspaceVCS.vue"),
- props: true,
- },
- {
- path: "new",
- name: WORKSPACE_ROUTE_GITOPS_CREATE,
- meta: {
- title: () => t("repository.add-git-provider"),
- requiredWorkspacePermissionList: () => ["bb.vcsProviders.create"],
- },
- component: () => import("@/views/SettingWorkspaceVCSCreate.vue"),
- props: true,
- },
- {
- path: ":vcsResourceId",
- name: WORKSPACE_ROUTE_GITOPS_DETAIL,
- meta: {
- requiredWorkspacePermissionList: () => ["bb.vcsProviders.get"],
- },
- component: () => import("@/views/SettingWorkspaceVCSDetail.vue"),
- props: true,
- },
- ],
- },
{
path: "sso",
meta: {
diff --git a/frontend/src/router/dashboard/workspaceRoutes.ts b/frontend/src/router/dashboard/workspaceRoutes.ts
index f78a7afb3d..51fe9f840d 100644
--- a/frontend/src/router/dashboard/workspaceRoutes.ts
+++ b/frontend/src/router/dashboard/workspaceRoutes.ts
@@ -26,10 +26,6 @@ export const WORKSPACE_ROUTE_USERS = "workspace.users";
export const WORKSPACE_ROUTE_MEMBERS = "workspace.members";
export const WORKSPACE_ROUTE_ROLES = "workspace.roles";
-export const WORKSPACE_ROUTE_GITOPS = "workspace.gitops";
-export const WORKSPACE_ROUTE_GITOPS_CREATE = `${WORKSPACE_ROUTE_GITOPS}.create`;
-export const WORKSPACE_ROUTE_GITOPS_DETAIL = `${WORKSPACE_ROUTE_GITOPS}.detail`;
-
export const WORKSPACE_ROUTE_SSO = "workspace.sso";
export const WORKSPACE_ROUTE_SSO_CREATE = `${WORKSPACE_ROUTE_SSO}.create`;
export const WORKSPACE_ROUTE_SSO_DETAIL = `${WORKSPACE_ROUTE_SSO}.detail`;
diff --git a/frontend/src/store/modules/v1/index.ts b/frontend/src/store/modules/v1/index.ts
index 0813feec2c..06124486a0 100644
--- a/frontend/src/store/modules/v1/index.ts
+++ b/frontend/src/store/modules/v1/index.ts
@@ -16,8 +16,6 @@ export * from "./experimental-issue";
export * from "./subscription";
export * from "./actuator";
export * from "./sql";
-export * from "./vcs_provider";
-export * from "./vcs_connector";
export * from "./dbSchema";
export * from "./databaseCatalog";
export * from "./anomaly";
diff --git a/frontend/src/store/modules/v1/vcs_connector.ts b/frontend/src/store/modules/v1/vcs_connector.ts
deleted file mode 100644
index 0cc89f5f11..0000000000
--- a/frontend/src/store/modules/v1/vcs_connector.ts
+++ /dev/null
@@ -1,162 +0,0 @@
-import { defineStore } from "pinia";
-import { reactive } from "vue";
-import { vcsConnectorServiceClient, vcsProviderServiceClient } from "@/grpcweb";
-import { useCache } from "@/store/cache";
-import { getVCSConnectorId } from "@/store/modules/v1/common";
-import type { VCSConnector } from "@/types/proto/v1/vcs_connector_service";
-import { vcsConnectorPrefix, projectNamePrefix } from "./common";
-
-type VCSConnectorCacheKey = [string /* /projects/{project}/vcsConnectors/ */];
-
-export const useVCSConnectorStore = defineStore("vcs_connector_v1", () => {
- const cacheByName = useCache<VCSConnectorCacheKey, VCSConnector[]>(
- "bb.project-vcs-connector.by-name"
- );
- const repositoryMapByVCS = reactive(new Map<string, VCSConnector[]>());
-
- const fetchConnectorsInProvider = async (
- vcsName: string
- ): Promise<VCSConnector[]> => {
- const resp = await vcsProviderServiceClient.listVCSConnectorsInProvider({
- name: vcsName,
- });
-
- repositoryMapByVCS.set(vcsName, resp.vcsConnectors);
- return resp.vcsConnectors;
- };
-
- const getConnectorsInProvider = (vcsName: string): VCSConnector[] => {
- return repositoryMapByVCS.get(vcsName) || [];
- };
-
- const fetchConnectorList = async (project: string) => {
- const resp = await vcsConnectorServiceClient.listVCSConnectors({
- parent: project,
- });
- return resp.vcsConnectors;
- };
-
- const getOrFetchConnectors = async (project: string) => {
- const cacheName = `${project}/${vcsConnectorPrefix}`;
- const cachedRequest = cacheByName.getRequest([cacheName]);
- if (cachedRequest) {
- return cachedRequest;
- }
- const cachedEntity = cacheByName.getEntity([cacheName]);
- if (cachedEntity) {
- return cachedEntity;
- }
- const request = fetchConnectorList(project);
- cacheByName.setRequest([cacheName], request);
- return request;
- };
-
- const getConnectorList = (project: string) => {
- const cacheName = `${project}/${vcsConnectorPrefix}`;
- return cacheByName.getEntity([cacheName]) ?? [];
- };
-
- const getConnector = (project: string, vcsConnectorId: string) => {
- const name = `${project}/${vcsConnectorPrefix}${vcsConnectorId}`;
- const cached = getConnectorList(project);
- return cached.find((item) => item.name === name);
- };
-
- const getConnectorByName = (connectorName: string) => {
- const { projectId, vcsConnectorId } = getVCSConnectorId(connectorName);
- return getConnector(`${projectNamePrefix}${projectId}`, vcsConnectorId);
- };
-
- const setCache = (project: string, connector: VCSConnector) => {
- const cached = getConnectorList(project);
- cached.push(connector);
- cacheByName.setEntity([`${project}/${vcsConnectorPrefix}`], cached);
- };
-
- const deleteCache = (name: string) => {
- const { projectId } = getVCSConnectorId(name);
- const project = `${projectNamePrefix}${projectId}`;
- const cached = getConnectorList(project);
-
- const index = cached.findIndex((item) => item.name === name);
- if (index >= 0) {
- cached.splice(index, 1);
- }
- cacheByName.setEntity([`${project}/${vcsConnectorPrefix}`], cached);
- };
-
- const getOrFetchConnector = async (
- project: string,
- vcsConnectorId: string
- ) => {
- const name = `${project}/${vcsConnectorPrefix}${vcsConnectorId}`;
- const entity = getConnector(project, vcsConnectorId);
- if (entity) {
- return entity;
- }
-
- const connector = await vcsConnectorServiceClient.getVCSConnector({ name });
- setCache(project, connector);
- return connector;
- };
-
- const getOrFetchConnectorByName = async (connectorName: string) => {
- const { projectId, vcsConnectorId } = getVCSConnectorId(connectorName);
- return getOrFetchConnector(
- `${projectNamePrefix}${projectId}`,
- vcsConnectorId
- );
- };
-
- const createConnector = async (
- project: string,
- vcsConnectorId: string,
- connector: Partial<VCSConnector>
- ) => {
- const newConnector = await vcsConnectorServiceClient.createVCSConnector({
- parent: project,
- vcsConnector: connector,
- vcsConnectorId,
- });
- setCache(project, newConnector);
- return newConnector;
- };
-
- const updateConnector = async (
- vcsConnector: Partial<VCSConnector>,
- updateMask: string[]
- ) => {
- const updatedConnector = await vcsConnectorServiceClient.updateVCSConnector(
- {
- vcsConnector,
- updateMask,
- }
- );
-
- deleteCache(updatedConnector.name);
-
- const { projectId } = getVCSConnectorId(updatedConnector.name);
- setCache(`${projectNamePrefix}${projectId}`, updatedConnector);
- return updatedConnector;
- };
-
- const deleteConnector = async (name: string) => {
- await vcsConnectorServiceClient.deleteVCSConnector({ name });
-
- deleteCache(name);
- };
-
- return {
- getOrFetchConnectors,
- getConnectorList,
- getOrFetchConnector,
- getOrFetchConnectorByName,
- getConnector,
- getConnectorByName,
- createConnector,
- deleteConnector,
- updateConnector,
- fetchConnectorsInProvider,
- getConnectorsInProvider,
- };
-});
diff --git a/frontend/src/store/modules/v1/vcs_provider.ts b/frontend/src/store/modules/v1/vcs_provider.ts
deleted file mode 100644
index 0532837b06..0000000000
--- a/frontend/src/store/modules/v1/vcs_provider.ts
+++ /dev/null
@@ -1,138 +0,0 @@
-import { uniqBy } from "lodash-es";
-import { isEqual, isUndefined } from "lodash-es";
-import { defineStore } from "pinia";
-import { computed } from "vue";
-import { vcsProviderServiceClient } from "@/grpcweb";
-import { useCache } from "@/store/cache";
-import type { VCSProvider } from "@/types/proto/v1/vcs_provider_service";
-import { vcsProviderPrefix } from "./common";
-
-type VCSProviderCacheKey = [string /* vcs name */];
-
-export const useVCSProviderStore = defineStore("vcs_provider", () => {
- const cacheByName = useCache<VCSProviderCacheKey, VCSProvider | undefined>(
- "bb.vcs-provider.by-name"
- );
-
- const vcsList = computed(() => {
- const list = Array.from(cacheByName.entityCacheMap.values())
- .map((entry) => entry.entity)
- .filter((vcs): vcs is VCSProvider => vcs !== undefined);
- return uniqBy(list, (vcs) => vcs.name);
- });
-
- const searchVCSProviderRepositories = async (vcsName: string) => {
- const resp = await vcsProviderServiceClient.searchVCSProviderRepositories({
- name: vcsName,
- });
- return resp.repositories;
- };
-
- const fetchVCSList = async () => {
- const resp = await vcsProviderServiceClient.listVCSProviders({});
- return resp.vcsProviders;
- };
-
- const getOrFetchVCSList = async () => {
- if (vcsList.value.length > 0) {
- return vcsList.value;
- }
- const list = await fetchVCSList();
- for (const vcs of list) {
- cacheByName.setEntity([vcs.name], vcs);
- }
- return list;
- };
-
- const fetchVCSByName = async (name: string, silent = false) => {
- const vcs = await vcsProviderServiceClient.getVCSProvider(
- {
- name,
- },
- { silent }
- );
-
- return vcs;
- };
-
- const getOrFetchVCSByName = async (name: string) => {
- const entity = cacheByName.getEntity([name]);
- if (entity) {
- return entity;
- }
-
- const vcs = await fetchVCSByName(name);
- cacheByName.setEntity([vcs.name], vcs);
- return vcs;
- };
-
- const getVCSById = (vcsId: string) => {
- return getVCSByName(`${vcsProviderPrefix}${vcsId}`);
- };
-
- const getVCSByName = (vcs: string) => {
- return cacheByName.getEntity([vcs]);
- };
-
- const deleteVCS = async (name: string) => {
- await vcsProviderServiceClient.deleteVCSProvider({
- name,
- });
- cacheByName.invalidateEntity([name]);
- };
-
- const createVCS = async (resourceId: string, vcs: VCSProvider) => {
- const provider = await vcsProviderServiceClient.createVCSProvider({
- vcsProvider: vcs,
- vcsProviderId: resourceId,
- });
- cacheByName.setEntity([provider.name], provider);
- return provider;
- };
-
- const updateVCS = async (vcs: Partial<VCSProvider>) => {
- if (!vcs.name) {
- return;
- }
- const existed = await fetchVCSByName(vcs.name);
- const updateMask = getUpdateMaskForVCS(existed, vcs);
- if (updateMask.length === 0) {
- return existed;
- }
- const provider = await vcsProviderServiceClient.updateVCSProvider({
- vcsProvider: vcs,
- updateMask,
- });
- cacheByName.setEntity([provider.name], provider);
- return provider;
- };
-
- return {
- vcsList,
- searchVCSProviderRepositories,
- getVCSById,
- getVCSByName,
- getOrFetchVCSByName,
- getOrFetchVCSList,
- deleteVCS,
- createVCS,
- updateVCS,
- };
-});
-
-const getUpdateMaskForVCS = (
- origin: VCSProvider,
- update: Partial<VCSProvider>
-): string[] => {
- const updateMask: string[] = [];
- if (!isUndefined(update.title) && !isEqual(origin.title, update.title)) {
- updateMask.push("title");
- }
- if (
- !isUndefined(update.accessToken) &&
- !isEqual(origin.accessToken, update.accessToken)
- ) {
- updateMask.push("access_token");
- }
- return updateMask;
-};
diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts
index eea46ad335..4e38b9b6ec 100644
--- a/frontend/src/types/index.ts
+++ b/frontend/src/types/index.ts
@@ -13,7 +13,6 @@ export * from "./oauth";
export * from "./plan";
export * from "./member";
export * from "./store";
-export * from "./vcs";
export * from "./sqlEditor";
export * from "./sheet";
export * from "./sqlReview";
diff --git a/frontend/src/types/proto/store/vcs.ts b/frontend/src/types/proto/store/vcs.ts
deleted file mode 100644
index 96cc68afaf..0000000000
--- a/frontend/src/types/proto/store/vcs.ts
+++ /dev/null
@@ -1,266 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: store/vcs.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "bytebase.store";
-
-export interface VCSConnector {
- /** The title or display name of the VCS connector. */
- title: string;
- /**
- * Full path from the corresponding VCS provider.
- * For GitLab, this is the project full path. e.g. group1/project-1
- */
- fullPath: string;
- /**
- * Web url from the corresponding VCS provider.
- * For GitLab, this is the project web url. e.g. https://gitlab.example.com/group1/project-1
- */
- webUrl: string;
- /** Branch to listen to. */
- branch: string;
- /** Base working directory we are interested. */
- baseDirectory: string;
- /**
- * Repository id from the corresponding VCS provider.
- * For GitLab, this is the project id. e.g. 123
- */
- externalId: string;
- /**
- * Push webhook id from the corresponding VCS provider.
- * For GitLab, this is the project webhook id. e.g. 123
- */
- externalWebhookId: string;
- /** For GitLab, webhook request contains this in the 'X-Gitlab-Token" header and we compare it with the one stored in db to validate it sends to the expected endpoint. */
- webhookSecretToken: string;
- /**
- * Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
- * Format: projects/{project}/databaseGroups/{databaseGroup}
- */
- databaseGroup: string;
-}
-
-function createBaseVCSConnector(): VCSConnector {
- return {
- title: "",
- fullPath: "",
- webUrl: "",
- branch: "",
- baseDirectory: "",
- externalId: "",
- externalWebhookId: "",
- webhookSecretToken: "",
- databaseGroup: "",
- };
-}
-
-export const VCSConnector: MessageFns<VCSConnector> = {
- encode(message: VCSConnector, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.title !== "") {
- writer.uint32(10).string(message.title);
- }
- if (message.fullPath !== "") {
- writer.uint32(18).string(message.fullPath);
- }
- if (message.webUrl !== "") {
- writer.uint32(26).string(message.webUrl);
- }
- if (message.branch !== "") {
- writer.uint32(34).string(message.branch);
- }
- if (message.baseDirectory !== "") {
- writer.uint32(42).string(message.baseDirectory);
- }
- if (message.externalId !== "") {
- writer.uint32(50).string(message.externalId);
- }
- if (message.externalWebhookId !== "") {
- writer.uint32(58).string(message.externalWebhookId);
- }
- if (message.webhookSecretToken !== "") {
- writer.uint32(66).string(message.webhookSecretToken);
- }
- if (message.databaseGroup !== "") {
- writer.uint32(74).string(message.databaseGroup);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): VCSConnector {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseVCSConnector();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.fullPath = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.webUrl = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.branch = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.baseDirectory = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.externalId = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.externalWebhookId = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.webhookSecretToken = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.databaseGroup = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): VCSConnector {
- return {
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- fullPath: isSet(object.fullPath) ? globalThis.String(object.fullPath) : "",
- webUrl: isSet(object.webUrl) ? globalThis.String(object.webUrl) : "",
- branch: isSet(object.branch) ? globalThis.String(object.branch) : "",
- baseDirectory: isSet(object.baseDirectory) ? globalThis.String(object.baseDirectory) : "",
- externalId: isSet(object.externalId) ? globalThis.String(object.externalId) : "",
- externalWebhookId: isSet(object.externalWebhookId) ? globalThis.String(object.externalWebhookId) : "",
- webhookSecretToken: isSet(object.webhookSecretToken) ? globalThis.String(object.webhookSecretToken) : "",
- databaseGroup: isSet(object.databaseGroup) ? globalThis.String(object.databaseGroup) : "",
- };
- },
-
- toJSON(message: VCSConnector): unknown {
- const obj: any = {};
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.fullPath !== "") {
- obj.fullPath = message.fullPath;
- }
- if (message.webUrl !== "") {
- obj.webUrl = message.webUrl;
- }
- if (message.branch !== "") {
- obj.branch = message.branch;
- }
- if (message.baseDirectory !== "") {
- obj.baseDirectory = message.baseDirectory;
- }
- if (message.externalId !== "") {
- obj.externalId = message.externalId;
- }
- if (message.externalWebhookId !== "") {
- obj.externalWebhookId = message.externalWebhookId;
- }
- if (message.webhookSecretToken !== "") {
- obj.webhookSecretToken = message.webhookSecretToken;
- }
- if (message.databaseGroup !== "") {
- obj.databaseGroup = message.databaseGroup;
- }
- return obj;
- },
-
- create(base?: DeepPartial<VCSConnector>): VCSConnector {
- return VCSConnector.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<VCSConnector>): VCSConnector {
- const message = createBaseVCSConnector();
- message.title = object.title ?? "";
- message.fullPath = object.fullPath ?? "";
- message.webUrl = object.webUrl ?? "";
- message.branch = object.branch ?? "";
- message.baseDirectory = object.baseDirectory ?? "";
- message.externalId = object.externalId ?? "";
- message.externalWebhookId = object.externalWebhookId ?? "";
- message.webhookSecretToken = object.webhookSecretToken ?? "";
- message.databaseGroup = object.databaseGroup ?? "";
- return message;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/project_service.ts b/frontend/src/types/proto/v1/project_service.ts
index 26555cbf6d..f2b0de8922 100644
--- a/frontend/src/types/proto/v1/project_service.ts
+++ b/frontend/src/types/proto/v1/project_service.ts
@@ -14,59 +14,6 @@ import { GetIamPolicyRequest, IamPolicy, SetIamPolicyRequest } from "./iam_polic
export const protobufPackage = "bytebase.v1";
-export enum Workflow {
- WORKFLOW_UNSPECIFIED = "WORKFLOW_UNSPECIFIED",
- UI = "UI",
- VCS = "VCS",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function workflowFromJSON(object: any): Workflow {
- switch (object) {
- case 0:
- case "WORKFLOW_UNSPECIFIED":
- return Workflow.WORKFLOW_UNSPECIFIED;
- case 1:
- case "UI":
- return Workflow.UI;
- case 2:
- case "VCS":
- return Workflow.VCS;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Workflow.UNRECOGNIZED;
- }
-}
-
-export function workflowToJSON(object: Workflow): string {
- switch (object) {
- case Workflow.WORKFLOW_UNSPECIFIED:
- return "WORKFLOW_UNSPECIFIED";
- case Workflow.UI:
- return "UI";
- case Workflow.VCS:
- return "VCS";
- case Workflow.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function workflowToNumber(object: Workflow): number {
- switch (object) {
- case Workflow.WORKFLOW_UNSPECIFIED:
- return 0;
- case Workflow.UI:
- return 1;
- case Workflow.VCS:
- return 2;
- case Workflow.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
export enum OperatorType {
/** OPERATOR_TYPE_UNSPECIFIED - The operator is not specified. */
OPERATOR_TYPE_UNSPECIFIED = "OPERATOR_TYPE_UNSPECIFIED",
@@ -271,7 +218,6 @@ export interface Project {
state: State;
/** The title or name of a project. It's not unique within the workspace. */
title: string;
- workflow: Workflow;
webhooks: Webhook[];
dataClassificationConfigId: string;
issueLabels: Label[];
@@ -1821,7 +1767,6 @@ function createBaseProject(): Project {
name: "",
state: State.STATE_UNSPECIFIED,
title: "",
- workflow: Workflow.WORKFLOW_UNSPECIFIED,
webhooks: [],
dataClassificationConfigId: "",
issueLabels: [],
@@ -1847,9 +1792,6 @@ export const Project: MessageFns<Project> = {
if (message.title !== "") {
writer.uint32(34).string(message.title);
}
- if (message.workflow !== Workflow.WORKFLOW_UNSPECIFIED) {
- writer.uint32(48).int32(workflowToNumber(message.workflow));
- }
for (const v of message.webhooks) {
Webhook.encode(v!, writer.uint32(90).fork()).join();
}
@@ -1917,14 +1859,6 @@ export const Project: MessageFns<Project> = {
message.title = reader.string();
continue;
}
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.workflow = workflowFromJSON(reader.int32());
- continue;
- }
case 11: {
if (tag !== 90) {
break;
@@ -2027,7 +1961,6 @@ export const Project: MessageFns<Project> = {
name: isSet(object.name) ? globalThis.String(object.name) : "",
state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
title: isSet(object.title) ? globalThis.String(object.title) : "",
- workflow: isSet(object.workflow) ? workflowFromJSON(object.workflow) : Workflow.WORKFLOW_UNSPECIFIED,
webhooks: globalThis.Array.isArray(object?.webhooks) ? object.webhooks.map((e: any) => Webhook.fromJSON(e)) : [],
dataClassificationConfigId: isSet(object.dataClassificationConfigId)
? globalThis.String(object.dataClassificationConfigId)
@@ -2061,9 +1994,6 @@ export const Project: MessageFns<Project> = {
if (message.title !== "") {
obj.title = message.title;
}
- if (message.workflow !== Workflow.WORKFLOW_UNSPECIFIED) {
- obj.workflow = workflowToJSON(message.workflow);
- }
if (message.webhooks?.length) {
obj.webhooks = message.webhooks.map((e) => Webhook.toJSON(e));
}
@@ -2108,7 +2038,6 @@ export const Project: MessageFns<Project> = {
message.name = object.name ?? "";
message.state = object.state ?? State.STATE_UNSPECIFIED;
message.title = object.title ?? "";
- message.workflow = object.workflow ?? Workflow.WORKFLOW_UNSPECIFIED;
message.webhooks = object.webhooks?.map((e) => Webhook.fromPartial(e)) || [];
message.dataClassificationConfigId = object.dataClassificationConfigId ?? "";
message.issueLabels = object.issueLabels?.map((e) => Label.fromPartial(e)) || [];
diff --git a/frontend/src/types/proto/v1/vcs_connector_service.ts b/frontend/src/types/proto/v1/vcs_connector_service.ts
deleted file mode 100644
index 513d8062fe..0000000000
--- a/frontend/src/types/proto/v1/vcs_connector_service.ts
+++ /dev/null
@@ -1,1336 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/vcs_connector_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface CreateVCSConnectorRequest {
- /**
- * The parent resource where this vcsConnector will be created.
- * Format: projects/{project}
- */
- parent: string;
- /** The vcsConnector to create. */
- vcsConnector:
- | VCSConnector
- | undefined;
- /**
- * The ID to use for the vcsConnector, which will become the final component of
- * the vcsConnector's resource name.
- *
- * This value should be 4-63 characters, and valid characters
- * are /[a-z][0-9]-/.
- */
- vcsConnectorId: string;
-}
-
-export interface GetVCSConnectorRequest {
- /**
- * The name of the vcsConnector to retrieve.
- * Format: projects/{project}/vcsConnectors/{vcsConnector}
- */
- name: string;
-}
-
-export interface ListVCSConnectorsRequest {
- /**
- * The parent, which owns this collection of vcsConnectors.
- * Format: projects/{project}
- */
- parent: string;
- /**
- * Not used.
- * The maximum number of vcs connectors to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 vcs connectors will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListVCSConnectors` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListVCSConnectors` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListVCSConnectorsResponse {
- /** The vcsConnectors from the specified request. */
- vcsConnectors: VCSConnector[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface UpdateVCSConnectorRequest {
- /**
- * The vcsConnector to update.
- *
- * The vcsConnector's `name` field is used to identify the vcsConnector to update.
- * Format: projects/{project}/vcsConnectors/{vcsConnector}
- */
- vcsConnector:
- | VCSConnector
- | undefined;
- /** The list of fields to be updated. */
- updateMask: string[] | undefined;
-}
-
-export interface DeleteVCSConnectorRequest {
- /**
- * The name of the vcsConnector to delete.
- * Format: projects/{project}/vcsConnectors/{vcsConnector}
- */
- name: string;
-}
-
-export interface VCSConnector {
- /**
- * The name of the vcsConnector resource.
- * Canonical parent is project.
- * Format: projects/{project}/vcsConnectors/{vcsConnector}
- */
- name: string;
- /** The title of the vcs connector. */
- title: string;
- /**
- * The name of the VCS.
- * Format: vcsProviders/{vcsProvider}
- */
- vcsProvider: string;
- /** The reposition external id in target VCS. */
- externalId: string;
- /** The root directory where Bytebase observes the file change. If empty, then it observes the entire repository. */
- baseDirectory: string;
- /** The branch Bytebase listens to for changes. For example: main. */
- branch: string;
- /**
- * TODO(d): move these to create VCS connector API.
- * The full_path of the repository. For example: bytebase/sample.
- */
- fullPath: string;
- /** The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. */
- webUrl: string;
- /**
- * Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
- * Format: projects/{project}/databaseGroups/{databaseGroup}
- */
- databaseGroup: string;
-}
-
-function createBaseCreateVCSConnectorRequest(): CreateVCSConnectorRequest {
- return { parent: "", vcsConnector: undefined, vcsConnectorId: "" };
-}
-
-export const CreateVCSConnectorRequest: MessageFns<CreateVCSConnectorRequest> = {
- encode(message: CreateVCSConnectorRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.vcsConnector !== undefined) {
- VCSConnector.encode(message.vcsConnector, writer.uint32(18).fork()).join();
- }
- if (message.vcsConnectorId !== "") {
- writer.uint32(26).string(message.vcsConnectorId);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateVCSConnectorRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateVCSConnectorRequest();
- 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.vcsConnector = VCSConnector.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.vcsConnectorId = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateVCSConnectorRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- vcsConnector: isSet(object.vcsConnector) ? VCSConnector.fromJSON(object.vcsConnector) : undefined,
- vcsConnectorId: isSet(object.vcsConnectorId) ? globalThis.String(object.vcsConnectorId) : "",
- };
- },
-
- toJSON(message: CreateVCSConnectorRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.vcsConnector !== undefined) {
- obj.vcsConnector = VCSConnector.toJSON(message.vcsConnector);
- }
- if (message.vcsConnectorId !== "") {
- obj.vcsConnectorId = message.vcsConnectorId;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateVCSConnectorRequest>): CreateVCSConnectorRequest {
- return CreateVCSConnectorRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateVCSConnectorRequest>): CreateVCSConnectorRequest {
- const message = createBaseCreateVCSConnectorRequest();
- message.parent = object.parent ?? "";
- message.vcsConnector = (object.vcsConnector !== undefined && object.vcsConnector !== null)
- ? VCSConnector.fromPartial(object.vcsConnector)
- : undefined;
- message.vcsConnectorId = object.vcsConnectorId ?? "";
- return message;
- },
-};
-
-function createBaseGetVCSConnectorRequest(): GetVCSConnectorRequest {
- return { name: "" };
-}
-
-export const GetVCSConnectorRequest: MessageFns<GetVCSConnectorRequest> = {
- encode(message: GetVCSConnectorRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetVCSConnectorRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetVCSConnectorRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetVCSConnectorRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetVCSConnectorRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetVCSConnectorRequest>): GetVCSConnectorRequest {
- return GetVCSConnectorRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetVCSConnectorRequest>): GetVCSConnectorRequest {
- const message = createBaseGetVCSConnectorRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListVCSConnectorsRequest(): ListVCSConnectorsRequest {
- return { parent: "", pageSize: 0, pageToken: "" };
-}
-
-export const ListVCSConnectorsRequest: MessageFns<ListVCSConnectorsRequest> = {
- encode(message: ListVCSConnectorsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListVCSConnectorsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListVCSConnectorsRequest();
- 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 !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListVCSConnectorsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListVCSConnectorsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListVCSConnectorsRequest>): ListVCSConnectorsRequest {
- return ListVCSConnectorsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListVCSConnectorsRequest>): ListVCSConnectorsRequest {
- const message = createBaseListVCSConnectorsRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListVCSConnectorsResponse(): ListVCSConnectorsResponse {
- return { vcsConnectors: [], nextPageToken: "" };
-}
-
-export const ListVCSConnectorsResponse: MessageFns<ListVCSConnectorsResponse> = {
- encode(message: ListVCSConnectorsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.vcsConnectors) {
- VCSConnector.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListVCSConnectorsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListVCSConnectorsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.vcsConnectors.push(VCSConnector.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListVCSConnectorsResponse {
- return {
- vcsConnectors: globalThis.Array.isArray(object?.vcsConnectors)
- ? object.vcsConnectors.map((e: any) => VCSConnector.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListVCSConnectorsResponse): unknown {
- const obj: any = {};
- if (message.vcsConnectors?.length) {
- obj.vcsConnectors = message.vcsConnectors.map((e) => VCSConnector.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListVCSConnectorsResponse>): ListVCSConnectorsResponse {
- return ListVCSConnectorsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListVCSConnectorsResponse>): ListVCSConnectorsResponse {
- const message = createBaseListVCSConnectorsResponse();
- message.vcsConnectors = object.vcsConnectors?.map((e) => VCSConnector.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseUpdateVCSConnectorRequest(): UpdateVCSConnectorRequest {
- return { vcsConnector: undefined, updateMask: undefined };
-}
-
-export const UpdateVCSConnectorRequest: MessageFns<UpdateVCSConnectorRequest> = {
- encode(message: UpdateVCSConnectorRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.vcsConnector !== undefined) {
- VCSConnector.encode(message.vcsConnector, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateVCSConnectorRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateVCSConnectorRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.vcsConnector = VCSConnector.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateVCSConnectorRequest {
- return {
- vcsConnector: isSet(object.vcsConnector) ? VCSConnector.fromJSON(object.vcsConnector) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateVCSConnectorRequest): unknown {
- const obj: any = {};
- if (message.vcsConnector !== undefined) {
- obj.vcsConnector = VCSConnector.toJSON(message.vcsConnector);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateVCSConnectorRequest>): UpdateVCSConnectorRequest {
- return UpdateVCSConnectorRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateVCSConnectorRequest>): UpdateVCSConnectorRequest {
- const message = createBaseUpdateVCSConnectorRequest();
- message.vcsConnector = (object.vcsConnector !== undefined && object.vcsConnector !== null)
- ? VCSConnector.fromPartial(object.vcsConnector)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseDeleteVCSConnectorRequest(): DeleteVCSConnectorRequest {
- return { name: "" };
-}
-
-export const DeleteVCSConnectorRequest: MessageFns<DeleteVCSConnectorRequest> = {
- encode(message: DeleteVCSConnectorRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteVCSConnectorRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteVCSConnectorRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteVCSConnectorRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteVCSConnectorRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteVCSConnectorRequest>): DeleteVCSConnectorRequest {
- return DeleteVCSConnectorRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteVCSConnectorRequest>): DeleteVCSConnectorRequest {
- const message = createBaseDeleteVCSConnectorRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseVCSConnector(): VCSConnector {
- return {
- name: "",
- title: "",
- vcsProvider: "",
- externalId: "",
- baseDirectory: "",
- branch: "",
- fullPath: "",
- webUrl: "",
- databaseGroup: "",
- };
-}
-
-export const VCSConnector: MessageFns<VCSConnector> = {
- encode(message: VCSConnector, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.vcsProvider !== "") {
- writer.uint32(58).string(message.vcsProvider);
- }
- if (message.externalId !== "") {
- writer.uint32(66).string(message.externalId);
- }
- if (message.baseDirectory !== "") {
- writer.uint32(74).string(message.baseDirectory);
- }
- if (message.branch !== "") {
- writer.uint32(82).string(message.branch);
- }
- if (message.fullPath !== "") {
- writer.uint32(98).string(message.fullPath);
- }
- if (message.webUrl !== "") {
- writer.uint32(106).string(message.webUrl);
- }
- if (message.databaseGroup !== "") {
- writer.uint32(114).string(message.databaseGroup);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): VCSConnector {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseVCSConnector();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.vcsProvider = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.externalId = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.baseDirectory = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.branch = reader.string();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.fullPath = reader.string();
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.webUrl = reader.string();
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.databaseGroup = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): VCSConnector {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- vcsProvider: isSet(object.vcsProvider) ? globalThis.String(object.vcsProvider) : "",
- externalId: isSet(object.externalId) ? globalThis.String(object.externalId) : "",
- baseDirectory: isSet(object.baseDirectory) ? globalThis.String(object.baseDirectory) : "",
- branch: isSet(object.branch) ? globalThis.String(object.branch) : "",
- fullPath: isSet(object.fullPath) ? globalThis.String(object.fullPath) : "",
- webUrl: isSet(object.webUrl) ? globalThis.String(object.webUrl) : "",
- databaseGroup: isSet(object.databaseGroup) ? globalThis.String(object.databaseGroup) : "",
- };
- },
-
- toJSON(message: VCSConnector): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.vcsProvider !== "") {
- obj.vcsProvider = message.vcsProvider;
- }
- if (message.externalId !== "") {
- obj.externalId = message.externalId;
- }
- if (message.baseDirectory !== "") {
- obj.baseDirectory = message.baseDirectory;
- }
- if (message.branch !== "") {
- obj.branch = message.branch;
- }
- if (message.fullPath !== "") {
- obj.fullPath = message.fullPath;
- }
- if (message.webUrl !== "") {
- obj.webUrl = message.webUrl;
- }
- if (message.databaseGroup !== "") {
- obj.databaseGroup = message.databaseGroup;
- }
- return obj;
- },
-
- create(base?: DeepPartial<VCSConnector>): VCSConnector {
- return VCSConnector.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<VCSConnector>): VCSConnector {
- const message = createBaseVCSConnector();
- message.name = object.name ?? "";
- message.title = object.title ?? "";
- message.vcsProvider = object.vcsProvider ?? "";
- message.externalId = object.externalId ?? "";
- message.baseDirectory = object.baseDirectory ?? "";
- message.branch = object.branch ?? "";
- message.fullPath = object.fullPath ?? "";
- message.webUrl = object.webUrl ?? "";
- message.databaseGroup = object.databaseGroup ?? "";
- return message;
- },
-};
-
-export type VCSConnectorServiceDefinition = typeof VCSConnectorServiceDefinition;
-export const VCSConnectorServiceDefinition = {
- name: "VCSConnectorService",
- fullName: "bytebase.v1.VCSConnectorService",
- methods: {
- createVCSConnector: {
- name: "CreateVCSConnector",
- requestType: CreateVCSConnectorRequest,
- requestStream: false,
- responseType: VCSConnector,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 19,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 44,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- ]),
- ],
- 800010: [
- new Uint8Array([
- 23,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- 46,
- 99,
- 114,
- 101,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 54,
- 58,
- 13,
- 118,
- 99,
- 115,
- 95,
- 99,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 34,
- 37,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- ]),
- ],
- },
- },
- },
- getVCSConnector: {
- name: "GetVCSConnector",
- requestType: GetVCSConnectorRequest,
- requestStream: false,
- responseType: VCSConnector,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 20,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- 46,
- 103,
- 101,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 39,
- 18,
- 37,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- listVCSConnectors: {
- name: "ListVCSConnectors",
- requestType: ListVCSConnectorsRequest,
- requestStream: false,
- responseType: ListVCSConnectorsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [
- new Uint8Array([
- 21,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- 46,
- 108,
- 105,
- 115,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 39,
- 18,
- 37,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- ]),
- ],
- },
- },
- },
- updateVCSConnector: {
- name: "UpdateVCSConnector",
- requestType: UpdateVCSConnectorRequest,
- requestStream: false,
- responseType: VCSConnector,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 25,
- 118,
- 99,
- 115,
- 95,
- 99,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([
- 23,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 68,
- 58,
- 13,
- 118,
- 99,
- 115,
- 95,
- 99,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 50,
- 51,
- 47,
- 118,
- 49,
- 47,
- 123,
- 118,
- 99,
- 115,
- 95,
- 99,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- deleteVCSConnector: {
- name: "DeleteVCSConnector",
- requestType: DeleteVCSConnectorRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 23,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- 46,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 39,
- 42,
- 37,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/vcs_provider_service.ts b/frontend/src/types/proto/v1/vcs_provider_service.ts
deleted file mode 100644
index faaa22d2c3..0000000000
--- a/frontend/src/types/proto/v1/vcs_provider_service.ts
+++ /dev/null
@@ -1,1653 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/vcs_provider_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { VCSType, vCSTypeFromJSON, vCSTypeToJSON, vCSTypeToNumber } from "./common";
-import { VCSConnector } from "./vcs_connector_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface CreateVCSProviderRequest {
- vcsProvider:
- | VCSProvider
- | undefined;
- /**
- * The ID to use for the VCS provider, which will become the final component of
- * the VCS provider's name.
- *
- * This value should be 4-63 characters, and valid characters
- * are /[a-z][0-9]-/.
- */
- vcsProviderId: string;
-}
-
-export interface GetVCSProviderRequest {
- /**
- * The name of the vcs provider to retrieve.
- * Format: vcsProviders/{vcsProvider}
- */
- name: string;
-}
-
-export interface ListVCSProvidersRequest {
- /**
- * Not used.
- * The maximum number of vcs provider to return. The service may return fewer than this value.
- * If unspecified, at most 10 vcs provider will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListVCSProviders` call.
- * Provide this to retrieve the subsequent page.
- */
- pageToken: string;
-}
-
-export interface ListVCSProvidersResponse {
- /** The list of vcs providers. */
- vcsProviders: VCSProvider[];
- /**
- * Not used. A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface UpdateVCSProviderRequest {
- vcsProvider:
- | VCSProvider
- | undefined;
- /** The list of fields to be updated. */
- updateMask: string[] | undefined;
-}
-
-export interface DeleteVCSProviderRequest {
- /**
- * The name of the vcs provider to delete.
- * Format: vcsProviders/{vcsProvider}
- */
- name: string;
-}
-
-export interface SearchVCSProviderRepositoriesRequest {
- /**
- * The name of the vcs provider to retrieve the vcs provider repositories.
- * Format: vcsProviders/{vcsProvider}
- */
- name: string;
-}
-
-export interface VCSRepository {
- /**
- * The id of the repository in vcs provider.
- * e.g. In GitLab, this is the corresponding project id. e.g. 123
- */
- id: string;
- /**
- * The title of the repository in vcs provider.
- * e.g. sample-project
- */
- title: string;
- /**
- * The full_path of the repository in vcs provider.
- * e.g. bytebase/sample-project
- */
- fullPath: string;
- /**
- * Web url of the repository in vcs provider.
- * e.g. http://gitlab.bytebase.com/bytebase/sample-project
- */
- webUrl: string;
-}
-
-export interface SearchVCSProviderRepositoriesResponse {
- /** The list of repositories in vcs provider. */
- repositories: VCSRepository[];
-}
-
-export interface ListVCSConnectorsInProviderRequest {
- /**
- * The name of the vcs provider to retrieve the linked projects.
- * Format: vcsProviders/{vcsProvider}
- */
- name: string;
-}
-
-export interface ListVCSConnectorsInProviderResponse {
- /** The vcsConnectors from the specified request. */
- vcsConnectors: VCSConnector[];
-}
-
-export interface VCSProvider {
- /**
- * The name of the vcs provider.
- * Format: vcsProviders/{vcsProvider}
- */
- name: string;
- /** The title of the vcs provider. It is used to display in the UI. Specified by the client. */
- title: string;
- type: VCSType;
- /**
- * The url of the vcs provider. Specified by the client.
- * For example: github.com, gitlab.com, gitlab.bytebase.com.
- */
- url: string;
- /** The access token of the vcs provider. */
- accessToken: string;
-}
-
-function createBaseCreateVCSProviderRequest(): CreateVCSProviderRequest {
- return { vcsProvider: undefined, vcsProviderId: "" };
-}
-
-export const CreateVCSProviderRequest: MessageFns<CreateVCSProviderRequest> = {
- encode(message: CreateVCSProviderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.vcsProvider !== undefined) {
- VCSProvider.encode(message.vcsProvider, writer.uint32(10).fork()).join();
- }
- if (message.vcsProviderId !== "") {
- writer.uint32(18).string(message.vcsProviderId);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateVCSProviderRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateVCSProviderRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.vcsProvider = VCSProvider.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.vcsProviderId = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateVCSProviderRequest {
- return {
- vcsProvider: isSet(object.vcsProvider) ? VCSProvider.fromJSON(object.vcsProvider) : undefined,
- vcsProviderId: isSet(object.vcsProviderId) ? globalThis.String(object.vcsProviderId) : "",
- };
- },
-
- toJSON(message: CreateVCSProviderRequest): unknown {
- const obj: any = {};
- if (message.vcsProvider !== undefined) {
- obj.vcsProvider = VCSProvider.toJSON(message.vcsProvider);
- }
- if (message.vcsProviderId !== "") {
- obj.vcsProviderId = message.vcsProviderId;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateVCSProviderRequest>): CreateVCSProviderRequest {
- return CreateVCSProviderRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateVCSProviderRequest>): CreateVCSProviderRequest {
- const message = createBaseCreateVCSProviderRequest();
- message.vcsProvider = (object.vcsProvider !== undefined && object.vcsProvider !== null)
- ? VCSProvider.fromPartial(object.vcsProvider)
- : undefined;
- message.vcsProviderId = object.vcsProviderId ?? "";
- return message;
- },
-};
-
-function createBaseGetVCSProviderRequest(): GetVCSProviderRequest {
- return { name: "" };
-}
-
-export const GetVCSProviderRequest: MessageFns<GetVCSProviderRequest> = {
- encode(message: GetVCSProviderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetVCSProviderRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetVCSProviderRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetVCSProviderRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetVCSProviderRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetVCSProviderRequest>): GetVCSProviderRequest {
- return GetVCSProviderRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetVCSProviderRequest>): GetVCSProviderRequest {
- const message = createBaseGetVCSProviderRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListVCSProvidersRequest(): ListVCSProvidersRequest {
- return { pageSize: 0, pageToken: "" };
-}
-
-export const ListVCSProvidersRequest: MessageFns<ListVCSProvidersRequest> = {
- encode(message: ListVCSProvidersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListVCSProvidersRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListVCSProvidersRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListVCSProvidersRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListVCSProvidersRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListVCSProvidersRequest>): ListVCSProvidersRequest {
- return ListVCSProvidersRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListVCSProvidersRequest>): ListVCSProvidersRequest {
- const message = createBaseListVCSProvidersRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListVCSProvidersResponse(): ListVCSProvidersResponse {
- return { vcsProviders: [], nextPageToken: "" };
-}
-
-export const ListVCSProvidersResponse: MessageFns<ListVCSProvidersResponse> = {
- encode(message: ListVCSProvidersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.vcsProviders) {
- VCSProvider.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListVCSProvidersResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListVCSProvidersResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.vcsProviders.push(VCSProvider.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListVCSProvidersResponse {
- return {
- vcsProviders: globalThis.Array.isArray(object?.vcsProviders)
- ? object.vcsProviders.map((e: any) => VCSProvider.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListVCSProvidersResponse): unknown {
- const obj: any = {};
- if (message.vcsProviders?.length) {
- obj.vcsProviders = message.vcsProviders.map((e) => VCSProvider.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListVCSProvidersResponse>): ListVCSProvidersResponse {
- return ListVCSProvidersResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListVCSProvidersResponse>): ListVCSProvidersResponse {
- const message = createBaseListVCSProvidersResponse();
- message.vcsProviders = object.vcsProviders?.map((e) => VCSProvider.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseUpdateVCSProviderRequest(): UpdateVCSProviderRequest {
- return { vcsProvider: undefined, updateMask: undefined };
-}
-
-export const UpdateVCSProviderRequest: MessageFns<UpdateVCSProviderRequest> = {
- encode(message: UpdateVCSProviderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.vcsProvider !== undefined) {
- VCSProvider.encode(message.vcsProvider, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateVCSProviderRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateVCSProviderRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.vcsProvider = VCSProvider.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateVCSProviderRequest {
- return {
- vcsProvider: isSet(object.vcsProvider) ? VCSProvider.fromJSON(object.vcsProvider) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateVCSProviderRequest): unknown {
- const obj: any = {};
- if (message.vcsProvider !== undefined) {
- obj.vcsProvider = VCSProvider.toJSON(message.vcsProvider);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateVCSProviderRequest>): UpdateVCSProviderRequest {
- return UpdateVCSProviderRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateVCSProviderRequest>): UpdateVCSProviderRequest {
- const message = createBaseUpdateVCSProviderRequest();
- message.vcsProvider = (object.vcsProvider !== undefined && object.vcsProvider !== null)
- ? VCSProvider.fromPartial(object.vcsProvider)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseDeleteVCSProviderRequest(): DeleteVCSProviderRequest {
- return { name: "" };
-}
-
-export const DeleteVCSProviderRequest: MessageFns<DeleteVCSProviderRequest> = {
- encode(message: DeleteVCSProviderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteVCSProviderRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteVCSProviderRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteVCSProviderRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteVCSProviderRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteVCSProviderRequest>): DeleteVCSProviderRequest {
- return DeleteVCSProviderRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteVCSProviderRequest>): DeleteVCSProviderRequest {
- const message = createBaseDeleteVCSProviderRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseSearchVCSProviderRepositoriesRequest(): SearchVCSProviderRepositoriesRequest {
- return { name: "" };
-}
-
-export const SearchVCSProviderRepositoriesRequest: MessageFns<SearchVCSProviderRepositoriesRequest> = {
- encode(message: SearchVCSProviderRepositoriesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchVCSProviderRepositoriesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchVCSProviderRepositoriesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchVCSProviderRepositoriesRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: SearchVCSProviderRepositoriesRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchVCSProviderRepositoriesRequest>): SearchVCSProviderRepositoriesRequest {
- return SearchVCSProviderRepositoriesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchVCSProviderRepositoriesRequest>): SearchVCSProviderRepositoriesRequest {
- const message = createBaseSearchVCSProviderRepositoriesRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseVCSRepository(): VCSRepository {
- return { id: "", title: "", fullPath: "", webUrl: "" };
-}
-
-export const VCSRepository: MessageFns<VCSRepository> = {
- encode(message: VCSRepository, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(10).string(message.id);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.fullPath !== "") {
- writer.uint32(26).string(message.fullPath);
- }
- if (message.webUrl !== "") {
- writer.uint32(34).string(message.webUrl);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): VCSRepository {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseVCSRepository();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.fullPath = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.webUrl = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): VCSRepository {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- fullPath: isSet(object.fullPath) ? globalThis.String(object.fullPath) : "",
- webUrl: isSet(object.webUrl) ? globalThis.String(object.webUrl) : "",
- };
- },
-
- toJSON(message: VCSRepository): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.fullPath !== "") {
- obj.fullPath = message.fullPath;
- }
- if (message.webUrl !== "") {
- obj.webUrl = message.webUrl;
- }
- return obj;
- },
-
- create(base?: DeepPartial<VCSRepository>): VCSRepository {
- return VCSRepository.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<VCSRepository>): VCSRepository {
- const message = createBaseVCSRepository();
- message.id = object.id ?? "";
- message.title = object.title ?? "";
- message.fullPath = object.fullPath ?? "";
- message.webUrl = object.webUrl ?? "";
- return message;
- },
-};
-
-function createBaseSearchVCSProviderRepositoriesResponse(): SearchVCSProviderRepositoriesResponse {
- return { repositories: [] };
-}
-
-export const SearchVCSProviderRepositoriesResponse: MessageFns<SearchVCSProviderRepositoriesResponse> = {
- encode(message: SearchVCSProviderRepositoriesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.repositories) {
- VCSRepository.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchVCSProviderRepositoriesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchVCSProviderRepositoriesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.repositories.push(VCSRepository.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchVCSProviderRepositoriesResponse {
- return {
- repositories: globalThis.Array.isArray(object?.repositories)
- ? object.repositories.map((e: any) => VCSRepository.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: SearchVCSProviderRepositoriesResponse): unknown {
- const obj: any = {};
- if (message.repositories?.length) {
- obj.repositories = message.repositories.map((e) => VCSRepository.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchVCSProviderRepositoriesResponse>): SearchVCSProviderRepositoriesResponse {
- return SearchVCSProviderRepositoriesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchVCSProviderRepositoriesResponse>): SearchVCSProviderRepositoriesResponse {
- const message = createBaseSearchVCSProviderRepositoriesResponse();
- message.repositories = object.repositories?.map((e) => VCSRepository.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseListVCSConnectorsInProviderRequest(): ListVCSConnectorsInProviderRequest {
- return { name: "" };
-}
-
-export const ListVCSConnectorsInProviderRequest: MessageFns<ListVCSConnectorsInProviderRequest> = {
- encode(message: ListVCSConnectorsInProviderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListVCSConnectorsInProviderRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListVCSConnectorsInProviderRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListVCSConnectorsInProviderRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: ListVCSConnectorsInProviderRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListVCSConnectorsInProviderRequest>): ListVCSConnectorsInProviderRequest {
- return ListVCSConnectorsInProviderRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListVCSConnectorsInProviderRequest>): ListVCSConnectorsInProviderRequest {
- const message = createBaseListVCSConnectorsInProviderRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListVCSConnectorsInProviderResponse(): ListVCSConnectorsInProviderResponse {
- return { vcsConnectors: [] };
-}
-
-export const ListVCSConnectorsInProviderResponse: MessageFns<ListVCSConnectorsInProviderResponse> = {
- encode(message: ListVCSConnectorsInProviderResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.vcsConnectors) {
- VCSConnector.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListVCSConnectorsInProviderResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListVCSConnectorsInProviderResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.vcsConnectors.push(VCSConnector.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListVCSConnectorsInProviderResponse {
- return {
- vcsConnectors: globalThis.Array.isArray(object?.vcsConnectors)
- ? object.vcsConnectors.map((e: any) => VCSConnector.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: ListVCSConnectorsInProviderResponse): unknown {
- const obj: any = {};
- if (message.vcsConnectors?.length) {
- obj.vcsConnectors = message.vcsConnectors.map((e) => VCSConnector.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListVCSConnectorsInProviderResponse>): ListVCSConnectorsInProviderResponse {
- return ListVCSConnectorsInProviderResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListVCSConnectorsInProviderResponse>): ListVCSConnectorsInProviderResponse {
- const message = createBaseListVCSConnectorsInProviderResponse();
- message.vcsConnectors = object.vcsConnectors?.map((e) => VCSConnector.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseVCSProvider(): VCSProvider {
- return { name: "", title: "", type: VCSType.VCS_TYPE_UNSPECIFIED, url: "", accessToken: "" };
-}
-
-export const VCSProvider: MessageFns<VCSProvider> = {
- encode(message: VCSProvider, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.type !== VCSType.VCS_TYPE_UNSPECIFIED) {
- writer.uint32(24).int32(vCSTypeToNumber(message.type));
- }
- if (message.url !== "") {
- writer.uint32(34).string(message.url);
- }
- if (message.accessToken !== "") {
- writer.uint32(42).string(message.accessToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): VCSProvider {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseVCSProvider();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.type = vCSTypeFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.url = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.accessToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): VCSProvider {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- type: isSet(object.type) ? vCSTypeFromJSON(object.type) : VCSType.VCS_TYPE_UNSPECIFIED,
- url: isSet(object.url) ? globalThis.String(object.url) : "",
- accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : "",
- };
- },
-
- toJSON(message: VCSProvider): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.type !== VCSType.VCS_TYPE_UNSPECIFIED) {
- obj.type = vCSTypeToJSON(message.type);
- }
- if (message.url !== "") {
- obj.url = message.url;
- }
- if (message.accessToken !== "") {
- obj.accessToken = message.accessToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<VCSProvider>): VCSProvider {
- return VCSProvider.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<VCSProvider>): VCSProvider {
- const message = createBaseVCSProvider();
- message.name = object.name ?? "";
- message.title = object.title ?? "";
- message.type = object.type ?? VCSType.VCS_TYPE_UNSPECIFIED;
- message.url = object.url ?? "";
- message.accessToken = object.accessToken ?? "";
- return message;
- },
-};
-
-export type VCSProviderServiceDefinition = typeof VCSProviderServiceDefinition;
-export const VCSProviderServiceDefinition = {
- name: "VCSProviderService",
- fullName: "bytebase.v1.VCSProviderService",
- methods: {
- getVCSProvider: {
- name: "GetVCSProvider",
- requestType: GetVCSProviderRequest,
- requestStream: false,
- responseType: VCSProvider,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 103,
- 101,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 27,
- 18,
- 25,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- listVCSProviders: {
- name: "ListVCSProviders",
- requestType: ListVCSProvidersRequest,
- requestStream: false,
- responseType: ListVCSProvidersResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [
- new Uint8Array([
- 20,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 108,
- 105,
- 115,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([18, 18, 16, 47, 118, 49, 47, 118, 99, 115, 80, 114, 111, 118, 105, 100, 101, 114, 115]),
- ],
- },
- },
- },
- createVCSProvider: {
- name: "CreateVCSProvider",
- requestType: CreateVCSProviderRequest,
- requestStream: false,
- responseType: VCSProvider,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [
- new Uint8Array([
- 22,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 99,
- 114,
- 101,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 32,
- 58,
- 12,
- 118,
- 99,
- 115,
- 95,
- 112,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 34,
- 16,
- 47,
- 118,
- 49,
- 47,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- ]),
- ],
- },
- },
- },
- updateVCSProvider: {
- name: "UpdateVCSProvider",
- requestType: UpdateVCSProviderRequest,
- requestStream: false,
- responseType: VCSProvider,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 24,
- 118,
- 99,
- 115,
- 95,
- 112,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([
- 22,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 54,
- 58,
- 12,
- 118,
- 99,
- 115,
- 95,
- 112,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 50,
- 38,
- 47,
- 118,
- 49,
- 47,
- 123,
- 118,
- 99,
- 115,
- 95,
- 112,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- deleteVCSProvider: {
- name: "DeleteVCSProvider",
- requestType: DeleteVCSProviderRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 22,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 27,
- 42,
- 25,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- searchVCSProviderRepositories: {
- name: "SearchVCSProviderRepositories",
- requestType: SearchVCSProviderRepositoriesRequest,
- requestStream: false,
- responseType: SearchVCSProviderRepositoriesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 30,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 115,
- 101,
- 97,
- 114,
- 99,
- 104,
- 80,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 49,
- 58,
- 1,
- 42,
- 34,
- 44,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 47,
- 42,
- 125,
- 58,
- 115,
- 101,
- 97,
- 114,
- 99,
- 104,
- 82,
- 101,
- 112,
- 111,
- 115,
- 105,
- 116,
- 111,
- 114,
- 105,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- listVCSConnectorsInProvider: {
- name: "ListVCSConnectorsInProvider",
- requestType: ListVCSConnectorsInProviderRequest,
- requestStream: false,
- responseType: ListVCSConnectorsInProviderResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 28,
- 98,
- 98,
- 46,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 108,
- 105,
- 115,
- 116,
- 80,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 41,
- 18,
- 39,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 118,
- 99,
- 115,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 47,
- 42,
- 125,
- 47,
- 118,
- 99,
- 115,
- 67,
- 111,
- 110,
- 110,
- 101,
- 99,
- 116,
- 111,
- 114,
- 115,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/v1/project.ts b/frontend/src/types/v1/project.ts
index 2f140d7b26..daaeaa47a6 100644
--- a/frontend/src/types/v1/project.ts
+++ b/frontend/src/types/v1/project.ts
@@ -1,11 +1,7 @@
import { EMPTY_ID, UNKNOWN_ID } from "../const";
import { State } from "../proto/v1/common";
import { IamPolicy } from "../proto/v1/iam_policy";
-import { Project, Workflow } from "../proto/v1/project_service";
-import type {
- VCSProvider,
- VCSRepository,
-} from "../proto/v1/vcs_provider_service";
+import { Project } from "../proto/v1/project_service";
export const DEFAULT_PROJECT_UID = 1;
export const EMPTY_PROJECT_NAME = `projects/${EMPTY_ID}`;
@@ -24,7 +20,6 @@ export const emptyProject = (): ComposedProject => {
title: "",
key: "",
state: State.ACTIVE,
- workflow: Workflow.UI,
}),
iamPolicy: IamPolicy.fromJSON({}),
};
@@ -54,16 +49,3 @@ export const isValidProjectName = (name: string | undefined) => {
name !== UNKNOWN_PROJECT_NAME
);
};
-
-export type RepositoryConfig = {
- baseDirectory: string;
- branch: string;
- resourceId: string;
- databaseGroup: string;
-};
-
-export type ProjectRepositoryConfig = {
- vcs: VCSProvider;
- repositoryInfo: VCSRepository;
- repositoryConfig: RepositoryConfig;
-};
diff --git a/frontend/src/types/vcs.ts b/frontend/src/types/vcs.ts
deleted file mode 100644
index 6de2babc45..0000000000
--- a/frontend/src/types/vcs.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { VCSType } from "@/types/proto/v1/common";
-
-// When configuring the VCS, we split the SaaS and self-hosted into two types to present optimal UX.
-export type VCSUIType =
- | "GITLAB_SELF_HOST"
- | "GITLAB_COM"
- | "GITHUB_COM"
- | "GITHUB_ENTERPRISE"
- | "BITBUCKET_ORG"
- | "AZURE_DEVOPS";
-
-export interface VCSConfig {
- type: VCSType;
- uiType: VCSUIType;
- resourceId: string;
- name: string;
- instanceUrl: string;
- accessToken: string;
-}
diff --git a/frontend/src/utils/useDashboardSidebar.ts b/frontend/src/utils/useDashboardSidebar.ts
index fe8492ae24..651f4a6692 100644
--- a/frontend/src/utils/useDashboardSidebar.ts
+++ b/frontend/src/utils/useDashboardSidebar.ts
@@ -30,7 +30,6 @@ import {
WORKSPACE_ROUTE_SEMANTIC_TYPES,
WORKSPACE_ROUTE_DATA_CLASSIFICATION,
WORKSPACE_ROUTE_AUDIT_LOG,
- WORKSPACE_ROUTE_GITOPS,
WORKSPACE_ROUTE_SSO,
WORKSPACE_ROUTE_MAIL_DELIVERY,
WORKSPACE_ROUTE_USERS,
@@ -251,12 +250,6 @@ export const useDashboardSidebar = () => {
name: WORKSPACE_ROUTE_SCHEMA_TEMPLATE,
type: "route",
},
- {
- title: t("settings.sidebar.gitops"),
- name: WORKSPACE_ROUTE_GITOPS,
- type: "route",
- hide: databaseChangeMode.value === DatabaseChangeMode.EDITOR,
- },
],
},
{
diff --git a/frontend/src/views/SettingWorkspaceVCS.vue b/frontend/src/views/SettingWorkspaceVCS.vue
deleted file mode 100644
index b27dcabf9a..0000000000
--- a/frontend/src/views/SettingWorkspaceVCS.vue
+++ /dev/null
@@ -1,122 +0,0 @@
-<template>
- <div class="space-y-4 h-full flex flex-col">
- <div class="textinfolabel">
- {{ $t("gitops.setting.description") }}
- <LearnMoreLink
- url="https://www.bytebase.com/docs/vcs-integration/add-git-provider?source=console"
- class="ml-1 text-sm"
- />
- </div>
- <div v-if="vcsList.length > 0" class="flex justify-end">
- <NButton
- type="primary"
- :disabled="!hasCreateVCSPermission"
- class="capitalize"
- @click.prevent="addVCSProvider"
- >
- <template #icon>
- <PlusIcon class="h-4 w-4" />
- </template>
- {{ $t("gitops.setting.add-git-provider.self") }}
- </NButton>
- </div>
-
- <NDataTable
- v-if="vcsList.length > 0 || loading"
- key="vcs-table"
- :data="vcsList"
- :row-key="(vcs: VCSProvider) => vcs.name"
- :columns="columnList"
- :striped="true"
- :bordered="true"
- />
- <VCSSetupWizard v-else class="flex-1" :show-cancel="false" />
- </div>
-</template>
-
-<script lang="tsx" setup>
-import { PlusIcon } from "lucide-vue-next";
-import { NButton, NDataTable } from "naive-ui";
-import type { DataTableColumn } from "naive-ui";
-import { computed, watchEffect, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
-import LearnMoreLink from "@/components/LearnMoreLink.vue";
-import VCSIcon from "@/components/VCS/VCSIcon.vue";
-import VCSSetupWizard from "@/components/VCS/VCSSetupWizard.vue";
-import {
- WORKSPACE_ROUTE_GITOPS_CREATE,
- WORKSPACE_ROUTE_GITOPS_DETAIL,
-} from "@/router/dashboard/workspaceRoutes";
-import { useVCSProviderStore } from "@/store";
-import { getVCSProviderId } from "@/store/modules/v1/common";
-import type { VCSProvider } from "@/types/proto/v1/vcs_provider_service";
-import { hasWorkspacePermissionV2 } from "@/utils";
-
-const vcsV1Store = useVCSProviderStore();
-const router = useRouter();
-const { t } = useI18n();
-const loading = ref<boolean>(true);
-
-const hasCreateVCSPermission = computed(() => {
- return hasWorkspacePermissionV2("bb.vcsProviders.create");
-});
-
-const prepareVCSList = async () => {
- await vcsV1Store.getOrFetchVCSList();
- loading.value = false;
-};
-
-watchEffect(prepareVCSList);
-
-const vcsList = computed(() => {
- return vcsV1Store.vcsList;
-});
-
-const addVCSProvider = () => {
- router.push({
- name: WORKSPACE_ROUTE_GITOPS_CREATE,
- });
-};
-
-const columnList = computed((): DataTableColumn<VCSProvider>[] => {
- return [
- {
- key: "title",
- title: t("common.name"),
- render: (vcs) => (
- <div class="flex items-center gap-x-2">
- <VCSIcon type={vcs.type} customClass={"h-5"} />
- {vcs.title}
- </div>
- ),
- },
- {
- key: "instance_url",
- title: `${t("common.instance")} URL`,
- render: (vcs) => vcs.url,
- },
- {
- key: "view",
- title: "",
- render: (vcs) => (
- <div class="flex justify-end">
- <NButton
- size={"small"}
- onClick={() => {
- router.push({
- name: WORKSPACE_ROUTE_GITOPS_DETAIL,
- params: {
- vcsResourceId: getVCSProviderId(vcs.name),
- },
- });
- }}
- >
- {t("common.view")}
- </NButton>
- </div>
- ),
- },
- ];
-});
-</script>
diff --git a/frontend/src/views/SettingWorkspaceVCSCreate.vue b/frontend/src/views/SettingWorkspaceVCSCreate.vue
deleted file mode 100644
index fd1832fb15..0000000000
--- a/frontend/src/views/SettingWorkspaceVCSCreate.vue
+++ /dev/null
@@ -1,20 +0,0 @@
-<template>
- <div class="space-y-4 h-full flex flex-col">
- <BBAttention type="info">
- <div class="textinfolabel">
- {{ $t("gitops.setting.add-git-provider.description") }}
- <LearnMoreLink
- url="https://www.bytebase.com/docs/vcs-integration/add-git-provider?source=console"
- class="text-sm"
- />
- </div>
- </BBAttention>
- <VCSSetupWizard class="flex-1" :show-cancel="true" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { BBAttention } from "@/bbkit";
-import LearnMoreLink from "@/components/LearnMoreLink.vue";
-import VCSSetupWizard from "@/components/VCS/VCSSetupWizard.vue";
-</script>
diff --git a/frontend/src/views/SettingWorkspaceVCSDetail.vue b/frontend/src/views/SettingWorkspaceVCSDetail.vue
deleted file mode 100644
index 37afa9ebd5..0000000000
--- a/frontend/src/views/SettingWorkspaceVCSDetail.vue
+++ /dev/null
@@ -1,205 +0,0 @@
-<template>
- <div class="flex flex-col gap-y-4">
- <VCSProviderBasicInfoPanel :create="false" :config="state.config" />
-
- <div class="pt-4 mt-2 flex border-t justify-between">
- <template v-if="connectorList.length == 0">
- <BBButtonConfirm
- :type="'DELETE'"
- :button-text="$t('gitops.setting.git-provider.delete')"
- :ok-text="$t('common.delete')"
- :confirm-title="
- $t('gitops.setting.git-provider.delete-confirm', {
- name: vcs?.title,
- })
- "
- :disabled="!hasDeleteVCSPermission"
- :require-confirm="true"
- @confirm="deleteVCS"
- />
- </template>
- <template v-else>
- <div class="mt-1 textinfolabel">
- {{ $t("gitops.setting.git-provider.delete-forbidden") }}
- </div>
- </template>
- <div class="space-x-3">
- <NButton
- v-if="allowUpdate"
- :disabled="state.loading"
- @click.prevent="cancel"
- >
- {{ $t("common.discard-changes") }}
- </NButton>
- <NButton
- type="primary"
- :disabled="!allowUpdate"
- :loading="state.loading"
- @click.prevent="doUpdate"
- >
- {{ $t("common.update") }}
- </NButton>
- </div>
- </div>
- </div>
-
- <div class="py-6 space-y-4">
- <div class="text-lg leading-6 font-medium text-main">
- {{ $t("repository.linked") + ` (${connectorList.length})` }}
- </div>
- <VCSConnectorTable
- v-if="hasListRepoPermission"
- :connector-list="connectorList"
- />
- <NoPermissionPlaceholder v-else />
- </div>
-</template>
-
-<script lang="ts" setup>
-import isEmpty from "lodash-es/isEmpty";
-import { NButton } from "naive-ui";
-import { reactive, computed, watchEffect } from "vue";
-import { useRouter } from "vue-router";
-import { BBButtonConfirm } from "@/bbkit";
-import { VCSProviderBasicInfoPanel } from "@/components/VCS";
-import VCSConnectorTable from "@/components/VCSConnectorTable.vue";
-import NoPermissionPlaceholder from "@/components/misc/NoPermissionPlaceholder.vue";
-import { WORKSPACE_ROUTE_GITOPS } from "@/router/dashboard/workspaceRoutes";
-import {
- pushNotification,
- useVCSConnectorStore,
- useVCSProviderStore,
-} from "@/store";
-import type { VCSConfig } from "@/types";
-import { VCSType } from "@/types/proto/v1/common";
-import type { VCSProvider } from "@/types/proto/v1/vcs_provider_service";
-import { hasWorkspacePermissionV2 } from "@/utils";
-
-interface LocalState {
- config: VCSConfig;
- loading: boolean;
-}
-
-const props = defineProps<{
- vcsResourceId: string;
-}>();
-
-const router = useRouter();
-const vcsV1Store = useVCSProviderStore();
-const vcsConnectorStore = useVCSConnectorStore();
-
-const vcs = computed((): VCSProvider | undefined => {
- return vcsV1Store.getVCSById(props.vcsResourceId);
-});
-
-const initState = computed(
- (): VCSConfig => ({
- type: vcs.value?.type ?? VCSType.GITLAB,
- uiType: "GITLAB_SELF_HOST",
- resourceId: props.vcsResourceId,
- name: vcs.value?.title ?? "",
- instanceUrl: vcs.value?.url ?? "",
- accessToken: "",
- })
-);
-
-const resetState = () => {
- state.config = { ...initState.value };
- state.loading = false;
-};
-
-const state = reactive<LocalState>({
- config: { ...initState.value },
- loading: false,
-});
-
-const hasUpdateVCSPermission = computed(() => {
- return hasWorkspacePermissionV2("bb.vcsProviders.update");
-});
-
-const hasDeleteVCSPermission = computed(() => {
- return hasWorkspacePermissionV2("bb.vcsProviders.delete");
-});
-
-const hasListRepoPermission = computed(() => {
- return hasWorkspacePermissionV2("bb.vcsProviders.listProjects");
-});
-
-watchEffect(async () => {
- await vcsV1Store.getOrFetchVCSList();
- resetState();
- if (vcs.value && hasListRepoPermission.value) {
- await vcsConnectorStore.fetchConnectorsInProvider(vcs.value.name);
- }
-});
-
-const connectorList = computed(() => {
- return vcsConnectorStore.getConnectorsInProvider(vcs.value?.name ?? "");
-});
-
-const allowUpdate = computed(() => {
- return (
- (state.config.name != vcs.value?.title ||
- !isEmpty(state.config.accessToken)) &&
- hasUpdateVCSPermission.value
- );
-});
-
-const doUpdate = async () => {
- if (!vcs.value) {
- return;
- }
- state.loading = true;
-
- const vcsPatch: Partial<VCSProvider> = {
- name: vcs.value.name,
- };
- if (state.config.name != vcs.value.title) {
- vcsPatch.title = state.config.name;
- }
- if (!isEmpty(state.config.accessToken)) {
- vcsPatch.accessToken = state.config.accessToken;
- }
-
- try {
- const updatedVCS = await vcsV1Store.updateVCS(vcsPatch);
- if (!updatedVCS) {
- return;
- }
- resetState();
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: `Successfully updated '${updatedVCS.title}'`,
- });
- } finally {
- state.loading = false;
- }
-};
-
-const cancel = () => {
- resetState();
-};
-
-const deleteVCS = async () => {
- if (!vcs.value) {
- return;
- }
- state.loading = true;
-
- try {
- const title = vcs.value.title;
- await vcsV1Store.deleteVCS(vcs.value.name);
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: `Successfully deleted '${title}'`,
- });
- router.push({
- name: WORKSPACE_ROUTE_GITOPS,
- });
- } finally {
- state.loading = false;
- }
-};
-</script>
diff --git a/frontend/src/views/project/ProjectVersionControlCreate.vue b/frontend/src/views/project/ProjectVersionControlCreate.vue
deleted file mode 100644
index af7f3606d5..0000000000
--- a/frontend/src/views/project/ProjectVersionControlCreate.vue
+++ /dev/null
@@ -1,96 +0,0 @@
-<template>
- <div class="space-y-4 h-full flex flex-col">
- <BBAttention
- v-if="!externalUrl"
- class="w-full border-none"
- type="error"
- :title="$t('banner.external-url')"
- :description="$t('settings.general.workspace.external-url.description')"
- >
- <template #action>
- <NButton type="primary" @click="configureSetting">
- {{ $t("common.configure-now") }}
- </NButton>
- </template>
- </BBAttention>
- <div class="flex-1">
- <RepositorySetupWizard
- :project="project"
- @cancel="onCancel"
- @finish="onFinish"
- />
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { NButton } from "naive-ui";
-import { computed } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
-import { BBAttention } from "@/bbkit";
-import RepositorySetupWizard from "@/components/RepositorySetupWizard.vue";
-import { PROJECT_V1_ROUTE_GITOPS } from "@/router/dashboard/projectV1";
-import { SETTING_ROUTE_WORKSPACE_GENERAL } from "@/router/dashboard/workspaceSetting";
-import { SQL_EDITOR_SETTING_GENERAL_MODULE } from "@/router/sqlEditor";
-import {
- pushNotification,
- useVCSConnectorStore,
- useProjectV1Store,
- useProjectByName,
- useActuatorV1Store,
-} from "@/store";
-import { projectNamePrefix } from "@/store/modules/v1/common";
-import { Workflow } from "@/types/proto/v1/project_service";
-
-const props = defineProps<{
- projectId: string;
-}>();
-
-const { t } = useI18n();
-const router = useRouter();
-const vcsConnectorStore = useVCSConnectorStore();
-const { project } = useProjectByName(
- computed(() => `${projectNamePrefix}${props.projectId}`)
-);
-
-const vcsConnectorList = computed(() =>
- vcsConnectorStore.getConnectorList(project.value.name)
-);
-
-const onCancel = () => {
- router.push({
- name: PROJECT_V1_ROUTE_GITOPS,
- });
-};
-
-const configureSetting = () => {
- router.push({
- name: router.currentRoute.value.name?.toString().startsWith("sql-editor")
- ? SQL_EDITOR_SETTING_GENERAL_MODULE
- : SETTING_ROUTE_WORKSPACE_GENERAL,
- });
-};
-
-const externalUrl = computed(
- () => useActuatorV1Store().serverInfo?.externalUrl ?? ""
-);
-
-const onFinish = () => {
- if (vcsConnectorList.value.length >= 1) {
- // Update workflow type in local cache.
- useProjectV1Store().updateProjectCache({
- ...project.value,
- workflow: Workflow.VCS,
- });
- }
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: t("project.gitops-connector.create-success"),
- });
- router.push({
- name: PROJECT_V1_ROUTE_GITOPS,
- });
-};
-</script>
diff --git a/frontend/src/views/project/ProjectVersionControlDetail.vue b/frontend/src/views/project/ProjectVersionControlDetail.vue
deleted file mode 100644
index b6580404e5..0000000000
--- a/frontend/src/views/project/ProjectVersionControlDetail.vue
+++ /dev/null
@@ -1,100 +0,0 @@
-<template>
- <RepositoryPanel
- :project="project"
- :vcs-connector="vcsConnector"
- :allow-edit="allowEdit"
- :allow-delete="allowDelete"
- @delete="onDelete"
- @update="onUpdate"
- @cancel="onCancel"
- />
-</template>
-
-<script lang="ts" setup>
-import { computed, watchEffect } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
-import RepositoryPanel from "@/components/RepositoryPanel.vue";
-import { PROJECT_V1_ROUTE_GITOPS } from "@/router/dashboard/projectV1";
-import {
- useVCSConnectorStore,
- useProjectV1Store,
- useVCSProviderStore,
- pushNotification,
- useProjectByName,
-} from "@/store";
-import { projectNamePrefix } from "@/store/modules/v1/common";
-import { Workflow } from "@/types/proto/v1/project_service";
-import { VCSConnector } from "@/types/proto/v1/vcs_connector_service";
-import { hasProjectPermissionV2 } from "@/utils";
-
-const props = defineProps<{
- projectId: string;
- vcsConnectorId: string;
-}>();
-
-const { t } = useI18n();
-const router = useRouter();
-const vcsConnectorStore = useVCSConnectorStore();
-const vcsProviderStore = useVCSProviderStore();
-const { project } = useProjectByName(
- computed(() => `${projectNamePrefix}${props.projectId}`)
-);
-
-const vcsConnector = computed(
- () =>
- vcsConnectorStore.getConnector(project.value.name, props.vcsConnectorId) ??
- VCSConnector.fromPartial({})
-);
-
-const vcsConnectorList = computed(() =>
- vcsConnectorStore.getConnectorList(project.value.name)
-);
-
-const allowEdit = computed(() => {
- return hasProjectPermissionV2(project.value, "bb.vcsConnectors.update");
-});
-
-const allowDelete = computed(() => {
- return hasProjectPermissionV2(project.value, "bb.vcsConnectors.delete");
-});
-
-watchEffect(async () => {
- await Promise.all([
- vcsProviderStore.getOrFetchVCSList(),
- vcsConnectorStore.getOrFetchConnectors(project.value.name),
- ]);
-});
-
-const onCancel = () => {
- router.push({
- name: PROJECT_V1_ROUTE_GITOPS,
- });
-};
-
-const onDelete = () => {
- if (vcsConnectorList.value.length === 0) {
- // Update workflow type in local cache.
- useProjectV1Store().updateProjectCache({
- ...project.value,
- workflow: Workflow.UI,
- });
- }
-
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: t("project.gitops-connector.delete-success"),
- });
-
- onCancel();
-};
-
-const onUpdate = () => {
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: t("project.gitops-connector.update-success"),
- });
-};
-</script>
diff --git a/frontend/src/views/project/ProjectVersionControlPanel.vue b/frontend/src/views/project/ProjectVersionControlPanel.vue
deleted file mode 100644
index 24310e802d..0000000000
--- a/frontend/src/views/project/ProjectVersionControlPanel.vue
+++ /dev/null
@@ -1,170 +0,0 @@
-<template>
- <div class="space-y-4">
- <div class="textinfolabel">
- {{ $t("workflow.gitops-workflow-description") }}
- <LearnMoreLink
- url="https://www.bytebase.com/docs/vcs-integration/add-gitops-connector/?source=console"
- />
- </div>
- <div class="flex flex-row items-center justify-end gap-x-2">
- <NButton v-if="allowCreate" type="primary" @click="createConnector">
- <template #icon>
- <PlusIcon class="h-4 w-4" />
- </template>
- {{ $t("project.gitops-connector.add") }}
- </NButton>
- </div>
- <NDataTable
- :data="connectorList"
- :columns="columnList"
- :striped="true"
- :row-key="(connector: VCSConnector) => connector.name"
- :bordered="true"
- />
- </div>
-</template>
-
-<script setup lang="ts">
-import { PlusIcon } from "lucide-vue-next";
-import { NButton, NDataTable } from "naive-ui";
-import type { DataTableColumn } from "naive-ui";
-import { computed, h, watchEffect } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
-import LearnMoreLink from "@/components/LearnMoreLink.vue";
-import VCSIcon from "@/components/VCS/VCSIcon.vue";
-import {
- PROJECT_V1_ROUTE_GITOPS_DETAIL,
- PROJECT_V1_ROUTE_GITOPS_CREATE,
-} from "@/router/dashboard/projectV1";
-import {
- useVCSConnectorStore,
- useVCSProviderStore,
- useProjectByName,
-} from "@/store";
-import {
- getProjectNameAndDatabaseGroupName,
- projectNamePrefix,
-} from "@/store/modules/v1/common";
-import { getVCSConnectorId } from "@/store/modules/v1/common";
-import { VCSType } from "@/types/proto/v1/common";
-import type { VCSConnector } from "@/types/proto/v1/vcs_connector_service";
-import { hasProjectPermissionV2 } from "@/utils";
-
-const props = defineProps<{
- projectId: string;
-}>();
-
-const { t } = useI18n();
-const router = useRouter();
-const vcsV1Store = useVCSProviderStore();
-const vcsConnectorStore = useVCSConnectorStore();
-const { project } = useProjectByName(
- computed(() => `${projectNamePrefix}${props.projectId}`)
-);
-
-const allowCreate = computed(() => {
- return hasProjectPermissionV2(project.value, "bb.vcsConnectors.create");
-});
-
-const allowView = computed(() => {
- return hasProjectPermissionV2(project.value, "bb.vcsConnectors.get");
-});
-
-const createConnector = () => {
- router.push({
- name: PROJECT_V1_ROUTE_GITOPS_CREATE,
- });
-};
-
-const columnList = computed((): DataTableColumn<VCSConnector>[] => {
- const list: DataTableColumn<VCSConnector>[] = [
- {
- key: "provider",
- title: t("repository.git-provider"),
- resizable: true,
- render: (connector) => {
- const vcs = vcsV1Store.getVCSByName(connector.vcsProvider);
- return h("div", { class: "flex items-center gap-x-2" }, [
- h(VCSIcon, {
- type: vcs?.type ?? VCSType.VCS_TYPE_UNSPECIFIED,
- customClass: "h-5",
- }),
- vcs?.title ?? "",
- ]);
- },
- },
- {
- key: "id",
- title: t("common.id"),
- resizable: true,
- render: (connector) => getVCSConnectorId(connector.name).vcsConnectorId,
- },
- {
- key: "databaseGroup",
- title: t("database-group.self"),
- resizable: true,
- render: (connector) =>
- getProjectNameAndDatabaseGroupName(connector.databaseGroup)[1] || "-",
- },
- {
- key: "repository",
- title: t("common.repository"),
- resizable: true,
- render: (connector) => connector.fullPath,
- },
- {
- key: "branch",
- title: t("common.branch"),
- render: (connector) => connector.branch,
- },
- {
- key: "baseDirectory",
- title: t("repository.base-directory"),
- render: (connector) => connector.baseDirectory,
- },
- ];
-
- if (allowView.value) {
- list.push({
- key: "view",
- title: "",
- render: (connector) =>
- h(
- "div",
- { class: "flex justify-end" },
- h(
- NButton,
- {
- size: "small",
- onClick: () => {
- router.push({
- name: PROJECT_V1_ROUTE_GITOPS_DETAIL,
- params: {
- vcsConnectorId: getVCSConnectorId(connector.name)
- .vcsConnectorId,
- },
- });
- },
- },
- t("common.view")
- )
- ),
- });
- }
-
- return list;
-});
-
-const connectorList = computed(() => {
- const list = vcsConnectorStore.getConnectorList(project.value.name);
- return list;
-});
-
-watchEffect(async () => {
- await Promise.all([
- vcsV1Store.getOrFetchVCSList(),
- vcsConnectorStore.getOrFetchConnectors(project.value.name),
- ]);
-});
-</script>
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 19c598dd48..b76d575065 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -6078,193 +6078,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
- /v1/projects/{project}/vcsConnectors:
- get:
- tags:
- - VCSConnectorService
- operationId: VCSConnectorService_ListVCSConnectors
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- Not used.
- The maximum number of vcs connectors to return. The service may return fewer than
- this value.
- If unspecified, at most 10 vcs connectors will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- Not used.
- A page token, received from a previous `ListVCSConnectors` call.
- Provide this to retrieve the subsequent page.
-
- When paginating, all other parameters provided to `ListVCSConnectors` must match
- the call that provided the page token.
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListVCSConnectorsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - VCSConnectorService
- operationId: VCSConnectorService_CreateVCSConnector
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: vcsConnectorId
- in: query
- description: |-
- The ID to use for the vcsConnector, which will become the final component of
- the vcsConnector's resource name.
-
- This value should be 4-63 characters, and valid characters
- are /[a-z][0-9]-/.
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VCSConnector'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VCSConnector'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/vcsConnectors/{vcsConnector}:
- get:
- tags:
- - VCSConnectorService
- operationId: VCSConnectorService_GetVCSConnector
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: vcsConnector
- in: path
- description: The vcsConnector id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VCSConnector'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - VCSConnectorService
- operationId: VCSConnectorService_DeleteVCSConnector
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: vcsConnector
- in: path
- description: The vcsConnector id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - VCSConnectorService
- operationId: VCSConnectorService_UpdateVCSConnector
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: vcsConnector
- in: path
- description: The vcsConnector id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to be updated.
- schema:
- type: string
- format: field-mask
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VCSConnector'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VCSConnector'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
/v1/projects/{project}/webhooks/{webhook}:removeWebhook:
post:
tags:
@@ -7549,215 +7362,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
- /v1/vcsProviders:
- get:
- tags:
- - VCSProviderService
- operationId: VCSProviderService_ListVCSProviders
- parameters:
- - name: pageSize
- in: query
- description: |-
- Not used.
- The maximum number of vcs provider to return. The service may return fewer than this value.
- If unspecified, at most 10 vcs provider will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- Not used.
- A page token, received from a previous `ListVCSProviders` call.
- Provide this to retrieve the subsequent page.
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListVCSProvidersResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - VCSProviderService
- operationId: VCSProviderService_CreateVCSProvider
- parameters:
- - name: vcsProviderId
- in: query
- description: |-
- The ID to use for the VCS provider, which will become the final component of
- the VCS provider's name.
-
- This value should be 4-63 characters, and valid characters
- are /[a-z][0-9]-/.
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VCSProvider'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VCSProvider'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/vcsProviders/{vcsProvider}:
- get:
- tags:
- - VCSProviderService
- operationId: VCSProviderService_GetVCSProvider
- parameters:
- - name: vcsProvider
- in: path
- description: The vcsProvider id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VCSProvider'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - VCSProviderService
- operationId: VCSProviderService_DeleteVCSProvider
- parameters:
- - name: vcsProvider
- in: path
- description: The vcsProvider id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - VCSProviderService
- operationId: VCSProviderService_UpdateVCSProvider
- parameters:
- - name: vcsProvider
- in: path
- description: The vcsProvider id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to be updated.
- schema:
- type: string
- format: field-mask
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VCSProvider'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VCSProvider'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/vcsProviders/{vcsProvider}/vcsConnectors:
- get:
- tags:
- - VCSProviderService
- operationId: VCSProviderService_ListVCSConnectorsInProvider
- parameters:
- - name: vcsProvider
- in: path
- description: The vcsProvider id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListVCSConnectorsInProviderResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/vcsProviders/{vcsProvider}:searchRepositories:
- post:
- tags:
- - VCSProviderService
- operationId: VCSProviderService_SearchVCSProviderRepositories
- parameters:
- - name: vcsProvider
- in: path
- description: The vcsProvider id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchVCSProviderRepositoriesRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchVCSProviderRepositoriesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
/v1/worksheets:
post:
tags:
@@ -11070,40 +10674,6 @@ components:
description: |-
A token, which can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
- ListVCSConnectorsInProviderResponse:
- type: object
- properties:
- vcsConnectors:
- type: array
- items:
- $ref: '#/components/schemas/VCSConnector'
- description: The vcsConnectors from the specified request.
- ListVCSConnectorsResponse:
- type: object
- properties:
- vcsConnectors:
- type: array
- items:
- $ref: '#/components/schemas/VCSConnector'
- description: The vcsConnectors from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListVCSProvidersResponse:
- type: object
- properties:
- vcsProviders:
- type: array
- items:
- $ref: '#/components/schemas/VCSProvider'
- description: The list of vcs providers.
- nextPageToken:
- type: string
- description: |-
- Not used. A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
LoginRequest:
type: object
properties:
@@ -13163,24 +12733,6 @@ components:
A token to retrieve next page of history.
Pass this value in the page_token field in the subsequent call to
`ListQueryHistory` method to retrieve the next page of history.
- SearchVCSProviderRepositoriesRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the vcs provider to retrieve the vcs provider repositories.
- Format: vcsProviders/{vcsProvider}
- SearchVCSProviderRepositoriesResponse:
- type: object
- properties:
- repositories:
- type: array
- items:
- $ref: '#/components/schemas/VCSRepository'
- description: The list of repositories in vcs provider.
SearchWorksheetsRequest:
type: object
properties:
@@ -14433,103 +13985,6 @@ components:
source:
type: string
description: source means where the user comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID.
- VCSConnector:
- type: object
- properties:
- title:
- type: string
- description: The title or display name of the VCS connector.
- fullPath:
- type: string
- description: |-
- Full path from the corresponding VCS provider.
- For GitLab, this is the project full path. e.g. group1/project-1
- webUrl:
- type: string
- description: |-
- Web url from the corresponding VCS provider.
- For GitLab, this is the project web url. e.g. https://gitlab.example.com/group1/project-1
- branch:
- type: string
- description: Branch to listen to.
- baseDirectory:
- type: string
- description: Base working directory we are interested.
- externalId:
- type: string
- description: |-
- Repository id from the corresponding VCS provider.
- For GitLab, this is the project id. e.g. 123
- externalWebhookId:
- type: string
- description: |-
- Push webhook id from the corresponding VCS provider.
- For GitLab, this is the project webhook id. e.g. 123
- webhookSecretToken:
- type: string
- description: For GitLab, webhook request contains this in the 'X-Gitlab-Token" header and we compare it with the one stored in db to validate it sends to the expected endpoint.
- databaseGroup:
- type: string
- description: |-
- Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
- Format: projects/{project}/databaseGroups/{databaseGroup}
- VCSProvider:
- required:
- - title
- - type
- - url
- type: object
- properties:
- name:
- readOnly: true
- type: string
- description: |-
- The name of the vcs provider.
- Format: vcsProviders/{vcsProvider}
- title:
- type: string
- description: The title of the vcs provider. It is used to display in the UI. Specified by the client.
- type:
- enum:
- - VCS_TYPE_UNSPECIFIED
- - GITHUB
- - GITLAB
- - BITBUCKET
- - AZURE_DEVOPS
- type: string
- format: enum
- url:
- type: string
- description: |-
- The url of the vcs provider. Specified by the client.
- For example: github.com, gitlab.com, gitlab.bytebase.com.
- accessToken:
- writeOnly: true
- type: string
- description: The access token of the vcs provider.
- VCSRepository:
- type: object
- properties:
- id:
- type: string
- description: |-
- The id of the repository in vcs provider.
- e.g. In GitLab, this is the corresponding project id. e.g. 123
- title:
- type: string
- description: |-
- The title of the repository in vcs provider.
- e.g. sample-project
- fullPath:
- type: string
- description: |-
- The full_path of the repository in vcs provider.
- e.g. bytebase/sample-project
- webUrl:
- type: string
- description: |-
- Web url of the repository in vcs provider.
- e.g. http://gitlab.bytebase.com/bytebase/sample-project
Value:
type: object
properties:
@@ -14843,7 +14298,5 @@ tags:
- name: SheetService
- name: SubscriptionService
- name: UserService
- - name: VCSConnectorService
- - name: VCSProviderService
- name: WorksheetService
- name: WorkspaceService
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 85e400e398..7560fb30aa 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -351,9 +351,6 @@
- [MFAConfig](#bytebase-store-MFAConfig)
- [UserProfile](#bytebase-store-UserProfile)
-- [store/vcs.proto](#store_vcs-proto)
- - [VCSConnector](#bytebase-store-VCSConnector)
-
- [Scalar Value Types](#scalar-value-types)
@@ -5421,45 +5418,6 @@ MFAConfig is the MFA configuration for a user.
-<a name="store_vcs-proto"></a>
-<p align="right"><a href="#top">Top</a></p>
-
-## store/vcs.proto
-
-
-
-<a name="bytebase-store-VCSConnector"></a>
-
-### VCSConnector
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| title | [string](#string) | | The title or display name of the VCS connector. |
-| full_path | [string](#string) | | Full path from the corresponding VCS provider. For GitLab, this is the project full path. e.g. group1/project-1 |
-| web_url | [string](#string) | | Web url from the corresponding VCS provider. For GitLab, this is the project web url. e.g. https://gitlab.example.com/group1/project-1 |
-| branch | [string](#string) | | Branch to listen to. |
-| base_directory | [string](#string) | | Base working directory we are interested. |
-| external_id | [string](#string) | | Repository id from the corresponding VCS provider. For GitLab, this is the project id. e.g. 123 |
-| external_webhook_id | [string](#string) | | Push webhook id from the corresponding VCS provider. For GitLab, this is the project webhook id. e.g. 123 |
-| webhook_secret_token | [string](#string) | | For GitLab, webhook request contains this in the &#39;X-Gitlab-Token&#34; header and we compare it with the one stored in db to validate it sends to the expected endpoint. |
-| database_group | [string](#string) | | Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project. Format: projects/{project}/databaseGroups/{databaseGroup} |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
## Scalar Value Types
| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 189d25b12f..1ad83f4c17 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -1602,21 +1602,6 @@
- </ul>
- </li>
-
-
- <li>
- <a href="#store%2fvcs.proto">store/vcs.proto</a>
- <ul>
-
- <li>
- <a href="#bytebase.store.VCSConnector"><span class="badge">M</span>VCSConnector</a>
- </li>
-
-
-
-
</ul>
</li>
@@ -13376,105 +13361,6 @@ Format: instances/{instance}/databases/{database} </p></td>
-
- <div class="file-heading">
- <h2 id="store/vcs.proto">store/vcs.proto</h2><a href="#title">Top</a>
- </div>
- <p></p>
-
-
- <h3 id="bytebase.store.VCSConnector">VCSConnector</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>title</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The title or display name of the VCS connector. </p></td>
- </tr>
-
- <tr>
- <td>full_path</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Full path from the corresponding VCS provider.
-For GitLab, this is the project full path. e.g. group1/project-1 </p></td>
- </tr>
-
- <tr>
- <td>web_url</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Web url from the corresponding VCS provider.
-For GitLab, this is the project web url. e.g. https://gitlab.example.com/group1/project-1 </p></td>
- </tr>
-
- <tr>
- <td>branch</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Branch to listen to. </p></td>
- </tr>
-
- <tr>
- <td>base_directory</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Base working directory we are interested. </p></td>
- </tr>
-
- <tr>
- <td>external_id</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Repository id from the corresponding VCS provider.
-For GitLab, this is the project id. e.g. 123 </p></td>
- </tr>
-
- <tr>
- <td>external_webhook_id</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Push webhook id from the corresponding VCS provider.
-For GitLab, this is the project webhook id. e.g. 123 </p></td>
- </tr>
-
- <tr>
- <td>webhook_secret_token</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>For GitLab, webhook request contains this in the &#39;X-Gitlab-Token&#34; header and we compare it with the one stored in db to validate it sends to the expected endpoint. </p></td>
- </tr>
-
- <tr>
- <td>database_group</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
-Format: projects/{project}/databaseGroups/{databaseGroup} </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
-
-
-
-
-
-
-
<h2 id="scalar-value-types">Scalar Value Types</h2>
<table class="scalar-value-types-table">
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 3efbf2e362..b3caf74951 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -494,7 +494,6 @@
- [Activity.Type](#bytebase-v1-Activity-Type)
- [OperatorType](#bytebase-v1-OperatorType)
- [Webhook.Type](#bytebase-v1-Webhook-Type)
- - [Workflow](#bytebase-v1-Workflow)
- [ProjectService](#bytebase-v1-ProjectService)
@@ -705,33 +704,6 @@
- [SheetService](#bytebase-v1-SheetService)
-- [v1/vcs_connector_service.proto](#v1_vcs_connector_service-proto)
- - [CreateVCSConnectorRequest](#bytebase-v1-CreateVCSConnectorRequest)
- - [DeleteVCSConnectorRequest](#bytebase-v1-DeleteVCSConnectorRequest)
- - [GetVCSConnectorRequest](#bytebase-v1-GetVCSConnectorRequest)
- - [ListVCSConnectorsRequest](#bytebase-v1-ListVCSConnectorsRequest)
- - [ListVCSConnectorsResponse](#bytebase-v1-ListVCSConnectorsResponse)
- - [UpdateVCSConnectorRequest](#bytebase-v1-UpdateVCSConnectorRequest)
- - [VCSConnector](#bytebase-v1-VCSConnector)
-
- - [VCSConnectorService](#bytebase-v1-VCSConnectorService)
-
-- [v1/vcs_provider_service.proto](#v1_vcs_provider_service-proto)
- - [CreateVCSProviderRequest](#bytebase-v1-CreateVCSProviderRequest)
- - [DeleteVCSProviderRequest](#bytebase-v1-DeleteVCSProviderRequest)
- - [GetVCSProviderRequest](#bytebase-v1-GetVCSProviderRequest)
- - [ListVCSConnectorsInProviderRequest](#bytebase-v1-ListVCSConnectorsInProviderRequest)
- - [ListVCSConnectorsInProviderResponse](#bytebase-v1-ListVCSConnectorsInProviderResponse)
- - [ListVCSProvidersRequest](#bytebase-v1-ListVCSProvidersRequest)
- - [ListVCSProvidersResponse](#bytebase-v1-ListVCSProvidersResponse)
- - [SearchVCSProviderRepositoriesRequest](#bytebase-v1-SearchVCSProviderRepositoriesRequest)
- - [SearchVCSProviderRepositoriesResponse](#bytebase-v1-SearchVCSProviderRepositoriesResponse)
- - [UpdateVCSProviderRequest](#bytebase-v1-UpdateVCSProviderRequest)
- - [VCSProvider](#bytebase-v1-VCSProvider)
- - [VCSRepository](#bytebase-v1-VCSRepository)
-
- - [VCSProviderService](#bytebase-v1-VCSProviderService)
-
- [v1/worksheet_service.proto](#v1_worksheet_service-proto)
- [CreateWorksheetRequest](#bytebase-v1-CreateWorksheetRequest)
- [DeleteWorksheetRequest](#bytebase-v1-DeleteWorksheetRequest)
@@ -7786,7 +7758,6 @@ When paginating, all other parameters provided to `ListProjects` must match the
| name | [string](#string) | | The name of the project. Format: projects/{project} |
| state | [State](#bytebase-v1-State) | | |
| title | [string](#string) | | The title or name of a project. It&#39;s not unique within the workspace. |
-| workflow | [Workflow](#bytebase-v1-Workflow) | | |
| webhooks | [Webhook](#bytebase-v1-Webhook) | repeated | |
| data_classification_config_id | [string](#string) | | |
| issue_labels | [Label](#bytebase-v1-Label) | repeated | |
@@ -8070,19 +8041,6 @@ TYPE_PROJECT_REPOSITORY_PUSH represents Bytebase receiving a push event from the
| TYPE_LARK | 8 | |
-
-<a name="bytebase-v1-Workflow"></a>
-
-### Workflow
-
-
-| Name | Number | Description |
-| ---- | ------ | ----------- |
-| WORKFLOW_UNSPECIFIED | 0 | |
-| UI | 1 | |
-| VCS | 2 | |
-
-
@@ -11232,386 +11190,6 @@ Type of the SheetPayload.
-<a name="v1_vcs_connector_service-proto"></a>
-<p align="right"><a href="#top">Top</a></p>
-
-## v1/vcs_connector_service.proto
-
-
-
-<a name="bytebase-v1-CreateVCSConnectorRequest"></a>
-
-### CreateVCSConnectorRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| parent | [string](#string) | | The parent resource where this vcsConnector will be created. Format: projects/{project} |
-| vcs_connector | [VCSConnector](#bytebase-v1-VCSConnector) | | The vcsConnector to create. |
-| vcs_connector_id | [string](#string) | | The ID to use for the vcsConnector, which will become the final component of the vcsConnector&#39;s resource name.
-
-This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. |
-
-
-
-
-
-
-<a name="bytebase-v1-DeleteVCSConnectorRequest"></a>
-
-### DeleteVCSConnectorRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the vcsConnector to delete. Format: projects/{project}/vcsConnectors/{vcsConnector} |
-
-
-
-
-
-
-<a name="bytebase-v1-GetVCSConnectorRequest"></a>
-
-### GetVCSConnectorRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the vcsConnector to retrieve. Format: projects/{project}/vcsConnectors/{vcsConnector} |
-
-
-
-
-
-
-<a name="bytebase-v1-ListVCSConnectorsRequest"></a>
-
-### ListVCSConnectorsRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| parent | [string](#string) | | The parent, which owns this collection of vcsConnectors. Format: projects/{project} |
-| page_size | [int32](#int32) | | Not used. The maximum number of vcs connectors to return. The service may return fewer than this value. If unspecified, at most 10 vcs connectors will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
-| page_token | [string](#string) | | Not used. A page token, received from a previous `ListVCSConnectors` call. Provide this to retrieve the subsequent page.
-
-When paginating, all other parameters provided to `ListVCSConnectors` must match the call that provided the page token. |
-
-
-
-
-
-
-<a name="bytebase-v1-ListVCSConnectorsResponse"></a>
-
-### ListVCSConnectorsResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| vcs_connectors | [VCSConnector](#bytebase-v1-VCSConnector) | repeated | The vcsConnectors from the specified request. |
-| next_page_token | [string](#string) | | A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |
-
-
-
-
-
-
-<a name="bytebase-v1-UpdateVCSConnectorRequest"></a>
-
-### UpdateVCSConnectorRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| vcs_connector | [VCSConnector](#bytebase-v1-VCSConnector) | | The vcsConnector to update.
-
-The vcsConnector&#39;s `name` field is used to identify the vcsConnector to update. Format: projects/{project}/vcsConnectors/{vcsConnector} |
-| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to be updated. |
-
-
-
-
-
-
-<a name="bytebase-v1-VCSConnector"></a>
-
-### VCSConnector
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the vcsConnector resource. Canonical parent is project. Format: projects/{project}/vcsConnectors/{vcsConnector} |
-| title | [string](#string) | | The title of the vcs connector. |
-| vcs_provider | [string](#string) | | The name of the VCS. Format: vcsProviders/{vcsProvider} |
-| external_id | [string](#string) | | The reposition external id in target VCS. |
-| base_directory | [string](#string) | | The root directory where Bytebase observes the file change. If empty, then it observes the entire repository. |
-| branch | [string](#string) | | The branch Bytebase listens to for changes. For example: main. |
-| full_path | [string](#string) | | TODO(d): move these to create VCS connector API. The full_path of the repository. For example: bytebase/sample. |
-| web_url | [string](#string) | | The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. |
-| database_group | [string](#string) | | Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project. Format: projects/{project}/databaseGroups/{databaseGroup} |
-
-
-
-
-
-
-
-
-
-
-
-
-<a name="bytebase-v1-VCSConnectorService"></a>
-
-### VCSConnectorService
-
-
-| Method Name | Request Type | Response Type | Description |
-| ----------- | ------------ | ------------- | ------------|
-| CreateVCSConnector | [CreateVCSConnectorRequest](#bytebase-v1-CreateVCSConnectorRequest) | [VCSConnector](#bytebase-v1-VCSConnector) | |
-| GetVCSConnector | [GetVCSConnectorRequest](#bytebase-v1-GetVCSConnectorRequest) | [VCSConnector](#bytebase-v1-VCSConnector) | |
-| ListVCSConnectors | [ListVCSConnectorsRequest](#bytebase-v1-ListVCSConnectorsRequest) | [ListVCSConnectorsResponse](#bytebase-v1-ListVCSConnectorsResponse) | |
-| UpdateVCSConnector | [UpdateVCSConnectorRequest](#bytebase-v1-UpdateVCSConnectorRequest) | [VCSConnector](#bytebase-v1-VCSConnector) | |
-| DeleteVCSConnector | [DeleteVCSConnectorRequest](#bytebase-v1-DeleteVCSConnectorRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
-
-
-
-
-
-<a name="v1_vcs_provider_service-proto"></a>
-<p align="right"><a href="#top">Top</a></p>
-
-## v1/vcs_provider_service.proto
-
-
-
-<a name="bytebase-v1-CreateVCSProviderRequest"></a>
-
-### CreateVCSProviderRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| vcs_provider | [VCSProvider](#bytebase-v1-VCSProvider) | | |
-| vcs_provider_id | [string](#string) | | The ID to use for the VCS provider, which will become the final component of the VCS provider&#39;s name.
-
-This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. |
-
-
-
-
-
-
-<a name="bytebase-v1-DeleteVCSProviderRequest"></a>
-
-### DeleteVCSProviderRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the vcs provider to delete. Format: vcsProviders/{vcsProvider} |
-
-
-
-
-
-
-<a name="bytebase-v1-GetVCSProviderRequest"></a>
-
-### GetVCSProviderRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the vcs provider to retrieve. Format: vcsProviders/{vcsProvider} |
-
-
-
-
-
-
-<a name="bytebase-v1-ListVCSConnectorsInProviderRequest"></a>
-
-### ListVCSConnectorsInProviderRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the vcs provider to retrieve the linked projects. Format: vcsProviders/{vcsProvider} |
-
-
-
-
-
-
-<a name="bytebase-v1-ListVCSConnectorsInProviderResponse"></a>
-
-### ListVCSConnectorsInProviderResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| vcs_connectors | [VCSConnector](#bytebase-v1-VCSConnector) | repeated | The vcsConnectors from the specified request. |
-
-
-
-
-
-
-<a name="bytebase-v1-ListVCSProvidersRequest"></a>
-
-### ListVCSProvidersRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| page_size | [int32](#int32) | | Not used. The maximum number of vcs provider to return. The service may return fewer than this value. If unspecified, at most 10 vcs provider will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
-| page_token | [string](#string) | | Not used. A page token, received from a previous `ListVCSProviders` call. Provide this to retrieve the subsequent page. |
-
-
-
-
-
-
-<a name="bytebase-v1-ListVCSProvidersResponse"></a>
-
-### ListVCSProvidersResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| vcs_providers | [VCSProvider](#bytebase-v1-VCSProvider) | repeated | The list of vcs providers. |
-| next_page_token | [string](#string) | | Not used. A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |
-
-
-
-
-
-
-<a name="bytebase-v1-SearchVCSProviderRepositoriesRequest"></a>
-
-### SearchVCSProviderRepositoriesRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the vcs provider to retrieve the vcs provider repositories. Format: vcsProviders/{vcsProvider} |
-
-
-
-
-
-
-<a name="bytebase-v1-SearchVCSProviderRepositoriesResponse"></a>
-
-### SearchVCSProviderRepositoriesResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| repositories | [VCSRepository](#bytebase-v1-VCSRepository) | repeated | The list of repositories in vcs provider. |
-
-
-
-
-
-
-<a name="bytebase-v1-UpdateVCSProviderRequest"></a>
-
-### UpdateVCSProviderRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| vcs_provider | [VCSProvider](#bytebase-v1-VCSProvider) | | |
-| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to be updated. |
-
-
-
-
-
-
-<a name="bytebase-v1-VCSProvider"></a>
-
-### VCSProvider
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the vcs provider. Format: vcsProviders/{vcsProvider} |
-| title | [string](#string) | | The title of the vcs provider. It is used to display in the UI. Specified by the client. |
-| type | [VCSType](#bytebase-v1-VCSType) | | |
-| url | [string](#string) | | The url of the vcs provider. Specified by the client. For example: github.com, gitlab.com, gitlab.bytebase.com. |
-| access_token | [string](#string) | | The access token of the vcs provider. |
-
-
-
-
-
-
-<a name="bytebase-v1-VCSRepository"></a>
-
-### VCSRepository
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| id | [string](#string) | | The id of the repository in vcs provider. e.g. In GitLab, this is the corresponding project id. e.g. 123 |
-| title | [string](#string) | | The title of the repository in vcs provider. e.g. sample-project |
-| full_path | [string](#string) | | The full_path of the repository in vcs provider. e.g. bytebase/sample-project |
-| web_url | [string](#string) | | Web url of the repository in vcs provider. e.g. http://gitlab.bytebase.com/bytebase/sample-project |
-
-
-
-
-
-
-
-
-
-
-
-
-<a name="bytebase-v1-VCSProviderService"></a>
-
-### VCSProviderService
-
-
-| Method Name | Request Type | Response Type | Description |
-| ----------- | ------------ | ------------- | ------------|
-| GetVCSProvider | [GetVCSProviderRequest](#bytebase-v1-GetVCSProviderRequest) | [VCSProvider](#bytebase-v1-VCSProvider) | |
-| ListVCSProviders | [ListVCSProvidersRequest](#bytebase-v1-ListVCSProvidersRequest) | [ListVCSProvidersResponse](#bytebase-v1-ListVCSProvidersResponse) | |
-| CreateVCSProvider | [CreateVCSProviderRequest](#bytebase-v1-CreateVCSProviderRequest) | [VCSProvider](#bytebase-v1-VCSProvider) | |
-| UpdateVCSProvider | [UpdateVCSProviderRequest](#bytebase-v1-UpdateVCSProviderRequest) | [VCSProvider](#bytebase-v1-VCSProvider) | |
-| DeleteVCSProvider | [DeleteVCSProviderRequest](#bytebase-v1-DeleteVCSProviderRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
-| SearchVCSProviderRepositories | [SearchVCSProviderRepositoriesRequest](#bytebase-v1-SearchVCSProviderRepositoriesRequest) | [SearchVCSProviderRepositoriesResponse](#bytebase-v1-SearchVCSProviderRepositoriesResponse) | |
-| ListVCSConnectorsInProvider | [ListVCSConnectorsInProviderRequest](#bytebase-v1-ListVCSConnectorsInProviderRequest) | [ListVCSConnectorsInProviderResponse](#bytebase-v1-ListVCSConnectorsInProviderResponse) | |
-
-
-
-
-
<a name="v1_worksheet_service-proto"></a>
<p align="right"><a href="#top">Top</a></p>
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 2adda2b078..8279a73cb1 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -2057,10 +2057,6 @@
<a href="#bytebase.v1.Webhook.Type"><span class="badge">E</span>Webhook.Type</a>
</li>
- <li>
- <a href="#bytebase.v1.Workflow"><span class="badge">E</span>Workflow</a>
- </li>
-
<li>
@@ -2863,112 +2859,6 @@
</li>
- <li>
- <a href="#v1%2fvcs_connector_service.proto">v1/vcs_connector_service.proto</a>
- <ul>
-
- <li>
- <a href="#bytebase.v1.CreateVCSConnectorRequest"><span class="badge">M</span>CreateVCSConnectorRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.DeleteVCSConnectorRequest"><span class="badge">M</span>DeleteVCSConnectorRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.GetVCSConnectorRequest"><span class="badge">M</span>GetVCSConnectorRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.ListVCSConnectorsRequest"><span class="badge">M</span>ListVCSConnectorsRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.ListVCSConnectorsResponse"><span class="badge">M</span>ListVCSConnectorsResponse</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.UpdateVCSConnectorRequest"><span class="badge">M</span>UpdateVCSConnectorRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.VCSConnector"><span class="badge">M</span>VCSConnector</a>
- </li>
-
-
-
-
- <li>
- <a href="#bytebase.v1.VCSConnectorService"><span class="badge">S</span>VCSConnectorService</a>
- </li>
-
- </ul>
- </li>
-
-
- <li>
- <a href="#v1%2fvcs_provider_service.proto">v1/vcs_provider_service.proto</a>
- <ul>
-
- <li>
- <a href="#bytebase.v1.CreateVCSProviderRequest"><span class="badge">M</span>CreateVCSProviderRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.DeleteVCSProviderRequest"><span class="badge">M</span>DeleteVCSProviderRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.GetVCSProviderRequest"><span class="badge">M</span>GetVCSProviderRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.ListVCSConnectorsInProviderRequest"><span class="badge">M</span>ListVCSConnectorsInProviderRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.ListVCSConnectorsInProviderResponse"><span class="badge">M</span>ListVCSConnectorsInProviderResponse</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.ListVCSProvidersRequest"><span class="badge">M</span>ListVCSProvidersRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.ListVCSProvidersResponse"><span class="badge">M</span>ListVCSProvidersResponse</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.SearchVCSProviderRepositoriesRequest"><span class="badge">M</span>SearchVCSProviderRepositoriesRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.SearchVCSProviderRepositoriesResponse"><span class="badge">M</span>SearchVCSProviderRepositoriesResponse</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.UpdateVCSProviderRequest"><span class="badge">M</span>UpdateVCSProviderRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.VCSProvider"><span class="badge">M</span>VCSProvider</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.VCSRepository"><span class="badge">M</span>VCSRepository</a>
- </li>
-
-
-
-
- <li>
- <a href="#bytebase.v1.VCSProviderService"><span class="badge">S</span>VCSProviderService</a>
- </li>
-
- </ul>
- </li>
-
-
<li>
<a href="#v1%2fworksheet_service.proto">v1/worksheet_service.proto</a>
<ul>
@@ -21540,13 +21430,6 @@ Format: projects/{project} </p></td>
<td><p>The title or name of a project. It&#39;s not unique within the workspace. </p></td>
</tr>
- <tr>
- <td>workflow</td>
- <td><a href="#bytebase.v1.Workflow">Workflow</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
<tr>
<td>webhooks</td>
<td><a href="#bytebase.v1.Webhook">Webhook</a></td>
@@ -22260,35 +22143,6 @@ TYPE_SQL_EDITOR_QUERY represents executing query in SQL Editor.</p></td>
</tbody>
</table>
- <h3 id="bytebase.v1.Workflow">Workflow</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Name</td><td>Number</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>WORKFLOW_UNSPECIFIED</td>
- <td>0</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>UI</td>
- <td>1</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>VCS</td>
- <td>2</td>
- <td><p></p></td>
- </tr>
-
- </tbody>
- </table>
-
@@ -30829,975 +30683,6 @@ Only support update the following fields for now:
- <div class="file-heading">
- <h2 id="v1/vcs_connector_service.proto">v1/vcs_connector_service.proto</h2><a href="#title">Top</a>
- </div>
- <p></p>
-
-
- <h3 id="bytebase.v1.CreateVCSConnectorRequest">CreateVCSConnectorRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>parent</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The parent resource where this vcsConnector will be created.
-Format: projects/{project} </p></td>
- </tr>
-
- <tr>
- <td>vcs_connector</td>
- <td><a href="#bytebase.v1.VCSConnector">VCSConnector</a></td>
- <td></td>
- <td><p>The vcsConnector to create. </p></td>
- </tr>
-
- <tr>
- <td>vcs_connector_id</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The ID to use for the vcsConnector, which will become the final component of
-the vcsConnector&#39;s resource name.
-
-This value should be 4-63 characters, and valid characters
-are /[a-z][0-9]-/. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.DeleteVCSConnectorRequest">DeleteVCSConnectorRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The name of the vcsConnector to delete.
-Format: projects/{project}/vcsConnectors/{vcsConnector} </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.GetVCSConnectorRequest">GetVCSConnectorRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The name of the vcsConnector to retrieve.
-Format: projects/{project}/vcsConnectors/{vcsConnector} </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.ListVCSConnectorsRequest">ListVCSConnectorsRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>parent</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The parent, which owns this collection of vcsConnectors.
-Format: projects/{project} </p></td>
- </tr>
-
- <tr>
- <td>page_size</td>
- <td><a href="#int32">int32</a></td>
- <td></td>
- <td><p>Not used.
-The maximum number of vcs connectors to return. The service may return fewer than
-this value.
-If unspecified, at most 10 vcs connectors will be returned.
-The maximum value is 1000; values above 1000 will be coerced to 1000. </p></td>
- </tr>
-
- <tr>
- <td>page_token</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Not used.
-A page token, received from a previous `ListVCSConnectors` call.
-Provide this to retrieve the subsequent page.
-
-When paginating, all other parameters provided to `ListVCSConnectors` must match
-the call that provided the page token. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.ListVCSConnectorsResponse">ListVCSConnectorsResponse</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>vcs_connectors</td>
- <td><a href="#bytebase.v1.VCSConnector">VCSConnector</a></td>
- <td>repeated</td>
- <td><p>The vcsConnectors from the specified request. </p></td>
- </tr>
-
- <tr>
- <td>next_page_token</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>A token, which can be sent as `page_token` to retrieve the next page.
-If this field is omitted, there are no subsequent pages. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.UpdateVCSConnectorRequest">UpdateVCSConnectorRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>vcs_connector</td>
- <td><a href="#bytebase.v1.VCSConnector">VCSConnector</a></td>
- <td></td>
- <td><p>The vcsConnector to update.
-
-The vcsConnector&#39;s `name` field is used to identify the vcsConnector to update.
-Format: projects/{project}/vcsConnectors/{vcsConnector} </p></td>
- </tr>
-
- <tr>
- <td>update_mask</td>
- <td><a href="#google.protobuf.FieldMask">google.protobuf.FieldMask</a></td>
- <td></td>
- <td><p>The list of fields to be updated. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.VCSConnector">VCSConnector</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The name of the vcsConnector resource.
-Canonical parent is project.
-Format: projects/{project}/vcsConnectors/{vcsConnector} </p></td>
- </tr>
-
- <tr>
- <td>title</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The title of the vcs connector. </p></td>
- </tr>
-
- <tr>
- <td>vcs_provider</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The name of the VCS.
-Format: vcsProviders/{vcsProvider} </p></td>
- </tr>
-
- <tr>
- <td>external_id</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The reposition external id in target VCS. </p></td>
- </tr>
-
- <tr>
- <td>base_directory</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The root directory where Bytebase observes the file change. If empty, then it observes the entire repository. </p></td>
- </tr>
-
- <tr>
- <td>branch</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The branch Bytebase listens to for changes. For example: main. </p></td>
- </tr>
-
- <tr>
- <td>full_path</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>TODO(d): move these to create VCS connector API.
-The full_path of the repository. For example: bytebase/sample. </p></td>
- </tr>
-
- <tr>
- <td>web_url</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. </p></td>
- </tr>
-
- <tr>
- <td>database_group</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
-Format: projects/{project}/databaseGroups/{databaseGroup} </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
-
-
-
-
-
-
- <h3 id="bytebase.v1.VCSConnectorService">VCSConnectorService</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Method Name</td><td>Request Type</td><td>Response Type</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>CreateVCSConnector</td>
- <td><a href="#bytebase.v1.CreateVCSConnectorRequest">CreateVCSConnectorRequest</a></td>
- <td><a href="#bytebase.v1.VCSConnector">VCSConnector</a></td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>GetVCSConnector</td>
- <td><a href="#bytebase.v1.GetVCSConnectorRequest">GetVCSConnectorRequest</a></td>
- <td><a href="#bytebase.v1.VCSConnector">VCSConnector</a></td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>ListVCSConnectors</td>
- <td><a href="#bytebase.v1.ListVCSConnectorsRequest">ListVCSConnectorsRequest</a></td>
- <td><a href="#bytebase.v1.ListVCSConnectorsResponse">ListVCSConnectorsResponse</a></td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>UpdateVCSConnector</td>
- <td><a href="#bytebase.v1.UpdateVCSConnectorRequest">UpdateVCSConnectorRequest</a></td>
- <td><a href="#bytebase.v1.VCSConnector">VCSConnector</a></td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>DeleteVCSConnector</td>
- <td><a href="#bytebase.v1.DeleteVCSConnectorRequest">DeleteVCSConnectorRequest</a></td>
- <td><a href="#google.protobuf.Empty">.google.protobuf.Empty</a></td>
- <td><p></p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
- <h4>Methods with HTTP bindings</h4>
- <table>
- <thead>
- <tr>
- <td>Method Name</td>
- <td>Method</td>
- <td>Pattern</td>
- <td>Body</td>
- </tr>
- </thead>
- <tbody>
-
-
-
- <tr>
- <td>CreateVCSConnector</td>
- <td>POST</td>
- <td>/v1/{parent=projects/*}/vcsConnectors</td>
- <td>vcs_connector</td>
- </tr>
-
-
-
-
- <tr>
- <td>GetVCSConnector</td>
- <td>GET</td>
- <td>/v1/{name=projects/*/vcsConnectors/*}</td>
- <td></td>
- </tr>
-
-
-
-
- <tr>
- <td>ListVCSConnectors</td>
- <td>GET</td>
- <td>/v1/{parent=projects/*}/vcsConnectors</td>
- <td></td>
- </tr>
-
-
-
-
- <tr>
- <td>UpdateVCSConnector</td>
- <td>PATCH</td>
- <td>/v1/{vcs_connector.name=projects/*/vcsConnectors/*}</td>
- <td>vcs_connector</td>
- </tr>
-
-
-
-
- <tr>
- <td>DeleteVCSConnector</td>
- <td>DELETE</td>
- <td>/v1/{name=projects/*/vcsConnectors/*}</td>
- <td></td>
- </tr>
-
-
- </tbody>
- </table>
-
-
-
-
- <div class="file-heading">
- <h2 id="v1/vcs_provider_service.proto">v1/vcs_provider_service.proto</h2><a href="#title">Top</a>
- </div>
- <p></p>
-
-
- <h3 id="bytebase.v1.CreateVCSProviderRequest">CreateVCSProviderRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>vcs_provider</td>
- <td><a href="#bytebase.v1.VCSProvider">VCSProvider</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>vcs_provider_id</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The ID to use for the VCS provider, which will become the final component of
-the VCS provider&#39;s name.
-
-This value should be 4-63 characters, and valid characters
-are /[a-z][0-9]-/. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.DeleteVCSProviderRequest">DeleteVCSProviderRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The name of the vcs provider to delete.
-Format: vcsProviders/{vcsProvider} </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.GetVCSProviderRequest">GetVCSProviderRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The name of the vcs provider to retrieve.
-Format: vcsProviders/{vcsProvider} </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.ListVCSConnectorsInProviderRequest">ListVCSConnectorsInProviderRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The name of the vcs provider to retrieve the linked projects.
-Format: vcsProviders/{vcsProvider} </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.ListVCSConnectorsInProviderResponse">ListVCSConnectorsInProviderResponse</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>vcs_connectors</td>
- <td><a href="#bytebase.v1.VCSConnector">VCSConnector</a></td>
- <td>repeated</td>
- <td><p>The vcsConnectors from the specified request. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.ListVCSProvidersRequest">ListVCSProvidersRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>page_size</td>
- <td><a href="#int32">int32</a></td>
- <td></td>
- <td><p>Not used.
-The maximum number of vcs provider to return. The service may return fewer than this value.
-If unspecified, at most 10 vcs provider will be returned.
-The maximum value is 1000; values above 1000 will be coerced to 1000. </p></td>
- </tr>
-
- <tr>
- <td>page_token</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Not used.
-A page token, received from a previous `ListVCSProviders` call.
-Provide this to retrieve the subsequent page. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.ListVCSProvidersResponse">ListVCSProvidersResponse</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>vcs_providers</td>
- <td><a href="#bytebase.v1.VCSProvider">VCSProvider</a></td>
- <td>repeated</td>
- <td><p>The list of vcs providers. </p></td>
- </tr>
-
- <tr>
- <td>next_page_token</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Not used. A token, which can be sent as `page_token` to retrieve the next page.
-If this field is omitted, there are no subsequent pages. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.SearchVCSProviderRepositoriesRequest">SearchVCSProviderRepositoriesRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The name of the vcs provider to retrieve the vcs provider repositories.
-Format: vcsProviders/{vcsProvider} </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.SearchVCSProviderRepositoriesResponse">SearchVCSProviderRepositoriesResponse</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>repositories</td>
- <td><a href="#bytebase.v1.VCSRepository">VCSRepository</a></td>
- <td>repeated</td>
- <td><p>The list of repositories in vcs provider. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.UpdateVCSProviderRequest">UpdateVCSProviderRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>vcs_provider</td>
- <td><a href="#bytebase.v1.VCSProvider">VCSProvider</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>update_mask</td>
- <td><a href="#google.protobuf.FieldMask">google.protobuf.FieldMask</a></td>
- <td></td>
- <td><p>The list of fields to be updated. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.VCSProvider">VCSProvider</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The name of the vcs provider.
-Format: vcsProviders/{vcsProvider} </p></td>
- </tr>
-
- <tr>
- <td>title</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The title of the vcs provider. It is used to display in the UI. Specified by the client. </p></td>
- </tr>
-
- <tr>
- <td>type</td>
- <td><a href="#bytebase.v1.VCSType">VCSType</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>url</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The url of the vcs provider. Specified by the client.
-For example: github.com, gitlab.com, gitlab.bytebase.com. </p></td>
- </tr>
-
- <tr>
- <td>access_token</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The access token of the vcs provider. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.VCSRepository">VCSRepository</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>id</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The id of the repository in vcs provider.
-e.g. In GitLab, this is the corresponding project id. e.g. 123 </p></td>
- </tr>
-
- <tr>
- <td>title</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The title of the repository in vcs provider.
-e.g. sample-project </p></td>
- </tr>
-
- <tr>
- <td>full_path</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The full_path of the repository in vcs provider.
-e.g. bytebase/sample-project </p></td>
- </tr>
-
- <tr>
- <td>web_url</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Web url of the repository in vcs provider.
-e.g. http://gitlab.bytebase.com/bytebase/sample-project </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
-
-
-
-
-
-
- <h3 id="bytebase.v1.VCSProviderService">VCSProviderService</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Method Name</td><td>Request Type</td><td>Response Type</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>GetVCSProvider</td>
- <td><a href="#bytebase.v1.GetVCSProviderRequest">GetVCSProviderRequest</a></td>
- <td><a href="#bytebase.v1.VCSProvider">VCSProvider</a></td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>ListVCSProviders</td>
- <td><a href="#bytebase.v1.ListVCSProvidersRequest">ListVCSProvidersRequest</a></td>
- <td><a href="#bytebase.v1.ListVCSProvidersResponse">ListVCSProvidersResponse</a></td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>CreateVCSProvider</td>
- <td><a href="#bytebase.v1.CreateVCSProviderRequest">CreateVCSProviderRequest</a></td>
- <td><a href="#bytebase.v1.VCSProvider">VCSProvider</a></td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>UpdateVCSProvider</td>
- <td><a href="#bytebase.v1.UpdateVCSProviderRequest">UpdateVCSProviderRequest</a></td>
- <td><a href="#bytebase.v1.VCSProvider">VCSProvider</a></td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>DeleteVCSProvider</td>
- <td><a href="#bytebase.v1.DeleteVCSProviderRequest">DeleteVCSProviderRequest</a></td>
- <td><a href="#google.protobuf.Empty">.google.protobuf.Empty</a></td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>SearchVCSProviderRepositories</td>
- <td><a href="#bytebase.v1.SearchVCSProviderRepositoriesRequest">SearchVCSProviderRepositoriesRequest</a></td>
- <td><a href="#bytebase.v1.SearchVCSProviderRepositoriesResponse">SearchVCSProviderRepositoriesResponse</a></td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>ListVCSConnectorsInProvider</td>
- <td><a href="#bytebase.v1.ListVCSConnectorsInProviderRequest">ListVCSConnectorsInProviderRequest</a></td>
- <td><a href="#bytebase.v1.ListVCSConnectorsInProviderResponse">ListVCSConnectorsInProviderResponse</a></td>
- <td><p></p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
- <h4>Methods with HTTP bindings</h4>
- <table>
- <thead>
- <tr>
- <td>Method Name</td>
- <td>Method</td>
- <td>Pattern</td>
- <td>Body</td>
- </tr>
- </thead>
- <tbody>
-
-
-
- <tr>
- <td>GetVCSProvider</td>
- <td>GET</td>
- <td>/v1/{name=vcsProviders/*}</td>
- <td></td>
- </tr>
-
-
-
-
- <tr>
- <td>ListVCSProviders</td>
- <td>GET</td>
- <td>/v1/vcsProviders</td>
- <td></td>
- </tr>
-
-
-
-
- <tr>
- <td>CreateVCSProvider</td>
- <td>POST</td>
- <td>/v1/vcsProviders</td>
- <td>vcs_provider</td>
- </tr>
-
-
-
-
- <tr>
- <td>UpdateVCSProvider</td>
- <td>PATCH</td>
- <td>/v1/{vcs_provider.name=vcsProviders/*}</td>
- <td>vcs_provider</td>
- </tr>
-
-
-
-
- <tr>
- <td>DeleteVCSProvider</td>
- <td>DELETE</td>
- <td>/v1/{name=vcsProviders/*}</td>
- <td></td>
- </tr>
-
-
-
-
- <tr>
- <td>SearchVCSProviderRepositories</td>
- <td>POST</td>
- <td>/v1/{name=vcsProviders/*}:searchRepositories</td>
- <td>*</td>
- </tr>
-
-
-
-
- <tr>
- <td>ListVCSConnectorsInProvider</td>
- <td>GET</td>
- <td>/v1/{name=vcsProviders/*}/vcsConnectors</td>
- <td></td>
- </tr>
-
-
- </tbody>
- </table>
-
-
-
-
<div class="file-heading">
<h2 id="v1/worksheet_service.proto">v1/worksheet_service.proto</h2><a href="#title">Top</a>
</div>
diff --git a/proto/generated-go/store/vcs.pb.go b/proto/generated-go/store/vcs.pb.go
deleted file mode 100644
index dee45534ba..0000000000
--- a/proto/generated-go/store/vcs.pb.go
+++ /dev/null
@@ -1,222 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.36.5
-// protoc (unknown)
-// source: store/vcs.proto
-
-package store
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- reflect "reflect"
- sync "sync"
- unsafe "unsafe"
-)
-
-const (
- // Verify that this generated code is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
- // Verify that runtime/protoimpl is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type VCSConnector struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The title or display name of the VCS connector.
- Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
- // Full path from the corresponding VCS provider.
- // For GitLab, this is the project full path. e.g. group1/project-1
- FullPath string `protobuf:"bytes,2,opt,name=full_path,json=fullPath,proto3" json:"full_path,omitempty"`
- // Web url from the corresponding VCS provider.
- // For GitLab, this is the project web url. e.g. https://gitlab.example.com/group1/project-1
- WebUrl string `protobuf:"bytes,3,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"`
- // Branch to listen to.
- Branch string `protobuf:"bytes,4,opt,name=branch,proto3" json:"branch,omitempty"`
- // Base working directory we are interested.
- BaseDirectory string `protobuf:"bytes,5,opt,name=base_directory,json=baseDirectory,proto3" json:"base_directory,omitempty"`
- // Repository id from the corresponding VCS provider.
- // For GitLab, this is the project id. e.g. 123
- ExternalId string `protobuf:"bytes,6,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
- // Push webhook id from the corresponding VCS provider.
- // For GitLab, this is the project webhook id. e.g. 123
- ExternalWebhookId string `protobuf:"bytes,7,opt,name=external_webhook_id,json=externalWebhookId,proto3" json:"external_webhook_id,omitempty"`
- // For GitLab, webhook request contains this in the 'X-Gitlab-Token" header and we compare it with the one stored in db to validate it sends to the expected endpoint.
- WebhookSecretToken string `protobuf:"bytes,8,opt,name=webhook_secret_token,json=webhookSecretToken,proto3" json:"webhook_secret_token,omitempty"`
- // Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
- // Format: projects/{project}/databaseGroups/{databaseGroup}
- DatabaseGroup string `protobuf:"bytes,9,opt,name=database_group,json=databaseGroup,proto3" json:"database_group,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *VCSConnector) Reset() {
- *x = VCSConnector{}
- mi := &file_store_vcs_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *VCSConnector) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*VCSConnector) ProtoMessage() {}
-
-func (x *VCSConnector) ProtoReflect() protoreflect.Message {
- mi := &file_store_vcs_proto_msgTypes[0]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use VCSConnector.ProtoReflect.Descriptor instead.
-func (*VCSConnector) Descriptor() ([]byte, []int) {
- return file_store_vcs_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *VCSConnector) GetTitle() string {
- if x != nil {
- return x.Title
- }
- return ""
-}
-
-func (x *VCSConnector) GetFullPath() string {
- if x != nil {
- return x.FullPath
- }
- return ""
-}
-
-func (x *VCSConnector) GetWebUrl() string {
- if x != nil {
- return x.WebUrl
- }
- return ""
-}
-
-func (x *VCSConnector) GetBranch() string {
- if x != nil {
- return x.Branch
- }
- return ""
-}
-
-func (x *VCSConnector) GetBaseDirectory() string {
- if x != nil {
- return x.BaseDirectory
- }
- return ""
-}
-
-func (x *VCSConnector) GetExternalId() string {
- if x != nil {
- return x.ExternalId
- }
- return ""
-}
-
-func (x *VCSConnector) GetExternalWebhookId() string {
- if x != nil {
- return x.ExternalWebhookId
- }
- return ""
-}
-
-func (x *VCSConnector) GetWebhookSecretToken() string {
- if x != nil {
- return x.WebhookSecretToken
- }
- return ""
-}
-
-func (x *VCSConnector) GetDatabaseGroup() string {
- if x != nil {
- return x.DatabaseGroup
- }
- return ""
-}
-
-var File_store_vcs_proto protoreflect.FileDescriptor
-
-var file_store_vcs_proto_rawDesc = string([]byte{
- 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x22, 0xc3, 0x02, 0x0a, 0x0c, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c,
- 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c,
- 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c,
- 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x16,
- 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
- 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d,
- 0x62, 0x61, 0x73, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a,
- 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e,
- 0x0a, 0x13, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f,
- 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x78, 0x74,
- 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x30,
- 0x0a, 0x14, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
- 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x77, 0x65,
- 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
- 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f,
- 0x75, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72,
- 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x33,
-})
-
-var (
- file_store_vcs_proto_rawDescOnce sync.Once
- file_store_vcs_proto_rawDescData []byte
-)
-
-func file_store_vcs_proto_rawDescGZIP() []byte {
- file_store_vcs_proto_rawDescOnce.Do(func() {
- file_store_vcs_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_store_vcs_proto_rawDesc), len(file_store_vcs_proto_rawDesc)))
- })
- return file_store_vcs_proto_rawDescData
-}
-
-var file_store_vcs_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
-var file_store_vcs_proto_goTypes = []any{
- (*VCSConnector)(nil), // 0: bytebase.store.VCSConnector
-}
-var file_store_vcs_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
-}
-
-func init() { file_store_vcs_proto_init() }
-func file_store_vcs_proto_init() {
- if File_store_vcs_proto != nil {
- return
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_vcs_proto_rawDesc), len(file_store_vcs_proto_rawDesc)),
- NumEnums: 0,
- NumMessages: 1,
- NumExtensions: 0,
- NumServices: 0,
- },
- GoTypes: file_store_vcs_proto_goTypes,
- DependencyIndexes: file_store_vcs_proto_depIdxs,
- MessageInfos: file_store_vcs_proto_msgTypes,
- }.Build()
- File_store_vcs_proto = out.File
- file_store_vcs_proto_goTypes = nil
- file_store_vcs_proto_depIdxs = nil
-}
diff --git a/proto/generated-go/v1/project_service.pb.go b/proto/generated-go/v1/project_service.pb.go
index a455825f8f..dcf611600c 100644
--- a/proto/generated-go/v1/project_service.pb.go
+++ b/proto/generated-go/v1/project_service.pb.go
@@ -24,55 +24,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
-type Workflow int32
-
-const (
- Workflow_WORKFLOW_UNSPECIFIED Workflow = 0
- Workflow_UI Workflow = 1
- Workflow_VCS Workflow = 2
-)
-
-// Enum value maps for Workflow.
-var (
- Workflow_name = map[int32]string{
- 0: "WORKFLOW_UNSPECIFIED",
- 1: "UI",
- 2: "VCS",
- }
- Workflow_value = map[string]int32{
- "WORKFLOW_UNSPECIFIED": 0,
- "UI": 1,
- "VCS": 2,
- }
-)
-
-func (x Workflow) Enum() *Workflow {
- p := new(Workflow)
- *p = x
- return p
-}
-
-func (x Workflow) String() string {
- return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (Workflow) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_project_service_proto_enumTypes[0].Descriptor()
-}
-
-func (Workflow) Type() protoreflect.EnumType {
- return &file_v1_project_service_proto_enumTypes[0]
-}
-
-func (x Workflow) Number() protoreflect.EnumNumber {
- return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use Workflow.Descriptor instead.
-func (Workflow) EnumDescriptor() ([]byte, []int) {
- return file_v1_project_service_proto_rawDescGZIP(), []int{0}
-}
-
type OperatorType int32
const (
@@ -113,11 +64,11 @@ func (x OperatorType) String() string {
}
func (OperatorType) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_project_service_proto_enumTypes[1].Descriptor()
+ return file_v1_project_service_proto_enumTypes[0].Descriptor()
}
func (OperatorType) Type() protoreflect.EnumType {
- return &file_v1_project_service_proto_enumTypes[1]
+ return &file_v1_project_service_proto_enumTypes[0]
}
func (x OperatorType) Number() protoreflect.EnumNumber {
@@ -126,7 +77,7 @@ func (x OperatorType) Number() protoreflect.EnumNumber {
// Deprecated: Use OperatorType.Descriptor instead.
func (OperatorType) EnumDescriptor() ([]byte, []int) {
- return file_v1_project_service_proto_rawDescGZIP(), []int{1}
+ return file_v1_project_service_proto_rawDescGZIP(), []int{0}
}
type Webhook_Type int32
@@ -180,11 +131,11 @@ func (x Webhook_Type) String() string {
}
func (Webhook_Type) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_project_service_proto_enumTypes[2].Descriptor()
+ return file_v1_project_service_proto_enumTypes[1].Descriptor()
}
func (Webhook_Type) Type() protoreflect.EnumType {
- return &file_v1_project_service_proto_enumTypes[2]
+ return &file_v1_project_service_proto_enumTypes[1]
}
func (x Webhook_Type) Number() protoreflect.EnumNumber {
@@ -316,11 +267,11 @@ func (x Activity_Type) String() string {
}
func (Activity_Type) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_project_service_proto_enumTypes[3].Descriptor()
+ return file_v1_project_service_proto_enumTypes[2].Descriptor()
}
func (Activity_Type) Type() protoreflect.EnumType {
- return &file_v1_project_service_proto_enumTypes[3]
+ return &file_v1_project_service_proto_enumTypes[2]
}
func (x Activity_Type) Number() protoreflect.EnumNumber {
@@ -1066,7 +1017,6 @@ type Project struct {
State State `protobuf:"varint,3,opt,name=state,proto3,enum=bytebase.v1.State" json:"state,omitempty"`
// The title or name of a project. It's not unique within the workspace.
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
- Workflow Workflow `protobuf:"varint,6,opt,name=workflow,proto3,enum=bytebase.v1.Workflow" json:"workflow,omitempty"`
Webhooks []*Webhook `protobuf:"bytes,11,rep,name=webhooks,proto3" json:"webhooks,omitempty"`
DataClassificationConfigId string `protobuf:"bytes,12,opt,name=data_classification_config_id,json=dataClassificationConfigId,proto3" json:"data_classification_config_id,omitempty"`
IssueLabels []*Label `protobuf:"bytes,13,rep,name=issue_labels,json=issueLabels,proto3" json:"issue_labels,omitempty"`
@@ -1142,13 +1092,6 @@ func (x *Project) GetTitle() string {
return ""
}
-func (x *Project) GetWorkflow() Workflow {
- if x != nil {
- return x.Workflow
- }
- return Workflow_WORKFLOW_UNSPECIFIED
-}
-
func (x *Project) GetWebhooks() []*Webhook {
if x != nil {
return x.Webhooks
@@ -2095,383 +2038,376 @@ var file_v1_project_service_proto_rawDesc = string([]byte{
0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70,
- 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x82, 0x06,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xcf, 0x05,
0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a,
0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x62,
0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65,
0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x31, 0x0a,
- 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f,
- 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77,
- 0x12, 0x30, 0x0a, 0x08, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x0b, 0x20, 0x03,
- 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x08, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f,
- 0x6b, 0x73, 0x12, 0x41, 0x0a, 0x1d, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73,
- 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1a, 0x64, 0x61, 0x74, 0x61, 0x43,
- 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e,
- 0x66, 0x69, 0x67, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x0c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6c,
- 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52,
- 0x0b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x12,
- 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6c, 0x61, 0x62, 0x65,
- 0x6c, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x49,
- 0x73, 0x73, 0x75, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x6c,
- 0x6c, 0x6f, 0x77, 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65,
- 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x61, 0x6c, 0x6c, 0x6f,
- 0x77, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74,
- 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65,
- 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x75,
- 0x74, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x12, 0x2e,
- 0x0a, 0x13, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f,
- 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x65, 0x6e, 0x66,
- 0x6f, 0x72, 0x63, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x2c,
- 0x0a, 0x12, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61,
- 0x63, 0x6b, 0x75, 0x70, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x75, 0x74, 0x6f,
- 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2c, 0x0a, 0x12,
- 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x65, 0x72, 0x72, 0x6f,
- 0x72, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x73, 0x6b, 0x69, 0x70, 0x42, 0x61,
- 0x63, 0x6b, 0x75, 0x70, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x41, 0x0a, 0x1d, 0x70, 0x6f,
- 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f,
- 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28,
- 0x08, 0x52, 0x1a, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x2e, 0x0a,
- 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x61, 0x70, 0x70, 0x72,
- 0x6f, 0x76, 0x61, 0x6c, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f,
- 0x77, 0x53, 0x65, 0x6c, 0x66, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x3a, 0x2d, 0xea,
- 0x41, 0x2a, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
- 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x4a, 0x04, 0x08, 0x02,
- 0x10, 0x03, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
- 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xe2, 0x41, 0x01, 0x02, 0xfa,
- 0x41, 0x16, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
- 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x12, 0x34, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07,
- 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x22, 0x89, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61,
- 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x12, 0x34, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07, 0x77,
- 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
- 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 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, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d,
- 0x61, 0x73, 0x6b, 0x22, 0x4c, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62,
- 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x77,
- 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f,
- 0x6f, 0x6b, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f,
- 0x6b, 0x22, 0x83, 0x01, 0x0a, 0x12, 0x54, 0x65, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
- 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xe2, 0x41, 0x01, 0x02, 0xfa,
- 0x41, 0x16, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
- 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x12, 0x34, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07,
- 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x22, 0x2b, 0x0a, 0x13, 0x54, 0x65, 0x73, 0x74, 0x57,
- 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14,
- 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65,
- 0x72, 0x72, 0x6f, 0x72, 0x22, 0xe5, 0x03, 0x0a, 0x07, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b,
- 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
- 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x04, 0xe2,
- 0x41, 0x01, 0x02, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x05, 0x74, 0x69, 0x74,
- 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05,
- 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01,
- 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x25, 0x0a,
- 0x0e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18,
- 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x73,
- 0x73, 0x61, 0x67, 0x65, 0x12, 0x4f, 0x0a, 0x12, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0e,
- 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41,
- 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x04, 0xe2, 0x41,
- 0x01, 0x06, 0x52, 0x11, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14,
- 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
- 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x4c, 0x41,
- 0x43, 0x4b, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x49, 0x53,
- 0x43, 0x4f, 0x52, 0x44, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54,
- 0x45, 0x41, 0x4d, 0x53, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44,
- 0x49, 0x4e, 0x47, 0x54, 0x41, 0x4c, 0x4b, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50,
- 0x45, 0x5f, 0x46, 0x45, 0x49, 0x53, 0x48, 0x55, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59,
- 0x50, 0x45, 0x5f, 0x57, 0x45, 0x43, 0x4f, 0x4d, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59,
- 0x50, 0x45, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x54,
- 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x41, 0x52, 0x4b, 0x10, 0x08, 0x3a, 0x40, 0xea, 0x41, 0x3d, 0x0a,
- 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x57, 0x65,
- 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x25, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,
- 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f,
- 0x6b, 0x73, 0x2f, 0x7b, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x7d, 0x22, 0xc1, 0x01, 0x0a,
- 0x10, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x31, 0x0a, 0x08, 0x73,
- 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65,
- 0x64, 0x75, 0x6c, 0x65, 0x52, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x50,
- 0xea, 0x41, 0x4d, 0x0a, 0x1d, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f,
- 0x6d, 0x2f, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x12, 0x2c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72,
- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e,
- 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
- 0x22, 0x4d, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x0b,
- 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x30, 0x0a,
+ 0x08, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32,
+ 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65,
+ 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x08, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12,
+ 0x41, 0x0a, 0x1d, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x64,
+ 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1a, 0x64, 0x61, 0x74, 0x61, 0x43, 0x6c, 0x61, 0x73,
+ 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x49, 0x64, 0x12, 0x35, 0x0a, 0x0c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6c, 0x61, 0x62, 0x65,
+ 0x6c, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x0b, 0x69, 0x73,
+ 0x73, 0x75, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x66, 0x6f, 0x72,
+ 0x63, 0x65, 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18,
+ 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x49, 0x73, 0x73, 0x75,
+ 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77,
+ 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x6f,
+ 0x64, 0x69, 0x66, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a,
+ 0x12, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x5f, 0x69, 0x73,
+ 0x73, 0x75, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x75, 0x74, 0x6f, 0x52,
+ 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x65,
+ 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x74, 0x69, 0x74,
+ 0x6c, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63,
+ 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x61,
+ 0x75, 0x74, 0x6f, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75,
+ 0x70, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x75, 0x74, 0x6f, 0x45, 0x6e, 0x61,
+ 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x6b, 0x69,
+ 0x70, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18,
+ 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x73, 0x6b, 0x69, 0x70, 0x42, 0x61, 0x63, 0x6b, 0x75,
+ 0x70, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x41, 0x0a, 0x1d, 0x70, 0x6f, 0x73, 0x74, 0x67,
+ 0x72, 0x65, 0x73, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x65, 0x6e,
+ 0x61, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a,
+ 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
+ 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6c,
+ 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61,
+ 0x6c, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x65,
+ 0x6c, 0x66, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x3a, 0x2d, 0xea, 0x41, 0x2a, 0x0a,
+ 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72,
+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,
+ 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22,
+ 0x82, 0x01, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x16, 0x0a,
+ 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72,
+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x34,
+ 0x0a, 0x07, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65,
+ 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07, 0x77, 0x65, 0x62,
+ 0x68, 0x6f, 0x6f, 0x6b, 0x22, 0x89, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57,
+ 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a,
+ 0x07, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x62,
+ 0x68, 0x6f, 0x6f, 0x6b, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07, 0x77, 0x65, 0x62, 0x68,
+ 0x6f, 0x6f, 0x6b, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61,
+ 0x73, 0x6b, 0x18, 0x02, 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, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b,
+ 0x22, 0x4c, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
+ 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x68,
+ 0x6f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x42,
+ 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x22, 0x83,
+ 0x01, 0x0a, 0x12, 0x54, 0x65, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x16, 0x0a,
+ 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72,
+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x34,
+ 0x0a, 0x07, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65,
+ 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07, 0x77, 0x65, 0x62,
+ 0x68, 0x6f, 0x6f, 0x6b, 0x22, 0x2b, 0x0a, 0x13, 0x54, 0x65, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68,
+ 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,
+ 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f,
+ 0x72, 0x22, 0xe5, 0x03, 0x0a, 0x07, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x12, 0x0a,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
+ 0x65, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65,
+ 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02,
+ 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05, 0x74, 0x69, 0x74,
+ 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x69,
+ 0x72, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01,
+ 0x28, 0x08, 0x52, 0x0d, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x12, 0x4f, 0x0a, 0x12, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1a, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69,
+ 0x76, 0x69, 0x74, 0x79, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x06, 0x52,
+ 0x11, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70,
+ 0x65, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54,
+ 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
+ 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x4c, 0x41, 0x43, 0x4b, 0x10,
+ 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x52,
+ 0x44, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x45, 0x41, 0x4d,
+ 0x53, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x49, 0x4e, 0x47,
+ 0x54, 0x41, 0x4c, 0x4b, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46,
+ 0x45, 0x49, 0x53, 0x48, 0x55, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x57, 0x45, 0x43, 0x4f, 0x4d, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45,
+ 0x5f, 0x4c, 0x41, 0x52, 0x4b, 0x10, 0x08, 0x3a, 0x40, 0xea, 0x41, 0x3d, 0x0a, 0x14, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x57, 0x65, 0x62, 0x68, 0x6f,
+ 0x6f, 0x6b, 0x12, 0x25, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72,
+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f,
+ 0x7b, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x7d, 0x22, 0xc1, 0x01, 0x0a, 0x10, 0x44, 0x65,
+ 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12,
+ 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x31, 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65,
+ 0x64, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c,
+ 0x65, 0x52, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x50, 0xea, 0x41, 0x4d,
+ 0x0a, 0x1d, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44,
+ 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
+ 0x2c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x7d, 0x2f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x4d, 0x0a,
+ 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x64, 0x65, 0x70,
+ 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68,
+ 0x65, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52,
+ 0x0b, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x71, 0x0a, 0x12,
0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65,
- 0x6e, 0x74, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22,
- 0x71, 0x0a, 0x12, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f,
- 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x02, 0x69,
- 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x02, 0x69,
- 0x64, 0x12, 0x2f, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65,
- 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70,
- 0x65, 0x63, 0x22, 0x53, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74,
- 0x53, 0x70, 0x65, 0x63, 0x12, 0x41, 0x0a, 0x0e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x73, 0x65,
- 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c,
- 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x0d, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x53,
- 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x63, 0x0a, 0x0d, 0x4c, 0x61, 0x62, 0x65, 0x6c,
- 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x52, 0x0a, 0x11, 0x6d, 0x61, 0x74, 0x63,
- 0x68, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20,
- 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52,
- 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x10, 0x6d, 0x61, 0x74, 0x63,
- 0x68, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7b, 0x0a, 0x18,
- 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71,
- 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x70,
- 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61,
- 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f,
- 0x72, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
- 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xfb, 0x05, 0x0a, 0x08, 0x41, 0x63,
- 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x22, 0xee, 0x05, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12,
- 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
- 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f,
- 0x54, 0x49, 0x46, 0x59, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f,
- 0x56, 0x45, 0x44, 0x10, 0x17, 0x12, 0x20, 0x0a, 0x1c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f,
- 0x54, 0x49, 0x46, 0x59, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x52, 0x4f,
- 0x4c, 0x4c, 0x4f, 0x55, 0x54, 0x10, 0x18, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f,
- 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x1d,
- 0x0a, 0x19, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x43, 0x4f, 0x4d,
- 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x1b, 0x0a,
- 0x17, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c,
- 0x44, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x54, 0x59,
- 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f,
- 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x59, 0x50, 0x45,
- 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f,
- 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x59, 0x10, 0x15, 0x12, 0x2b, 0x0a, 0x27, 0x54, 0x59, 0x50, 0x45,
- 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f,
- 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x50, 0x44,
- 0x41, 0x54, 0x45, 0x10, 0x05, 0x12, 0x2a, 0x0a, 0x26, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53,
- 0x53, 0x55, 0x45, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x41, 0x53,
- 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10,
- 0x06, 0x12, 0x2e, 0x0a, 0x2a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f,
- 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x52, 0x55,
- 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10,
- 0x16, 0x12, 0x2d, 0x0a, 0x29, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f,
- 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x54,
- 0x41, 0x54, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x08,
- 0x12, 0x39, 0x0a, 0x35, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x50,
- 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x45, 0x41, 0x52,
- 0x4c, 0x49, 0x45, 0x53, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x54, 0x49,
- 0x4d, 0x45, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x09, 0x12, 0x16, 0x0a, 0x12, 0x54,
- 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54,
- 0x45, 0x10, 0x0a, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x42,
- 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x0b,
- 0x12, 0x18, 0x0a, 0x14, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f,
- 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x0c, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x59,
- 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x41, 0x43, 0x54, 0x49,
- 0x56, 0x41, 0x54, 0x45, 0x10, 0x0d, 0x12, 0x20, 0x0a, 0x1c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50,
- 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52,
- 0x59, 0x5f, 0x50, 0x55, 0x53, 0x48, 0x10, 0x0e, 0x12, 0x22, 0x0a, 0x1e, 0x54, 0x59, 0x50, 0x45,
- 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53,
- 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x45, 0x52, 0x10, 0x0f, 0x12, 0x1e, 0x0a, 0x1a,
- 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x45, 0x4d,
- 0x42, 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x10, 0x12, 0x1e, 0x0a, 0x1a,
- 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x45, 0x4d,
- 0x42, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x11, 0x12, 0x19, 0x0a, 0x15,
- 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x51, 0x4c, 0x5f, 0x45, 0x44, 0x49, 0x54, 0x4f, 0x52, 0x5f,
- 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x13, 0x2a, 0x35, 0x0a, 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x66,
- 0x6c, 0x6f, 0x77, 0x12, 0x18, 0x0a, 0x14, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f,
- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a,
- 0x02, 0x55, 0x49, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x56, 0x43, 0x53, 0x10, 0x02, 0x2a, 0x77,
- 0x0a, 0x0c, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d,
- 0x0a, 0x19, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a,
- 0x10, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49,
- 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f,
- 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x02, 0x12, 0x18, 0x0a,
- 0x14, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e,
- 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x10, 0x03, 0x32, 0xf5, 0x13, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7f, 0x0a, 0x0a, 0x47, 0x65,
- 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3b,
- 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x0f, 0x62, 0x62, 0x2e, 0x70, 0x72,
- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x84, 0x01, 0x0a, 0x0c,
- 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50,
- 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,
- 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x22, 0x2f, 0xda, 0x41, 0x00, 0x8a, 0xea, 0x30, 0x10, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x73, 0x12, 0x80, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72,
- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25,
- 0xda, 0x41, 0x00, 0x90, 0xea, 0x30, 0x02, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a,
- 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x3a, 0x73,
- 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x84, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
- 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
- 0x22, 0x3a, 0xda, 0x41, 0x00, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82,
- 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x0c,
- 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0xa8, 0x01, 0x0a,
- 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x21,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x5e, 0xda, 0x41, 0x13, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a,
- 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75,
- 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a,
- 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x32, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70,
- 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65,
- 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72,
- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,
- 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3e, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30,
- 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x6c,
- 0x65, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x2a, 0x15, 0x2f,
- 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
- 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x93, 0x01, 0x0a, 0x0f, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74,
- 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50,
- 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x22, 0x45, 0x8a, 0xea, 0x30, 0x14, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x90, 0xea, 0x30,
- 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f,
+ 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f,
+ 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f,
+ 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22,
+ 0x53, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65,
+ 0x63, 0x12, 0x41, 0x0a, 0x0e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63,
+ 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x0d, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x6f, 0x72, 0x22, 0x63, 0x0a, 0x0d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x52, 0x0a, 0x11, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x65,
+ 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
+ 0x32, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c,
+ 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75,
+ 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x10, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x45, 0x78,
+ 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7b, 0x0a, 0x18, 0x4c, 0x61, 0x62,
+ 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61,
+ 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72,
+ 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x16,
+ 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xfb, 0x05, 0x0a, 0x08, 0x41, 0x63, 0x74, 0x69, 0x76,
+ 0x69, 0x74, 0x79, 0x22, 0xee, 0x05, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10,
+ 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
+ 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46,
+ 0x59, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44,
+ 0x10, 0x17, 0x12, 0x20, 0x0a, 0x1c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46,
+ 0x59, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x4c, 0x4f,
+ 0x55, 0x54, 0x10, 0x18, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53,
+ 0x55, 0x45, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x54,
+ 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e,
+ 0x54, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x59,
+ 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x55,
+ 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x50, 0x44,
+ 0x41, 0x54, 0x45, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53,
+ 0x53, 0x55, 0x45, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x4e, 0x4f, 0x54,
+ 0x49, 0x46, 0x59, 0x10, 0x15, 0x12, 0x2b, 0x0a, 0x27, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53,
+ 0x53, 0x55, 0x45, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41,
+ 0x47, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45,
+ 0x10, 0x05, 0x12, 0x2a, 0x0a, 0x26, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45,
+ 0x5f, 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53,
+ 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x06, 0x12, 0x2e,
+ 0x0a, 0x2a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x50, 0x49, 0x50,
+ 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x53,
+ 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x16, 0x12, 0x2d,
+ 0x0a, 0x29, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x50, 0x49, 0x50,
+ 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45,
+ 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x08, 0x12, 0x39, 0x0a,
+ 0x35, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x50, 0x49, 0x50, 0x45,
+ 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x45, 0x41, 0x52, 0x4c, 0x49, 0x45,
+ 0x53, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x5f,
+ 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x09, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x59, 0x50, 0x45,
+ 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x0a,
+ 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f,
+ 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x0b, 0x12, 0x18, 0x0a,
+ 0x14, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x54,
+ 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x0c, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54,
+ 0x45, 0x10, 0x0d, 0x12, 0x20, 0x0a, 0x1c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4a,
+ 0x45, 0x43, 0x54, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x50,
+ 0x55, 0x53, 0x48, 0x10, 0x0e, 0x12, 0x22, 0x0a, 0x1e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x52,
+ 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x54,
+ 0x52, 0x41, 0x4e, 0x53, 0x46, 0x45, 0x52, 0x10, 0x0f, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x59, 0x50,
+ 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52,
+ 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x10, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x59, 0x50,
+ 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52,
+ 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x11, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x59, 0x50,
+ 0x45, 0x5f, 0x53, 0x51, 0x4c, 0x5f, 0x45, 0x44, 0x49, 0x54, 0x4f, 0x52, 0x5f, 0x51, 0x55, 0x45,
+ 0x52, 0x59, 0x10, 0x13, 0x2a, 0x77, 0x0a, 0x0c, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72,
+ 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52,
+ 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
+ 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f,
+ 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x45,
+ 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54,
+ 0x53, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f,
+ 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x10, 0x03, 0x32, 0xf5, 0x13,
+ 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
+ 0x12, 0x7f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
+ 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f,
+ 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3b, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30,
+ 0x0f, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x67, 0x65, 0x74,
+ 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f,
0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x0c, 0x47,
- 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x20, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d,
- 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x61, 0x6d, 0x50,
- 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x4e, 0x8a, 0xea, 0x30, 0x18, 0x62, 0x62, 0x2e, 0x70, 0x72,
- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c,
- 0x69, 0x63, 0x79, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f,
- 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x67, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50,
- 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0xb0, 0x01, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47,
- 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x25, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47,
- 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69,
- 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4c, 0x8a, 0xea, 0x30, 0x18,
- 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x49,
- 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x90, 0xea, 0x30, 0x02, 0x82, 0xd3, 0xe4, 0x93,
- 0x02, 0x26, 0x12, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x3d, 0x2a,
- 0x2f, 0x2a, 0x7d, 0x2f, 0x69, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x3a,
- 0x62, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x12, 0x9f, 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x74,
- 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f,
- 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c,
- 0x69, 0x63, 0x79, 0x22, 0x55, 0x8a, 0xea, 0x30, 0x18, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a,
- 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
- 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x73, 0x65,
- 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0xa7, 0x01, 0x0a, 0x13, 0x47,
- 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x12, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79,
- 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x48, 0x8a, 0xea, 0x30, 0x0f,
- 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90,
- 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
- 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xd5, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44,
- 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
- 0x2a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70,
- 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79,
- 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x70, 0x8a, 0xea, 0x30, 0x12,
- 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61,
- 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x50, 0x3a, 0x11, 0x64, 0x65,
- 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32,
- 0x3b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74,
- 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65,
- 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8c, 0x01, 0x0a,
- 0x0a, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x1e, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62,
- 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x22, 0x48, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4,
- 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d,
- 0x3a, 0x61, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0xbb, 0x01, 0x0a, 0x0d,
- 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x21, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61,
- 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x7d, 0x12, 0x84, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+ 0x74, 0x73, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x00, 0x8a, 0xea, 0x30, 0x10,
+ 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74,
+ 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x76, 0x31, 0x2f,
+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x80, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x61,
+ 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
+ 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
+ 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0xda, 0x41, 0x00, 0x90, 0xea, 0x30, 0x02, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x84, 0x01, 0x0a, 0x0d,
+ 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x21, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50,
- 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x71, 0xda, 0x41, 0x13, 0x77, 0x65, 0x62, 0x68, 0x6f,
- 0x6f, 0x6b, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea,
- 0x30, 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75, 0x70,
- 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x3a, 0x01,
- 0x2a, 0x22, 0x36, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
- 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x70, 0x64, 0x61,
- 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0xa5, 0x01, 0x0a, 0x0d, 0x52, 0x65,
- 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x21, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65,
- 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x22, 0x5b, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01,
- 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x3a, 0x01, 0x2a, 0x22, 0x36, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
- 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73,
- 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
- 0x6b, 0x12, 0x9b, 0x01, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
- 0x6b, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x54, 0x65, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x54, 0x65, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01,
- 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
- 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73,
- 0x2f, 0x2a, 0x7d, 0x3a, 0x74, 0x65, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x42,
- 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f,
- 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3a, 0xda, 0x41, 0x00, 0x8a, 0xea, 0x30, 0x12, 0x62,
+ 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x07, 0x70, 0x72, 0x6f,
+ 0x6a, 0x65, 0x63, 0x74, 0x22, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+ 0x74, 0x73, 0x12, 0xa8, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f,
+ 0x6a, 0x65, 0x63, 0x74, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x5e, 0xda,
+ 0x41, 0x13, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x32, 0x1d,
+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8a, 0x01,
+ 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12,
+ 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65,
+ 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3e, 0xda, 0x41, 0x04, 0x6e,
+ 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+ 0x74, 0x73, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x17, 0x2a, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70,
+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x93, 0x01, 0x0a, 0x0f, 0x55,
+ 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64,
+ 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x45, 0x8a, 0xea, 0x30, 0x14, 0x62,
+ 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75, 0x6e, 0x64, 0x65, 0x6c,
+ 0x65, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a,
+ 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x12, 0x98, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63,
+ 0x79, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x4e, 0x8a, 0xea, 0x30,
+ 0x18, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x67, 0x65, 0x74,
+ 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
+ 0x63, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x67,
+ 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0xb0, 0x01, 0x0a, 0x11,
+ 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63,
+ 0x79, 0x12, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63,
+ 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x49,
+ 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x4c, 0x8a, 0xea, 0x30, 0x18, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x73, 0x2e, 0x67, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x90, 0xea,
+ 0x30, 0x02, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x73,
+ 0x63, 0x6f, 0x70, 0x65, 0x3d, 0x2a, 0x2f, 0x2a, 0x7d, 0x2f, 0x69, 0x61, 0x6d, 0x50, 0x6f, 0x6c,
+ 0x69, 0x63, 0x69, 0x65, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x12, 0x9f,
+ 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12,
+ 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
+ 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x55, 0x8a, 0xea, 0x30, 0x18, 0x62,
+ 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x49, 0x61,
+ 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72,
+ 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73,
+ 0x2f, 0x2a, 0x7d, 0x3a, 0x73, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x12, 0xa7, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65,
+ 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79,
+ 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x22, 0x48, 0x8a, 0xea, 0x30, 0x0f, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12,
+ 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74,
+ 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xd5, 0x01, 0x0a, 0x16, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79,
+ 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x22, 0x70, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93,
+ 0x02, 0x50, 0x3a, 0x11, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0x3b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64, 0x65, 0x70, 0x6c,
+ 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x65,
+ 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2f,
+ 0x2a, 0x7d, 0x12, 0x8c, 0x01, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
+ 0x6b, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x48, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e,
+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90,
+ 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x76,
+ 0x31, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
+ 0x6b, 0x12, 0xbb, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68,
+ 0x6f, 0x6f, 0x6b, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x71, 0xda, 0x41,
+ 0x13, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
+ 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x3b, 0x3a, 0x01, 0x2a, 0x22, 0x36, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x77, 0x65,
+ 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x2a,
+ 0x7d, 0x3a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12,
+ 0xa5, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
+ 0x6b, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x5b, 0x8a, 0xea, 0x30, 0x12,
+ 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x3a, 0x01, 0x2a, 0x22,
+ 0x36, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x77, 0x65,
+ 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65,
+ 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x9b, 0x01, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74,
+ 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
+ 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f,
+ 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, 0x8a, 0xea, 0x30, 0x12,
+ 0x62, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22,
+ 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x70, 0x72,
+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x74, 0x65, 0x73, 0x74, 0x57, 0x65,
+ 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
})
var (
@@ -2486,112 +2422,110 @@ func file_v1_project_service_proto_rawDescGZIP() []byte {
return file_v1_project_service_proto_rawDescData
}
-var file_v1_project_service_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
+var file_v1_project_service_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_v1_project_service_proto_msgTypes = make([]protoimpl.MessageInfo, 29)
var file_v1_project_service_proto_goTypes = []any{
- (Workflow)(0), // 0: bytebase.v1.Workflow
- (OperatorType)(0), // 1: bytebase.v1.OperatorType
- (Webhook_Type)(0), // 2: bytebase.v1.Webhook.Type
- (Activity_Type)(0), // 3: bytebase.v1.Activity.Type
- (*GetProjectRequest)(nil), // 4: bytebase.v1.GetProjectRequest
- (*ListProjectsRequest)(nil), // 5: bytebase.v1.ListProjectsRequest
- (*ListProjectsResponse)(nil), // 6: bytebase.v1.ListProjectsResponse
- (*SearchProjectsRequest)(nil), // 7: bytebase.v1.SearchProjectsRequest
- (*SearchProjectsResponse)(nil), // 8: bytebase.v1.SearchProjectsResponse
- (*CreateProjectRequest)(nil), // 9: bytebase.v1.CreateProjectRequest
- (*UpdateProjectRequest)(nil), // 10: bytebase.v1.UpdateProjectRequest
- (*DeleteProjectRequest)(nil), // 11: bytebase.v1.DeleteProjectRequest
- (*UndeleteProjectRequest)(nil), // 12: bytebase.v1.UndeleteProjectRequest
- (*BatchGetIamPolicyRequest)(nil), // 13: bytebase.v1.BatchGetIamPolicyRequest
- (*BatchGetIamPolicyResponse)(nil), // 14: bytebase.v1.BatchGetIamPolicyResponse
- (*GetDeploymentConfigRequest)(nil), // 15: bytebase.v1.GetDeploymentConfigRequest
- (*UpdateDeploymentConfigRequest)(nil), // 16: bytebase.v1.UpdateDeploymentConfigRequest
- (*Label)(nil), // 17: bytebase.v1.Label
- (*Project)(nil), // 18: bytebase.v1.Project
- (*AddWebhookRequest)(nil), // 19: bytebase.v1.AddWebhookRequest
- (*UpdateWebhookRequest)(nil), // 20: bytebase.v1.UpdateWebhookRequest
- (*RemoveWebhookRequest)(nil), // 21: bytebase.v1.RemoveWebhookRequest
- (*TestWebhookRequest)(nil), // 22: bytebase.v1.TestWebhookRequest
- (*TestWebhookResponse)(nil), // 23: bytebase.v1.TestWebhookResponse
- (*Webhook)(nil), // 24: bytebase.v1.Webhook
- (*DeploymentConfig)(nil), // 25: bytebase.v1.DeploymentConfig
- (*Schedule)(nil), // 26: bytebase.v1.Schedule
- (*ScheduleDeployment)(nil), // 27: bytebase.v1.ScheduleDeployment
- (*DeploymentSpec)(nil), // 28: bytebase.v1.DeploymentSpec
- (*LabelSelector)(nil), // 29: bytebase.v1.LabelSelector
- (*LabelSelectorRequirement)(nil), // 30: bytebase.v1.LabelSelectorRequirement
- (*Activity)(nil), // 31: bytebase.v1.Activity
- (*BatchGetIamPolicyResponse_PolicyResult)(nil), // 32: bytebase.v1.BatchGetIamPolicyResponse.PolicyResult
- (*fieldmaskpb.FieldMask)(nil), // 33: google.protobuf.FieldMask
- (State)(0), // 34: bytebase.v1.State
- (*IamPolicy)(nil), // 35: bytebase.v1.IamPolicy
- (*GetIamPolicyRequest)(nil), // 36: bytebase.v1.GetIamPolicyRequest
- (*SetIamPolicyRequest)(nil), // 37: bytebase.v1.SetIamPolicyRequest
- (*emptypb.Empty)(nil), // 38: google.protobuf.Empty
+ (OperatorType)(0), // 0: bytebase.v1.OperatorType
+ (Webhook_Type)(0), // 1: bytebase.v1.Webhook.Type
+ (Activity_Type)(0), // 2: bytebase.v1.Activity.Type
+ (*GetProjectRequest)(nil), // 3: bytebase.v1.GetProjectRequest
+ (*ListProjectsRequest)(nil), // 4: bytebase.v1.ListProjectsRequest
+ (*ListProjectsResponse)(nil), // 5: bytebase.v1.ListProjectsResponse
+ (*SearchProjectsRequest)(nil), // 6: bytebase.v1.SearchProjectsRequest
+ (*SearchProjectsResponse)(nil), // 7: bytebase.v1.SearchProjectsResponse
+ (*CreateProjectRequest)(nil), // 8: bytebase.v1.CreateProjectRequest
+ (*UpdateProjectRequest)(nil), // 9: bytebase.v1.UpdateProjectRequest
+ (*DeleteProjectRequest)(nil), // 10: bytebase.v1.DeleteProjectRequest
+ (*UndeleteProjectRequest)(nil), // 11: bytebase.v1.UndeleteProjectRequest
+ (*BatchGetIamPolicyRequest)(nil), // 12: bytebase.v1.BatchGetIamPolicyRequest
+ (*BatchGetIamPolicyResponse)(nil), // 13: bytebase.v1.BatchGetIamPolicyResponse
+ (*GetDeploymentConfigRequest)(nil), // 14: bytebase.v1.GetDeploymentConfigRequest
+ (*UpdateDeploymentConfigRequest)(nil), // 15: bytebase.v1.UpdateDeploymentConfigRequest
+ (*Label)(nil), // 16: bytebase.v1.Label
+ (*Project)(nil), // 17: bytebase.v1.Project
+ (*AddWebhookRequest)(nil), // 18: bytebase.v1.AddWebhookRequest
+ (*UpdateWebhookRequest)(nil), // 19: bytebase.v1.UpdateWebhookRequest
+ (*RemoveWebhookRequest)(nil), // 20: bytebase.v1.RemoveWebhookRequest
+ (*TestWebhookRequest)(nil), // 21: bytebase.v1.TestWebhookRequest
+ (*TestWebhookResponse)(nil), // 22: bytebase.v1.TestWebhookResponse
+ (*Webhook)(nil), // 23: bytebase.v1.Webhook
+ (*DeploymentConfig)(nil), // 24: bytebase.v1.DeploymentConfig
+ (*Schedule)(nil), // 25: bytebase.v1.Schedule
+ (*ScheduleDeployment)(nil), // 26: bytebase.v1.ScheduleDeployment
+ (*DeploymentSpec)(nil), // 27: bytebase.v1.DeploymentSpec
+ (*LabelSelector)(nil), // 28: bytebase.v1.LabelSelector
+ (*LabelSelectorRequirement)(nil), // 29: bytebase.v1.LabelSelectorRequirement
+ (*Activity)(nil), // 30: bytebase.v1.Activity
+ (*BatchGetIamPolicyResponse_PolicyResult)(nil), // 31: bytebase.v1.BatchGetIamPolicyResponse.PolicyResult
+ (*fieldmaskpb.FieldMask)(nil), // 32: google.protobuf.FieldMask
+ (State)(0), // 33: bytebase.v1.State
+ (*IamPolicy)(nil), // 34: bytebase.v1.IamPolicy
+ (*GetIamPolicyRequest)(nil), // 35: bytebase.v1.GetIamPolicyRequest
+ (*SetIamPolicyRequest)(nil), // 36: bytebase.v1.SetIamPolicyRequest
+ (*emptypb.Empty)(nil), // 37: google.protobuf.Empty
}
var file_v1_project_service_proto_depIdxs = []int32{
- 18, // 0: bytebase.v1.ListProjectsResponse.projects:type_name -> bytebase.v1.Project
- 18, // 1: bytebase.v1.SearchProjectsResponse.projects:type_name -> bytebase.v1.Project
- 18, // 2: bytebase.v1.CreateProjectRequest.project:type_name -> bytebase.v1.Project
- 18, // 3: bytebase.v1.UpdateProjectRequest.project:type_name -> bytebase.v1.Project
- 33, // 4: bytebase.v1.UpdateProjectRequest.update_mask:type_name -> google.protobuf.FieldMask
- 32, // 5: bytebase.v1.BatchGetIamPolicyResponse.policy_results:type_name -> bytebase.v1.BatchGetIamPolicyResponse.PolicyResult
- 25, // 6: bytebase.v1.UpdateDeploymentConfigRequest.deployment_config:type_name -> bytebase.v1.DeploymentConfig
- 34, // 7: bytebase.v1.Project.state:type_name -> bytebase.v1.State
- 0, // 8: bytebase.v1.Project.workflow:type_name -> bytebase.v1.Workflow
- 24, // 9: bytebase.v1.Project.webhooks:type_name -> bytebase.v1.Webhook
- 17, // 10: bytebase.v1.Project.issue_labels:type_name -> bytebase.v1.Label
- 24, // 11: bytebase.v1.AddWebhookRequest.webhook:type_name -> bytebase.v1.Webhook
- 24, // 12: bytebase.v1.UpdateWebhookRequest.webhook:type_name -> bytebase.v1.Webhook
- 33, // 13: bytebase.v1.UpdateWebhookRequest.update_mask:type_name -> google.protobuf.FieldMask
- 24, // 14: bytebase.v1.RemoveWebhookRequest.webhook:type_name -> bytebase.v1.Webhook
- 24, // 15: bytebase.v1.TestWebhookRequest.webhook:type_name -> bytebase.v1.Webhook
- 2, // 16: bytebase.v1.Webhook.type:type_name -> bytebase.v1.Webhook.Type
- 3, // 17: bytebase.v1.Webhook.notification_types:type_name -> bytebase.v1.Activity.Type
- 26, // 18: bytebase.v1.DeploymentConfig.schedule:type_name -> bytebase.v1.Schedule
- 27, // 19: bytebase.v1.Schedule.deployments:type_name -> bytebase.v1.ScheduleDeployment
- 28, // 20: bytebase.v1.ScheduleDeployment.spec:type_name -> bytebase.v1.DeploymentSpec
- 29, // 21: bytebase.v1.DeploymentSpec.label_selector:type_name -> bytebase.v1.LabelSelector
- 30, // 22: bytebase.v1.LabelSelector.match_expressions:type_name -> bytebase.v1.LabelSelectorRequirement
- 1, // 23: bytebase.v1.LabelSelectorRequirement.operator:type_name -> bytebase.v1.OperatorType
- 35, // 24: bytebase.v1.BatchGetIamPolicyResponse.PolicyResult.policy:type_name -> bytebase.v1.IamPolicy
- 4, // 25: bytebase.v1.ProjectService.GetProject:input_type -> bytebase.v1.GetProjectRequest
- 5, // 26: bytebase.v1.ProjectService.ListProjects:input_type -> bytebase.v1.ListProjectsRequest
- 7, // 27: bytebase.v1.ProjectService.SearchProjects:input_type -> bytebase.v1.SearchProjectsRequest
- 9, // 28: bytebase.v1.ProjectService.CreateProject:input_type -> bytebase.v1.CreateProjectRequest
- 10, // 29: bytebase.v1.ProjectService.UpdateProject:input_type -> bytebase.v1.UpdateProjectRequest
- 11, // 30: bytebase.v1.ProjectService.DeleteProject:input_type -> bytebase.v1.DeleteProjectRequest
- 12, // 31: bytebase.v1.ProjectService.UndeleteProject:input_type -> bytebase.v1.UndeleteProjectRequest
- 36, // 32: bytebase.v1.ProjectService.GetIamPolicy:input_type -> bytebase.v1.GetIamPolicyRequest
- 13, // 33: bytebase.v1.ProjectService.BatchGetIamPolicy:input_type -> bytebase.v1.BatchGetIamPolicyRequest
- 37, // 34: bytebase.v1.ProjectService.SetIamPolicy:input_type -> bytebase.v1.SetIamPolicyRequest
- 15, // 35: bytebase.v1.ProjectService.GetDeploymentConfig:input_type -> bytebase.v1.GetDeploymentConfigRequest
- 16, // 36: bytebase.v1.ProjectService.UpdateDeploymentConfig:input_type -> bytebase.v1.UpdateDeploymentConfigRequest
- 19, // 37: bytebase.v1.ProjectService.AddWebhook:input_type -> bytebase.v1.AddWebhookRequest
- 20, // 38: bytebase.v1.ProjectService.UpdateWebhook:input_type -> bytebase.v1.UpdateWebhookRequest
- 21, // 39: bytebase.v1.ProjectService.RemoveWebhook:input_type -> bytebase.v1.RemoveWebhookRequest
- 22, // 40: bytebase.v1.ProjectService.TestWebhook:input_type -> bytebase.v1.TestWebhookRequest
- 18, // 41: bytebase.v1.ProjectService.GetProject:output_type -> bytebase.v1.Project
- 6, // 42: bytebase.v1.ProjectService.ListProjects:output_type -> bytebase.v1.ListProjectsResponse
- 8, // 43: bytebase.v1.ProjectService.SearchProjects:output_type -> bytebase.v1.SearchProjectsResponse
- 18, // 44: bytebase.v1.ProjectService.CreateProject:output_type -> bytebase.v1.Project
- 18, // 45: bytebase.v1.ProjectService.UpdateProject:output_type -> bytebase.v1.Project
- 38, // 46: bytebase.v1.ProjectService.DeleteProject:output_type -> google.protobuf.Empty
- 18, // 47: bytebase.v1.ProjectService.UndeleteProject:output_type -> bytebase.v1.Project
- 35, // 48: bytebase.v1.ProjectService.GetIamPolicy:output_type -> bytebase.v1.IamPolicy
- 14, // 49: bytebase.v1.ProjectService.BatchGetIamPolicy:output_type -> bytebase.v1.BatchGetIamPolicyResponse
- 35, // 50: bytebase.v1.ProjectService.SetIamPolicy:output_type -> bytebase.v1.IamPolicy
- 25, // 51: bytebase.v1.ProjectService.GetDeploymentConfig:output_type -> bytebase.v1.DeploymentConfig
- 25, // 52: bytebase.v1.ProjectService.UpdateDeploymentConfig:output_type -> bytebase.v1.DeploymentConfig
- 18, // 53: bytebase.v1.ProjectService.AddWebhook:output_type -> bytebase.v1.Project
- 18, // 54: bytebase.v1.ProjectService.UpdateWebhook:output_type -> bytebase.v1.Project
- 18, // 55: bytebase.v1.ProjectService.RemoveWebhook:output_type -> bytebase.v1.Project
- 23, // 56: bytebase.v1.ProjectService.TestWebhook:output_type -> bytebase.v1.TestWebhookResponse
- 41, // [41:57] is the sub-list for method output_type
- 25, // [25:41] is the sub-list for method input_type
- 25, // [25:25] is the sub-list for extension type_name
- 25, // [25:25] is the sub-list for extension extendee
- 0, // [0:25] is the sub-list for field type_name
+ 17, // 0: bytebase.v1.ListProjectsResponse.projects:type_name -> bytebase.v1.Project
+ 17, // 1: bytebase.v1.SearchProjectsResponse.projects:type_name -> bytebase.v1.Project
+ 17, // 2: bytebase.v1.CreateProjectRequest.project:type_name -> bytebase.v1.Project
+ 17, // 3: bytebase.v1.UpdateProjectRequest.project:type_name -> bytebase.v1.Project
+ 32, // 4: bytebase.v1.UpdateProjectRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 31, // 5: bytebase.v1.BatchGetIamPolicyResponse.policy_results:type_name -> bytebase.v1.BatchGetIamPolicyResponse.PolicyResult
+ 24, // 6: bytebase.v1.UpdateDeploymentConfigRequest.deployment_config:type_name -> bytebase.v1.DeploymentConfig
+ 33, // 7: bytebase.v1.Project.state:type_name -> bytebase.v1.State
+ 23, // 8: bytebase.v1.Project.webhooks:type_name -> bytebase.v1.Webhook
+ 16, // 9: bytebase.v1.Project.issue_labels:type_name -> bytebase.v1.Label
+ 23, // 10: bytebase.v1.AddWebhookRequest.webhook:type_name -> bytebase.v1.Webhook
+ 23, // 11: bytebase.v1.UpdateWebhookRequest.webhook:type_name -> bytebase.v1.Webhook
+ 32, // 12: bytebase.v1.UpdateWebhookRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 23, // 13: bytebase.v1.RemoveWebhookRequest.webhook:type_name -> bytebase.v1.Webhook
+ 23, // 14: bytebase.v1.TestWebhookRequest.webhook:type_name -> bytebase.v1.Webhook
+ 1, // 15: bytebase.v1.Webhook.type:type_name -> bytebase.v1.Webhook.Type
+ 2, // 16: bytebase.v1.Webhook.notification_types:type_name -> bytebase.v1.Activity.Type
+ 25, // 17: bytebase.v1.DeploymentConfig.schedule:type_name -> bytebase.v1.Schedule
+ 26, // 18: bytebase.v1.Schedule.deployments:type_name -> bytebase.v1.ScheduleDeployment
+ 27, // 19: bytebase.v1.ScheduleDeployment.spec:type_name -> bytebase.v1.DeploymentSpec
+ 28, // 20: bytebase.v1.DeploymentSpec.label_selector:type_name -> bytebase.v1.LabelSelector
+ 29, // 21: bytebase.v1.LabelSelector.match_expressions:type_name -> bytebase.v1.LabelSelectorRequirement
+ 0, // 22: bytebase.v1.LabelSelectorRequirement.operator:type_name -> bytebase.v1.OperatorType
+ 34, // 23: bytebase.v1.BatchGetIamPolicyResponse.PolicyResult.policy:type_name -> bytebase.v1.IamPolicy
+ 3, // 24: bytebase.v1.ProjectService.GetProject:input_type -> bytebase.v1.GetProjectRequest
+ 4, // 25: bytebase.v1.ProjectService.ListProjects:input_type -> bytebase.v1.ListProjectsRequest
+ 6, // 26: bytebase.v1.ProjectService.SearchProjects:input_type -> bytebase.v1.SearchProjectsRequest
+ 8, // 27: bytebase.v1.ProjectService.CreateProject:input_type -> bytebase.v1.CreateProjectRequest
+ 9, // 28: bytebase.v1.ProjectService.UpdateProject:input_type -> bytebase.v1.UpdateProjectRequest
+ 10, // 29: bytebase.v1.ProjectService.DeleteProject:input_type -> bytebase.v1.DeleteProjectRequest
+ 11, // 30: bytebase.v1.ProjectService.UndeleteProject:input_type -> bytebase.v1.UndeleteProjectRequest
+ 35, // 31: bytebase.v1.ProjectService.GetIamPolicy:input_type -> bytebase.v1.GetIamPolicyRequest
+ 12, // 32: bytebase.v1.ProjectService.BatchGetIamPolicy:input_type -> bytebase.v1.BatchGetIamPolicyRequest
+ 36, // 33: bytebase.v1.ProjectService.SetIamPolicy:input_type -> bytebase.v1.SetIamPolicyRequest
+ 14, // 34: bytebase.v1.ProjectService.GetDeploymentConfig:input_type -> bytebase.v1.GetDeploymentConfigRequest
+ 15, // 35: bytebase.v1.ProjectService.UpdateDeploymentConfig:input_type -> bytebase.v1.UpdateDeploymentConfigRequest
+ 18, // 36: bytebase.v1.ProjectService.AddWebhook:input_type -> bytebase.v1.AddWebhookRequest
+ 19, // 37: bytebase.v1.ProjectService.UpdateWebhook:input_type -> bytebase.v1.UpdateWebhookRequest
+ 20, // 38: bytebase.v1.ProjectService.RemoveWebhook:input_type -> bytebase.v1.RemoveWebhookRequest
+ 21, // 39: bytebase.v1.ProjectService.TestWebhook:input_type -> bytebase.v1.TestWebhookRequest
+ 17, // 40: bytebase.v1.ProjectService.GetProject:output_type -> bytebase.v1.Project
+ 5, // 41: bytebase.v1.ProjectService.ListProjects:output_type -> bytebase.v1.ListProjectsResponse
+ 7, // 42: bytebase.v1.ProjectService.SearchProjects:output_type -> bytebase.v1.SearchProjectsResponse
+ 17, // 43: bytebase.v1.ProjectService.CreateProject:output_type -> bytebase.v1.Project
+ 17, // 44: bytebase.v1.ProjectService.UpdateProject:output_type -> bytebase.v1.Project
+ 37, // 45: bytebase.v1.ProjectService.DeleteProject:output_type -> google.protobuf.Empty
+ 17, // 46: bytebase.v1.ProjectService.UndeleteProject:output_type -> bytebase.v1.Project
+ 34, // 47: bytebase.v1.ProjectService.GetIamPolicy:output_type -> bytebase.v1.IamPolicy
+ 13, // 48: bytebase.v1.ProjectService.BatchGetIamPolicy:output_type -> bytebase.v1.BatchGetIamPolicyResponse
+ 34, // 49: bytebase.v1.ProjectService.SetIamPolicy:output_type -> bytebase.v1.IamPolicy
+ 24, // 50: bytebase.v1.ProjectService.GetDeploymentConfig:output_type -> bytebase.v1.DeploymentConfig
+ 24, // 51: bytebase.v1.ProjectService.UpdateDeploymentConfig:output_type -> bytebase.v1.DeploymentConfig
+ 17, // 52: bytebase.v1.ProjectService.AddWebhook:output_type -> bytebase.v1.Project
+ 17, // 53: bytebase.v1.ProjectService.UpdateWebhook:output_type -> bytebase.v1.Project
+ 17, // 54: bytebase.v1.ProjectService.RemoveWebhook:output_type -> bytebase.v1.Project
+ 22, // 55: bytebase.v1.ProjectService.TestWebhook:output_type -> bytebase.v1.TestWebhookResponse
+ 40, // [40:56] is the sub-list for method output_type
+ 24, // [24:40] is the sub-list for method input_type
+ 24, // [24:24] is the sub-list for extension type_name
+ 24, // [24:24] is the sub-list for extension extendee
+ 0, // [0:24] is the sub-list for field type_name
}
func init() { file_v1_project_service_proto_init() }
@@ -2607,7 +2541,7 @@ func file_v1_project_service_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_project_service_proto_rawDesc), len(file_v1_project_service_proto_rawDesc)),
- NumEnums: 4,
+ NumEnums: 3,
NumMessages: 29,
NumExtensions: 0,
NumServices: 1,
diff --git a/proto/generated-go/v1/vcs_connector_service.pb.go b/proto/generated-go/v1/vcs_connector_service.pb.go
deleted file mode 100644
index a6dc5ef361..0000000000
--- a/proto/generated-go/v1/vcs_connector_service.pb.go
+++ /dev/null
@@ -1,721 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.36.5
-// protoc (unknown)
-// source: v1/vcs_connector_service.proto
-
-package v1
-
-import (
- _ "google.golang.org/genproto/googleapis/api/annotations"
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- emptypb "google.golang.org/protobuf/types/known/emptypb"
- fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
- reflect "reflect"
- sync "sync"
- unsafe "unsafe"
-)
-
-const (
- // Verify that this generated code is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
- // Verify that runtime/protoimpl is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type CreateVCSConnectorRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The parent resource where this vcsConnector will be created.
- // Format: projects/{project}
- Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
- // The vcsConnector to create.
- VcsConnector *VCSConnector `protobuf:"bytes,2,opt,name=vcs_connector,json=vcsConnector,proto3" json:"vcs_connector,omitempty"`
- // The ID to use for the vcsConnector, which will become the final component of
- // the vcsConnector's resource name.
- //
- // This value should be 4-63 characters, and valid characters
- // are /[a-z][0-9]-/.
- VcsConnectorId string `protobuf:"bytes,3,opt,name=vcs_connector_id,json=vcsConnectorId,proto3" json:"vcs_connector_id,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *CreateVCSConnectorRequest) Reset() {
- *x = CreateVCSConnectorRequest{}
- mi := &file_v1_vcs_connector_service_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *CreateVCSConnectorRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CreateVCSConnectorRequest) ProtoMessage() {}
-
-func (x *CreateVCSConnectorRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_connector_service_proto_msgTypes[0]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CreateVCSConnectorRequest.ProtoReflect.Descriptor instead.
-func (*CreateVCSConnectorRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_connector_service_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *CreateVCSConnectorRequest) GetParent() string {
- if x != nil {
- return x.Parent
- }
- return ""
-}
-
-func (x *CreateVCSConnectorRequest) GetVcsConnector() *VCSConnector {
- if x != nil {
- return x.VcsConnector
- }
- return nil
-}
-
-func (x *CreateVCSConnectorRequest) GetVcsConnectorId() string {
- if x != nil {
- return x.VcsConnectorId
- }
- return ""
-}
-
-type GetVCSConnectorRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The name of the vcsConnector to retrieve.
- // Format: projects/{project}/vcsConnectors/{vcsConnector}
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *GetVCSConnectorRequest) Reset() {
- *x = GetVCSConnectorRequest{}
- mi := &file_v1_vcs_connector_service_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *GetVCSConnectorRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetVCSConnectorRequest) ProtoMessage() {}
-
-func (x *GetVCSConnectorRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_connector_service_proto_msgTypes[1]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use GetVCSConnectorRequest.ProtoReflect.Descriptor instead.
-func (*GetVCSConnectorRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_connector_service_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *GetVCSConnectorRequest) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-type ListVCSConnectorsRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The parent, which owns this collection of vcsConnectors.
- // Format: projects/{project}
- Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
- // Not used.
- // The maximum number of vcs connectors to return. The service may return fewer than
- // this value.
- // If unspecified, at most 10 vcs connectors will be returned.
- // The maximum value is 1000; values above 1000 will be coerced to 1000.
- PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
- // Not used.
- // A page token, received from a previous `ListVCSConnectors` call.
- // Provide this to retrieve the subsequent page.
- //
- // When paginating, all other parameters provided to `ListVCSConnectors` must match
- // the call that provided the page token.
- PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *ListVCSConnectorsRequest) Reset() {
- *x = ListVCSConnectorsRequest{}
- mi := &file_v1_vcs_connector_service_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ListVCSConnectorsRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListVCSConnectorsRequest) ProtoMessage() {}
-
-func (x *ListVCSConnectorsRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_connector_service_proto_msgTypes[2]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ListVCSConnectorsRequest.ProtoReflect.Descriptor instead.
-func (*ListVCSConnectorsRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_connector_service_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *ListVCSConnectorsRequest) GetParent() string {
- if x != nil {
- return x.Parent
- }
- return ""
-}
-
-func (x *ListVCSConnectorsRequest) GetPageSize() int32 {
- if x != nil {
- return x.PageSize
- }
- return 0
-}
-
-func (x *ListVCSConnectorsRequest) GetPageToken() string {
- if x != nil {
- return x.PageToken
- }
- return ""
-}
-
-type ListVCSConnectorsResponse struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The vcsConnectors from the specified request.
- VcsConnectors []*VCSConnector `protobuf:"bytes,1,rep,name=vcs_connectors,json=vcsConnectors,proto3" json:"vcs_connectors,omitempty"`
- // A token, which can be sent as `page_token` to retrieve the next page.
- // If this field is omitted, there are no subsequent pages.
- NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *ListVCSConnectorsResponse) Reset() {
- *x = ListVCSConnectorsResponse{}
- mi := &file_v1_vcs_connector_service_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ListVCSConnectorsResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListVCSConnectorsResponse) ProtoMessage() {}
-
-func (x *ListVCSConnectorsResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_connector_service_proto_msgTypes[3]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ListVCSConnectorsResponse.ProtoReflect.Descriptor instead.
-func (*ListVCSConnectorsResponse) Descriptor() ([]byte, []int) {
- return file_v1_vcs_connector_service_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *ListVCSConnectorsResponse) GetVcsConnectors() []*VCSConnector {
- if x != nil {
- return x.VcsConnectors
- }
- return nil
-}
-
-func (x *ListVCSConnectorsResponse) GetNextPageToken() string {
- if x != nil {
- return x.NextPageToken
- }
- return ""
-}
-
-type UpdateVCSConnectorRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The vcsConnector to update.
- //
- // The vcsConnector's `name` field is used to identify the vcsConnector to update.
- // Format: projects/{project}/vcsConnectors/{vcsConnector}
- VcsConnector *VCSConnector `protobuf:"bytes,1,opt,name=vcs_connector,json=vcsConnector,proto3" json:"vcs_connector,omitempty"`
- // The list of fields to be updated.
- UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *UpdateVCSConnectorRequest) Reset() {
- *x = UpdateVCSConnectorRequest{}
- mi := &file_v1_vcs_connector_service_proto_msgTypes[4]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *UpdateVCSConnectorRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*UpdateVCSConnectorRequest) ProtoMessage() {}
-
-func (x *UpdateVCSConnectorRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_connector_service_proto_msgTypes[4]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use UpdateVCSConnectorRequest.ProtoReflect.Descriptor instead.
-func (*UpdateVCSConnectorRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_connector_service_proto_rawDescGZIP(), []int{4}
-}
-
-func (x *UpdateVCSConnectorRequest) GetVcsConnector() *VCSConnector {
- if x != nil {
- return x.VcsConnector
- }
- return nil
-}
-
-func (x *UpdateVCSConnectorRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
- if x != nil {
- return x.UpdateMask
- }
- return nil
-}
-
-type DeleteVCSConnectorRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The name of the vcsConnector to delete.
- // Format: projects/{project}/vcsConnectors/{vcsConnector}
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *DeleteVCSConnectorRequest) Reset() {
- *x = DeleteVCSConnectorRequest{}
- mi := &file_v1_vcs_connector_service_proto_msgTypes[5]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *DeleteVCSConnectorRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DeleteVCSConnectorRequest) ProtoMessage() {}
-
-func (x *DeleteVCSConnectorRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_connector_service_proto_msgTypes[5]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use DeleteVCSConnectorRequest.ProtoReflect.Descriptor instead.
-func (*DeleteVCSConnectorRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_connector_service_proto_rawDescGZIP(), []int{5}
-}
-
-func (x *DeleteVCSConnectorRequest) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-type VCSConnector struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The name of the vcsConnector resource.
- // Canonical parent is project.
- // Format: projects/{project}/vcsConnectors/{vcsConnector}
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // The title of the vcs connector.
- Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
- // The name of the VCS.
- // Format: vcsProviders/{vcsProvider}
- VcsProvider string `protobuf:"bytes,7,opt,name=vcs_provider,json=vcsProvider,proto3" json:"vcs_provider,omitempty"`
- // The reposition external id in target VCS.
- ExternalId string `protobuf:"bytes,8,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
- // The root directory where Bytebase observes the file change. If empty, then it observes the entire repository.
- BaseDirectory string `protobuf:"bytes,9,opt,name=base_directory,json=baseDirectory,proto3" json:"base_directory,omitempty"`
- // The branch Bytebase listens to for changes. For example: main.
- Branch string `protobuf:"bytes,10,opt,name=branch,proto3" json:"branch,omitempty"`
- // TODO(d): move these to create VCS connector API.
- // The full_path of the repository. For example: bytebase/sample.
- FullPath string `protobuf:"bytes,12,opt,name=full_path,json=fullPath,proto3" json:"full_path,omitempty"`
- // The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample.
- WebUrl string `protobuf:"bytes,13,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"`
- // Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
- // Format: projects/{project}/databaseGroups/{databaseGroup}
- DatabaseGroup string `protobuf:"bytes,14,opt,name=database_group,json=databaseGroup,proto3" json:"database_group,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *VCSConnector) Reset() {
- *x = VCSConnector{}
- mi := &file_v1_vcs_connector_service_proto_msgTypes[6]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *VCSConnector) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*VCSConnector) ProtoMessage() {}
-
-func (x *VCSConnector) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_connector_service_proto_msgTypes[6]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use VCSConnector.ProtoReflect.Descriptor instead.
-func (*VCSConnector) Descriptor() ([]byte, []int) {
- return file_v1_vcs_connector_service_proto_rawDescGZIP(), []int{6}
-}
-
-func (x *VCSConnector) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-func (x *VCSConnector) GetTitle() string {
- if x != nil {
- return x.Title
- }
- return ""
-}
-
-func (x *VCSConnector) GetVcsProvider() string {
- if x != nil {
- return x.VcsProvider
- }
- return ""
-}
-
-func (x *VCSConnector) GetExternalId() string {
- if x != nil {
- return x.ExternalId
- }
- return ""
-}
-
-func (x *VCSConnector) GetBaseDirectory() string {
- if x != nil {
- return x.BaseDirectory
- }
- return ""
-}
-
-func (x *VCSConnector) GetBranch() string {
- if x != nil {
- return x.Branch
- }
- return ""
-}
-
-func (x *VCSConnector) GetFullPath() string {
- if x != nil {
- return x.FullPath
- }
- return ""
-}
-
-func (x *VCSConnector) GetWebUrl() string {
- if x != nil {
- return x.WebUrl
- }
- return ""
-}
-
-func (x *VCSConnector) GetDatabaseGroup() string {
- if x != nil {
- return x.DatabaseGroup
- }
- return ""
-}
-
-var File_v1_vcs_connector_service_proto protoreflect.FileDescriptor
-
-var file_v1_vcs_connector_service_proto_rawDesc = string([]byte{
- 0x0a, 0x1e, 0x76, 0x31, 0x2f, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x12, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
- 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
- 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66,
- 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
- 0x13, 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8, 0x01, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56,
- 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x12, 0x35, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x09, 0x42, 0x1d, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x16, 0x0a, 0x14, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x63, 0x73,
- 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56,
- 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x42, 0x04, 0xe2, 0x41, 0x01,
- 0x02, 0x52, 0x0c, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12,
- 0x2e, 0x0a, 0x10, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72,
- 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52,
- 0x0e, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22,
- 0x50, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
- 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x1b,
- 0x0a, 0x19, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x56,
- 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d,
- 0x65, 0x22, 0x8d, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e,
- 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35,
- 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d,
- 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x16, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x70,
- 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69,
- 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69,
- 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
- 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
- 0x6e, 0x22, 0x85, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e,
- 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
- 0x40, 0x0a, 0x0e, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72,
- 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x52, 0x0d, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72,
- 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74,
- 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74,
- 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9e, 0x01, 0x0a, 0x19, 0x55, 0x70,
- 0x64, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x63, 0x73, 0x5f, 0x63,
- 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53,
- 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52,
- 0x0c, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x3b, 0x0a,
- 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 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, 0x52, 0x0a,
- 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x53, 0x0a, 0x19, 0x44, 0x65,
- 0x6c, 0x65, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x1b, 0x0a, 0x19,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x56, 0x43, 0x53,
- 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,
- 0xf0, 0x02, 0x0a, 0x0c, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72,
- 0x12, 0x19, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05,
- 0xe2, 0x41, 0x02, 0x02, 0x05, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74,
- 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c,
- 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76,
- 0x69, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
- 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72,
- 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62,
- 0x61, 0x73, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06,
- 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72,
- 0x61, 0x6e, 0x63, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x70, 0x61, 0x74,
- 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74,
- 0x68, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0d, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x0e, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75,
- 0x70, 0x3a, 0x4f, 0xea, 0x41, 0x4c, 0x0a, 0x19, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f,
- 0x72, 0x12, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f,
- 0x72, 0x7d, 0x32, 0xdc, 0x07, 0x0a, 0x13, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
- 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xce, 0x01, 0x0a, 0x12, 0x43,
- 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f,
- 0x72, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
- 0x63, 0x74, 0x6f, 0x72, 0x22, 0x75, 0xda, 0x41, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c,
- 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x8a, 0xea, 0x30, 0x17,
- 0x62, 0x62, 0x2e, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73,
- 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82,
- 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x3a, 0x0d, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65,
- 0x63, 0x74, 0x6f, 0x72, 0x22, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x76, 0x63,
- 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xa3, 0x01, 0x0a, 0x0f,
- 0x47, 0x65, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12,
- 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65,
- 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22,
- 0x50, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x14, 0x62, 0x62, 0x2e, 0x76,
- 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x67, 0x65, 0x74,
- 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a,
- 0x7d, 0x12, 0xb7, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e,
- 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e,
- 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,
- 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 0x8a, 0xea, 0x30, 0x15, 0x62, 0x62, 0x2e, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
- 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x76, 0x63,
- 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xe3, 0x01, 0x0a, 0x12,
- 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
- 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e,
- 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x89, 0x01, 0xda, 0x41, 0x19, 0x76, 0x63, 0x73, 0x5f, 0x63,
- 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
- 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x17, 0x62, 0x62, 0x2e, 0x76, 0x63, 0x73, 0x43, 0x6f,
- 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90,
- 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x3a, 0x0d, 0x76,
- 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x32, 0x33, 0x2f, 0x76,
- 0x31, 0x2f, 0x7b, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72,
- 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a,
- 0x7d, 0x12, 0xad, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43,
- 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x43, 0x53,
- 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x57, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d,
- 0x65, 0x8a, 0xea, 0x30, 0x17, 0x62, 0x62, 0x2e, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
- 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01,
- 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x2a, 0x25, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a,
- 0x7d, 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 (
- file_v1_vcs_connector_service_proto_rawDescOnce sync.Once
- file_v1_vcs_connector_service_proto_rawDescData []byte
-)
-
-func file_v1_vcs_connector_service_proto_rawDescGZIP() []byte {
- file_v1_vcs_connector_service_proto_rawDescOnce.Do(func() {
- file_v1_vcs_connector_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_vcs_connector_service_proto_rawDesc), len(file_v1_vcs_connector_service_proto_rawDesc)))
- })
- return file_v1_vcs_connector_service_proto_rawDescData
-}
-
-var file_v1_vcs_connector_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
-var file_v1_vcs_connector_service_proto_goTypes = []any{
- (*CreateVCSConnectorRequest)(nil), // 0: bytebase.v1.CreateVCSConnectorRequest
- (*GetVCSConnectorRequest)(nil), // 1: bytebase.v1.GetVCSConnectorRequest
- (*ListVCSConnectorsRequest)(nil), // 2: bytebase.v1.ListVCSConnectorsRequest
- (*ListVCSConnectorsResponse)(nil), // 3: bytebase.v1.ListVCSConnectorsResponse
- (*UpdateVCSConnectorRequest)(nil), // 4: bytebase.v1.UpdateVCSConnectorRequest
- (*DeleteVCSConnectorRequest)(nil), // 5: bytebase.v1.DeleteVCSConnectorRequest
- (*VCSConnector)(nil), // 6: bytebase.v1.VCSConnector
- (*fieldmaskpb.FieldMask)(nil), // 7: google.protobuf.FieldMask
- (*emptypb.Empty)(nil), // 8: google.protobuf.Empty
-}
-var file_v1_vcs_connector_service_proto_depIdxs = []int32{
- 6, // 0: bytebase.v1.CreateVCSConnectorRequest.vcs_connector:type_name -> bytebase.v1.VCSConnector
- 6, // 1: bytebase.v1.ListVCSConnectorsResponse.vcs_connectors:type_name -> bytebase.v1.VCSConnector
- 6, // 2: bytebase.v1.UpdateVCSConnectorRequest.vcs_connector:type_name -> bytebase.v1.VCSConnector
- 7, // 3: bytebase.v1.UpdateVCSConnectorRequest.update_mask:type_name -> google.protobuf.FieldMask
- 0, // 4: bytebase.v1.VCSConnectorService.CreateVCSConnector:input_type -> bytebase.v1.CreateVCSConnectorRequest
- 1, // 5: bytebase.v1.VCSConnectorService.GetVCSConnector:input_type -> bytebase.v1.GetVCSConnectorRequest
- 2, // 6: bytebase.v1.VCSConnectorService.ListVCSConnectors:input_type -> bytebase.v1.ListVCSConnectorsRequest
- 4, // 7: bytebase.v1.VCSConnectorService.UpdateVCSConnector:input_type -> bytebase.v1.UpdateVCSConnectorRequest
- 5, // 8: bytebase.v1.VCSConnectorService.DeleteVCSConnector:input_type -> bytebase.v1.DeleteVCSConnectorRequest
- 6, // 9: bytebase.v1.VCSConnectorService.CreateVCSConnector:output_type -> bytebase.v1.VCSConnector
- 6, // 10: bytebase.v1.VCSConnectorService.GetVCSConnector:output_type -> bytebase.v1.VCSConnector
- 3, // 11: bytebase.v1.VCSConnectorService.ListVCSConnectors:output_type -> bytebase.v1.ListVCSConnectorsResponse
- 6, // 12: bytebase.v1.VCSConnectorService.UpdateVCSConnector:output_type -> bytebase.v1.VCSConnector
- 8, // 13: bytebase.v1.VCSConnectorService.DeleteVCSConnector:output_type -> google.protobuf.Empty
- 9, // [9:14] is the sub-list for method output_type
- 4, // [4:9] is the sub-list for method input_type
- 4, // [4:4] is the sub-list for extension type_name
- 4, // [4:4] is the sub-list for extension extendee
- 0, // [0:4] is the sub-list for field type_name
-}
-
-func init() { file_v1_vcs_connector_service_proto_init() }
-func file_v1_vcs_connector_service_proto_init() {
- if File_v1_vcs_connector_service_proto != nil {
- return
- }
- file_v1_annotation_proto_init()
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_vcs_connector_service_proto_rawDesc), len(file_v1_vcs_connector_service_proto_rawDesc)),
- NumEnums: 0,
- NumMessages: 7,
- NumExtensions: 0,
- NumServices: 1,
- },
- GoTypes: file_v1_vcs_connector_service_proto_goTypes,
- DependencyIndexes: file_v1_vcs_connector_service_proto_depIdxs,
- MessageInfos: file_v1_vcs_connector_service_proto_msgTypes,
- }.Build()
- File_v1_vcs_connector_service_proto = out.File
- file_v1_vcs_connector_service_proto_goTypes = nil
- file_v1_vcs_connector_service_proto_depIdxs = nil
-}
diff --git a/proto/generated-go/v1/vcs_connector_service.pb.gw.go b/proto/generated-go/v1/vcs_connector_service.pb.gw.go
deleted file mode 100644
index e7355b9c31..0000000000
--- a/proto/generated-go/v1/vcs_connector_service.pb.gw.go
+++ /dev/null
@@ -1,542 +0,0 @@
-// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
-// source: v1/vcs_connector_service.proto
-
-/*
-Package v1 is a reverse proxy.
-
-It translates gRPC into RESTful JSON APIs.
-*/
-package v1
-
-import (
- "context"
- "errors"
- "io"
- "net/http"
-
- "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
- "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
- "google.golang.org/grpc"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/grpclog"
- "google.golang.org/grpc/metadata"
- "google.golang.org/grpc/status"
- "google.golang.org/protobuf/proto"
-)
-
-// Suppress "imported and not used" errors
-var (
- _ codes.Code
- _ io.Reader
- _ status.Status
- _ = errors.New
- _ = runtime.String
- _ = utilities.NewDoubleArray
- _ = metadata.Join
-)
-
-var filter_VCSConnectorService_CreateVCSConnector_0 = &utilities.DoubleArray{Encoding: map[string]int{"vcs_connector": 0, "parent": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
-
-func request_VCSConnectorService_CreateVCSConnector_0(ctx context.Context, marshaler runtime.Marshaler, client VCSConnectorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq CreateVCSConnectorRequest
- metadata runtime.ServerMetadata
- err error
- )
- if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.VcsConnector); err != nil && !errors.Is(err, io.EOF) {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", 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_VCSConnectorService_CreateVCSConnector_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := client.CreateVCSConnector(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSConnectorService_CreateVCSConnector_0(ctx context.Context, marshaler runtime.Marshaler, server VCSConnectorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq CreateVCSConnectorRequest
- metadata runtime.ServerMetadata
- err error
- )
- if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.VcsConnector); err != nil && !errors.Is(err, io.EOF) {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", 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_VCSConnectorService_CreateVCSConnector_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := server.CreateVCSConnector(ctx, &protoReq)
- return msg, metadata, err
-}
-
-func request_VCSConnectorService_GetVCSConnector_0(ctx context.Context, marshaler runtime.Marshaler, client VCSConnectorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq GetVCSConnectorRequest
- metadata runtime.ServerMetadata
- err error
- )
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := client.GetVCSConnector(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSConnectorService_GetVCSConnector_0(ctx context.Context, marshaler runtime.Marshaler, server VCSConnectorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq GetVCSConnectorRequest
- metadata runtime.ServerMetadata
- err error
- )
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := server.GetVCSConnector(ctx, &protoReq)
- return msg, metadata, err
-}
-
-var filter_VCSConnectorService_ListVCSConnectors_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
-
-func request_VCSConnectorService_ListVCSConnectors_0(ctx context.Context, marshaler runtime.Marshaler, client VCSConnectorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq ListVCSConnectorsRequest
- metadata runtime.ServerMetadata
- err error
- )
- 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_VCSConnectorService_ListVCSConnectors_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := client.ListVCSConnectors(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSConnectorService_ListVCSConnectors_0(ctx context.Context, marshaler runtime.Marshaler, server VCSConnectorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq ListVCSConnectorsRequest
- metadata runtime.ServerMetadata
- err error
- )
- 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_VCSConnectorService_ListVCSConnectors_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := server.ListVCSConnectors(ctx, &protoReq)
- return msg, metadata, err
-}
-
-var filter_VCSConnectorService_UpdateVCSConnector_0 = &utilities.DoubleArray{Encoding: map[string]int{"vcs_connector": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
-
-func request_VCSConnectorService_UpdateVCSConnector_0(ctx context.Context, marshaler runtime.Marshaler, client VCSConnectorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq UpdateVCSConnectorRequest
- metadata runtime.ServerMetadata
- err error
- )
- 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.VcsConnector); err != nil && !errors.Is(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.VcsConnector); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- } else {
- protoReq.UpdateMask = fieldMask
- }
- }
- val, ok := pathParams["vcs_connector.name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "vcs_connector.name")
- }
- err = runtime.PopulateFieldFromPath(&protoReq, "vcs_connector.name", val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "vcs_connector.name", err)
- }
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_VCSConnectorService_UpdateVCSConnector_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := client.UpdateVCSConnector(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSConnectorService_UpdateVCSConnector_0(ctx context.Context, marshaler runtime.Marshaler, server VCSConnectorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq UpdateVCSConnectorRequest
- metadata runtime.ServerMetadata
- err error
- )
- 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.VcsConnector); err != nil && !errors.Is(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.VcsConnector); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- } else {
- protoReq.UpdateMask = fieldMask
- }
- }
- val, ok := pathParams["vcs_connector.name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "vcs_connector.name")
- }
- err = runtime.PopulateFieldFromPath(&protoReq, "vcs_connector.name", val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "vcs_connector.name", err)
- }
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_VCSConnectorService_UpdateVCSConnector_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := server.UpdateVCSConnector(ctx, &protoReq)
- return msg, metadata, err
-}
-
-func request_VCSConnectorService_DeleteVCSConnector_0(ctx context.Context, marshaler runtime.Marshaler, client VCSConnectorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq DeleteVCSConnectorRequest
- metadata runtime.ServerMetadata
- err error
- )
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := client.DeleteVCSConnector(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSConnectorService_DeleteVCSConnector_0(ctx context.Context, marshaler runtime.Marshaler, server VCSConnectorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq DeleteVCSConnectorRequest
- metadata runtime.ServerMetadata
- err error
- )
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := server.DeleteVCSConnector(ctx, &protoReq)
- return msg, metadata, err
-}
-
-// RegisterVCSConnectorServiceHandlerServer registers the http handlers for service VCSConnectorService to "mux".
-// UnaryRPC :call VCSConnectorServiceServer directly.
-// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
-// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterVCSConnectorServiceHandlerFromEndpoint instead.
-// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
-func RegisterVCSConnectorServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server VCSConnectorServiceServer) error {
- mux.Handle(http.MethodPost, pattern_VCSConnectorService_CreateVCSConnector_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSConnectorService/CreateVCSConnector", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/vcsConnectors"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSConnectorService_CreateVCSConnector_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_VCSConnectorService_CreateVCSConnector_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodGet, pattern_VCSConnectorService_GetVCSConnector_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSConnectorService/GetVCSConnector", runtime.WithHTTPPathPattern("/v1/{name=projects/*/vcsConnectors/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSConnectorService_GetVCSConnector_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_VCSConnectorService_GetVCSConnector_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodGet, pattern_VCSConnectorService_ListVCSConnectors_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSConnectorService/ListVCSConnectors", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/vcsConnectors"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSConnectorService_ListVCSConnectors_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_VCSConnectorService_ListVCSConnectors_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodPatch, pattern_VCSConnectorService_UpdateVCSConnector_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSConnectorService/UpdateVCSConnector", runtime.WithHTTPPathPattern("/v1/{vcs_connector.name=projects/*/vcsConnectors/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSConnectorService_UpdateVCSConnector_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_VCSConnectorService_UpdateVCSConnector_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodDelete, pattern_VCSConnectorService_DeleteVCSConnector_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSConnectorService/DeleteVCSConnector", runtime.WithHTTPPathPattern("/v1/{name=projects/*/vcsConnectors/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSConnectorService_DeleteVCSConnector_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_VCSConnectorService_DeleteVCSConnector_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
-
- return nil
-}
-
-// RegisterVCSConnectorServiceHandlerFromEndpoint is same as RegisterVCSConnectorServiceHandler but
-// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
-func RegisterVCSConnectorServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
- conn, err := grpc.NewClient(endpoint, opts...)
- if err != nil {
- return err
- }
- defer func() {
- if err != nil {
- if cerr := conn.Close(); cerr != nil {
- grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
- }
- return
- }
- go func() {
- <-ctx.Done()
- if cerr := conn.Close(); cerr != nil {
- grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
- }
- }()
- }()
- return RegisterVCSConnectorServiceHandler(ctx, mux, conn)
-}
-
-// RegisterVCSConnectorServiceHandler registers the http handlers for service VCSConnectorService to "mux".
-// The handlers forward requests to the grpc endpoint over "conn".
-func RegisterVCSConnectorServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
- return RegisterVCSConnectorServiceHandlerClient(ctx, mux, NewVCSConnectorServiceClient(conn))
-}
-
-// RegisterVCSConnectorServiceHandlerClient registers the http handlers for service VCSConnectorService
-// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "VCSConnectorServiceClient".
-// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "VCSConnectorServiceClient"
-// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
-// "VCSConnectorServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
-func RegisterVCSConnectorServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client VCSConnectorServiceClient) error {
- mux.Handle(http.MethodPost, pattern_VCSConnectorService_CreateVCSConnector_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSConnectorService/CreateVCSConnector", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/vcsConnectors"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSConnectorService_CreateVCSConnector_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSConnectorService_CreateVCSConnector_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodGet, pattern_VCSConnectorService_GetVCSConnector_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSConnectorService/GetVCSConnector", runtime.WithHTTPPathPattern("/v1/{name=projects/*/vcsConnectors/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSConnectorService_GetVCSConnector_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSConnectorService_GetVCSConnector_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodGet, pattern_VCSConnectorService_ListVCSConnectors_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSConnectorService/ListVCSConnectors", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/vcsConnectors"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSConnectorService_ListVCSConnectors_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSConnectorService_ListVCSConnectors_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodPatch, pattern_VCSConnectorService_UpdateVCSConnector_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSConnectorService/UpdateVCSConnector", runtime.WithHTTPPathPattern("/v1/{vcs_connector.name=projects/*/vcsConnectors/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSConnectorService_UpdateVCSConnector_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSConnectorService_UpdateVCSConnector_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodDelete, pattern_VCSConnectorService_DeleteVCSConnector_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSConnectorService/DeleteVCSConnector", runtime.WithHTTPPathPattern("/v1/{name=projects/*/vcsConnectors/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSConnectorService_DeleteVCSConnector_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSConnectorService_DeleteVCSConnector_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- return nil
-}
-
-var (
- pattern_VCSConnectorService_CreateVCSConnector_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "vcsConnectors"}, ""))
- pattern_VCSConnectorService_GetVCSConnector_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "vcsConnectors", "name"}, ""))
- pattern_VCSConnectorService_ListVCSConnectors_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "vcsConnectors"}, ""))
- pattern_VCSConnectorService_UpdateVCSConnector_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "vcsConnectors", "vcs_connector.name"}, ""))
- pattern_VCSConnectorService_DeleteVCSConnector_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "vcsConnectors", "name"}, ""))
-)
-
-var (
- forward_VCSConnectorService_CreateVCSConnector_0 = runtime.ForwardResponseMessage
- forward_VCSConnectorService_GetVCSConnector_0 = runtime.ForwardResponseMessage
- forward_VCSConnectorService_ListVCSConnectors_0 = runtime.ForwardResponseMessage
- forward_VCSConnectorService_UpdateVCSConnector_0 = runtime.ForwardResponseMessage
- forward_VCSConnectorService_DeleteVCSConnector_0 = runtime.ForwardResponseMessage
-)
diff --git a/proto/generated-go/v1/vcs_connector_service_grpc.pb.go b/proto/generated-go/v1/vcs_connector_service_grpc.pb.go
deleted file mode 100644
index be658e01cb..0000000000
--- a/proto/generated-go/v1/vcs_connector_service_grpc.pb.go
+++ /dev/null
@@ -1,274 +0,0 @@
-// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
-// versions:
-// - protoc-gen-go-grpc v1.5.1
-// - protoc (unknown)
-// source: v1/vcs_connector_service.proto
-
-package v1
-
-import (
- context "context"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- emptypb "google.golang.org/protobuf/types/known/emptypb"
-)
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-// Requires gRPC-Go v1.64.0 or later.
-const _ = grpc.SupportPackageIsVersion9
-
-const (
- VCSConnectorService_CreateVCSConnector_FullMethodName = "/bytebase.v1.VCSConnectorService/CreateVCSConnector"
- VCSConnectorService_GetVCSConnector_FullMethodName = "/bytebase.v1.VCSConnectorService/GetVCSConnector"
- VCSConnectorService_ListVCSConnectors_FullMethodName = "/bytebase.v1.VCSConnectorService/ListVCSConnectors"
- VCSConnectorService_UpdateVCSConnector_FullMethodName = "/bytebase.v1.VCSConnectorService/UpdateVCSConnector"
- VCSConnectorService_DeleteVCSConnector_FullMethodName = "/bytebase.v1.VCSConnectorService/DeleteVCSConnector"
-)
-
-// VCSConnectorServiceClient is the client API for VCSConnectorService service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
-type VCSConnectorServiceClient interface {
- CreateVCSConnector(ctx context.Context, in *CreateVCSConnectorRequest, opts ...grpc.CallOption) (*VCSConnector, error)
- GetVCSConnector(ctx context.Context, in *GetVCSConnectorRequest, opts ...grpc.CallOption) (*VCSConnector, error)
- ListVCSConnectors(ctx context.Context, in *ListVCSConnectorsRequest, opts ...grpc.CallOption) (*ListVCSConnectorsResponse, error)
- UpdateVCSConnector(ctx context.Context, in *UpdateVCSConnectorRequest, opts ...grpc.CallOption) (*VCSConnector, error)
- DeleteVCSConnector(ctx context.Context, in *DeleteVCSConnectorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
-}
-
-type vCSConnectorServiceClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewVCSConnectorServiceClient(cc grpc.ClientConnInterface) VCSConnectorServiceClient {
- return &vCSConnectorServiceClient{cc}
-}
-
-func (c *vCSConnectorServiceClient) CreateVCSConnector(ctx context.Context, in *CreateVCSConnectorRequest, opts ...grpc.CallOption) (*VCSConnector, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(VCSConnector)
- err := c.cc.Invoke(ctx, VCSConnectorService_CreateVCSConnector_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *vCSConnectorServiceClient) GetVCSConnector(ctx context.Context, in *GetVCSConnectorRequest, opts ...grpc.CallOption) (*VCSConnector, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(VCSConnector)
- err := c.cc.Invoke(ctx, VCSConnectorService_GetVCSConnector_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *vCSConnectorServiceClient) ListVCSConnectors(ctx context.Context, in *ListVCSConnectorsRequest, opts ...grpc.CallOption) (*ListVCSConnectorsResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(ListVCSConnectorsResponse)
- err := c.cc.Invoke(ctx, VCSConnectorService_ListVCSConnectors_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *vCSConnectorServiceClient) UpdateVCSConnector(ctx context.Context, in *UpdateVCSConnectorRequest, opts ...grpc.CallOption) (*VCSConnector, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(VCSConnector)
- err := c.cc.Invoke(ctx, VCSConnectorService_UpdateVCSConnector_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *vCSConnectorServiceClient) DeleteVCSConnector(ctx context.Context, in *DeleteVCSConnectorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(emptypb.Empty)
- err := c.cc.Invoke(ctx, VCSConnectorService_DeleteVCSConnector_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// VCSConnectorServiceServer is the server API for VCSConnectorService service.
-// All implementations must embed UnimplementedVCSConnectorServiceServer
-// for forward compatibility.
-type VCSConnectorServiceServer interface {
- CreateVCSConnector(context.Context, *CreateVCSConnectorRequest) (*VCSConnector, error)
- GetVCSConnector(context.Context, *GetVCSConnectorRequest) (*VCSConnector, error)
- ListVCSConnectors(context.Context, *ListVCSConnectorsRequest) (*ListVCSConnectorsResponse, error)
- UpdateVCSConnector(context.Context, *UpdateVCSConnectorRequest) (*VCSConnector, error)
- DeleteVCSConnector(context.Context, *DeleteVCSConnectorRequest) (*emptypb.Empty, error)
- mustEmbedUnimplementedVCSConnectorServiceServer()
-}
-
-// UnimplementedVCSConnectorServiceServer must be embedded to have
-// forward compatible implementations.
-//
-// NOTE: this should be embedded by value instead of pointer to avoid a nil
-// pointer dereference when methods are called.
-type UnimplementedVCSConnectorServiceServer struct{}
-
-func (UnimplementedVCSConnectorServiceServer) CreateVCSConnector(context.Context, *CreateVCSConnectorRequest) (*VCSConnector, error) {
- return nil, status.Errorf(codes.Unimplemented, "method CreateVCSConnector not implemented")
-}
-func (UnimplementedVCSConnectorServiceServer) GetVCSConnector(context.Context, *GetVCSConnectorRequest) (*VCSConnector, error) {
- return nil, status.Errorf(codes.Unimplemented, "method GetVCSConnector not implemented")
-}
-func (UnimplementedVCSConnectorServiceServer) ListVCSConnectors(context.Context, *ListVCSConnectorsRequest) (*ListVCSConnectorsResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ListVCSConnectors not implemented")
-}
-func (UnimplementedVCSConnectorServiceServer) UpdateVCSConnector(context.Context, *UpdateVCSConnectorRequest) (*VCSConnector, error) {
- return nil, status.Errorf(codes.Unimplemented, "method UpdateVCSConnector not implemented")
-}
-func (UnimplementedVCSConnectorServiceServer) DeleteVCSConnector(context.Context, *DeleteVCSConnectorRequest) (*emptypb.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method DeleteVCSConnector not implemented")
-}
-func (UnimplementedVCSConnectorServiceServer) mustEmbedUnimplementedVCSConnectorServiceServer() {}
-func (UnimplementedVCSConnectorServiceServer) testEmbeddedByValue() {}
-
-// UnsafeVCSConnectorServiceServer may be embedded to opt out of forward compatibility for this service.
-// Use of this interface is not recommended, as added methods to VCSConnectorServiceServer will
-// result in compilation errors.
-type UnsafeVCSConnectorServiceServer interface {
- mustEmbedUnimplementedVCSConnectorServiceServer()
-}
-
-func RegisterVCSConnectorServiceServer(s grpc.ServiceRegistrar, srv VCSConnectorServiceServer) {
- // If the following call pancis, it indicates UnimplementedVCSConnectorServiceServer was
- // embedded by pointer and is nil. This will cause panics if an
- // unimplemented method is ever invoked, so we test this at initialization
- // time to prevent it from happening at runtime later due to I/O.
- if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
- t.testEmbeddedByValue()
- }
- s.RegisterService(&VCSConnectorService_ServiceDesc, srv)
-}
-
-func _VCSConnectorService_CreateVCSConnector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CreateVCSConnectorRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSConnectorServiceServer).CreateVCSConnector(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSConnectorService_CreateVCSConnector_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSConnectorServiceServer).CreateVCSConnector(ctx, req.(*CreateVCSConnectorRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _VCSConnectorService_GetVCSConnector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetVCSConnectorRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSConnectorServiceServer).GetVCSConnector(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSConnectorService_GetVCSConnector_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSConnectorServiceServer).GetVCSConnector(ctx, req.(*GetVCSConnectorRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _VCSConnectorService_ListVCSConnectors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListVCSConnectorsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSConnectorServiceServer).ListVCSConnectors(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSConnectorService_ListVCSConnectors_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSConnectorServiceServer).ListVCSConnectors(ctx, req.(*ListVCSConnectorsRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _VCSConnectorService_UpdateVCSConnector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateVCSConnectorRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSConnectorServiceServer).UpdateVCSConnector(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSConnectorService_UpdateVCSConnector_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSConnectorServiceServer).UpdateVCSConnector(ctx, req.(*UpdateVCSConnectorRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _VCSConnectorService_DeleteVCSConnector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteVCSConnectorRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSConnectorServiceServer).DeleteVCSConnector(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSConnectorService_DeleteVCSConnector_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSConnectorServiceServer).DeleteVCSConnector(ctx, req.(*DeleteVCSConnectorRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-// VCSConnectorService_ServiceDesc is the grpc.ServiceDesc for VCSConnectorService service.
-// It's only intended for direct use with grpc.RegisterService,
-// and not to be introspected or modified (even as a copy)
-var VCSConnectorService_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "bytebase.v1.VCSConnectorService",
- HandlerType: (*VCSConnectorServiceServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "CreateVCSConnector",
- Handler: _VCSConnectorService_CreateVCSConnector_Handler,
- },
- {
- MethodName: "GetVCSConnector",
- Handler: _VCSConnectorService_GetVCSConnector_Handler,
- },
- {
- MethodName: "ListVCSConnectors",
- Handler: _VCSConnectorService_ListVCSConnectors_Handler,
- },
- {
- MethodName: "UpdateVCSConnector",
- Handler: _VCSConnectorService_UpdateVCSConnector_Handler,
- },
- {
- MethodName: "DeleteVCSConnector",
- Handler: _VCSConnectorService_DeleteVCSConnector_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "v1/vcs_connector_service.proto",
-}
diff --git a/proto/generated-go/v1/vcs_provider_service.pb.go b/proto/generated-go/v1/vcs_provider_service.pb.go
deleted file mode 100644
index e1826d3ad6..0000000000
--- a/proto/generated-go/v1/vcs_provider_service.pb.go
+++ /dev/null
@@ -1,964 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.36.5
-// protoc (unknown)
-// source: v1/vcs_provider_service.proto
-
-package v1
-
-import (
- _ "google.golang.org/genproto/googleapis/api/annotations"
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- emptypb "google.golang.org/protobuf/types/known/emptypb"
- fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
- reflect "reflect"
- sync "sync"
- unsafe "unsafe"
-)
-
-const (
- // Verify that this generated code is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
- // Verify that runtime/protoimpl is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type CreateVCSProviderRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- VcsProvider *VCSProvider `protobuf:"bytes,1,opt,name=vcs_provider,json=vcsProvider,proto3" json:"vcs_provider,omitempty"`
- // The ID to use for the VCS provider, which will become the final component of
- // the VCS provider's name.
- //
- // This value should be 4-63 characters, and valid characters
- // are /[a-z][0-9]-/.
- VcsProviderId string `protobuf:"bytes,2,opt,name=vcs_provider_id,json=vcsProviderId,proto3" json:"vcs_provider_id,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *CreateVCSProviderRequest) Reset() {
- *x = CreateVCSProviderRequest{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *CreateVCSProviderRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CreateVCSProviderRequest) ProtoMessage() {}
-
-func (x *CreateVCSProviderRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[0]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CreateVCSProviderRequest.ProtoReflect.Descriptor instead.
-func (*CreateVCSProviderRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *CreateVCSProviderRequest) GetVcsProvider() *VCSProvider {
- if x != nil {
- return x.VcsProvider
- }
- return nil
-}
-
-func (x *CreateVCSProviderRequest) GetVcsProviderId() string {
- if x != nil {
- return x.VcsProviderId
- }
- return ""
-}
-
-type GetVCSProviderRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The name of the vcs provider to retrieve.
- // Format: vcsProviders/{vcsProvider}
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *GetVCSProviderRequest) Reset() {
- *x = GetVCSProviderRequest{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *GetVCSProviderRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetVCSProviderRequest) ProtoMessage() {}
-
-func (x *GetVCSProviderRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[1]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use GetVCSProviderRequest.ProtoReflect.Descriptor instead.
-func (*GetVCSProviderRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *GetVCSProviderRequest) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-type ListVCSProvidersRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // Not used.
- // The maximum number of vcs provider to return. The service may return fewer than this value.
- // If unspecified, at most 10 vcs provider will be returned.
- // The maximum value is 1000; values above 1000 will be coerced to 1000.
- PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
- // Not used.
- // A page token, received from a previous `ListVCSProviders` call.
- // Provide this to retrieve the subsequent page.
- PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *ListVCSProvidersRequest) Reset() {
- *x = ListVCSProvidersRequest{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ListVCSProvidersRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListVCSProvidersRequest) ProtoMessage() {}
-
-func (x *ListVCSProvidersRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[2]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ListVCSProvidersRequest.ProtoReflect.Descriptor instead.
-func (*ListVCSProvidersRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *ListVCSProvidersRequest) GetPageSize() int32 {
- if x != nil {
- return x.PageSize
- }
- return 0
-}
-
-func (x *ListVCSProvidersRequest) GetPageToken() string {
- if x != nil {
- return x.PageToken
- }
- return ""
-}
-
-type ListVCSProvidersResponse struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The list of vcs providers.
- VcsProviders []*VCSProvider `protobuf:"bytes,1,rep,name=vcs_providers,json=vcsProviders,proto3" json:"vcs_providers,omitempty"`
- // Not used. A token, which can be sent as `page_token` to retrieve the next page.
- // If this field is omitted, there are no subsequent pages.
- NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *ListVCSProvidersResponse) Reset() {
- *x = ListVCSProvidersResponse{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ListVCSProvidersResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListVCSProvidersResponse) ProtoMessage() {}
-
-func (x *ListVCSProvidersResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[3]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ListVCSProvidersResponse.ProtoReflect.Descriptor instead.
-func (*ListVCSProvidersResponse) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *ListVCSProvidersResponse) GetVcsProviders() []*VCSProvider {
- if x != nil {
- return x.VcsProviders
- }
- return nil
-}
-
-func (x *ListVCSProvidersResponse) GetNextPageToken() string {
- if x != nil {
- return x.NextPageToken
- }
- return ""
-}
-
-type UpdateVCSProviderRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- VcsProvider *VCSProvider `protobuf:"bytes,1,opt,name=vcs_provider,json=vcsProvider,proto3" json:"vcs_provider,omitempty"`
- // The list of fields to be updated.
- UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *UpdateVCSProviderRequest) Reset() {
- *x = UpdateVCSProviderRequest{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[4]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *UpdateVCSProviderRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*UpdateVCSProviderRequest) ProtoMessage() {}
-
-func (x *UpdateVCSProviderRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[4]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use UpdateVCSProviderRequest.ProtoReflect.Descriptor instead.
-func (*UpdateVCSProviderRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{4}
-}
-
-func (x *UpdateVCSProviderRequest) GetVcsProvider() *VCSProvider {
- if x != nil {
- return x.VcsProvider
- }
- return nil
-}
-
-func (x *UpdateVCSProviderRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
- if x != nil {
- return x.UpdateMask
- }
- return nil
-}
-
-type DeleteVCSProviderRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The name of the vcs provider to delete.
- // Format: vcsProviders/{vcsProvider}
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *DeleteVCSProviderRequest) Reset() {
- *x = DeleteVCSProviderRequest{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[5]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *DeleteVCSProviderRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DeleteVCSProviderRequest) ProtoMessage() {}
-
-func (x *DeleteVCSProviderRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[5]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use DeleteVCSProviderRequest.ProtoReflect.Descriptor instead.
-func (*DeleteVCSProviderRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{5}
-}
-
-func (x *DeleteVCSProviderRequest) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-type SearchVCSProviderRepositoriesRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The name of the vcs provider to retrieve the vcs provider repositories.
- // Format: vcsProviders/{vcsProvider}
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *SearchVCSProviderRepositoriesRequest) Reset() {
- *x = SearchVCSProviderRepositoriesRequest{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[6]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *SearchVCSProviderRepositoriesRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*SearchVCSProviderRepositoriesRequest) ProtoMessage() {}
-
-func (x *SearchVCSProviderRepositoriesRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[6]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use SearchVCSProviderRepositoriesRequest.ProtoReflect.Descriptor instead.
-func (*SearchVCSProviderRepositoriesRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{6}
-}
-
-func (x *SearchVCSProviderRepositoriesRequest) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-type VCSRepository struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The id of the repository in vcs provider.
- // e.g. In GitLab, this is the corresponding project id. e.g. 123
- Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- // The title of the repository in vcs provider.
- // e.g. sample-project
- Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
- // The full_path of the repository in vcs provider.
- // e.g. bytebase/sample-project
- FullPath string `protobuf:"bytes,3,opt,name=full_path,json=fullPath,proto3" json:"full_path,omitempty"`
- // Web url of the repository in vcs provider.
- // e.g. http://gitlab.bytebase.com/bytebase/sample-project
- WebUrl string `protobuf:"bytes,4,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *VCSRepository) Reset() {
- *x = VCSRepository{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[7]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *VCSRepository) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*VCSRepository) ProtoMessage() {}
-
-func (x *VCSRepository) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[7]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use VCSRepository.ProtoReflect.Descriptor instead.
-func (*VCSRepository) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{7}
-}
-
-func (x *VCSRepository) GetId() string {
- if x != nil {
- return x.Id
- }
- return ""
-}
-
-func (x *VCSRepository) GetTitle() string {
- if x != nil {
- return x.Title
- }
- return ""
-}
-
-func (x *VCSRepository) GetFullPath() string {
- if x != nil {
- return x.FullPath
- }
- return ""
-}
-
-func (x *VCSRepository) GetWebUrl() string {
- if x != nil {
- return x.WebUrl
- }
- return ""
-}
-
-type SearchVCSProviderRepositoriesResponse struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The list of repositories in vcs provider.
- Repositories []*VCSRepository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *SearchVCSProviderRepositoriesResponse) Reset() {
- *x = SearchVCSProviderRepositoriesResponse{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[8]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *SearchVCSProviderRepositoriesResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*SearchVCSProviderRepositoriesResponse) ProtoMessage() {}
-
-func (x *SearchVCSProviderRepositoriesResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[8]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use SearchVCSProviderRepositoriesResponse.ProtoReflect.Descriptor instead.
-func (*SearchVCSProviderRepositoriesResponse) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{8}
-}
-
-func (x *SearchVCSProviderRepositoriesResponse) GetRepositories() []*VCSRepository {
- if x != nil {
- return x.Repositories
- }
- return nil
-}
-
-type ListVCSConnectorsInProviderRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The name of the vcs provider to retrieve the linked projects.
- // Format: vcsProviders/{vcsProvider}
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *ListVCSConnectorsInProviderRequest) Reset() {
- *x = ListVCSConnectorsInProviderRequest{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[9]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ListVCSConnectorsInProviderRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListVCSConnectorsInProviderRequest) ProtoMessage() {}
-
-func (x *ListVCSConnectorsInProviderRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[9]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ListVCSConnectorsInProviderRequest.ProtoReflect.Descriptor instead.
-func (*ListVCSConnectorsInProviderRequest) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{9}
-}
-
-func (x *ListVCSConnectorsInProviderRequest) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-type ListVCSConnectorsInProviderResponse struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The vcsConnectors from the specified request.
- VcsConnectors []*VCSConnector `protobuf:"bytes,1,rep,name=vcs_connectors,json=vcsConnectors,proto3" json:"vcs_connectors,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *ListVCSConnectorsInProviderResponse) Reset() {
- *x = ListVCSConnectorsInProviderResponse{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[10]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ListVCSConnectorsInProviderResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListVCSConnectorsInProviderResponse) ProtoMessage() {}
-
-func (x *ListVCSConnectorsInProviderResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[10]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ListVCSConnectorsInProviderResponse.ProtoReflect.Descriptor instead.
-func (*ListVCSConnectorsInProviderResponse) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{10}
-}
-
-func (x *ListVCSConnectorsInProviderResponse) GetVcsConnectors() []*VCSConnector {
- if x != nil {
- return x.VcsConnectors
- }
- return nil
-}
-
-type VCSProvider struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The name of the vcs provider.
- // Format: vcsProviders/{vcsProvider}
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // The title of the vcs provider. It is used to display in the UI. Specified by the client.
- Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
- Type VCSType `protobuf:"varint,3,opt,name=type,proto3,enum=bytebase.v1.VCSType" json:"type,omitempty"`
- // The url of the vcs provider. Specified by the client.
- // For example: github.com, gitlab.com, gitlab.bytebase.com.
- Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"`
- // The access token of the vcs provider.
- AccessToken string `protobuf:"bytes,5,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *VCSProvider) Reset() {
- *x = VCSProvider{}
- mi := &file_v1_vcs_provider_service_proto_msgTypes[11]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *VCSProvider) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*VCSProvider) ProtoMessage() {}
-
-func (x *VCSProvider) ProtoReflect() protoreflect.Message {
- mi := &file_v1_vcs_provider_service_proto_msgTypes[11]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use VCSProvider.ProtoReflect.Descriptor instead.
-func (*VCSProvider) Descriptor() ([]byte, []int) {
- return file_v1_vcs_provider_service_proto_rawDescGZIP(), []int{11}
-}
-
-func (x *VCSProvider) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-func (x *VCSProvider) GetTitle() string {
- if x != nil {
- return x.Title
- }
- return ""
-}
-
-func (x *VCSProvider) GetType() VCSType {
- if x != nil {
- return x.Type
- }
- return VCSType_VCS_TYPE_UNSPECIFIED
-}
-
-func (x *VCSProvider) GetUrl() string {
- if x != nil {
- return x.Url
- }
- return ""
-}
-
-func (x *VCSProvider) GetAccessToken() string {
- if x != nil {
- return x.AccessToken
- }
- return ""
-}
-
-var File_v1_vcs_provider_service_proto protoreflect.FileDescriptor
-
-var file_v1_vcs_provider_service_proto_rawDesc = string([]byte{
- 0x0a, 0x1d, 0x76, 0x31, 0x2f, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
- 0x0b, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f,
- 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
- 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
- 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69,
- 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13,
- 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x76, 0x31, 0x2f, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e,
- 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x01, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56,
- 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x12, 0x41, 0x0a, 0x0c, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x0b, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76,
- 0x69, 0x64, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76,
- 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x76,
- 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x4e, 0x0a, 0x15,
- 0x47, 0x65, 0x74, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x42, 0x21, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x1a, 0x0a, 0x18, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x56, 0x43, 0x53, 0x50, 0x72,
- 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x55, 0x0a, 0x17,
- 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f,
- 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65,
- 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b,
- 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f,
- 0x6b, 0x65, 0x6e, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x50,
- 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x12, 0x3d, 0x0a, 0x0d, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
- 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x52, 0x0c, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12,
- 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b,
- 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61,
- 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa0, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61,
- 0x74, 0x65, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x0c, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76,
- 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76,
- 0x69, 0x64, 0x65, 0x72, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x0b, 0x76, 0x63, 0x73, 0x50,
- 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74,
- 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 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, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x0a,
- 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x51, 0x0a, 0x18, 0x44, 0x65,
- 0x6c, 0x65, 0x74, 0x65, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x1a, 0x0a, 0x18, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x56, 0x43, 0x53, 0x50,
- 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5d, 0x0a,
- 0x24, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64,
- 0x65, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x42, 0x21, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x1a, 0x0a, 0x18, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x56, 0x43, 0x53, 0x50, 0x72,
- 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x6b, 0x0a, 0x0d,
- 0x56, 0x43, 0x53, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a,
- 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a,
- 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69,
- 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68,
- 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68,
- 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x22, 0x67, 0x0a, 0x25, 0x53, 0x65, 0x61,
- 0x72, 0x63, 0x68, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65,
- 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69,
- 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69,
- 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69,
- 0x65, 0x73, 0x22, 0x5b, 0x0a, 0x22, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e,
- 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x1a, 0x0a,
- 0x18, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x56, 0x43,
- 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,
- 0x67, 0x0a, 0x23, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
- 0x74, 0x6f, 0x72, 0x73, 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f,
- 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53,
- 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x0d, 0x76, 0x63, 0x73, 0x43, 0x6f,
- 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x22, 0xef, 0x01, 0x0a, 0x0b, 0x56, 0x43, 0x53,
- 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x2e,
- 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x54, 0x79,
- 0x70, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16,
- 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01,
- 0x02, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x27, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73,
- 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41,
- 0x01, 0x04, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a,
- 0x39, 0xea, 0x41, 0x36, 0x0a, 0x18, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63,
- 0x6f, 0x6d, 0x2f, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x1a,
- 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x76, 0x63,
- 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x7d, 0x32, 0x95, 0x0a, 0x0a, 0x12, 0x56,
- 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
- 0x65, 0x12, 0x93, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76,
- 0x69, 0x64, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64,
- 0x65, 0x72, 0x22, 0x43, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x13, 0x62,
- 0x62, 0x2e, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x67,
- 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76,
- 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69,
- 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74,
- 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0x24, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56,
- 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
- 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0xda, 0x41, 0x00, 0x8a, 0xea,
- 0x30, 0x14, 0x62, 0x62, 0x2e, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
- 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12,
- 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53,
- 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53,
- 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43,
- 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x4b, 0xda, 0x41, 0x00, 0x8a, 0xea,
- 0x30, 0x16, 0x62, 0x62, 0x2e, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
- 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01,
- 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x0c, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76,
- 0x69, 0x64, 0x65, 0x72, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f,
- 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0xcf, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74,
- 0x65, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
- 0x65, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x79, 0xda,
- 0x41, 0x18, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2c, 0x75,
- 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x16, 0x62, 0x62,
- 0x2e, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x75, 0x70,
- 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93,
- 0x02, 0x36, 0x3a, 0x0c, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
- 0x32, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69,
- 0x64, 0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76,
- 0x69, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x11, 0x44, 0x65, 0x6c,
- 0x65, 0x74, 0x65, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x25,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c,
- 0x65, 0x74, 0x65, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x43, 0x8a,
- 0xea, 0x30, 0x16, 0x62, 0x62, 0x2e, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x73, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30,
- 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x2a, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2f,
- 0x2a, 0x7d, 0x12, 0xe5, 0x01, 0x0a, 0x1d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x56, 0x43, 0x53,
- 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f,
- 0x72, 0x69, 0x65, 0x73, 0x12, 0x31, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76,
- 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x56, 0x43, 0x53, 0x50,
- 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72,
- 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5d, 0x8a, 0xea, 0x30,
- 0x1e, 0x62, 0x62, 0x2e, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73,
- 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x90,
- 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x3a, 0x01, 0x2a, 0x22, 0x2c, 0x2f, 0x76,
- 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69,
- 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65,
- 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0xd5, 0x01, 0x0a, 0x1b, 0x4c,
- 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73,
- 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x2f, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53,
- 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x76,
- 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43,
- 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x49, 0x6e, 0x50, 0x72, 0x6f,
- 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x8a,
- 0xea, 0x30, 0x1c, 0x62, 0x62, 0x2e, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x90,
- 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x76, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
- 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f,
- 0x72, 0x73, 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 (
- file_v1_vcs_provider_service_proto_rawDescOnce sync.Once
- file_v1_vcs_provider_service_proto_rawDescData []byte
-)
-
-func file_v1_vcs_provider_service_proto_rawDescGZIP() []byte {
- file_v1_vcs_provider_service_proto_rawDescOnce.Do(func() {
- file_v1_vcs_provider_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_vcs_provider_service_proto_rawDesc), len(file_v1_vcs_provider_service_proto_rawDesc)))
- })
- return file_v1_vcs_provider_service_proto_rawDescData
-}
-
-var file_v1_vcs_provider_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
-var file_v1_vcs_provider_service_proto_goTypes = []any{
- (*CreateVCSProviderRequest)(nil), // 0: bytebase.v1.CreateVCSProviderRequest
- (*GetVCSProviderRequest)(nil), // 1: bytebase.v1.GetVCSProviderRequest
- (*ListVCSProvidersRequest)(nil), // 2: bytebase.v1.ListVCSProvidersRequest
- (*ListVCSProvidersResponse)(nil), // 3: bytebase.v1.ListVCSProvidersResponse
- (*UpdateVCSProviderRequest)(nil), // 4: bytebase.v1.UpdateVCSProviderRequest
- (*DeleteVCSProviderRequest)(nil), // 5: bytebase.v1.DeleteVCSProviderRequest
- (*SearchVCSProviderRepositoriesRequest)(nil), // 6: bytebase.v1.SearchVCSProviderRepositoriesRequest
- (*VCSRepository)(nil), // 7: bytebase.v1.VCSRepository
- (*SearchVCSProviderRepositoriesResponse)(nil), // 8: bytebase.v1.SearchVCSProviderRepositoriesResponse
- (*ListVCSConnectorsInProviderRequest)(nil), // 9: bytebase.v1.ListVCSConnectorsInProviderRequest
- (*ListVCSConnectorsInProviderResponse)(nil), // 10: bytebase.v1.ListVCSConnectorsInProviderResponse
- (*VCSProvider)(nil), // 11: bytebase.v1.VCSProvider
- (*fieldmaskpb.FieldMask)(nil), // 12: google.protobuf.FieldMask
- (*VCSConnector)(nil), // 13: bytebase.v1.VCSConnector
- (VCSType)(0), // 14: bytebase.v1.VCSType
- (*emptypb.Empty)(nil), // 15: google.protobuf.Empty
-}
-var file_v1_vcs_provider_service_proto_depIdxs = []int32{
- 11, // 0: bytebase.v1.CreateVCSProviderRequest.vcs_provider:type_name -> bytebase.v1.VCSProvider
- 11, // 1: bytebase.v1.ListVCSProvidersResponse.vcs_providers:type_name -> bytebase.v1.VCSProvider
- 11, // 2: bytebase.v1.UpdateVCSProviderRequest.vcs_provider:type_name -> bytebase.v1.VCSProvider
- 12, // 3: bytebase.v1.UpdateVCSProviderRequest.update_mask:type_name -> google.protobuf.FieldMask
- 7, // 4: bytebase.v1.SearchVCSProviderRepositoriesResponse.repositories:type_name -> bytebase.v1.VCSRepository
- 13, // 5: bytebase.v1.ListVCSConnectorsInProviderResponse.vcs_connectors:type_name -> bytebase.v1.VCSConnector
- 14, // 6: bytebase.v1.VCSProvider.type:type_name -> bytebase.v1.VCSType
- 1, // 7: bytebase.v1.VCSProviderService.GetVCSProvider:input_type -> bytebase.v1.GetVCSProviderRequest
- 2, // 8: bytebase.v1.VCSProviderService.ListVCSProviders:input_type -> bytebase.v1.ListVCSProvidersRequest
- 0, // 9: bytebase.v1.VCSProviderService.CreateVCSProvider:input_type -> bytebase.v1.CreateVCSProviderRequest
- 4, // 10: bytebase.v1.VCSProviderService.UpdateVCSProvider:input_type -> bytebase.v1.UpdateVCSProviderRequest
- 5, // 11: bytebase.v1.VCSProviderService.DeleteVCSProvider:input_type -> bytebase.v1.DeleteVCSProviderRequest
- 6, // 12: bytebase.v1.VCSProviderService.SearchVCSProviderRepositories:input_type -> bytebase.v1.SearchVCSProviderRepositoriesRequest
- 9, // 13: bytebase.v1.VCSProviderService.ListVCSConnectorsInProvider:input_type -> bytebase.v1.ListVCSConnectorsInProviderRequest
- 11, // 14: bytebase.v1.VCSProviderService.GetVCSProvider:output_type -> bytebase.v1.VCSProvider
- 3, // 15: bytebase.v1.VCSProviderService.ListVCSProviders:output_type -> bytebase.v1.ListVCSProvidersResponse
- 11, // 16: bytebase.v1.VCSProviderService.CreateVCSProvider:output_type -> bytebase.v1.VCSProvider
- 11, // 17: bytebase.v1.VCSProviderService.UpdateVCSProvider:output_type -> bytebase.v1.VCSProvider
- 15, // 18: bytebase.v1.VCSProviderService.DeleteVCSProvider:output_type -> google.protobuf.Empty
- 8, // 19: bytebase.v1.VCSProviderService.SearchVCSProviderRepositories:output_type -> bytebase.v1.SearchVCSProviderRepositoriesResponse
- 10, // 20: bytebase.v1.VCSProviderService.ListVCSConnectorsInProvider:output_type -> bytebase.v1.ListVCSConnectorsInProviderResponse
- 14, // [14:21] is the sub-list for method output_type
- 7, // [7:14] is the sub-list for method input_type
- 7, // [7:7] is the sub-list for extension type_name
- 7, // [7:7] is the sub-list for extension extendee
- 0, // [0:7] is the sub-list for field type_name
-}
-
-func init() { file_v1_vcs_provider_service_proto_init() }
-func file_v1_vcs_provider_service_proto_init() {
- if File_v1_vcs_provider_service_proto != nil {
- return
- }
- file_v1_annotation_proto_init()
- file_v1_common_proto_init()
- file_v1_vcs_connector_service_proto_init()
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_vcs_provider_service_proto_rawDesc), len(file_v1_vcs_provider_service_proto_rawDesc)),
- NumEnums: 0,
- NumMessages: 12,
- NumExtensions: 0,
- NumServices: 1,
- },
- GoTypes: file_v1_vcs_provider_service_proto_goTypes,
- DependencyIndexes: file_v1_vcs_provider_service_proto_depIdxs,
- MessageInfos: file_v1_vcs_provider_service_proto_msgTypes,
- }.Build()
- File_v1_vcs_provider_service_proto = out.File
- file_v1_vcs_provider_service_proto_goTypes = nil
- file_v1_vcs_provider_service_proto_depIdxs = nil
-}
diff --git a/proto/generated-go/v1/vcs_provider_service.pb.gw.go b/proto/generated-go/v1/vcs_provider_service.pb.gw.go
deleted file mode 100644
index ed716257c0..0000000000
--- a/proto/generated-go/v1/vcs_provider_service.pb.gw.go
+++ /dev/null
@@ -1,662 +0,0 @@
-// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
-// source: v1/vcs_provider_service.proto
-
-/*
-Package v1 is a reverse proxy.
-
-It translates gRPC into RESTful JSON APIs.
-*/
-package v1
-
-import (
- "context"
- "errors"
- "io"
- "net/http"
-
- "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
- "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
- "google.golang.org/grpc"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/grpclog"
- "google.golang.org/grpc/metadata"
- "google.golang.org/grpc/status"
- "google.golang.org/protobuf/proto"
-)
-
-// Suppress "imported and not used" errors
-var (
- _ codes.Code
- _ io.Reader
- _ status.Status
- _ = errors.New
- _ = runtime.String
- _ = utilities.NewDoubleArray
- _ = metadata.Join
-)
-
-func request_VCSProviderService_GetVCSProvider_0(ctx context.Context, marshaler runtime.Marshaler, client VCSProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq GetVCSProviderRequest
- metadata runtime.ServerMetadata
- err error
- )
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := client.GetVCSProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSProviderService_GetVCSProvider_0(ctx context.Context, marshaler runtime.Marshaler, server VCSProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq GetVCSProviderRequest
- metadata runtime.ServerMetadata
- err error
- )
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := server.GetVCSProvider(ctx, &protoReq)
- return msg, metadata, err
-}
-
-var filter_VCSProviderService_ListVCSProviders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
-
-func request_VCSProviderService_ListVCSProviders_0(ctx context.Context, marshaler runtime.Marshaler, client VCSProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq ListVCSProvidersRequest
- metadata runtime.ServerMetadata
- )
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_VCSProviderService_ListVCSProviders_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := client.ListVCSProviders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSProviderService_ListVCSProviders_0(ctx context.Context, marshaler runtime.Marshaler, server VCSProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq ListVCSProvidersRequest
- metadata runtime.ServerMetadata
- )
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_VCSProviderService_ListVCSProviders_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := server.ListVCSProviders(ctx, &protoReq)
- return msg, metadata, err
-}
-
-var filter_VCSProviderService_CreateVCSProvider_0 = &utilities.DoubleArray{Encoding: map[string]int{"vcs_provider": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
-
-func request_VCSProviderService_CreateVCSProvider_0(ctx context.Context, marshaler runtime.Marshaler, client VCSProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq CreateVCSProviderRequest
- metadata runtime.ServerMetadata
- )
- if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.VcsProvider); err != nil && !errors.Is(err, io.EOF) {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_VCSProviderService_CreateVCSProvider_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := client.CreateVCSProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSProviderService_CreateVCSProvider_0(ctx context.Context, marshaler runtime.Marshaler, server VCSProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq CreateVCSProviderRequest
- metadata runtime.ServerMetadata
- )
- if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.VcsProvider); err != nil && !errors.Is(err, io.EOF) {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_VCSProviderService_CreateVCSProvider_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := server.CreateVCSProvider(ctx, &protoReq)
- return msg, metadata, err
-}
-
-var filter_VCSProviderService_UpdateVCSProvider_0 = &utilities.DoubleArray{Encoding: map[string]int{"vcs_provider": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
-
-func request_VCSProviderService_UpdateVCSProvider_0(ctx context.Context, marshaler runtime.Marshaler, client VCSProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq UpdateVCSProviderRequest
- metadata runtime.ServerMetadata
- err error
- )
- 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.VcsProvider); err != nil && !errors.Is(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.VcsProvider); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- } else {
- protoReq.UpdateMask = fieldMask
- }
- }
- val, ok := pathParams["vcs_provider.name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "vcs_provider.name")
- }
- err = runtime.PopulateFieldFromPath(&protoReq, "vcs_provider.name", val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "vcs_provider.name", err)
- }
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_VCSProviderService_UpdateVCSProvider_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := client.UpdateVCSProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSProviderService_UpdateVCSProvider_0(ctx context.Context, marshaler runtime.Marshaler, server VCSProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq UpdateVCSProviderRequest
- metadata runtime.ServerMetadata
- err error
- )
- 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.VcsProvider); err != nil && !errors.Is(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.VcsProvider); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- } else {
- protoReq.UpdateMask = fieldMask
- }
- }
- val, ok := pathParams["vcs_provider.name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "vcs_provider.name")
- }
- err = runtime.PopulateFieldFromPath(&protoReq, "vcs_provider.name", val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "vcs_provider.name", err)
- }
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_VCSProviderService_UpdateVCSProvider_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := server.UpdateVCSProvider(ctx, &protoReq)
- return msg, metadata, err
-}
-
-func request_VCSProviderService_DeleteVCSProvider_0(ctx context.Context, marshaler runtime.Marshaler, client VCSProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq DeleteVCSProviderRequest
- metadata runtime.ServerMetadata
- err error
- )
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := client.DeleteVCSProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSProviderService_DeleteVCSProvider_0(ctx context.Context, marshaler runtime.Marshaler, server VCSProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq DeleteVCSProviderRequest
- metadata runtime.ServerMetadata
- err error
- )
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := server.DeleteVCSProvider(ctx, &protoReq)
- return msg, metadata, err
-}
-
-func request_VCSProviderService_SearchVCSProviderRepositories_0(ctx context.Context, marshaler runtime.Marshaler, client VCSProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq SearchVCSProviderRepositoriesRequest
- metadata runtime.ServerMetadata
- err error
- )
- if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := client.SearchVCSProviderRepositories(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSProviderService_SearchVCSProviderRepositories_0(ctx context.Context, marshaler runtime.Marshaler, server VCSProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq SearchVCSProviderRepositoriesRequest
- metadata runtime.ServerMetadata
- err error
- )
- if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := server.SearchVCSProviderRepositories(ctx, &protoReq)
- return msg, metadata, err
-}
-
-func request_VCSProviderService_ListVCSConnectorsInProvider_0(ctx context.Context, marshaler runtime.Marshaler, client VCSProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq ListVCSConnectorsInProviderRequest
- metadata runtime.ServerMetadata
- err error
- )
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := client.ListVCSConnectorsInProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_VCSProviderService_ListVCSConnectorsInProvider_0(ctx context.Context, marshaler runtime.Marshaler, server VCSProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq ListVCSConnectorsInProviderRequest
- metadata runtime.ServerMetadata
- err error
- )
- val, ok := pathParams["name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
- }
- protoReq.Name, err = runtime.String(val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
- }
- msg, err := server.ListVCSConnectorsInProvider(ctx, &protoReq)
- return msg, metadata, err
-}
-
-// RegisterVCSProviderServiceHandlerServer registers the http handlers for service VCSProviderService to "mux".
-// UnaryRPC :call VCSProviderServiceServer directly.
-// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
-// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterVCSProviderServiceHandlerFromEndpoint instead.
-// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
-func RegisterVCSProviderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server VCSProviderServiceServer) error {
- mux.Handle(http.MethodGet, pattern_VCSProviderService_GetVCSProvider_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/GetVCSProvider", runtime.WithHTTPPathPattern("/v1/{name=vcsProviders/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSProviderService_GetVCSProvider_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_VCSProviderService_GetVCSProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodGet, pattern_VCSProviderService_ListVCSProviders_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/ListVCSProviders", runtime.WithHTTPPathPattern("/v1/vcsProviders"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSProviderService_ListVCSProviders_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_VCSProviderService_ListVCSProviders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodPost, pattern_VCSProviderService_CreateVCSProvider_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/CreateVCSProvider", runtime.WithHTTPPathPattern("/v1/vcsProviders"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSProviderService_CreateVCSProvider_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_VCSProviderService_CreateVCSProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodPatch, pattern_VCSProviderService_UpdateVCSProvider_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/UpdateVCSProvider", runtime.WithHTTPPathPattern("/v1/{vcs_provider.name=vcsProviders/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSProviderService_UpdateVCSProvider_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_VCSProviderService_UpdateVCSProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodDelete, pattern_VCSProviderService_DeleteVCSProvider_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/DeleteVCSProvider", runtime.WithHTTPPathPattern("/v1/{name=vcsProviders/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSProviderService_DeleteVCSProvider_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_VCSProviderService_DeleteVCSProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodPost, pattern_VCSProviderService_SearchVCSProviderRepositories_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/SearchVCSProviderRepositories", runtime.WithHTTPPathPattern("/v1/{name=vcsProviders/*}:searchRepositories"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSProviderService_SearchVCSProviderRepositories_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_VCSProviderService_SearchVCSProviderRepositories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodGet, pattern_VCSProviderService_ListVCSConnectorsInProvider_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)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/ListVCSConnectorsInProvider", runtime.WithHTTPPathPattern("/v1/{name=vcsProviders/*}/vcsConnectors"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_VCSProviderService_ListVCSConnectorsInProvider_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_VCSProviderService_ListVCSConnectorsInProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
-
- return nil
-}
-
-// RegisterVCSProviderServiceHandlerFromEndpoint is same as RegisterVCSProviderServiceHandler but
-// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
-func RegisterVCSProviderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
- conn, err := grpc.NewClient(endpoint, opts...)
- if err != nil {
- return err
- }
- defer func() {
- if err != nil {
- if cerr := conn.Close(); cerr != nil {
- grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
- }
- return
- }
- go func() {
- <-ctx.Done()
- if cerr := conn.Close(); cerr != nil {
- grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
- }
- }()
- }()
- return RegisterVCSProviderServiceHandler(ctx, mux, conn)
-}
-
-// RegisterVCSProviderServiceHandler registers the http handlers for service VCSProviderService to "mux".
-// The handlers forward requests to the grpc endpoint over "conn".
-func RegisterVCSProviderServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
- return RegisterVCSProviderServiceHandlerClient(ctx, mux, NewVCSProviderServiceClient(conn))
-}
-
-// RegisterVCSProviderServiceHandlerClient registers the http handlers for service VCSProviderService
-// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "VCSProviderServiceClient".
-// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "VCSProviderServiceClient"
-// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
-// "VCSProviderServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
-func RegisterVCSProviderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client VCSProviderServiceClient) error {
- mux.Handle(http.MethodGet, pattern_VCSProviderService_GetVCSProvider_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/GetVCSProvider", runtime.WithHTTPPathPattern("/v1/{name=vcsProviders/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSProviderService_GetVCSProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSProviderService_GetVCSProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodGet, pattern_VCSProviderService_ListVCSProviders_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/ListVCSProviders", runtime.WithHTTPPathPattern("/v1/vcsProviders"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSProviderService_ListVCSProviders_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSProviderService_ListVCSProviders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodPost, pattern_VCSProviderService_CreateVCSProvider_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/CreateVCSProvider", runtime.WithHTTPPathPattern("/v1/vcsProviders"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSProviderService_CreateVCSProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSProviderService_CreateVCSProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodPatch, pattern_VCSProviderService_UpdateVCSProvider_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/UpdateVCSProvider", runtime.WithHTTPPathPattern("/v1/{vcs_provider.name=vcsProviders/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSProviderService_UpdateVCSProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSProviderService_UpdateVCSProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodDelete, pattern_VCSProviderService_DeleteVCSProvider_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/DeleteVCSProvider", runtime.WithHTTPPathPattern("/v1/{name=vcsProviders/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSProviderService_DeleteVCSProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSProviderService_DeleteVCSProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodPost, pattern_VCSProviderService_SearchVCSProviderRepositories_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/SearchVCSProviderRepositories", runtime.WithHTTPPathPattern("/v1/{name=vcsProviders/*}:searchRepositories"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSProviderService_SearchVCSProviderRepositories_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSProviderService_SearchVCSProviderRepositories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- mux.Handle(http.MethodGet, pattern_VCSProviderService_ListVCSConnectorsInProvider_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)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.VCSProviderService/ListVCSConnectorsInProvider", runtime.WithHTTPPathPattern("/v1/{name=vcsProviders/*}/vcsConnectors"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_VCSProviderService_ListVCSConnectorsInProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_VCSProviderService_ListVCSConnectorsInProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
- return nil
-}
-
-var (
- pattern_VCSProviderService_GetVCSProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "vcsProviders", "name"}, ""))
- pattern_VCSProviderService_ListVCSProviders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "vcsProviders"}, ""))
- pattern_VCSProviderService_CreateVCSProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "vcsProviders"}, ""))
- pattern_VCSProviderService_UpdateVCSProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "vcsProviders", "vcs_provider.name"}, ""))
- pattern_VCSProviderService_DeleteVCSProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "vcsProviders", "name"}, ""))
- pattern_VCSProviderService_SearchVCSProviderRepositories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "vcsProviders", "name"}, "searchRepositories"))
- pattern_VCSProviderService_ListVCSConnectorsInProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "vcsProviders", "name", "vcsConnectors"}, ""))
-)
-
-var (
- forward_VCSProviderService_GetVCSProvider_0 = runtime.ForwardResponseMessage
- forward_VCSProviderService_ListVCSProviders_0 = runtime.ForwardResponseMessage
- forward_VCSProviderService_CreateVCSProvider_0 = runtime.ForwardResponseMessage
- forward_VCSProviderService_UpdateVCSProvider_0 = runtime.ForwardResponseMessage
- forward_VCSProviderService_DeleteVCSProvider_0 = runtime.ForwardResponseMessage
- forward_VCSProviderService_SearchVCSProviderRepositories_0 = runtime.ForwardResponseMessage
- forward_VCSProviderService_ListVCSConnectorsInProvider_0 = runtime.ForwardResponseMessage
-)
diff --git a/proto/generated-go/v1/vcs_provider_service_grpc.pb.go b/proto/generated-go/v1/vcs_provider_service_grpc.pb.go
deleted file mode 100644
index a80064008b..0000000000
--- a/proto/generated-go/v1/vcs_provider_service_grpc.pb.go
+++ /dev/null
@@ -1,350 +0,0 @@
-// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
-// versions:
-// - protoc-gen-go-grpc v1.5.1
-// - protoc (unknown)
-// source: v1/vcs_provider_service.proto
-
-package v1
-
-import (
- context "context"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- emptypb "google.golang.org/protobuf/types/known/emptypb"
-)
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-// Requires gRPC-Go v1.64.0 or later.
-const _ = grpc.SupportPackageIsVersion9
-
-const (
- VCSProviderService_GetVCSProvider_FullMethodName = "/bytebase.v1.VCSProviderService/GetVCSProvider"
- VCSProviderService_ListVCSProviders_FullMethodName = "/bytebase.v1.VCSProviderService/ListVCSProviders"
- VCSProviderService_CreateVCSProvider_FullMethodName = "/bytebase.v1.VCSProviderService/CreateVCSProvider"
- VCSProviderService_UpdateVCSProvider_FullMethodName = "/bytebase.v1.VCSProviderService/UpdateVCSProvider"
- VCSProviderService_DeleteVCSProvider_FullMethodName = "/bytebase.v1.VCSProviderService/DeleteVCSProvider"
- VCSProviderService_SearchVCSProviderRepositories_FullMethodName = "/bytebase.v1.VCSProviderService/SearchVCSProviderRepositories"
- VCSProviderService_ListVCSConnectorsInProvider_FullMethodName = "/bytebase.v1.VCSProviderService/ListVCSConnectorsInProvider"
-)
-
-// VCSProviderServiceClient is the client API for VCSProviderService service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
-type VCSProviderServiceClient interface {
- GetVCSProvider(ctx context.Context, in *GetVCSProviderRequest, opts ...grpc.CallOption) (*VCSProvider, error)
- ListVCSProviders(ctx context.Context, in *ListVCSProvidersRequest, opts ...grpc.CallOption) (*ListVCSProvidersResponse, error)
- CreateVCSProvider(ctx context.Context, in *CreateVCSProviderRequest, opts ...grpc.CallOption) (*VCSProvider, error)
- UpdateVCSProvider(ctx context.Context, in *UpdateVCSProviderRequest, opts ...grpc.CallOption) (*VCSProvider, error)
- DeleteVCSProvider(ctx context.Context, in *DeleteVCSProviderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
- SearchVCSProviderRepositories(ctx context.Context, in *SearchVCSProviderRepositoriesRequest, opts ...grpc.CallOption) (*SearchVCSProviderRepositoriesResponse, error)
- ListVCSConnectorsInProvider(ctx context.Context, in *ListVCSConnectorsInProviderRequest, opts ...grpc.CallOption) (*ListVCSConnectorsInProviderResponse, error)
-}
-
-type vCSProviderServiceClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewVCSProviderServiceClient(cc grpc.ClientConnInterface) VCSProviderServiceClient {
- return &vCSProviderServiceClient{cc}
-}
-
-func (c *vCSProviderServiceClient) GetVCSProvider(ctx context.Context, in *GetVCSProviderRequest, opts ...grpc.CallOption) (*VCSProvider, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(VCSProvider)
- err := c.cc.Invoke(ctx, VCSProviderService_GetVCSProvider_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *vCSProviderServiceClient) ListVCSProviders(ctx context.Context, in *ListVCSProvidersRequest, opts ...grpc.CallOption) (*ListVCSProvidersResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(ListVCSProvidersResponse)
- err := c.cc.Invoke(ctx, VCSProviderService_ListVCSProviders_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *vCSProviderServiceClient) CreateVCSProvider(ctx context.Context, in *CreateVCSProviderRequest, opts ...grpc.CallOption) (*VCSProvider, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(VCSProvider)
- err := c.cc.Invoke(ctx, VCSProviderService_CreateVCSProvider_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *vCSProviderServiceClient) UpdateVCSProvider(ctx context.Context, in *UpdateVCSProviderRequest, opts ...grpc.CallOption) (*VCSProvider, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(VCSProvider)
- err := c.cc.Invoke(ctx, VCSProviderService_UpdateVCSProvider_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *vCSProviderServiceClient) DeleteVCSProvider(ctx context.Context, in *DeleteVCSProviderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(emptypb.Empty)
- err := c.cc.Invoke(ctx, VCSProviderService_DeleteVCSProvider_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *vCSProviderServiceClient) SearchVCSProviderRepositories(ctx context.Context, in *SearchVCSProviderRepositoriesRequest, opts ...grpc.CallOption) (*SearchVCSProviderRepositoriesResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(SearchVCSProviderRepositoriesResponse)
- err := c.cc.Invoke(ctx, VCSProviderService_SearchVCSProviderRepositories_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *vCSProviderServiceClient) ListVCSConnectorsInProvider(ctx context.Context, in *ListVCSConnectorsInProviderRequest, opts ...grpc.CallOption) (*ListVCSConnectorsInProviderResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(ListVCSConnectorsInProviderResponse)
- err := c.cc.Invoke(ctx, VCSProviderService_ListVCSConnectorsInProvider_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// VCSProviderServiceServer is the server API for VCSProviderService service.
-// All implementations must embed UnimplementedVCSProviderServiceServer
-// for forward compatibility.
-type VCSProviderServiceServer interface {
- GetVCSProvider(context.Context, *GetVCSProviderRequest) (*VCSProvider, error)
- ListVCSProviders(context.Context, *ListVCSProvidersRequest) (*ListVCSProvidersResponse, error)
- CreateVCSProvider(context.Context, *CreateVCSProviderRequest) (*VCSProvider, error)
- UpdateVCSProvider(context.Context, *UpdateVCSProviderRequest) (*VCSProvider, error)
- DeleteVCSProvider(context.Context, *DeleteVCSProviderRequest) (*emptypb.Empty, error)
- SearchVCSProviderRepositories(context.Context, *SearchVCSProviderRepositoriesRequest) (*SearchVCSProviderRepositoriesResponse, error)
- ListVCSConnectorsInProvider(context.Context, *ListVCSConnectorsInProviderRequest) (*ListVCSConnectorsInProviderResponse, error)
- mustEmbedUnimplementedVCSProviderServiceServer()
-}
-
-// UnimplementedVCSProviderServiceServer must be embedded to have
-// forward compatible implementations.
-//
-// NOTE: this should be embedded by value instead of pointer to avoid a nil
-// pointer dereference when methods are called.
-type UnimplementedVCSProviderServiceServer struct{}
-
-func (UnimplementedVCSProviderServiceServer) GetVCSProvider(context.Context, *GetVCSProviderRequest) (*VCSProvider, error) {
- return nil, status.Errorf(codes.Unimplemented, "method GetVCSProvider not implemented")
-}
-func (UnimplementedVCSProviderServiceServer) ListVCSProviders(context.Context, *ListVCSProvidersRequest) (*ListVCSProvidersResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ListVCSProviders not implemented")
-}
-func (UnimplementedVCSProviderServiceServer) CreateVCSProvider(context.Context, *CreateVCSProviderRequest) (*VCSProvider, error) {
- return nil, status.Errorf(codes.Unimplemented, "method CreateVCSProvider not implemented")
-}
-func (UnimplementedVCSProviderServiceServer) UpdateVCSProvider(context.Context, *UpdateVCSProviderRequest) (*VCSProvider, error) {
- return nil, status.Errorf(codes.Unimplemented, "method UpdateVCSProvider not implemented")
-}
-func (UnimplementedVCSProviderServiceServer) DeleteVCSProvider(context.Context, *DeleteVCSProviderRequest) (*emptypb.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method DeleteVCSProvider not implemented")
-}
-func (UnimplementedVCSProviderServiceServer) SearchVCSProviderRepositories(context.Context, *SearchVCSProviderRepositoriesRequest) (*SearchVCSProviderRepositoriesResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method SearchVCSProviderRepositories not implemented")
-}
-func (UnimplementedVCSProviderServiceServer) ListVCSConnectorsInProvider(context.Context, *ListVCSConnectorsInProviderRequest) (*ListVCSConnectorsInProviderResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ListVCSConnectorsInProvider not implemented")
-}
-func (UnimplementedVCSProviderServiceServer) mustEmbedUnimplementedVCSProviderServiceServer() {}
-func (UnimplementedVCSProviderServiceServer) testEmbeddedByValue() {}
-
-// UnsafeVCSProviderServiceServer may be embedded to opt out of forward compatibility for this service.
-// Use of this interface is not recommended, as added methods to VCSProviderServiceServer will
-// result in compilation errors.
-type UnsafeVCSProviderServiceServer interface {
- mustEmbedUnimplementedVCSProviderServiceServer()
-}
-
-func RegisterVCSProviderServiceServer(s grpc.ServiceRegistrar, srv VCSProviderServiceServer) {
- // If the following call pancis, it indicates UnimplementedVCSProviderServiceServer was
- // embedded by pointer and is nil. This will cause panics if an
- // unimplemented method is ever invoked, so we test this at initialization
- // time to prevent it from happening at runtime later due to I/O.
- if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
- t.testEmbeddedByValue()
- }
- s.RegisterService(&VCSProviderService_ServiceDesc, srv)
-}
-
-func _VCSProviderService_GetVCSProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetVCSProviderRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSProviderServiceServer).GetVCSProvider(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSProviderService_GetVCSProvider_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSProviderServiceServer).GetVCSProvider(ctx, req.(*GetVCSProviderRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _VCSProviderService_ListVCSProviders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListVCSProvidersRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSProviderServiceServer).ListVCSProviders(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSProviderService_ListVCSProviders_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSProviderServiceServer).ListVCSProviders(ctx, req.(*ListVCSProvidersRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _VCSProviderService_CreateVCSProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CreateVCSProviderRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSProviderServiceServer).CreateVCSProvider(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSProviderService_CreateVCSProvider_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSProviderServiceServer).CreateVCSProvider(ctx, req.(*CreateVCSProviderRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _VCSProviderService_UpdateVCSProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateVCSProviderRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSProviderServiceServer).UpdateVCSProvider(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSProviderService_UpdateVCSProvider_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSProviderServiceServer).UpdateVCSProvider(ctx, req.(*UpdateVCSProviderRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _VCSProviderService_DeleteVCSProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteVCSProviderRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSProviderServiceServer).DeleteVCSProvider(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSProviderService_DeleteVCSProvider_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSProviderServiceServer).DeleteVCSProvider(ctx, req.(*DeleteVCSProviderRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _VCSProviderService_SearchVCSProviderRepositories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(SearchVCSProviderRepositoriesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSProviderServiceServer).SearchVCSProviderRepositories(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSProviderService_SearchVCSProviderRepositories_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSProviderServiceServer).SearchVCSProviderRepositories(ctx, req.(*SearchVCSProviderRepositoriesRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _VCSProviderService_ListVCSConnectorsInProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListVCSConnectorsInProviderRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VCSProviderServiceServer).ListVCSConnectorsInProvider(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: VCSProviderService_ListVCSConnectorsInProvider_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VCSProviderServiceServer).ListVCSConnectorsInProvider(ctx, req.(*ListVCSConnectorsInProviderRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-// VCSProviderService_ServiceDesc is the grpc.ServiceDesc for VCSProviderService service.
-// It's only intended for direct use with grpc.RegisterService,
-// and not to be introspected or modified (even as a copy)
-var VCSProviderService_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "bytebase.v1.VCSProviderService",
- HandlerType: (*VCSProviderServiceServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "GetVCSProvider",
- Handler: _VCSProviderService_GetVCSProvider_Handler,
- },
- {
- MethodName: "ListVCSProviders",
- Handler: _VCSProviderService_ListVCSProviders_Handler,
- },
- {
- MethodName: "CreateVCSProvider",
- Handler: _VCSProviderService_CreateVCSProvider_Handler,
- },
- {
- MethodName: "UpdateVCSProvider",
- Handler: _VCSProviderService_UpdateVCSProvider_Handler,
- },
- {
- MethodName: "DeleteVCSProvider",
- Handler: _VCSProviderService_DeleteVCSProvider_Handler,
- },
- {
- MethodName: "SearchVCSProviderRepositories",
- Handler: _VCSProviderService_SearchVCSProviderRepositories_Handler,
- },
- {
- MethodName: "ListVCSConnectorsInProvider",
- Handler: _VCSProviderService_ListVCSConnectorsInProvider_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "v1/vcs_provider_service.proto",
-}
diff --git a/proto/store/vcs.proto b/proto/store/vcs.proto
deleted file mode 100644
index bcd97ae370..0000000000
--- a/proto/store/vcs.proto
+++ /dev/null
@@ -1,31 +0,0 @@
-syntax = "proto3";
-
-package bytebase.store;
-
-option go_package = "generated-go/store";
-
-message VCSConnector {
- // The title or display name of the VCS connector.
- string title = 1;
- // Full path from the corresponding VCS provider.
- // For GitLab, this is the project full path. e.g. group1/project-1
- string full_path = 2;
- // Web url from the corresponding VCS provider.
- // For GitLab, this is the project web url. e.g. https://gitlab.example.com/group1/project-1
- string web_url = 3;
- // Branch to listen to.
- string branch = 4;
- // Base working directory we are interested.
- string base_directory = 5;
- // Repository id from the corresponding VCS provider.
- // For GitLab, this is the project id. e.g. 123
- string external_id = 6;
- // Push webhook id from the corresponding VCS provider.
- // For GitLab, this is the project webhook id. e.g. 123
- string external_webhook_id = 7;
- // For GitLab, webhook request contains this in the 'X-Gitlab-Token" header and we compare it with the one stored in db to validate it sends to the expected endpoint.
- string webhook_secret_token = 8;
- // Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
- // Format: projects/{project}/databaseGroups/{databaseGroup}
- string database_group = 9;
-}
diff --git a/proto/v1/project_service.proto b/proto/v1/project_service.proto
index bb54cb19d2..d3456a3dea 100644
--- a/proto/v1/project_service.proto
+++ b/proto/v1/project_service.proto
@@ -294,8 +294,6 @@ message Project {
// The title or name of a project. It's not unique within the workspace.
string title = 4;
- Workflow workflow = 6;
-
repeated Webhook webhooks = 11;
string data_classification_config_id = 12;
@@ -325,12 +323,6 @@ message Project {
bool allow_self_approval = 21;
}
-enum Workflow {
- WORKFLOW_UNSPECIFIED = 0;
- UI = 1;
- VCS = 2;
-}
-
message AddWebhookRequest {
// The name of the project to add the webhook to.
// Format: projects/{project}
diff --git a/proto/v1/vcs_connector_service.proto b/proto/v1/vcs_connector_service.proto
deleted file mode 100644
index f3ec3a49f7..0000000000
--- a/proto/v1/vcs_connector_service.proto
+++ /dev/null
@@ -1,182 +0,0 @@
-syntax = "proto3";
-
-package bytebase.v1;
-
-import "google/api/annotations.proto";
-import "google/api/client.proto";
-import "google/api/field_behavior.proto";
-import "google/api/resource.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/field_mask.proto";
-import "v1/annotation.proto";
-
-option go_package = "generated-go/v1";
-
-service VCSConnectorService {
- rpc CreateVCSConnector(CreateVCSConnectorRequest) returns (VCSConnector) {
- option (google.api.http) = {
- post: "/v1/{parent=projects/*}/vcsConnectors"
- body: "vcs_connector"
- };
- option (google.api.method_signature) = "parent,vcsConnector";
- option (bytebase.v1.permission) = "bb.vcsConnectors.create";
- option (bytebase.v1.auth_method) = IAM;
- option (bytebase.v1.audit) = true;
- }
-
- rpc GetVCSConnector(GetVCSConnectorRequest) returns (VCSConnector) {
- option (google.api.http) = {get: "/v1/{name=projects/*/vcsConnectors/*}"};
- option (google.api.method_signature) = "name";
- option (bytebase.v1.permission) = "bb.vcsConnectors.get";
- option (bytebase.v1.auth_method) = IAM;
- }
-
- rpc ListVCSConnectors(ListVCSConnectorsRequest) returns (ListVCSConnectorsResponse) {
- option (google.api.http) = {get: "/v1/{parent=projects/*}/vcsConnectors"};
- option (google.api.method_signature) = "parent";
- option (bytebase.v1.permission) = "bb.vcsConnectors.list";
- option (bytebase.v1.auth_method) = IAM;
- }
-
- rpc UpdateVCSConnector(UpdateVCSConnectorRequest) returns (VCSConnector) {
- option (google.api.http) = {
- patch: "/v1/{vcs_connector.name=projects/*/vcsConnectors/*}"
- body: "vcs_connector"
- };
- option (google.api.method_signature) = "vcs_connector,update_mask";
- option (bytebase.v1.permission) = "bb.vcsConnectors.update";
- option (bytebase.v1.auth_method) = IAM;
- option (bytebase.v1.audit) = true;
- }
-
- rpc DeleteVCSConnector(DeleteVCSConnectorRequest) returns (google.protobuf.Empty) {
- option (google.api.http) = {delete: "/v1/{name=projects/*/vcsConnectors/*}"};
- option (google.api.method_signature) = "name";
- option (bytebase.v1.permission) = "bb.vcsConnectors.delete";
- option (bytebase.v1.auth_method) = IAM;
- option (bytebase.v1.audit) = true;
- }
-}
-
-message CreateVCSConnectorRequest {
- // The parent resource where this vcsConnector will be created.
- // Format: projects/{project}
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/Project"}
- ];
-
- // The vcsConnector to create.
- VCSConnector vcs_connector = 2 [(google.api.field_behavior) = REQUIRED];
-
- // The ID to use for the vcsConnector, which will become the final component of
- // the vcsConnector's resource name.
- //
- // This value should be 4-63 characters, and valid characters
- // are /[a-z][0-9]-/.
- string vcs_connector_id = 3 [(google.api.field_behavior) = REQUIRED];
-}
-
-message GetVCSConnectorRequest {
- // The name of the vcsConnector to retrieve.
- // Format: projects/{project}/vcsConnectors/{vcsConnector}
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/VCSConnector"}
- ];
-}
-
-message ListVCSConnectorsRequest {
- // The parent, which owns this collection of vcsConnectors.
- // Format: projects/{project}
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/Project"}
- ];
-
- // Not used.
- // The maximum number of vcs connectors to return. The service may return fewer than
- // this value.
- // If unspecified, at most 10 vcs connectors will be returned.
- // The maximum value is 1000; values above 1000 will be coerced to 1000.
- int32 page_size = 2;
-
- // Not used.
- // A page token, received from a previous `ListVCSConnectors` call.
- // Provide this to retrieve the subsequent page.
- //
- // When paginating, all other parameters provided to `ListVCSConnectors` must match
- // the call that provided the page token.
- string page_token = 3;
-}
-
-message ListVCSConnectorsResponse {
- // The vcsConnectors from the specified request.
- repeated VCSConnector vcs_connectors = 1;
-
- // A token, which can be sent as `page_token` to retrieve the next page.
- // If this field is omitted, there are no subsequent pages.
- string next_page_token = 2;
-}
-
-message UpdateVCSConnectorRequest {
- // The vcsConnector to update.
- //
- // The vcsConnector's `name` field is used to identify the vcsConnector to update.
- // Format: projects/{project}/vcsConnectors/{vcsConnector}
- VCSConnector vcs_connector = 1 [(google.api.field_behavior) = REQUIRED];
-
- // The list of fields to be updated.
- google.protobuf.FieldMask update_mask = 2;
-}
-
-message DeleteVCSConnectorRequest {
- // The name of the vcsConnector to delete.
- // Format: projects/{project}/vcsConnectors/{vcsConnector}
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/VCSConnector"}
- ];
-}
-
-message VCSConnector {
- option (google.api.resource) = {
- type: "bytebase.com/VCSConnector"
- pattern: "projects/{project}/vcsConnectors/{vcsConnector}"
- };
-
- // The name of the vcsConnector resource.
- // Canonical parent is project.
- // Format: projects/{project}/vcsConnectors/{vcsConnector}
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.field_behavior) = IMMUTABLE
- ];
-
- // The title of the vcs connector.
- string title = 2;
-
- // The name of the VCS.
- // Format: vcsProviders/{vcsProvider}
- string vcs_provider = 7;
-
- // The reposition external id in target VCS.
- string external_id = 8;
-
- // The root directory where Bytebase observes the file change. If empty, then it observes the entire repository.
- string base_directory = 9;
-
- // The branch Bytebase listens to for changes. For example: main.
- string branch = 10;
-
- // TODO(d): move these to create VCS connector API.
- // The full_path of the repository. For example: bytebase/sample.
- string full_path = 12;
-
- // The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample.
- string web_url = 13;
-
- // Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
- // Format: projects/{project}/databaseGroups/{databaseGroup}
- string database_group = 14;
-}
diff --git a/proto/v1/vcs_provider_service.proto b/proto/v1/vcs_provider_service.proto
deleted file mode 100644
index 76fa428067..0000000000
--- a/proto/v1/vcs_provider_service.proto
+++ /dev/null
@@ -1,199 +0,0 @@
-syntax = "proto3";
-
-package bytebase.v1;
-
-import "google/api/annotations.proto";
-import "google/api/client.proto";
-import "google/api/field_behavior.proto";
-import "google/api/resource.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/field_mask.proto";
-import "v1/annotation.proto";
-import "v1/common.proto";
-import "v1/vcs_connector_service.proto";
-
-option go_package = "generated-go/v1";
-
-service VCSProviderService {
- rpc GetVCSProvider(GetVCSProviderRequest) returns (VCSProvider) {
- option (google.api.http) = {get: "/v1/{name=vcsProviders/*}"};
- option (google.api.method_signature) = "name";
- option (bytebase.v1.permission) = "bb.vcsProviders.get";
- option (bytebase.v1.auth_method) = IAM;
- }
-
- rpc ListVCSProviders(ListVCSProvidersRequest) returns (ListVCSProvidersResponse) {
- option (google.api.http) = {get: "/v1/vcsProviders"};
- option (google.api.method_signature) = "";
- option (bytebase.v1.permission) = "bb.vcsProviders.list";
- option (bytebase.v1.auth_method) = IAM;
- }
-
- rpc CreateVCSProvider(CreateVCSProviderRequest) returns (VCSProvider) {
- option (google.api.http) = {
- post: "/v1/vcsProviders"
- body: "vcs_provider"
- };
- option (google.api.method_signature) = "";
- option (bytebase.v1.permission) = "bb.vcsProviders.create";
- option (bytebase.v1.auth_method) = IAM;
- option (bytebase.v1.audit) = true;
- }
-
- rpc UpdateVCSProvider(UpdateVCSProviderRequest) returns (VCSProvider) {
- option (google.api.http) = {
- patch: "/v1/{vcs_provider.name=vcsProviders/*}"
- body: "vcs_provider"
- };
- option (google.api.method_signature) = "vcs_provider,update_mask";
- option (bytebase.v1.permission) = "bb.vcsProviders.update";
- option (bytebase.v1.auth_method) = IAM;
- option (bytebase.v1.audit) = true;
- }
-
- rpc DeleteVCSProvider(DeleteVCSProviderRequest) returns (google.protobuf.Empty) {
- option (google.api.http) = {delete: "/v1/{name=vcsProviders/*}"};
- option (bytebase.v1.permission) = "bb.vcsProviders.delete";
- option (bytebase.v1.auth_method) = IAM;
- option (bytebase.v1.audit) = true;
- }
-
- rpc SearchVCSProviderRepositories(SearchVCSProviderRepositoriesRequest) returns (SearchVCSProviderRepositoriesResponse) {
- option (google.api.http) = {
- post: "/v1/{name=vcsProviders/*}:searchRepositories"
- body: "*"
- };
- option (bytebase.v1.permission) = "bb.vcsProviders.searchProjects";
- option (bytebase.v1.auth_method) = IAM;
- }
-
- rpc ListVCSConnectorsInProvider(ListVCSConnectorsInProviderRequest) returns (ListVCSConnectorsInProviderResponse) {
- option (google.api.http) = {get: "/v1/{name=vcsProviders/*}/vcsConnectors"};
- option (bytebase.v1.permission) = "bb.vcsProviders.listProjects";
- option (bytebase.v1.auth_method) = IAM;
- }
-}
-
-message CreateVCSProviderRequest {
- VCSProvider vcs_provider = 1 [(google.api.field_behavior) = REQUIRED];
-
- // The ID to use for the VCS provider, which will become the final component of
- // the VCS provider's name.
- //
- // This value should be 4-63 characters, and valid characters
- // are /[a-z][0-9]-/.
- string vcs_provider_id = 2;
-}
-
-message GetVCSProviderRequest {
- // The name of the vcs provider to retrieve.
- // Format: vcsProviders/{vcsProvider}
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/VCSProvider"}
- ];
-}
-
-message ListVCSProvidersRequest {
- // Not used.
- // The maximum number of vcs provider to return. The service may return fewer than this value.
- // If unspecified, at most 10 vcs provider will be returned.
- // The maximum value is 1000; values above 1000 will be coerced to 1000.
- int32 page_size = 1;
-
- // Not used.
- // A page token, received from a previous `ListVCSProviders` call.
- // Provide this to retrieve the subsequent page.
- string page_token = 2;
-}
-
-message ListVCSProvidersResponse {
- // The list of vcs providers.
- repeated VCSProvider vcs_providers = 1;
-
- // Not used. A token, which can be sent as `page_token` to retrieve the next page.
- // If this field is omitted, there are no subsequent pages.
- string next_page_token = 2;
-}
-
-message UpdateVCSProviderRequest {
- VCSProvider vcs_provider = 1 [(google.api.field_behavior) = REQUIRED];
-
- // The list of fields to be updated.
- google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
-}
-
-message DeleteVCSProviderRequest {
- // The name of the vcs provider to delete.
- // Format: vcsProviders/{vcsProvider}
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/VCSProvider"}
- ];
-}
-
-message SearchVCSProviderRepositoriesRequest {
- // The name of the vcs provider to retrieve the vcs provider repositories.
- // Format: vcsProviders/{vcsProvider}
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/VCSProvider"}
- ];
-}
-
-message VCSRepository {
- // The id of the repository in vcs provider.
- // e.g. In GitLab, this is the corresponding project id. e.g. 123
- string id = 1;
- // The title of the repository in vcs provider.
- // e.g. sample-project
- string title = 2;
- // The full_path of the repository in vcs provider.
- // e.g. bytebase/sample-project
- string full_path = 3;
- // Web url of the repository in vcs provider.
- // e.g. http://gitlab.bytebase.com/bytebase/sample-project
- string web_url = 4;
-}
-
-message SearchVCSProviderRepositoriesResponse {
- // The list of repositories in vcs provider.
- repeated VCSRepository repositories = 1;
-}
-
-message ListVCSConnectorsInProviderRequest {
- // The name of the vcs provider to retrieve the linked projects.
- // Format: vcsProviders/{vcsProvider}
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/VCSProvider"}
- ];
-}
-
-message ListVCSConnectorsInProviderResponse {
- // The vcsConnectors from the specified request.
- repeated VCSConnector vcs_connectors = 1;
-}
-
-message VCSProvider {
- option (google.api.resource) = {
- type: "bytebase.com/VCSProvider"
- pattern: "vcsProviders/{vcsProvider}"
- };
-
- // The name of the vcs provider.
- // Format: vcsProviders/{vcsProvider}
- string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
-
- // The title of the vcs provider. It is used to display in the UI. Specified by the client.
- string title = 2 [(google.api.field_behavior) = REQUIRED];
-
- VCSType type = 3 [(google.api.field_behavior) = REQUIRED];
-
- // The url of the vcs provider. Specified by the client.
- // For example: github.com, gitlab.com, gitlab.bytebase.com.
- string url = 4 [(google.api.field_behavior) = REQUIRED];
-
- // The access token of the vcs provider.
- string access_token = 5 [(google.api.field_behavior) = INPUT_ONLY];
-}