Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: track VCS provider users (#20441)
p0ny605c74afbb7f
diff --git a/action/bitbucket/bitbucket.go b/action/bitbucket/bitbucket.goindex a803ca50dd..575a1fb632 100644--- a/action/bitbucket/bitbucket.go+++ b/action/bitbucket/bitbucket.go@@ -15,6 +15,11 @@ import (v1pb "github.com/bytebase/bytebase/backend/generated-go/v1")+// APIBaseURL is the Bitbucket Cloud API URL used by Bitbucket Pipelines.+const APIBaseURL = "http://api.bitbucket.org/2.0" //nolint:revive++const pipelinesProxyURL = "http://localhost:29418"+// Define a struct for the report datatype Report struct {Title string `json:"title"`@@ -44,16 +49,9 @@ func CreateBitbucketReport(checkResponse *v1pb.CheckReleaseResponse) error {if repoOwner == "" || repoSlug == "" || commit == "" {return errors.Errorf("BITBUCKET_REPO_OWNER, BITBUCKET_REPO_SLUG, and BITBUCKET_COMMIT environment variables must be set")}- proxy, err := url.Parse("http://localhost:29418")- if err != nil {- return err- }- transport := &http.Transport{- Proxy: http.ProxyURL(proxy),- }- client := &http.Client{Transport: transport}+ client := NewHTTPClient(APIBaseURL)- reportURL := fmt.Sprintf("http://api.bitbucket.org/2.0/repositories/%s/%s/commit/%s/reports/bytebase", repoOwner, repoSlug, commit)+ reportURL := fmt.Sprintf("%s/repositories/%s/%s/commit/%s/reports/bytebase", APIBaseURL, repoOwner, repoSlug, commit)var warningCount, errorCount intfor _, result := range checkResponse.Results {for _, advice := range result.Advices {@@ -138,10 +136,27 @@ func CreateBitbucketReport(checkResponse *v1pb.CheckReleaseResponse) error {if err != nil {return errors.Wrapf(err, "error marshaling json")}- annotationsURL := fmt.Sprintf("http://api.bitbucket.org/2.0/repositories/%s/%s/commit/%s/reports/bytebase/annotations", repoOwner, repoSlug, commit)+ annotationsURL := fmt.Sprintf("%s/repositories/%s/%s/commit/%s/reports/bytebase/annotations", APIBaseURL, repoOwner, repoSlug, commit)return sendPutRequest(client, http.MethodPost, annotationsURL, string(annotationsData))}+// NewHTTPClient returns the Bitbucket HTTP client. Bitbucket Pipelines reaches+// the public API through its localhost proxy.+func NewHTTPClient(apiURL string) *http.Client {+ if apiURL != APIBaseURL {+ return http.DefaultClient+ }+ proxyURL, err := url.Parse(pipelinesProxyURL)+ if err != nil {+ return http.DefaultClient+ }+ return &http.Client{+ Transport: &http.Transport{+ Proxy: http.ProxyURL(proxyURL),+ },+ }+}+func sendPutRequest(client *http.Client, method, url, data string) error {req, err := http.NewRequest(method, url, bytes.NewBufferString(data))if err != nil {diff --git a/action/command/check.go b/action/command/check.goindex 94fc619429..30f893b92d 100644--- a/action/command/check.go+++ b/action/command/check.go@@ -78,6 +78,7 @@ func runCheck(w *world.World) func(*cobra.Command, []string) error {},Targets: w.Targets,CustomRules: w.CustomRules,+ VcsUser: getVCSUser(platform),})if err != nil {return errdiff --git a/action/command/vcs_user.go b/action/command/vcs_user.gonew file mode 100644index 0000000000..92b2c3d18e--- /dev/null+++ b/action/command/vcs_user.go@@ -0,0 +1,262 @@+package command++import (+ "context"+ "encoding/json"+ "io"+ "log/slog"+ "net/http"+ "net/url"+ "os"+ "regexp"+ "strconv"+ "strings"+ "time"++ "github.com/bytebase/bytebase/action/bitbucket"+ "github.com/bytebase/bytebase/action/world"+ v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"+)++var gitLabBotUserNameRE = regexp.MustCompile(`^(project|group)_\d+_bot_[a-z0-9]+$`)++func getVCSUser(platform world.JobPlatform) *v1pb.VCSUser {+ switch platform {+ case world.GitHub:+ return getGitHubVCSUser()+ case world.GitLab:+ return getGitLabVCSUser()+ case world.Bitbucket:+ return getBitbucketVCSUser()+ default:+ return nil+ }+}++func getGitHubVCSUser() *v1pb.VCSUser {+ eventName := os.Getenv("GITHUB_EVENT_NAME")+ if eventName != "pull_request" && eventName != "pull_request_target" {+ return nil+ }+ eventPath := os.Getenv("GITHUB_EVENT_PATH")+ if eventPath == "" {+ return nil+ }+ data, err := os.ReadFile(eventPath)+ if err != nil {+ return nil+ }++ var event struct {+ PullRequest struct {+ User struct {+ ID int64 `json:"id"`+ Login string `json:"login"`+ Name string `json:"name"`+ Type string `json:"type"`+ } `json:"user"`+ } `json:"pull_request"`+ }+ if err := json.Unmarshal(data, &event); err != nil {+ return nil+ }++ user := event.PullRequest.User+ if user.ID == 0 || isBotUser(user.Type, user.Login) {+ return nil+ }+ return &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: strconv.FormatInt(user.ID, 10),+ UserName: user.Login,+ DisplayName: user.Name,+ }+}++func getGitLabVCSUser() *v1pb.VCSUser {+ projectID := os.Getenv("CI_MERGE_REQUEST_PROJECT_ID")+ mergeRequestIID := os.Getenv("CI_MERGE_REQUEST_IID")+ apiURL := os.Getenv("CI_API_V4_URL")+ jobToken := os.Getenv("CI_JOB_TOKEN")+ if projectID == "" || mergeRequestIID == "" || apiURL == "" || jobToken == "" {+ return nil+ }++ requestURL, err := buildGitLabMergeRequestURL(apiURL, projectID, mergeRequestIID)+ if err != nil {+ return nil+ }+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)+ defer cancel()+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, requestURL, nil)+ if err != nil {+ return nil+ }+ req.Header.Set("Accept", "application/json")+ req.Header.Set("JOB-TOKEN", jobToken)++ resp, err := http.DefaultClient.Do(req)+ if err != nil {+ return nil+ }+ defer resp.Body.Close()+ if resp.StatusCode != http.StatusOK {+ return nil+ }++ data, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20))+ if err != nil {+ slog.Warn("failed to read GitLab merge request for VCS user attribution", "error", err)+ return nil+ }+ var mergeRequest struct {+ Author struct {+ ID int64 `json:"id"`+ Username string `json:"username"`+ Name string `json:"name"`+ } `json:"author"`+ }+ if err := json.Unmarshal(data, &mergeRequest); err != nil {+ slog.Warn("failed to parse GitLab merge request for VCS user attribution", "error", err)+ return nil+ }++ author := mergeRequest.Author+ if author.ID == 0 || isGitLabBotUser(author.Username) {+ return nil+ }+ return &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITLAB,+ UserId: strconv.FormatInt(author.ID, 10),+ UserName: author.Username,+ DisplayName: author.Name,+ }+}++func getBitbucketVCSUser() *v1pb.VCSUser {+ pullRequestID := os.Getenv("BITBUCKET_PR_ID")+ if pullRequestID == "" {+ return nil+ }+ workspace, repoSlug := getBitbucketRepository()+ if workspace == "" || repoSlug == "" {+ return nil+ }++ apiURL := getBitbucketAPIBaseURL()+ requestURL, err := buildBitbucketPullRequestURL(apiURL, workspace, repoSlug, pullRequestID)+ if err != nil {+ return nil+ }+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)+ defer cancel()+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, requestURL, nil)+ if err != nil {+ return nil+ }+ req.Header.Set("Accept", "application/json")++ resp, err := bitbucket.NewHTTPClient(apiURL).Do(req)+ if err != nil {+ return nil+ }+ defer resp.Body.Close()+ if resp.StatusCode != http.StatusOK {+ return nil+ }++ data, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20))+ if err != nil {+ slog.Warn("failed to read Bitbucket pull request for VCS user attribution", "error", err)+ return nil+ }+ var pullRequest struct {+ Author struct {+ AccountID string `json:"account_id"`+ UUID string `json:"uuid"`+ Nickname string `json:"nickname"`+ DisplayName string `json:"display_name"`+ Type string `json:"type"`+ } `json:"author"`+ }+ if err := json.Unmarshal(data, &pullRequest); err != nil {+ slog.Warn("failed to parse Bitbucket pull request for VCS user attribution", "error", err)+ return nil+ }++ author := pullRequest.Author+ userID := author.AccountID+ if userID == "" {+ userID = strings.Trim(author.UUID, "{}")+ }+ if userID == "" || isBitbucketBotUser(author.Type, author.Nickname) {+ return nil+ }+ return &v1pb.VCSUser{+ VcsType: v1pb.VCSType_BITBUCKET,+ UserId: userID,+ UserName: author.Nickname,+ DisplayName: author.DisplayName,+ }+}++func buildGitLabMergeRequestURL(apiURL, projectID, mergeRequestIID string) (string, error) {+ parsedURL, err := url.Parse(apiURL)+ if err != nil {+ return "", err+ }+ parsedURL.Path = strings.TrimRight(parsedURL.Path, "/") + "/projects/" + url.PathEscape(projectID) + "/merge_requests/" + url.PathEscape(mergeRequestIID)+ parsedURL.RawQuery = ""+ parsedURL.Fragment = ""+ return parsedURL.String(), nil+}++func getBitbucketRepository() (string, string) {+ if fullName := os.Getenv("BITBUCKET_REPO_FULL_NAME"); fullName != "" {+ parts := strings.SplitN(fullName, "/", 2)+ if len(parts) == 2 {+ return parts[0], parts[1]+ }+ }+ return firstNonEmpty(os.Getenv("BITBUCKET_WORKSPACE"), os.Getenv("BITBUCKET_REPO_OWNER")), os.Getenv("BITBUCKET_REPO_SLUG")+}++func getBitbucketAPIBaseURL() string {+ if apiURL := os.Getenv("BYTEBASE_BITBUCKET_API_BASE_URL"); apiURL != "" {+ return apiURL+ }+ return bitbucket.APIBaseURL+}++func buildBitbucketPullRequestURL(apiURL, workspace, repoSlug, pullRequestID string) (string, error) {+ parsedURL, err := url.Parse(apiURL)+ if err != nil {+ return "", err+ }+ parsedURL.Path = strings.TrimRight(parsedURL.Path, "/") + "/repositories/" + url.PathEscape(workspace) + "/" + url.PathEscape(repoSlug) + "/pullrequests/" + url.PathEscape(pullRequestID)+ parsedURL.RawQuery = ""+ parsedURL.Fragment = ""+ return parsedURL.String(), nil+}++func firstNonEmpty(values ...string) string {+ for _, value := range values {+ if value != "" {+ return value+ }+ }+ return ""+}++func isGitLabBotUser(userName string) bool {+ lowerUserName := strings.ToLower(userName)+ return isBotUser("", lowerUserName) || gitLabBotUserNameRE.MatchString(lowerUserName)+}++func isBitbucketBotUser(userType, userName string) bool {+ return isBotUser(userType, userName) || strings.EqualFold(userType, "app") || strings.EqualFold(userType, "app_user")+}++func isBotUser(userType, userName string) bool {+ return strings.EqualFold(userType, "bot") || strings.HasSuffix(strings.ToLower(userName), "[bot]")+}diff --git a/action/command/vcs_user_test.go b/action/command/vcs_user_test.gonew file mode 100644index 0000000000..45499a5f91--- /dev/null+++ b/action/command/vcs_user_test.go@@ -0,0 +1,191 @@+package command++import (+ "net/http"+ "net/http/httptest"+ "net/url"+ "os"+ "path/filepath"+ "testing"++ "github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/action/bitbucket"+ "github.com/bytebase/bytebase/action/world"+ v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"+)++func TestGetVCSUserFromGitHubPullRequest(t *testing.T) {+ eventPath := filepath.Join(t.TempDir(), "event.json")+ require.NoError(t, os.WriteFile(eventPath, []byte(`{"pull_request":{"user":{"id":1001,"login":"alice","name":"Alice","type":"User"}}}`), 0600))+ t.Setenv("GITHUB_EVENT_NAME", "pull_request")+ t.Setenv("GITHUB_EVENT_PATH", eventPath)++ user := getVCSUser(world.GitHub)+ require.NotNil(t, user)+ require.Equal(t, v1pb.VCSType_GITHUB, user.VcsType)+ require.Equal(t, "1001", user.UserId)+ require.Equal(t, "alice", user.UserName)+ require.Equal(t, "Alice", user.DisplayName)+}++func TestGetVCSUserSkipsGitHubBot(t *testing.T) {+ eventPath := filepath.Join(t.TempDir(), "event.json")+ require.NoError(t, os.WriteFile(eventPath, []byte(`{"pull_request":{"user":{"id":41898282,"login":"github-actions[bot]","type":"Bot"}}}`), 0600))+ t.Setenv("GITHUB_EVENT_NAME", "pull_request")+ t.Setenv("GITHUB_EVENT_PATH", eventPath)++ require.Nil(t, getVCSUser(world.GitHub))+}++func TestGetVCSUserFromGitHubPullRequestTarget(t *testing.T) {+ eventPath := filepath.Join(t.TempDir(), "event.json")+ require.NoError(t, os.WriteFile(eventPath, []byte(`{"pull_request":{"user":{"id":1001,"login":"alice","name":"Alice","type":"User"}}}`), 0600))+ t.Setenv("GITHUB_EVENT_NAME", "pull_request_target")+ t.Setenv("GITHUB_EVENT_PATH", eventPath)++ user := getVCSUser(world.GitHub)+ require.NotNil(t, user)+ require.Equal(t, v1pb.VCSType_GITHUB, user.VcsType)+ require.Equal(t, "1001", user.UserId)+}++func TestGetVCSUserSkipsGitLabWhenAuthorUnavailable(t *testing.T) {+ t.Setenv("CI_PIPELINE_SOURCE", "merge_request_event")+ t.Setenv("GITLAB_USER_ID", "2002")+ t.Setenv("GITLAB_USER_LOGIN", "bob")+ t.Setenv("GITLAB_USER_NAME", "Bob")++ require.Nil(t, getVCSUser(world.GitLab))+}++func TestGetVCSUserFromGitLabMergeRequestAuthor(t *testing.T) {+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ require.Equal(t, "/api/v4/projects/987/merge_requests/42", r.URL.Path)+ require.Equal(t, "job-token", r.Header.Get("JOB-TOKEN"))+ w.Header().Set("Content-Type", "application/json")+ _, err := w.Write([]byte(`{"author":{"id":3003,"username":"alice","name":"Alice"}}`))+ require.NoError(t, err)+ }))+ t.Cleanup(server.Close)++ t.Setenv("CI_MERGE_REQUEST_PROJECT_ID", "987")+ t.Setenv("CI_MERGE_REQUEST_IID", "42")+ t.Setenv("CI_API_V4_URL", server.URL+"/api/v4")+ t.Setenv("CI_JOB_TOKEN", "job-token")+ t.Setenv("GITLAB_USER_ID", "2002")+ t.Setenv("GITLAB_USER_LOGIN", "triggerer")+ t.Setenv("GITLAB_USER_NAME", "Pipeline Triggerer")++ user := getVCSUser(world.GitLab)+ require.NotNil(t, user)+ require.Equal(t, v1pb.VCSType_GITLAB, user.VcsType)+ require.Equal(t, "3003", user.UserId)+ require.Equal(t, "alice", user.UserName)+ require.Equal(t, "Alice", user.DisplayName)+}++func TestGetVCSUserSkipsGitLabBotAuthor(t *testing.T) {+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {+ w.Header().Set("Content-Type", "application/json")+ _, err := w.Write([]byte(`{"author":{"id":4004,"username":"project_987_bot_a1b2c3","name":"Project bot"}}`))+ require.NoError(t, err)+ }))+ t.Cleanup(server.Close)++ t.Setenv("CI_MERGE_REQUEST_PROJECT_ID", "987")+ t.Setenv("CI_MERGE_REQUEST_IID", "42")+ t.Setenv("CI_API_V4_URL", server.URL+"/api/v4")+ t.Setenv("CI_JOB_TOKEN", "job-token")++ require.Nil(t, getVCSUser(world.GitLab))+}++func TestGetVCSUserSkipsBitbucketWhenAuthorUnavailable(t *testing.T) {+ t.Setenv("BITBUCKET_PR_ID", "10")+ t.Setenv("BITBUCKET_STEP_TRIGGERER_UUID", "{3003}")+ t.Setenv("BITBUCKET_STEP_TRIGGERER_USERNAME", "carol")++ require.Nil(t, getVCSUser(world.Bitbucket))+}++func TestGetVCSUserFromBitbucketPullRequestAuthor(t *testing.T) {+ var gotPath string+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ gotPath = r.URL.Path+ require.Equal(t, http.MethodGet, r.Method)+ require.Equal(t, "application/json", r.Header.Get("Accept"))+ w.Header().Set("Content-Type", "application/json")+ _, err := w.Write([]byte(`{"author":{"account_id":"557058:author-account","uuid":"{author-uuid}","nickname":"alice","display_name":"Alice","type":"user"}}`))+ require.NoError(t, err)+ }))+ t.Cleanup(server.Close)++ t.Setenv("BITBUCKET_PR_ID", "10")+ t.Setenv("BITBUCKET_REPO_FULL_NAME", "bytebase/example")+ t.Setenv("BITBUCKET_STEP_TRIGGERER_UUID", "{triggerer-uuid}")+ t.Setenv("BITBUCKET_STEP_TRIGGERER_USERNAME", "triggerer")+ t.Setenv("BYTEBASE_BITBUCKET_API_BASE_URL", server.URL)++ user := getVCSUser(world.Bitbucket)+ require.NotNil(t, user)+ require.Equal(t, "/repositories/bytebase/example/pullrequests/10", gotPath)+ require.Equal(t, v1pb.VCSType_BITBUCKET, user.VcsType)+ require.Equal(t, "557058:author-account", user.UserId)+ require.Equal(t, "alice", user.UserName)+ require.Equal(t, "Alice", user.DisplayName)+}++func TestBitbucketDefaultAPIUsesPipelinesProxy(t *testing.T) {+ requestURL, err := buildBitbucketPullRequestURL(getBitbucketAPIBaseURL(), "bytebase", "example", "10")+ require.NoError(t, err)+ require.Equal(t, "http://api.bitbucket.org/2.0/repositories/bytebase/example/pullrequests/10", requestURL)++ client := bitbucket.NewHTTPClient(getBitbucketAPIBaseURL())+ transport, ok := client.Transport.(*http.Transport)+ require.True(t, ok)+ proxyURL, err := transport.Proxy(&http.Request{URL: mustParseURL(t, requestURL)})+ require.NoError(t, err)+ require.Equal(t, "http://localhost:29418", proxyURL.String())+}++func TestGetVCSUserSkipsBitbucketBotAuthor(t *testing.T) {+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {+ w.Header().Set("Content-Type", "application/json")+ _, err := w.Write([]byte(`{"author":{"account_id":"557058:bot-account","nickname":"release[bot]","type":"bot"}}`))+ require.NoError(t, err)+ }))+ t.Cleanup(server.Close)++ t.Setenv("BITBUCKET_PR_ID", "10")+ t.Setenv("BITBUCKET_REPO_FULL_NAME", "bytebase/example")+ t.Setenv("BYTEBASE_BITBUCKET_API_BASE_URL", server.URL)++ require.Nil(t, getVCSUser(world.Bitbucket))+}++func TestGetVCSUserSkipsBitbucketAppUserAuthor(t *testing.T) {+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {+ w.Header().Set("Content-Type", "application/json")+ _, err := w.Write([]byte(`{"author":{"account_id":"557058:app-account","nickname":"release-app","type":"app_user"}}`))+ require.NoError(t, err)+ }))+ t.Cleanup(server.Close)++ t.Setenv("BITBUCKET_PR_ID", "10")+ t.Setenv("BITBUCKET_REPO_FULL_NAME", "bytebase/example")+ t.Setenv("BYTEBASE_BITBUCKET_API_BASE_URL", server.URL)++ require.Nil(t, getVCSUser(world.Bitbucket))+}++func TestGetVCSUserSkipsUnsupportedPlatform(t *testing.T) {+ require.Nil(t, getVCSUser(world.LocalPlatform))+}++func mustParseURL(t *testing.T, rawURL string) *url.URL {+ t.Helper()+ parsedURL, err := url.Parse(rawURL)+ require.NoError(t, err)+ return parsedURL+}diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yamlindex cfb03546b9..cb8529c8f3 100644--- a/backend/api/mcp/gen/openapi.yaml+++ b/backend/api/mcp/gen/openapi.yaml@@ -6211,6 +6211,42 @@ paths:application/json:schema:$ref: '#/components/schemas/bytebase.v1.PurchaseResponse'+ /bytebase.v1.SubscriptionService/ExportVCSProviderUsers:+ post:+ tags:+ - bytebase.v1.SubscriptionService+ summary: ExportVCSProviderUsers+ description: Exports active VCS users as CSV.+ operationId: bytebase.v1.SubscriptionService.ExportVCSProviderUsers+ parameters:+ - name: Connect-Protocol-Version+ in: header+ required: true+ schema:+ $ref: '#/components/schemas/connect-protocol-version'+ - name: Connect-Timeout-Ms+ in: header+ schema:+ $ref: '#/components/schemas/connect-timeout-header'+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/bytebase.v1.ExportVCSProviderUsersRequest'+ required: true+ responses:+ default:+ description: Error+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/connect.error'+ "200":+ description: Success+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/google.api.HttpBody'/bytebase.v1.SubscriptionService/GetPaymentInfo:post:tags:@@ -7995,6 +8031,11 @@ components:title: user_count_in_iamformat: int32description: The number of users in the workspace IAM (for seat limit display).+ activeVcsUserCount:+ type: integer+ title: active_vcs_user_count+ format: int32+ description: The number of active VCS users seen in the active window.title: ActuatorInfoadditionalProperties: falsedescription: |-@@ -9276,6 +9317,12 @@ components:Each rule should be a clear statement describing the desired schema constraint.Example: "All tables must have a primary key"Example: "VARCHAR columns should specify a maximum length"+ vcsUser:+ title: vcs_user+ description: |-+ The non-bot VCS pull request or merge request creator observed by bytebase-release.+ If absent, Bytebase skips VCS user tracking and VCS user limit enforcement.+ $ref: '#/components/schemas/bytebase.v1.VCSUser'title: CheckReleaseRequestadditionalProperties: falsebytebase.v1.CheckReleaseResponse:@@ -11347,6 +11394,10 @@ components:description: The export file content.title: ExportResponseadditionalProperties: false+ bytebase.v1.ExportVCSProviderUsersRequest:+ type: object+ title: ExportVCSProviderUsersRequest+ additionalProperties: falsebytebase.v1.ExtensionMetadata:type: objectproperties:@@ -20077,6 +20128,23 @@ components:- BITBUCKET- AZURE_DEVOPSdescription: Version control system type.+ bytebase.v1.VCSUser:+ type: object+ properties:+ vcsType:+ title: vcs_type+ $ref: '#/components/schemas/bytebase.v1.VCSType'+ userId:+ type: string+ title: user_id+ userName:+ type: string+ title: user_name+ displayName:+ type: string+ title: display_name+ title: VCSUser+ additionalProperties: falsebytebase.v1.VerifyCheckoutSessionRequest:type: objectproperties:@@ -20645,6 +20713,72 @@ components:description: Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.additionalProperties: truedescription: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details.+ google.api.HttpBody:+ type: object+ properties:+ contentType:+ type: string+ title: content_type+ description: The HTTP Content-Type header value specifying the content type of the body.+ data:+ type: string+ title: data+ format: byte+ description: The HTTP request/response body as raw binary.+ extensions:+ type: array+ items:+ $ref: '#/components/schemas/google.protobuf.Any'+ title: extensions+ description: |-+ Application specific response metadata. Must be set in the first response+ for streaming APIs.+ title: HttpBody+ additionalProperties: false+ description: |-+ Message that represents an arbitrary HTTP body. It should only be used for+ payload formats that can't be represented as JSON, such as raw binary or+ an HTML page.+++ This message can be used both in streaming and non-streaming API methods in+ the request as well as the response.++ It can be used as a top-level request field, which is convenient if one+ wants to extract parameters from either the URL or HTTP template into the+ request fields and also want access to the raw HTTP body.++ Example:++ message GetResourceRequest {+ // A unique request id.+ string request_id = 1;++ // The raw HTTP body is bound to this field.+ google.api.HttpBody http_body = 2;++ }++ service ResourceService {+ rpc GetResource(GetResourceRequest)+ returns (google.api.HttpBody);+ rpc UpdateResource(google.api.HttpBody)+ returns (google.protobuf.Empty);++ }++ Example with streaming methods:++ service CaldavService {+ rpc GetCalendar(stream google.api.HttpBody)+ returns (stream google.api.HttpBody);+ rpc UpdateCalendar(stream google.api.HttpBody)+ returns (stream google.api.HttpBody);++ }++ Use of this type only changes how the request and response bodies are+ handled, all other features will continue to work unchanged.google.api.expr.v1alpha1.Constant:type: objectoneOf:diff --git a/backend/api/v1/actuator_service.go b/backend/api/v1/actuator_service.goindex 79c5c289fb..5c137236a1 100644--- a/backend/api/v1/actuator_service.go+++ b/backend/api/v1/actuator_service.go@@ -6,6 +6,7 @@ import ("time""connectrpc.com/connect"+ "github.com/hashicorp/golang-lru/v2/expirable""google.golang.org/protobuf/types/known/emptypb""google.golang.org/protobuf/types/known/timestamppb"@@ -32,8 +33,12 @@ type ActuatorService struct {licenseService *enterprise.LicenseServiceschemaSyncer *schemasync.SyncersampleInstanceManager *sampleinstance.Manager++ activeVCSUserCountSnapshot *expirable.LRU[string, int]}+const activeVCSUserCountSnapshotTTL = time.Minute+// NewActuatorService creates a new ActuatorService.func NewActuatorService(store *store.Store,@@ -43,11 +48,12 @@ func NewActuatorService(sampleInstanceManager *sampleinstance.Manager,) *ActuatorService {return &ActuatorService{- store: store,- profile: profile,- licenseService: licenseService,- schemaSyncer: schemaSyncer,- sampleInstanceManager: sampleInstanceManager,+ store: store,+ profile: profile,+ licenseService: licenseService,+ schemaSyncer: schemaSyncer,+ sampleInstanceManager: sampleInstanceManager,+ activeVCSUserCountSnapshot: expirable.NewLRU[string, int](1024, nil, activeVCSUserCountSnapshotTTL),}}@@ -179,6 +185,12 @@ func (s *ActuatorService) getServerInfo(ctx context.Context, workspaceID string)}serverInfo.UserCountInIam = int32(userCountInIam)+ activeVCSUserCount, err := s.getActiveVCSUserCount(ctx, workspaceID)+ if err != nil {+ return nil, connect.NewError(connect.CodeInternal, errors.Wrap(err, "failed to count active VCS users"))+ }+ serverInfo.ActiveVcsUserCount = int32(activeVCSUserCount)+// Check if sample instances are availablehasSampleInstances, _ := s.store.HasSampleInstances(ctx, workspaceID)serverInfo.EnableSample = hasSampleInstances@@ -214,6 +226,19 @@ func (s *ActuatorService) getServerInfo(ctx context.Context, workspaceID string)return &serverInfo, nil}+func (s *ActuatorService) getActiveVCSUserCount(ctx context.Context, workspaceID string) (int, error) {+ if count, ok := s.activeVCSUserCountSnapshot.Get(workspaceID); ok {+ return count, nil+ }++ count, err := s.store.CountActiveVCSProviderUsers(ctx, workspaceID, vcsProviderUserActiveWindow)+ if err != nil {+ return 0, err+ }+ s.activeVCSUserCountSnapshot.Add(workspaceID, count)+ return count, nil+}+func (s *ActuatorService) getUsedFeatures(ctx context.Context, workspaceID string) ([]v1pb.PlanFeature, error) {var features []v1pb.PlanFeaturediff --git a/backend/api/v1/release_service.go b/backend/api/v1/release_service.goindex 858945ed54..6fc31b9dbc 100644--- a/backend/api/v1/release_service.go+++ b/backend/api/v1/release_service.go@@ -19,6 +19,7 @@ import ("github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/component/dbfactory""github.com/bytebase/bytebase/backend/component/sheet"+ "github.com/bytebase/bytebase/backend/enterprise"storepb "github.com/bytebase/bytebase/backend/generated-go/store"v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"@@ -32,17 +33,20 @@ type ReleaseService struct {store *store.StoresheetManager *sheet.ManagerdbFactory *dbfactory.DBFactory+ license *enterprise.LicenseService}func NewReleaseService(store *store.Store,sheetManager *sheet.Manager,dbFactory *dbfactory.DBFactory,+ licenseService *enterprise.LicenseService,) *ReleaseService {return &ReleaseService{store: store,sheetManager: sheetManager,dbFactory: dbFactory,+ license: licenseService,}}diff --git a/backend/api/v1/release_service_check.go b/backend/api/v1/release_service_check.goindex 7fb60f8557..10ec4587cf 100644--- a/backend/api/v1/release_service_check.go+++ b/backend/api/v1/release_service_check.go@@ -5,6 +5,8 @@ import ("fmt""log/slog""strings"+ "unicode"+ "unicode/utf8""connectrpc.com/connect""github.com/pkg/errors"@@ -29,10 +31,6 @@ import (func (s *ReleaseService) CheckRelease(ctx context.Context, req *connect.Request[v1pb.CheckReleaseRequest]) (*connect.Response[v1pb.CheckReleaseResponse], error) {request := req.Msg- if len(request.Targets) == 0 {- return nil, connect.NewError(connect.CodeInvalidArgument, errors.New("targets cannot be empty"))- }-projectID, err := common.GetProjectID(request.GetParent())if err != nil {return nil, connect.NewError(connect.CodeInvalidArgument, err)@@ -50,6 +48,22 @@ func (s *ReleaseService) CheckRelease(ctx context.Context, req *connect.Request[return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("project %q not found", projectID))}+ if request.GetRelease() == nil {+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.New("release is required"))+ }+ releaseType := request.Release.Type+ if releaseType != v1pb.Release_DECLARATIVE && releaseType != v1pb.Release_VERSIONED {+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("unexpected release type %q", releaseType.String()))+ }++ if err := validateVCSProviderUser(request.GetVcsUser()); err != nil {+ return nil, err+ }++ if len(request.Targets) == 0 {+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.New("targets cannot be empty"))+ }+var targetDatabases []*store.DatabaseMessagefor _, target := range request.Targets {// Handle database target.@@ -66,6 +80,7 @@ func (s *ReleaseService) CheckRelease(ctx context.Context, req *connect.Request[return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("database %v not found", target))}targetDatabases = append(targetDatabases, database)+ continue}// Handle database group target. Extract all matched databases in the database group.@@ -106,7 +121,10 @@ func (s *ReleaseService) CheckRelease(ctx context.Context, req *connect.Request[return nil, err}targetDatabases = append(targetDatabases, matches...)+ continue}++ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("unsupported target %q", target))}if project.Setting.GetCiSamplingSize() > 0 && len(targetDatabases) > int(project.Setting.GetCiSamplingSize()) {@@ -122,7 +140,9 @@ func (s *ReleaseService) CheckRelease(ctx context.Context, req *connect.Request[return nil, connect.NewError(connect.CodeInvalidArgument, errors.New("release files cannot be empty"))}- releaseType := request.Release.Type+ if err := s.touchVCSProviderUser(ctx, workspaceID, request.GetVcsUser()); err != nil {+ return nil, err+ }var response *v1pb.CheckReleaseResponseswitch releaseType {@@ -145,6 +165,69 @@ func (s *ReleaseService) CheckRelease(ctx context.Context, req *connect.Request[return connect.NewResponse(response), nil}+func (s *ReleaseService) touchVCSProviderUser(ctx context.Context, workspaceID string, vcsUser *v1pb.VCSUser) error {+ if vcsUser == nil {+ return nil+ }+ userName := truncateVCSProviderUserMetadata(vcsUser.GetUserName())+ displayName := truncateVCSProviderUserMetadata(vcsUser.GetDisplayName())+ ok, err := s.store.TouchVCSProviderUser(ctx, workspaceID, &store.VCSProviderUserMessage{+ VCSType: vcsUser.GetVcsType(),+ UserID: vcsUser.GetUserId(),+ Payload: &storepb.VCSProviderUserPayload{+ UserName: userName,+ DisplayName: displayName,+ },+ }, vcsProviderUserActiveWindow, s.license.GetUserLimit(ctx, workspaceID))+ if err != nil {+ return connect.NewError(connect.CodeInternal, errors.Wrap(err, "failed to touch VCS provider user"))+ }+ if !ok {+ return connect.NewError(connect.CodeResourceExhausted, errors.Errorf("new VCS user would exceed the license user limit; increase the license user limit or wait for inactive VCS users to age out of the %d-day window", vcsProviderUserActiveWindowDays))+ }+ return nil+}++const maxVCSProviderUserFieldLength = 256++func validateVCSProviderUser(vcsUser *v1pb.VCSUser) error {+ if vcsUser == nil {+ return nil+ }+ if vcsUser.GetVcsType() == v1pb.VCSType_VCS_TYPE_UNSPECIFIED {+ return connect.NewError(connect.CodeInvalidArgument, errors.New("vcs_user.vcs_type is required"))+ }+ if _, ok := v1pb.VCSType_name[int32(vcsUser.GetVcsType())]; !ok {+ return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("vcs_user.vcs_type %d is invalid", vcsUser.GetVcsType()))+ }+ if vcsUser.GetUserId() == "" {+ return connect.NewError(connect.CodeInvalidArgument, errors.New("vcs_user.user_id is required"))+ }+ if utf8.RuneCountInString(vcsUser.GetUserId()) > maxVCSProviderUserFieldLength {+ return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("vcs_user.user_id exceeds maximum length %d", maxVCSProviderUserFieldLength))+ }+ for _, field := range []struct {+ name string+ value string+ }{+ {name: "user_id", value: vcsUser.GetUserId()},+ {name: "user_name", value: vcsUser.GetUserName()},+ {name: "display_name", value: vcsUser.GetDisplayName()},+ } {+ if strings.ContainsFunc(field.value, unicode.IsControl) {+ return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("vcs_user.%s contains control characters", field.name))+ }+ }+ return nil+}++func truncateVCSProviderUserMetadata(value string) string {+ if utf8.RuneCountInString(value) <= maxVCSProviderUserFieldLength {+ return value+ }+ return string([]rune(value)[:maxVCSProviderUserFieldLength])+}+func (s *ReleaseService) checkReleaseVersioned(ctx context.Context, project *store.ProjectMessage, files []*v1pb.Release_File, databases []*store.DatabaseMessage, customRules string) (*v1pb.CheckReleaseResponse, error) {resp := &v1pb.CheckReleaseResponse{}var errorAdviceCount, warningAdviceCount intdiff --git a/backend/api/v1/subscription_service.go b/backend/api/v1/subscription_service.goindex 59fcf39ae3..9962d35695 100644--- a/backend/api/v1/subscription_service.go+++ b/backend/api/v1/subscription_service.go@@ -1,7 +1,9 @@package v1import (+ "bytes""context"+ "encoding/csv""fmt""log/slog""strconv"@@ -9,6 +11,7 @@ import ("connectrpc.com/connect""github.com/pkg/errors"+ "google.golang.org/genproto/googleapis/api/httpbody""github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/common/log"@@ -56,6 +59,53 @@ func (s *SubscriptionService) GetSubscription(ctx context.Context, _ *connect.Rereturn connect.NewResponse(subscription), nil}+// ExportVCSProviderUsers exports active VCS provider users as CSV.+func (s *SubscriptionService) ExportVCSProviderUsers(ctx context.Context, _ *connect.Request[v1pb.ExportVCSProviderUsersRequest]) (*connect.Response[httpbody.HttpBody], error) {+ workspaceID := common.GetWorkspaceIDFromContext(ctx)+ users, err := s.store.ListActiveVCSProviderUsers(ctx, workspaceID, vcsProviderUserActiveWindow)+ if err != nil {+ return nil, connect.NewError(connect.CodeInternal, errors.Wrap(err, "failed to list active VCS provider users"))+ }++ var buf bytes.Buffer+ writer := csv.NewWriter(&buf)+ if err := writer.Write([]string{"vcs_type", "user_id", "user_name", "display_name", "last_seen_at"}); err != nil {+ return nil, connect.NewError(connect.CodeInternal, err)+ }+ for _, user := range users {+ if err := writer.Write([]string{+ user.VCSType.String(),+ escapeCSVFormula(user.UserID),+ escapeCSVFormula(user.Payload.GetUserName()),+ escapeCSVFormula(user.Payload.GetDisplayName()),+ user.LastSeenAt.UTC().Format(time.RFC3339),+ }); err != nil {+ return nil, connect.NewError(connect.CodeInternal, err)+ }+ }+ writer.Flush()+ if err := writer.Error(); err != nil {+ return nil, connect.NewError(connect.CodeInternal, err)+ }++ return connect.NewResponse(&httpbody.HttpBody{+ ContentType: "text/csv; charset=utf-8",+ Data: buf.Bytes(),+ }), nil+}++func escapeCSVFormula(value string) string {+ if value == "" {+ return value+ }+ switch value[0] {+ case '=', '+', '-', '@', '\t', '\r', '\n':+ return "'" + value+ default:+ return value+ }+}+// UploadLicense uploads an enterprise license (self-hosted only).func (s *SubscriptionService) UploadLicense(ctx context.Context, req *connect.Request[v1pb.UploadLicenseRequest]) (*connect.Response[v1pb.Subscription], error) {if s.profile.SaaS && s.profile.Mode == common.ReleaseModeProd {diff --git a/backend/api/v1/vcs_provider_user.go b/backend/api/v1/vcs_provider_user.gonew file mode 100644index 0000000000..41db9f44b4--- /dev/null+++ b/backend/api/v1/vcs_provider_user.go@@ -0,0 +1,8 @@+package v1++import "github.com/bytebase/bytebase/backend/store"++const (+ vcsProviderUserActiveWindowDays = 90+ vcsProviderUserActiveWindow = store.VCSProviderUserActiveWindow+)diff --git a/backend/generated-go/store/vcs_provider_user.pb.go b/backend/generated-go/store/vcs_provider_user.pb.gonew file mode 100644index 0000000000..0490c027cd--- /dev/null+++ b/backend/generated-go/store/vcs_provider_user.pb.go@@ -0,0 +1,132 @@+// Code generated by protoc-gen-go. DO NOT EDIT.+// versions:+// protoc-gen-go v1.36.11+// protoc (unknown)+// source: store/vcs_provider_user.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 VCSProviderUserPayload struct {+ state protoimpl.MessageState `protogen:"open.v1"`+ UserName string `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"`+ DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache+}++func (x *VCSProviderUserPayload) Reset() {+ *x = VCSProviderUserPayload{}+ mi := &file_store_vcs_provider_user_proto_msgTypes[0]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+}++func (x *VCSProviderUserPayload) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*VCSProviderUserPayload) ProtoMessage() {}++func (x *VCSProviderUserPayload) ProtoReflect() protoreflect.Message {+ mi := &file_store_vcs_provider_user_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 VCSProviderUserPayload.ProtoReflect.Descriptor instead.+func (*VCSProviderUserPayload) Descriptor() ([]byte, []int) {+ return file_store_vcs_provider_user_proto_rawDescGZIP(), []int{0}+}++func (x *VCSProviderUserPayload) GetUserName() string {+ if x != nil {+ return x.UserName+ }+ return ""+}++func (x *VCSProviderUserPayload) GetDisplayName() string {+ if x != nil {+ return x.DisplayName+ }+ return ""+}++var File_store_vcs_provider_user_proto protoreflect.FileDescriptor++const file_store_vcs_provider_user_proto_rawDesc = "" ++ "\n" ++ "\x1dstore/vcs_provider_user.proto\x12\x0ebytebase.store\"X\n" ++ "\x16VCSProviderUserPayload\x12\x1b\n" ++ "\tuser_name\x18\x01 \x01(\tR\buserName\x12!\n" ++ "\fdisplay_name\x18\x02 \x01(\tR\vdisplayNameB\x97\x01\n" ++ "\x12com.bytebase.storeB\x14VcsProviderUserProtoP\x01Z\x12generated-go/store\xa2\x02\x03BSX\xaa\x02\x0eBytebase.Store\xca\x02\x0eBytebase\\Store\xe2\x02\x1aBytebase\\Store\\GPBMetadata\xea\x02\x0fBytebase::Storeb\x06proto3"++var (+ file_store_vcs_provider_user_proto_rawDescOnce sync.Once+ file_store_vcs_provider_user_proto_rawDescData []byte+)++func file_store_vcs_provider_user_proto_rawDescGZIP() []byte {+ file_store_vcs_provider_user_proto_rawDescOnce.Do(func() {+ file_store_vcs_provider_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_store_vcs_provider_user_proto_rawDesc), len(file_store_vcs_provider_user_proto_rawDesc)))+ })+ return file_store_vcs_provider_user_proto_rawDescData+}++var file_store_vcs_provider_user_proto_msgTypes = make([]protoimpl.MessageInfo, 1)+var file_store_vcs_provider_user_proto_goTypes = []any{+ (*VCSProviderUserPayload)(nil), // 0: bytebase.store.VCSProviderUserPayload+}+var file_store_vcs_provider_user_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_provider_user_proto_init() }+func file_store_vcs_provider_user_proto_init() {+ if File_store_vcs_provider_user_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_provider_user_proto_rawDesc), len(file_store_vcs_provider_user_proto_rawDesc)),+ NumEnums: 0,+ NumMessages: 1,+ NumExtensions: 0,+ NumServices: 0,+ },+ GoTypes: file_store_vcs_provider_user_proto_goTypes,+ DependencyIndexes: file_store_vcs_provider_user_proto_depIdxs,+ MessageInfos: file_store_vcs_provider_user_proto_msgTypes,+ }.Build()+ File_store_vcs_provider_user_proto = out.File+ file_store_vcs_provider_user_proto_goTypes = nil+ file_store_vcs_provider_user_proto_depIdxs = nil+}diff --git a/backend/generated-go/store/vcs_provider_user_equal.pb.go b/backend/generated-go/store/vcs_provider_user_equal.pb.gonew file mode 100644index 0000000000..c5cf9ab89e--- /dev/null+++ b/backend/generated-go/store/vcs_provider_user_equal.pb.go@@ -0,0 +1,20 @@+// Code generated by protoc-gen-equal-go. DO NOT EDIT.+// source: store/vcs_provider_user.proto++package store++func (x *VCSProviderUserPayload) Equal(y *VCSProviderUserPayload) bool {+ if x == y {+ return true+ }+ if x == nil || y == nil {+ return x == nil && y == nil+ }+ if x.UserName != y.UserName {+ return false+ }+ if x.DisplayName != y.DisplayName {+ return false+ }+ return true+}diff --git a/backend/generated-go/v1/actuator_service.pb.go b/backend/generated-go/v1/actuator_service.pb.goindex d2b510f3fe..cda4bb9fe6 100644--- a/backend/generated-go/v1/actuator_service.pb.go+++ b/backend/generated-go/v1/actuator_service.pb.go@@ -274,8 +274,10 @@ type ActuatorInfo struct {DefaultProject string `protobuf:"bytes,26,opt,name=default_project,json=defaultProject,proto3" json:"default_project,omitempty"`// The number of users in the workspace IAM (for seat limit display).UserCountInIam int32 `protobuf:"varint,27,opt,name=user_count_in_iam,json=userCountInIam,proto3" json:"user_count_in_iam,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache+ // The number of active VCS users seen in the active window.+ ActiveVcsUserCount int32 `protobuf:"varint,28,opt,name=active_vcs_user_count,json=activeVcsUserCount,proto3" json:"active_vcs_user_count,omitempty"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache}func (x *ActuatorInfo) Reset() {@@ -448,6 +450,13 @@ func (x *ActuatorInfo) GetUserCountInIam() int32 {return 0}+func (x *ActuatorInfo) GetActiveVcsUserCount() int32 {+ if x != nil {+ return x.ActiveVcsUserCount+ }+ return 0+}+var File_v1_actuator_service_proto protoreflect.FileDescriptorconst file_v1_actuator_service_proto_rawDesc = "" +@@ -463,7 +472,7 @@ const file_v1_actuator_service_proto_rawDesc = "" +"\x18disallow_password_signin\x18\x02 \x01(\bB\x03\xe0A\x03R\x16disallowPasswordSignin\x12p\n" +"\x14password_restriction\x18\x03 \x01(\v28.bytebase.v1.WorkspaceProfileSetting.PasswordRestrictionB\x03\xe0A\x03R\x13passwordRestriction\x12:\n" +"\x17allow_email_code_signin\x18\x04 \x01(\bB\x03\xe0A\x03R\x14allowEmailCodeSignin\x129\n" +- "\x16password_reset_enabled\x18\x05 \x01(\bB\x03\xe0A\x03R\x14passwordResetEnabled\"\xaa\a\n" ++ "\x16password_reset_enabled\x18\x05 \x01(\bB\x03\xe0A\x03R\x14passwordResetEnabled\"\xe2\a\n" +"\fActuatorInfo\x12\x1d\n" +"\aversion\x18\x01 \x01(\tB\x03\xe0A\x03R\aversion\x12\"\n" +"\n" +@@ -485,7 +494,8 @@ const file_v1_actuator_service_proto_rawDesc = "" +"\rreplica_count\x18\x18 \x01(\x05B\x03\xe0A\x03R\freplicaCount\x12?\n" +"\vrestriction\x18\x19 \x01(\v2\x18.bytebase.v1.RestrictionB\x03\xe0A\x03R\vrestriction\x12,\n" +"\x0fdefault_project\x18\x1a \x01(\tB\x03\xe0A\x03R\x0edefaultProject\x12.\n" +- "\x11user_count_in_iam\x18\x1b \x01(\x05B\x03\xe0A\x03R\x0euserCountInIamJ\x04\b\x05\x10\x06J\x04\b\t\x10\n" ++ "\x11user_count_in_iam\x18\x1b \x01(\x05B\x03\xe0A\x03R\x0euserCountInIam\x126\n" ++ "\x15active_vcs_user_count\x18\x1c \x01(\x05B\x03\xe0A\x03R\x12activeVcsUserCountJ\x04\b\x05\x10\x06J\x04\b\t\x10\n" +"J\x04\b\n" +"\x10\vJ\x04\b\f\x10\rJ\x04\b\x10\x10\x11J\x04\b\x11\x10\x12J\x04\b\x0e\x10\x0f2\x9d\x03\n" +"\x0fActuatorService\x12\x9c\x01\n" +diff --git a/backend/generated-go/v1/actuator_service_equal.pb.go b/backend/generated-go/v1/actuator_service_equal.pb.goindex 077170f64c..72bce80234 100644--- a/backend/generated-go/v1/actuator_service_equal.pb.go+++ b/backend/generated-go/v1/actuator_service_equal.pb.go@@ -133,5 +133,8 @@ func (x *ActuatorInfo) Equal(y *ActuatorInfo) bool {if x.UserCountInIam != y.UserCountInIam {return false}+ if x.ActiveVcsUserCount != y.ActiveVcsUserCount {+ return false+ }return true}diff --git a/backend/generated-go/v1/release_service.pb.go b/backend/generated-go/v1/release_service.pb.goindex d501ac1b54..6b3271d263 100644--- a/backend/generated-go/v1/release_service.pb.go+++ b/backend/generated-go/v1/release_service.pb.go@@ -75,7 +75,7 @@ func (x Release_Type) Number() protoreflect.EnumNumber {// Deprecated: Use Release_Type.Descriptor instead.func (Release_Type) EnumDescriptor() ([]byte, []int) {- return file_v1_release_service_proto_rawDescGZIP(), []int{11, 0}+ return file_v1_release_service_proto_rawDescGZIP(), []int{12, 0}}type GetReleaseRequest struct {@@ -511,7 +511,10 @@ type CheckReleaseRequest struct {// Each rule should be a clear statement describing the desired schema constraint.// Example: "All tables must have a primary key"// Example: "VARCHAR columns should specify a maximum length"- CustomRules string `protobuf:"bytes,4,opt,name=custom_rules,json=customRules,proto3" json:"custom_rules,omitempty"`+ CustomRules string `protobuf:"bytes,4,opt,name=custom_rules,json=customRules,proto3" json:"custom_rules,omitempty"`+ // The non-bot VCS pull request or merge request creator observed by bytebase-release.+ // If absent, Bytebase skips VCS user tracking and VCS user limit enforcement.+ VcsUser *VCSUser `protobuf:"bytes,5,opt,name=vcs_user,json=vcsUser,proto3" json:"vcs_user,omitempty"`unknownFields protoimpl.UnknownFieldssizeCache protoimpl.SizeCache}@@ -574,6 +577,81 @@ func (x *CheckReleaseRequest) GetCustomRules() string {return ""}+func (x *CheckReleaseRequest) GetVcsUser() *VCSUser {+ if x != nil {+ return x.VcsUser+ }+ return nil+}++type VCSUser struct {+ state protoimpl.MessageState `protogen:"open.v1"`+ VcsType VCSType `protobuf:"varint,1,opt,name=vcs_type,json=vcsType,proto3,enum=bytebase.v1.VCSType" json:"vcs_type,omitempty"`+ UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`+ UserName string `protobuf:"bytes,3,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"`+ DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache+}++func (x *VCSUser) Reset() {+ *x = VCSUser{}+ mi := &file_v1_release_service_proto_msgTypes[8]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+}++func (x *VCSUser) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*VCSUser) ProtoMessage() {}++func (x *VCSUser) ProtoReflect() protoreflect.Message {+ mi := &file_v1_release_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 VCSUser.ProtoReflect.Descriptor instead.+func (*VCSUser) Descriptor() ([]byte, []int) {+ return file_v1_release_service_proto_rawDescGZIP(), []int{8}+}++func (x *VCSUser) GetVcsType() VCSType {+ if x != nil {+ return x.VcsType+ }+ return VCSType_VCS_TYPE_UNSPECIFIED+}++func (x *VCSUser) GetUserId() string {+ if x != nil {+ return x.UserId+ }+ return ""+}++func (x *VCSUser) GetUserName() string {+ if x != nil {+ return x.UserName+ }+ return ""+}++func (x *VCSUser) GetDisplayName() string {+ if x != nil {+ return x.DisplayName+ }+ return ""+}+type CheckReleaseResponse struct {state protoimpl.MessageState `protogen:"open.v1"`// The check results for each file and target combination.@@ -588,7 +666,7 @@ type CheckReleaseResponse struct {func (x *CheckReleaseResponse) Reset() {*x = CheckReleaseResponse{}- mi := &file_v1_release_service_proto_msgTypes[8]+ mi := &file_v1_release_service_proto_msgTypes[9]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -600,7 +678,7 @@ func (x *CheckReleaseResponse) String() string {func (*CheckReleaseResponse) ProtoMessage() {}func (x *CheckReleaseResponse) ProtoReflect() protoreflect.Message {- mi := &file_v1_release_service_proto_msgTypes[8]+ mi := &file_v1_release_service_proto_msgTypes[9]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -613,7 +691,7 @@ func (x *CheckReleaseResponse) ProtoReflect() protoreflect.Message {// Deprecated: Use CheckReleaseResponse.ProtoReflect.Descriptor instead.func (*CheckReleaseResponse) Descriptor() ([]byte, []int) {- return file_v1_release_service_proto_rawDescGZIP(), []int{8}+ return file_v1_release_service_proto_rawDescGZIP(), []int{9}}func (x *CheckReleaseResponse) GetResults() []*CheckReleaseResponse_CheckResult {@@ -647,7 +725,7 @@ type ListReleaseCategoriesRequest struct {func (x *ListReleaseCategoriesRequest) Reset() {*x = ListReleaseCategoriesRequest{}- mi := &file_v1_release_service_proto_msgTypes[9]+ mi := &file_v1_release_service_proto_msgTypes[10]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -659,7 +737,7 @@ func (x *ListReleaseCategoriesRequest) String() string {func (*ListReleaseCategoriesRequest) ProtoMessage() {}func (x *ListReleaseCategoriesRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_release_service_proto_msgTypes[9]+ mi := &file_v1_release_service_proto_msgTypes[10]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -672,7 +750,7 @@ func (x *ListReleaseCategoriesRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use ListReleaseCategoriesRequest.ProtoReflect.Descriptor instead.func (*ListReleaseCategoriesRequest) Descriptor() ([]byte, []int) {- return file_v1_release_service_proto_rawDescGZIP(), []int{9}+ return file_v1_release_service_proto_rawDescGZIP(), []int{10}}func (x *ListReleaseCategoriesRequest) GetParent() string {@@ -692,7 +770,7 @@ type ListReleaseCategoriesResponse struct {func (x *ListReleaseCategoriesResponse) Reset() {*x = ListReleaseCategoriesResponse{}- mi := &file_v1_release_service_proto_msgTypes[10]+ mi := &file_v1_release_service_proto_msgTypes[11]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -704,7 +782,7 @@ func (x *ListReleaseCategoriesResponse) String() string {func (*ListReleaseCategoriesResponse) ProtoMessage() {}func (x *ListReleaseCategoriesResponse) ProtoReflect() protoreflect.Message {- mi := &file_v1_release_service_proto_msgTypes[10]+ mi := &file_v1_release_service_proto_msgTypes[11]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -717,7 +795,7 @@ func (x *ListReleaseCategoriesResponse) ProtoReflect() protoreflect.Message {// Deprecated: Use ListReleaseCategoriesResponse.ProtoReflect.Descriptor instead.func (*ListReleaseCategoriesResponse) Descriptor() ([]byte, []int) {- return file_v1_release_service_proto_rawDescGZIP(), []int{10}+ return file_v1_release_service_proto_rawDescGZIP(), []int{11}}func (x *ListReleaseCategoriesResponse) GetCategories() []string {@@ -751,7 +829,7 @@ type Release struct {func (x *Release) Reset() {*x = Release{}- mi := &file_v1_release_service_proto_msgTypes[11]+ mi := &file_v1_release_service_proto_msgTypes[12]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -763,7 +841,7 @@ func (x *Release) String() string {func (*Release) ProtoMessage() {}func (x *Release) ProtoReflect() protoreflect.Message {- mi := &file_v1_release_service_proto_msgTypes[11]+ mi := &file_v1_release_service_proto_msgTypes[12]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -776,7 +854,7 @@ func (x *Release) ProtoReflect() protoreflect.Message {// Deprecated: Use Release.ProtoReflect.Descriptor instead.func (*Release) Descriptor() ([]byte, []int) {- return file_v1_release_service_proto_rawDescGZIP(), []int{11}+ return file_v1_release_service_proto_rawDescGZIP(), []int{12}}func (x *Release) GetName() string {@@ -855,7 +933,7 @@ type CheckReleaseResponse_CheckResult struct {func (x *CheckReleaseResponse_CheckResult) Reset() {*x = CheckReleaseResponse_CheckResult{}- mi := &file_v1_release_service_proto_msgTypes[12]+ mi := &file_v1_release_service_proto_msgTypes[13]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -867,7 +945,7 @@ func (x *CheckReleaseResponse_CheckResult) String() string {func (*CheckReleaseResponse_CheckResult) ProtoMessage() {}func (x *CheckReleaseResponse_CheckResult) ProtoReflect() protoreflect.Message {- mi := &file_v1_release_service_proto_msgTypes[12]+ mi := &file_v1_release_service_proto_msgTypes[13]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -880,7 +958,7 @@ func (x *CheckReleaseResponse_CheckResult) ProtoReflect() protoreflect.Message {// Deprecated: Use CheckReleaseResponse_CheckResult.ProtoReflect.Descriptor instead.func (*CheckReleaseResponse_CheckResult) Descriptor() ([]byte, []int) {- return file_v1_release_service_proto_rawDescGZIP(), []int{8, 0}+ return file_v1_release_service_proto_rawDescGZIP(), []int{9, 0}}func (x *CheckReleaseResponse_CheckResult) GetFile() string {@@ -941,7 +1019,7 @@ type Release_File struct {func (x *Release_File) Reset() {*x = Release_File{}- mi := &file_v1_release_service_proto_msgTypes[13]+ mi := &file_v1_release_service_proto_msgTypes[14]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -953,7 +1031,7 @@ func (x *Release_File) String() string {func (*Release_File) ProtoMessage() {}func (x *Release_File) ProtoReflect() protoreflect.Message {- mi := &file_v1_release_service_proto_msgTypes[13]+ mi := &file_v1_release_service_proto_msgTypes[14]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -966,7 +1044,7 @@ func (x *Release_File) ProtoReflect() protoreflect.Message {// Deprecated: Use Release_File.ProtoReflect.Descriptor instead.func (*Release_File) Descriptor() ([]byte, []int) {- return file_v1_release_service_proto_rawDescGZIP(), []int{11, 0}+ return file_v1_release_service_proto_rawDescGZIP(), []int{12, 0}}func (x *Release_File) GetPath() string {@@ -1017,7 +1095,7 @@ type Release_VCSSource struct {func (x *Release_VCSSource) Reset() {*x = Release_VCSSource{}- mi := &file_v1_release_service_proto_msgTypes[14]+ mi := &file_v1_release_service_proto_msgTypes[15]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1029,7 +1107,7 @@ func (x *Release_VCSSource) String() string {func (*Release_VCSSource) ProtoMessage() {}func (x *Release_VCSSource) ProtoReflect() protoreflect.Message {- mi := &file_v1_release_service_proto_msgTypes[14]+ mi := &file_v1_release_service_proto_msgTypes[15]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1042,7 +1120,7 @@ func (x *Release_VCSSource) ProtoReflect() protoreflect.Message {// Deprecated: Use Release_VCSSource.ProtoReflect.Descriptor instead.func (*Release_VCSSource) Descriptor() ([]byte, []int) {- return file_v1_release_service_proto_rawDescGZIP(), []int{11, 1}+ return file_v1_release_service_proto_rawDescGZIP(), []int{12, 1}}func (x *Release_VCSSource) GetVcsType() VCSType {@@ -1093,13 +1171,19 @@ const file_v1_release_service_proto_rawDesc = "" +"\x14bytebase.com/ReleaseR\x04name\"J\n" +"\x16UndeleteReleaseRequest\x120\n" +"\x04name\x18\x01 \x01(\tB\x1c\xe0A\x02\xfaA\x16\n" +- "\x14bytebase.com/ReleaseR\x04name\"\xbd\x01\n" ++ "\x14bytebase.com/ReleaseR\x04name\"\xee\x01\n" +"\x13CheckReleaseRequest\x124\n" +"\x06parent\x18\x01 \x01(\tB\x1c\xe0A\x02\xfaA\x16\n" +"\x14bytebase.com/ProjectR\x06parent\x123\n" +"\arelease\x18\x02 \x01(\v2\x14.bytebase.v1.ReleaseB\x03\xe0A\x02R\arelease\x12\x18\n" +"\atargets\x18\x03 \x03(\tR\atargets\x12!\n" +- "\fcustom_rules\x18\x04 \x01(\tR\vcustomRules\"\x82\x03\n" ++ "\fcustom_rules\x18\x04 \x01(\tR\vcustomRules\x12/\n" ++ "\bvcs_user\x18\x05 \x01(\v2\x14.bytebase.v1.VCSUserR\avcsUser\"\x93\x01\n" ++ "\aVCSUser\x12/\n" ++ "\bvcs_type\x18\x01 \x01(\x0e2\x14.bytebase.v1.VCSTypeR\avcsType\x12\x17\n" ++ "\auser_id\x18\x02 \x01(\tR\x06userId\x12\x1b\n" ++ "\tuser_name\x18\x03 \x01(\tR\buserName\x12!\n" ++ "\fdisplay_name\x18\x04 \x01(\tR\vdisplayName\"\x82\x03\n" +"\x14CheckReleaseResponse\x12G\n" +"\aresults\x18\x01 \x03(\v2-.bytebase.v1.CheckReleaseResponse.CheckResultR\aresults\x12#\n" +"\raffected_rows\x18\x02 \x01(\x03R\faffectedRows\x125\n" +@@ -1171,7 +1255,7 @@ func file_v1_release_service_proto_rawDescGZIP() []byte {}var file_v1_release_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)-var file_v1_release_service_proto_msgTypes = make([]protoimpl.MessageInfo, 15)+var file_v1_release_service_proto_msgTypes = make([]protoimpl.MessageInfo, 16)var file_v1_release_service_proto_goTypes = []any{(Release_Type)(0), // 0: bytebase.v1.Release.Type(*GetReleaseRequest)(nil), // 1: bytebase.v1.GetReleaseRequest@@ -1182,58 +1266,61 @@ var file_v1_release_service_proto_goTypes = []any{(*DeleteReleaseRequest)(nil), // 6: bytebase.v1.DeleteReleaseRequest(*UndeleteReleaseRequest)(nil), // 7: bytebase.v1.UndeleteReleaseRequest(*CheckReleaseRequest)(nil), // 8: bytebase.v1.CheckReleaseRequest- (*CheckReleaseResponse)(nil), // 9: bytebase.v1.CheckReleaseResponse- (*ListReleaseCategoriesRequest)(nil), // 10: bytebase.v1.ListReleaseCategoriesRequest- (*ListReleaseCategoriesResponse)(nil), // 11: bytebase.v1.ListReleaseCategoriesResponse- (*Release)(nil), // 12: bytebase.v1.Release- (*CheckReleaseResponse_CheckResult)(nil), // 13: bytebase.v1.CheckReleaseResponse.CheckResult- (*Release_File)(nil), // 14: bytebase.v1.Release.File- (*Release_VCSSource)(nil), // 15: bytebase.v1.Release.VCSSource- (*fieldmaskpb.FieldMask)(nil), // 16: google.protobuf.FieldMask- (RiskLevel)(0), // 17: bytebase.v1.RiskLevel- (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp- (State)(0), // 19: bytebase.v1.State- (*Advice)(nil), // 20: bytebase.v1.Advice- (VCSType)(0), // 21: bytebase.v1.VCSType- (*emptypb.Empty)(nil), // 22: google.protobuf.Empty+ (*VCSUser)(nil), // 9: bytebase.v1.VCSUser+ (*CheckReleaseResponse)(nil), // 10: bytebase.v1.CheckReleaseResponse+ (*ListReleaseCategoriesRequest)(nil), // 11: bytebase.v1.ListReleaseCategoriesRequest+ (*ListReleaseCategoriesResponse)(nil), // 12: bytebase.v1.ListReleaseCategoriesResponse+ (*Release)(nil), // 13: bytebase.v1.Release+ (*CheckReleaseResponse_CheckResult)(nil), // 14: bytebase.v1.CheckReleaseResponse.CheckResult+ (*Release_File)(nil), // 15: bytebase.v1.Release.File+ (*Release_VCSSource)(nil), // 16: bytebase.v1.Release.VCSSource+ (*fieldmaskpb.FieldMask)(nil), // 17: google.protobuf.FieldMask+ (VCSType)(0), // 18: bytebase.v1.VCSType+ (RiskLevel)(0), // 19: bytebase.v1.RiskLevel+ (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp+ (State)(0), // 21: bytebase.v1.State+ (*Advice)(nil), // 22: bytebase.v1.Advice+ (*emptypb.Empty)(nil), // 23: google.protobuf.Empty}var file_v1_release_service_proto_depIdxs = []int32{- 12, // 0: bytebase.v1.ListReleasesResponse.releases:type_name -> bytebase.v1.Release- 12, // 1: bytebase.v1.CreateReleaseRequest.release:type_name -> bytebase.v1.Release- 12, // 2: bytebase.v1.UpdateReleaseRequest.release:type_name -> bytebase.v1.Release- 16, // 3: bytebase.v1.UpdateReleaseRequest.update_mask:type_name -> google.protobuf.FieldMask- 12, // 4: bytebase.v1.CheckReleaseRequest.release:type_name -> bytebase.v1.Release- 13, // 5: bytebase.v1.CheckReleaseResponse.results:type_name -> bytebase.v1.CheckReleaseResponse.CheckResult- 17, // 6: bytebase.v1.CheckReleaseResponse.risk_level:type_name -> bytebase.v1.RiskLevel- 14, // 7: bytebase.v1.Release.files:type_name -> bytebase.v1.Release.File- 15, // 8: bytebase.v1.Release.vcs_source:type_name -> bytebase.v1.Release.VCSSource- 18, // 9: bytebase.v1.Release.create_time:type_name -> google.protobuf.Timestamp- 19, // 10: bytebase.v1.Release.state:type_name -> bytebase.v1.State- 0, // 11: bytebase.v1.Release.type:type_name -> bytebase.v1.Release.Type- 20, // 12: bytebase.v1.CheckReleaseResponse.CheckResult.advices:type_name -> bytebase.v1.Advice- 17, // 13: bytebase.v1.CheckReleaseResponse.CheckResult.risk_level:type_name -> bytebase.v1.RiskLevel- 21, // 14: bytebase.v1.Release.VCSSource.vcs_type:type_name -> bytebase.v1.VCSType- 1, // 15: bytebase.v1.ReleaseService.GetRelease:input_type -> bytebase.v1.GetReleaseRequest- 2, // 16: bytebase.v1.ReleaseService.ListReleases:input_type -> bytebase.v1.ListReleasesRequest- 4, // 17: bytebase.v1.ReleaseService.CreateRelease:input_type -> bytebase.v1.CreateReleaseRequest- 5, // 18: bytebase.v1.ReleaseService.UpdateRelease:input_type -> bytebase.v1.UpdateReleaseRequest- 6, // 19: bytebase.v1.ReleaseService.DeleteRelease:input_type -> bytebase.v1.DeleteReleaseRequest- 7, // 20: bytebase.v1.ReleaseService.UndeleteRelease:input_type -> bytebase.v1.UndeleteReleaseRequest- 8, // 21: bytebase.v1.ReleaseService.CheckRelease:input_type -> bytebase.v1.CheckReleaseRequest- 10, // 22: bytebase.v1.ReleaseService.ListReleaseCategories:input_type -> bytebase.v1.ListReleaseCategoriesRequest- 12, // 23: bytebase.v1.ReleaseService.GetRelease:output_type -> bytebase.v1.Release- 3, // 24: bytebase.v1.ReleaseService.ListReleases:output_type -> bytebase.v1.ListReleasesResponse- 12, // 25: bytebase.v1.ReleaseService.CreateRelease:output_type -> bytebase.v1.Release- 12, // 26: bytebase.v1.ReleaseService.UpdateRelease:output_type -> bytebase.v1.Release- 22, // 27: bytebase.v1.ReleaseService.DeleteRelease:output_type -> google.protobuf.Empty- 12, // 28: bytebase.v1.ReleaseService.UndeleteRelease:output_type -> bytebase.v1.Release- 9, // 29: bytebase.v1.ReleaseService.CheckRelease:output_type -> bytebase.v1.CheckReleaseResponse- 11, // 30: bytebase.v1.ReleaseService.ListReleaseCategories:output_type -> bytebase.v1.ListReleaseCategoriesResponse- 23, // [23:31] is the sub-list for method output_type- 15, // [15:23] is the sub-list for method input_type- 15, // [15:15] is the sub-list for extension type_name- 15, // [15:15] is the sub-list for extension extendee- 0, // [0:15] is the sub-list for field type_name+ 13, // 0: bytebase.v1.ListReleasesResponse.releases:type_name -> bytebase.v1.Release+ 13, // 1: bytebase.v1.CreateReleaseRequest.release:type_name -> bytebase.v1.Release+ 13, // 2: bytebase.v1.UpdateReleaseRequest.release:type_name -> bytebase.v1.Release+ 17, // 3: bytebase.v1.UpdateReleaseRequest.update_mask:type_name -> google.protobuf.FieldMask+ 13, // 4: bytebase.v1.CheckReleaseRequest.release:type_name -> bytebase.v1.Release+ 9, // 5: bytebase.v1.CheckReleaseRequest.vcs_user:type_name -> bytebase.v1.VCSUser+ 18, // 6: bytebase.v1.VCSUser.vcs_type:type_name -> bytebase.v1.VCSType+ 14, // 7: bytebase.v1.CheckReleaseResponse.results:type_name -> bytebase.v1.CheckReleaseResponse.CheckResult+ 19, // 8: bytebase.v1.CheckReleaseResponse.risk_level:type_name -> bytebase.v1.RiskLevel+ 15, // 9: bytebase.v1.Release.files:type_name -> bytebase.v1.Release.File+ 16, // 10: bytebase.v1.Release.vcs_source:type_name -> bytebase.v1.Release.VCSSource+ 20, // 11: bytebase.v1.Release.create_time:type_name -> google.protobuf.Timestamp+ 21, // 12: bytebase.v1.Release.state:type_name -> bytebase.v1.State+ 0, // 13: bytebase.v1.Release.type:type_name -> bytebase.v1.Release.Type+ 22, // 14: bytebase.v1.CheckReleaseResponse.CheckResult.advices:type_name -> bytebase.v1.Advice+ 19, // 15: bytebase.v1.CheckReleaseResponse.CheckResult.risk_level:type_name -> bytebase.v1.RiskLevel+ 18, // 16: bytebase.v1.Release.VCSSource.vcs_type:type_name -> bytebase.v1.VCSType+ 1, // 17: bytebase.v1.ReleaseService.GetRelease:input_type -> bytebase.v1.GetReleaseRequest+ 2, // 18: bytebase.v1.ReleaseService.ListReleases:input_type -> bytebase.v1.ListReleasesRequest+ 4, // 19: bytebase.v1.ReleaseService.CreateRelease:input_type -> bytebase.v1.CreateReleaseRequest+ 5, // 20: bytebase.v1.ReleaseService.UpdateRelease:input_type -> bytebase.v1.UpdateReleaseRequest+ 6, // 21: bytebase.v1.ReleaseService.DeleteRelease:input_type -> bytebase.v1.DeleteReleaseRequest+ 7, // 22: bytebase.v1.ReleaseService.UndeleteRelease:input_type -> bytebase.v1.UndeleteReleaseRequest+ 8, // 23: bytebase.v1.ReleaseService.CheckRelease:input_type -> bytebase.v1.CheckReleaseRequest+ 11, // 24: bytebase.v1.ReleaseService.ListReleaseCategories:input_type -> bytebase.v1.ListReleaseCategoriesRequest+ 13, // 25: bytebase.v1.ReleaseService.GetRelease:output_type -> bytebase.v1.Release+ 3, // 26: bytebase.v1.ReleaseService.ListReleases:output_type -> bytebase.v1.ListReleasesResponse+ 13, // 27: bytebase.v1.ReleaseService.CreateRelease:output_type -> bytebase.v1.Release+ 13, // 28: bytebase.v1.ReleaseService.UpdateRelease:output_type -> bytebase.v1.Release+ 23, // 29: bytebase.v1.ReleaseService.DeleteRelease:output_type -> google.protobuf.Empty+ 13, // 30: bytebase.v1.ReleaseService.UndeleteRelease:output_type -> bytebase.v1.Release+ 10, // 31: bytebase.v1.ReleaseService.CheckRelease:output_type -> bytebase.v1.CheckReleaseResponse+ 12, // 32: bytebase.v1.ReleaseService.ListReleaseCategories:output_type -> bytebase.v1.ListReleaseCategoriesResponse+ 25, // [25:33] is the sub-list for method output_type+ 17, // [17:25] is the sub-list for method input_type+ 17, // [17:17] is the sub-list for extension type_name+ 17, // [17:17] is the sub-list for extension extendee+ 0, // [0:17] is the sub-list for field type_name}func init() { file_v1_release_service_proto_init() }@@ -1250,7 +1337,7 @@ func file_v1_release_service_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_release_service_proto_rawDesc), len(file_v1_release_service_proto_rawDesc)),NumEnums: 1,- NumMessages: 15,+ NumMessages: 16,NumExtensions: 0,NumServices: 1,},diff --git a/backend/generated-go/v1/release_service_equal.pb.go b/backend/generated-go/v1/release_service_equal.pb.goindex ff2f4a7202..bbb09116fd 100644--- a/backend/generated-go/v1/release_service_equal.pb.go+++ b/backend/generated-go/v1/release_service_equal.pb.go@@ -159,6 +159,31 @@ func (x *CheckReleaseRequest) Equal(y *CheckReleaseRequest) bool {if x.CustomRules != y.CustomRules {return false}+ if !x.VcsUser.Equal(y.VcsUser) {+ return false+ }+ return true+}++func (x *VCSUser) Equal(y *VCSUser) bool {+ if x == y {+ return true+ }+ if x == nil || y == nil {+ return x == nil && y == nil+ }+ if x.VcsType != y.VcsType {+ return false+ }+ if x.UserId != y.UserId {+ return false+ }+ if x.UserName != y.UserName {+ return false+ }+ if x.DisplayName != y.DisplayName {+ return false+ }return true}diff --git a/backend/generated-go/v1/subscription_service.pb.go b/backend/generated-go/v1/subscription_service.pb.goindex 2d7590895a..185e069bf8 100644--- a/backend/generated-go/v1/subscription_service.pb.go+++ b/backend/generated-go/v1/subscription_service.pb.go@@ -8,6 +8,7 @@ package v1import (_ "google.golang.org/genproto/googleapis/api/annotations"+ httpbody "google.golang.org/genproto/googleapis/api/httpbody"protoreflect "google.golang.org/protobuf/reflect/protoreflect"protoimpl "google.golang.org/protobuf/runtime/protoimpl"timestamppb "google.golang.org/protobuf/types/known/timestamppb"@@ -433,7 +434,7 @@ func (x PurchasePlanAdditional_Type) Number() protoreflect.EnumNumber {// Deprecated: Use PurchasePlanAdditional_Type.Descriptor instead.func (PurchasePlanAdditional_Type) EnumDescriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{11, 0}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{12, 0}}type PurchaseDiscount_Type int32@@ -485,7 +486,7 @@ func (x PurchaseDiscount_Type) Number() protoreflect.EnumNumber {// Deprecated: Use PurchaseDiscount_Type.Descriptor instead.func (PurchaseDiscount_Type) EnumDescriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{13, 0}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{14, 0}}type GetSubscriptionRequest struct {@@ -524,6 +525,42 @@ func (*GetSubscriptionRequest) Descriptor() ([]byte, []int) {return file_v1_subscription_service_proto_rawDescGZIP(), []int{0}}+type ExportVCSProviderUsersRequest struct {+ state protoimpl.MessageState `protogen:"open.v1"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache+}++func (x *ExportVCSProviderUsersRequest) Reset() {+ *x = ExportVCSProviderUsersRequest{}+ mi := &file_v1_subscription_service_proto_msgTypes[1]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+}++func (x *ExportVCSProviderUsersRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*ExportVCSProviderUsersRequest) ProtoMessage() {}++func (x *ExportVCSProviderUsersRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_subscription_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 ExportVCSProviderUsersRequest.ProtoReflect.Descriptor instead.+func (*ExportVCSProviderUsersRequest) Descriptor() ([]byte, []int) {+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{1}+}+type UploadLicenseRequest struct {state protoimpl.MessageState `protogen:"open.v1"`License string `protobuf:"bytes,1,opt,name=license,proto3" json:"license,omitempty"`@@ -533,7 +570,7 @@ type UploadLicenseRequest struct {func (x *UploadLicenseRequest) Reset() {*x = UploadLicenseRequest{}- mi := &file_v1_subscription_service_proto_msgTypes[1]+ mi := &file_v1_subscription_service_proto_msgTypes[2]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -545,7 +582,7 @@ func (x *UploadLicenseRequest) String() string {func (*UploadLicenseRequest) ProtoMessage() {}func (x *UploadLicenseRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[1]+ mi := &file_v1_subscription_service_proto_msgTypes[2]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -558,7 +595,7 @@ func (x *UploadLicenseRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use UploadLicenseRequest.ProtoReflect.Descriptor instead.func (*UploadLicenseRequest) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{1}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{2}}func (x *UploadLicenseRequest) GetLicense() string {@@ -579,7 +616,7 @@ type CreatePurchaseRequest struct {func (x *CreatePurchaseRequest) Reset() {*x = CreatePurchaseRequest{}- mi := &file_v1_subscription_service_proto_msgTypes[2]+ mi := &file_v1_subscription_service_proto_msgTypes[3]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -591,7 +628,7 @@ func (x *CreatePurchaseRequest) String() string {func (*CreatePurchaseRequest) ProtoMessage() {}func (x *CreatePurchaseRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[2]+ mi := &file_v1_subscription_service_proto_msgTypes[3]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -604,7 +641,7 @@ func (x *CreatePurchaseRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use CreatePurchaseRequest.ProtoReflect.Descriptor instead.func (*CreatePurchaseRequest) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{2}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{3}}func (x *CreatePurchaseRequest) GetPlan() PlanType {@@ -641,7 +678,7 @@ type PurchaseResponse struct {func (x *PurchaseResponse) Reset() {*x = PurchaseResponse{}- mi := &file_v1_subscription_service_proto_msgTypes[3]+ mi := &file_v1_subscription_service_proto_msgTypes[4]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -653,7 +690,7 @@ func (x *PurchaseResponse) String() string {func (*PurchaseResponse) ProtoMessage() {}func (x *PurchaseResponse) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[3]+ mi := &file_v1_subscription_service_proto_msgTypes[4]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -666,7 +703,7 @@ func (x *PurchaseResponse) ProtoReflect() protoreflect.Message {// Deprecated: Use PurchaseResponse.ProtoReflect.Descriptor instead.func (*PurchaseResponse) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{3}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{4}}func (x *PurchaseResponse) GetPaymentUrl() string {@@ -692,7 +729,7 @@ type VerifyCheckoutSessionRequest struct {func (x *VerifyCheckoutSessionRequest) Reset() {*x = VerifyCheckoutSessionRequest{}- mi := &file_v1_subscription_service_proto_msgTypes[4]+ mi := &file_v1_subscription_service_proto_msgTypes[5]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -704,7 +741,7 @@ func (x *VerifyCheckoutSessionRequest) String() string {func (*VerifyCheckoutSessionRequest) ProtoMessage() {}func (x *VerifyCheckoutSessionRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[4]+ mi := &file_v1_subscription_service_proto_msgTypes[5]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -717,7 +754,7 @@ func (x *VerifyCheckoutSessionRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use VerifyCheckoutSessionRequest.ProtoReflect.Descriptor instead.func (*VerifyCheckoutSessionRequest) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{4}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{5}}func (x *VerifyCheckoutSessionRequest) GetSessionId() string {@@ -737,7 +774,7 @@ type VerifyCheckoutSessionResponse struct {func (x *VerifyCheckoutSessionResponse) Reset() {*x = VerifyCheckoutSessionResponse{}- mi := &file_v1_subscription_service_proto_msgTypes[5]+ mi := &file_v1_subscription_service_proto_msgTypes[6]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -749,7 +786,7 @@ func (x *VerifyCheckoutSessionResponse) String() string {func (*VerifyCheckoutSessionResponse) ProtoMessage() {}func (x *VerifyCheckoutSessionResponse) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[5]+ mi := &file_v1_subscription_service_proto_msgTypes[6]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -762,7 +799,7 @@ func (x *VerifyCheckoutSessionResponse) ProtoReflect() protoreflect.Message {// Deprecated: Use VerifyCheckoutSessionResponse.ProtoReflect.Descriptor instead.func (*VerifyCheckoutSessionResponse) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{5}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{6}}func (x *VerifyCheckoutSessionResponse) GetStatus() string {@@ -784,7 +821,7 @@ type UpdatePurchaseRequest struct {func (x *UpdatePurchaseRequest) Reset() {*x = UpdatePurchaseRequest{}- mi := &file_v1_subscription_service_proto_msgTypes[6]+ mi := &file_v1_subscription_service_proto_msgTypes[7]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -796,7 +833,7 @@ func (x *UpdatePurchaseRequest) String() string {func (*UpdatePurchaseRequest) ProtoMessage() {}func (x *UpdatePurchaseRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[6]+ mi := &file_v1_subscription_service_proto_msgTypes[7]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -809,7 +846,7 @@ func (x *UpdatePurchaseRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use UpdatePurchaseRequest.ProtoReflect.Descriptor instead.func (*UpdatePurchaseRequest) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{6}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{7}}func (x *UpdatePurchaseRequest) GetPlan() PlanType {@@ -855,7 +892,7 @@ type CancelPurchaseRequest struct {func (x *CancelPurchaseRequest) Reset() {*x = CancelPurchaseRequest{}- mi := &file_v1_subscription_service_proto_msgTypes[7]+ mi := &file_v1_subscription_service_proto_msgTypes[8]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -867,7 +904,7 @@ func (x *CancelPurchaseRequest) String() string {func (*CancelPurchaseRequest) ProtoMessage() {}func (x *CancelPurchaseRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[7]+ mi := &file_v1_subscription_service_proto_msgTypes[8]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -880,7 +917,7 @@ func (x *CancelPurchaseRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use CancelPurchaseRequest.ProtoReflect.Descriptor instead.func (*CancelPurchaseRequest) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{7}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{8}}func (x *CancelPurchaseRequest) GetFeedback() string {@@ -905,7 +942,7 @@ type GetPaymentInfoRequest struct {func (x *GetPaymentInfoRequest) Reset() {*x = GetPaymentInfoRequest{}- mi := &file_v1_subscription_service_proto_msgTypes[8]+ mi := &file_v1_subscription_service_proto_msgTypes[9]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -917,7 +954,7 @@ func (x *GetPaymentInfoRequest) String() string {func (*GetPaymentInfoRequest) ProtoMessage() {}func (x *GetPaymentInfoRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[8]+ mi := &file_v1_subscription_service_proto_msgTypes[9]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -930,7 +967,7 @@ func (x *GetPaymentInfoRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use GetPaymentInfoRequest.ProtoReflect.Descriptor instead.func (*GetPaymentInfoRequest) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{8}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{9}}type PaymentInfo struct {@@ -953,7 +990,7 @@ type PaymentInfo struct {func (x *PaymentInfo) Reset() {*x = PaymentInfo{}- mi := &file_v1_subscription_service_proto_msgTypes[9]+ mi := &file_v1_subscription_service_proto_msgTypes[10]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -965,7 +1002,7 @@ func (x *PaymentInfo) String() string {func (*PaymentInfo) ProtoMessage() {}func (x *PaymentInfo) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[9]+ mi := &file_v1_subscription_service_proto_msgTypes[10]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -978,7 +1015,7 @@ func (x *PaymentInfo) ProtoReflect() protoreflect.Message {// Deprecated: Use PaymentInfo.ProtoReflect.Descriptor instead.func (*PaymentInfo) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{9}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{10}}func (x *PaymentInfo) GetTotalPrice() string {@@ -1042,7 +1079,7 @@ type PurchasePlan struct {func (x *PurchasePlan) Reset() {*x = PurchasePlan{}- mi := &file_v1_subscription_service_proto_msgTypes[10]+ mi := &file_v1_subscription_service_proto_msgTypes[11]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1054,7 +1091,7 @@ func (x *PurchasePlan) String() string {func (*PurchasePlan) ProtoMessage() {}func (x *PurchasePlan) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[10]+ mi := &file_v1_subscription_service_proto_msgTypes[11]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1067,7 +1104,7 @@ func (x *PurchasePlan) ProtoReflect() protoreflect.Message {// Deprecated: Use PurchasePlan.ProtoReflect.Descriptor instead.func (*PurchasePlan) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{10}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{11}}func (x *PurchasePlan) GetType() PlanType {@@ -1113,7 +1150,7 @@ type PurchasePlanAdditional struct {func (x *PurchasePlanAdditional) Reset() {*x = PurchasePlanAdditional{}- mi := &file_v1_subscription_service_proto_msgTypes[11]+ mi := &file_v1_subscription_service_proto_msgTypes[12]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1125,7 +1162,7 @@ func (x *PurchasePlanAdditional) String() string {func (*PurchasePlanAdditional) ProtoMessage() {}func (x *PurchasePlanAdditional) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[11]+ mi := &file_v1_subscription_service_proto_msgTypes[12]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1138,7 +1175,7 @@ func (x *PurchasePlanAdditional) ProtoReflect() protoreflect.Message {// Deprecated: Use PurchasePlanAdditional.ProtoReflect.Descriptor instead.func (*PurchasePlanAdditional) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{11}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{12}}func (x *PurchasePlanAdditional) GetType() PurchasePlanAdditional_Type {@@ -1186,7 +1223,7 @@ type PurchaseBillingMethod struct {func (x *PurchaseBillingMethod) Reset() {*x = PurchaseBillingMethod{}- mi := &file_v1_subscription_service_proto_msgTypes[12]+ mi := &file_v1_subscription_service_proto_msgTypes[13]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1198,7 +1235,7 @@ func (x *PurchaseBillingMethod) String() string {func (*PurchaseBillingMethod) ProtoMessage() {}func (x *PurchaseBillingMethod) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[12]+ mi := &file_v1_subscription_service_proto_msgTypes[13]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1211,7 +1248,7 @@ func (x *PurchaseBillingMethod) ProtoReflect() protoreflect.Message {// Deprecated: Use PurchaseBillingMethod.ProtoReflect.Descriptor instead.func (*PurchaseBillingMethod) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{12}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{13}}func (x *PurchaseBillingMethod) GetInterval() BillingInterval {@@ -1238,7 +1275,7 @@ type PurchaseDiscount struct {func (x *PurchaseDiscount) Reset() {*x = PurchaseDiscount{}- mi := &file_v1_subscription_service_proto_msgTypes[13]+ mi := &file_v1_subscription_service_proto_msgTypes[14]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1250,7 +1287,7 @@ func (x *PurchaseDiscount) String() string {func (*PurchaseDiscount) ProtoMessage() {}func (x *PurchaseDiscount) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[13]+ mi := &file_v1_subscription_service_proto_msgTypes[14]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1263,7 +1300,7 @@ func (x *PurchaseDiscount) ProtoReflect() protoreflect.Message {// Deprecated: Use PurchaseDiscount.ProtoReflect.Descriptor instead.func (*PurchaseDiscount) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{13}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{14}}func (x *PurchaseDiscount) GetType() PurchaseDiscount_Type {@@ -1288,7 +1325,7 @@ type ListPurchasePlansRequest struct {func (x *ListPurchasePlansRequest) Reset() {*x = ListPurchasePlansRequest{}- mi := &file_v1_subscription_service_proto_msgTypes[14]+ mi := &file_v1_subscription_service_proto_msgTypes[15]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1300,7 +1337,7 @@ func (x *ListPurchasePlansRequest) String() string {func (*ListPurchasePlansRequest) ProtoMessage() {}func (x *ListPurchasePlansRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[14]+ mi := &file_v1_subscription_service_proto_msgTypes[15]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1313,7 +1350,7 @@ func (x *ListPurchasePlansRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use ListPurchasePlansRequest.ProtoReflect.Descriptor instead.func (*ListPurchasePlansRequest) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{14}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{15}}type ListPurchasePlansResponse struct {@@ -1325,7 +1362,7 @@ type ListPurchasePlansResponse struct {func (x *ListPurchasePlansResponse) Reset() {*x = ListPurchasePlansResponse{}- mi := &file_v1_subscription_service_proto_msgTypes[15]+ mi := &file_v1_subscription_service_proto_msgTypes[16]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1337,7 +1374,7 @@ func (x *ListPurchasePlansResponse) String() string {func (*ListPurchasePlansResponse) ProtoMessage() {}func (x *ListPurchasePlansResponse) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[15]+ mi := &file_v1_subscription_service_proto_msgTypes[16]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1350,7 +1387,7 @@ func (x *ListPurchasePlansResponse) ProtoReflect() protoreflect.Message {// Deprecated: Use ListPurchasePlansResponse.ProtoReflect.Descriptor instead.func (*ListPurchasePlansResponse) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{15}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{16}}func (x *ListPurchasePlansResponse) GetPlans() []*PurchasePlan {@@ -1379,7 +1416,7 @@ type Subscription struct {func (x *Subscription) Reset() {*x = Subscription{}- mi := &file_v1_subscription_service_proto_msgTypes[16]+ mi := &file_v1_subscription_service_proto_msgTypes[17]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1391,7 +1428,7 @@ func (x *Subscription) String() string {func (*Subscription) ProtoMessage() {}func (x *Subscription) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[16]+ mi := &file_v1_subscription_service_proto_msgTypes[17]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1404,7 +1441,7 @@ func (x *Subscription) ProtoReflect() protoreflect.Message {// Deprecated: Use Subscription.ProtoReflect.Descriptor instead.func (*Subscription) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{16}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{17}}func (x *Subscription) GetPlan() PlanType {@@ -1481,7 +1518,7 @@ type PlanConfig struct {func (x *PlanConfig) Reset() {*x = PlanConfig{}- mi := &file_v1_subscription_service_proto_msgTypes[17]+ mi := &file_v1_subscription_service_proto_msgTypes[18]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1493,7 +1530,7 @@ func (x *PlanConfig) String() string {func (*PlanConfig) ProtoMessage() {}func (x *PlanConfig) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[17]+ mi := &file_v1_subscription_service_proto_msgTypes[18]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1506,7 +1543,7 @@ func (x *PlanConfig) ProtoReflect() protoreflect.Message {// Deprecated: Use PlanConfig.ProtoReflect.Descriptor instead.func (*PlanConfig) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{17}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{18}}func (x *PlanConfig) GetPlans() []*PlanLimitConfig {@@ -1536,7 +1573,7 @@ type PlanLimitConfig struct {func (x *PlanLimitConfig) Reset() {*x = PlanLimitConfig{}- mi := &file_v1_subscription_service_proto_msgTypes[18]+ mi := &file_v1_subscription_service_proto_msgTypes[19]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1548,7 +1585,7 @@ func (x *PlanLimitConfig) String() string {func (*PlanLimitConfig) ProtoMessage() {}func (x *PlanLimitConfig) ProtoReflect() protoreflect.Message {- mi := &file_v1_subscription_service_proto_msgTypes[18]+ mi := &file_v1_subscription_service_proto_msgTypes[19]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1561,7 +1598,7 @@ func (x *PlanLimitConfig) ProtoReflect() protoreflect.Message {// Deprecated: Use PlanLimitConfig.ProtoReflect.Descriptor instead.func (*PlanLimitConfig) Descriptor() ([]byte, []int) {- return file_v1_subscription_service_proto_rawDescGZIP(), []int{18}+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{19}}func (x *PlanLimitConfig) GetType() PlanType {@@ -1596,8 +1633,9 @@ var File_v1_subscription_service_proto protoreflect.FileDescriptorconst file_v1_subscription_service_proto_rawDesc = "" +"\n" +- "\x1dv1/subscription_service.proto\x12\vbytebase.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13v1/annotation.proto\"\x18\n" +- "\x16GetSubscriptionRequest\"0\n" ++ "\x1dv1/subscription_service.proto\x12\vbytebase.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13v1/annotation.proto\"\x18\n" ++ "\x16GetSubscriptionRequest\"\x1f\n" ++ "\x1dExportVCSProviderUsersRequest\"0\n" +"\x14UploadLicenseRequest\x12\x18\n" +"\alicense\x18\x01 \x01(\tR\alicense\"\x92\x01\n" +"\x15CreatePurchaseRequest\x12)\n" +@@ -1766,9 +1804,11 @@ const file_v1_subscription_service_proto_rawDesc = "" +"\x12FEATURE_CUSTOM_MSA\x10D\x12\x1d\n" +"\x19FEATURE_COMMUNITY_SUPPORT\x10E\x12\x19\n" +"\x15FEATURE_EMAIL_SUPPORT\x10F\x12&\n" +- "\"FEATURE_DEDICATED_SUPPORT_WITH_SLA\x10G2\xd2\t\n" ++ "\"FEATURE_DEDICATED_SUPPORT_WITH_SLA\x10G2\xfe\n" ++ "\n" +"\x13SubscriptionService\x12n\n" +- "\x0fGetSubscription\x12#.bytebase.v1.GetSubscriptionRequest\x1a\x19.bytebase.v1.Subscription\"\x1b\xdaA\x00\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/subscription\x12\x90\x01\n" ++ "\x0fGetSubscription\x12#.bytebase.v1.GetSubscriptionRequest\x1a\x19.bytebase.v1.Subscription\"\x1b\xdaA\x00\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/subscription\x12\xa9\x01\n" ++ "\x16ExportVCSProviderUsers\x12*.bytebase.v1.ExportVCSProviderUsersRequest\x1a\x14.google.api.HttpBody\"M\x8a\xea0\x16bb.subscription.manage\x90\xea0\x01\x82\xd3\xe4\x93\x02)\x12'/v1/subscription:vcsProviderUsersExport\x12\x90\x01\n" +"\rUploadLicense\x12!.bytebase.v1.UploadLicenseRequest\x1a\x19.bytebase.v1.Subscription\"A\x8a\xea0\x16bb.subscription.manage\x90\xea0\x01\x82\xd3\xe4\x93\x02\x1d:\x01*2\x18/v1/subscription/license\x12\x97\x01\n" +"\x0eCreatePurchase\x12\".bytebase.v1.CreatePurchaseRequest\x1a\x1d.bytebase.v1.PurchaseResponse\"B\x8a\xea0\x16bb.subscription.manage\x90\xea0\x01\x82\xd3\xe4\x93\x02\x1e:\x01*\"\x19/v1/subscription:purchase\x12\x9d\x01\n" +"\x0eUpdatePurchase\x12\".bytebase.v1.UpdatePurchaseRequest\x1a\x1d.bytebase.v1.PurchaseResponse\"H\x8a\xea0\x16bb.subscription.manage\x90\xea0\x01\x82\xd3\xe4\x93\x02$:\x01*\"\x1f/v1/subscription:updatePurchase\x12\x9d\x01\n" +@@ -1791,7 +1831,7 @@ func file_v1_subscription_service_proto_rawDescGZIP() []byte {}var file_v1_subscription_service_proto_enumTypes = make([]protoimpl.EnumInfo, 5)-var file_v1_subscription_service_proto_msgTypes = make([]protoimpl.MessageInfo, 19)+var file_v1_subscription_service_proto_msgTypes = make([]protoimpl.MessageInfo, 20)var file_v1_subscription_service_proto_goTypes = []any{(BillingInterval)(0), // 0: bytebase.v1.BillingInterval(PlanType)(0), // 1: bytebase.v1.PlanType@@ -1799,25 +1839,27 @@ var file_v1_subscription_service_proto_goTypes = []any{(PurchasePlanAdditional_Type)(0), // 3: bytebase.v1.PurchasePlanAdditional.Type(PurchaseDiscount_Type)(0), // 4: bytebase.v1.PurchaseDiscount.Type(*GetSubscriptionRequest)(nil), // 5: bytebase.v1.GetSubscriptionRequest- (*UploadLicenseRequest)(nil), // 6: bytebase.v1.UploadLicenseRequest- (*CreatePurchaseRequest)(nil), // 7: bytebase.v1.CreatePurchaseRequest- (*PurchaseResponse)(nil), // 8: bytebase.v1.PurchaseResponse- (*VerifyCheckoutSessionRequest)(nil), // 9: bytebase.v1.VerifyCheckoutSessionRequest- (*VerifyCheckoutSessionResponse)(nil), // 10: bytebase.v1.VerifyCheckoutSessionResponse- (*UpdatePurchaseRequest)(nil), // 11: bytebase.v1.UpdatePurchaseRequest- (*CancelPurchaseRequest)(nil), // 12: bytebase.v1.CancelPurchaseRequest- (*GetPaymentInfoRequest)(nil), // 13: bytebase.v1.GetPaymentInfoRequest- (*PaymentInfo)(nil), // 14: bytebase.v1.PaymentInfo- (*PurchasePlan)(nil), // 15: bytebase.v1.PurchasePlan- (*PurchasePlanAdditional)(nil), // 16: bytebase.v1.PurchasePlanAdditional- (*PurchaseBillingMethod)(nil), // 17: bytebase.v1.PurchaseBillingMethod- (*PurchaseDiscount)(nil), // 18: bytebase.v1.PurchaseDiscount- (*ListPurchasePlansRequest)(nil), // 19: bytebase.v1.ListPurchasePlansRequest- (*ListPurchasePlansResponse)(nil), // 20: bytebase.v1.ListPurchasePlansResponse- (*Subscription)(nil), // 21: bytebase.v1.Subscription- (*PlanConfig)(nil), // 22: bytebase.v1.PlanConfig- (*PlanLimitConfig)(nil), // 23: bytebase.v1.PlanLimitConfig- (*timestamppb.Timestamp)(nil), // 24: google.protobuf.Timestamp+ (*ExportVCSProviderUsersRequest)(nil), // 6: bytebase.v1.ExportVCSProviderUsersRequest+ (*UploadLicenseRequest)(nil), // 7: bytebase.v1.UploadLicenseRequest+ (*CreatePurchaseRequest)(nil), // 8: bytebase.v1.CreatePurchaseRequest+ (*PurchaseResponse)(nil), // 9: bytebase.v1.PurchaseResponse+ (*VerifyCheckoutSessionRequest)(nil), // 10: bytebase.v1.VerifyCheckoutSessionRequest+ (*VerifyCheckoutSessionResponse)(nil), // 11: bytebase.v1.VerifyCheckoutSessionResponse+ (*UpdatePurchaseRequest)(nil), // 12: bytebase.v1.UpdatePurchaseRequest+ (*CancelPurchaseRequest)(nil), // 13: bytebase.v1.CancelPurchaseRequest+ (*GetPaymentInfoRequest)(nil), // 14: bytebase.v1.GetPaymentInfoRequest+ (*PaymentInfo)(nil), // 15: bytebase.v1.PaymentInfo+ (*PurchasePlan)(nil), // 16: bytebase.v1.PurchasePlan+ (*PurchasePlanAdditional)(nil), // 17: bytebase.v1.PurchasePlanAdditional+ (*PurchaseBillingMethod)(nil), // 18: bytebase.v1.PurchaseBillingMethod+ (*PurchaseDiscount)(nil), // 19: bytebase.v1.PurchaseDiscount+ (*ListPurchasePlansRequest)(nil), // 20: bytebase.v1.ListPurchasePlansRequest+ (*ListPurchasePlansResponse)(nil), // 21: bytebase.v1.ListPurchasePlansResponse+ (*Subscription)(nil), // 22: bytebase.v1.Subscription+ (*PlanConfig)(nil), // 23: bytebase.v1.PlanConfig+ (*PlanLimitConfig)(nil), // 24: bytebase.v1.PlanLimitConfig+ (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp+ (*httpbody.HttpBody)(nil), // 26: google.api.HttpBody}var file_v1_subscription_service_proto_depIdxs = []int32{1, // 0: bytebase.v1.CreatePurchaseRequest.plan:type_name -> bytebase.v1.PlanType@@ -1825,37 +1867,39 @@ var file_v1_subscription_service_proto_depIdxs = []int32{1, // 2: bytebase.v1.UpdatePurchaseRequest.plan:type_name -> bytebase.v1.PlanType0, // 3: bytebase.v1.UpdatePurchaseRequest.interval:type_name -> bytebase.v1.BillingInterval1, // 4: bytebase.v1.PurchasePlan.type:type_name -> bytebase.v1.PlanType- 16, // 5: bytebase.v1.PurchasePlan.additionals:type_name -> bytebase.v1.PurchasePlanAdditional- 17, // 6: bytebase.v1.PurchasePlan.billing_methods:type_name -> bytebase.v1.PurchaseBillingMethod+ 17, // 5: bytebase.v1.PurchasePlan.additionals:type_name -> bytebase.v1.PurchasePlanAdditional+ 18, // 6: bytebase.v1.PurchasePlan.billing_methods:type_name -> bytebase.v1.PurchaseBillingMethod3, // 7: bytebase.v1.PurchasePlanAdditional.type:type_name -> bytebase.v1.PurchasePlanAdditional.Type0, // 8: bytebase.v1.PurchaseBillingMethod.interval:type_name -> bytebase.v1.BillingInterval- 18, // 9: bytebase.v1.PurchaseBillingMethod.discount:type_name -> bytebase.v1.PurchaseDiscount+ 19, // 9: bytebase.v1.PurchaseBillingMethod.discount:type_name -> bytebase.v1.PurchaseDiscount4, // 10: bytebase.v1.PurchaseDiscount.type:type_name -> bytebase.v1.PurchaseDiscount.Type- 15, // 11: bytebase.v1.ListPurchasePlansResponse.plans:type_name -> bytebase.v1.PurchasePlan+ 16, // 11: bytebase.v1.ListPurchasePlansResponse.plans:type_name -> bytebase.v1.PurchasePlan1, // 12: bytebase.v1.Subscription.plan:type_name -> bytebase.v1.PlanType- 24, // 13: bytebase.v1.Subscription.expires_time:type_name -> google.protobuf.Timestamp- 23, // 14: bytebase.v1.PlanConfig.plans:type_name -> bytebase.v1.PlanLimitConfig+ 25, // 13: bytebase.v1.Subscription.expires_time:type_name -> google.protobuf.Timestamp+ 24, // 14: bytebase.v1.PlanConfig.plans:type_name -> bytebase.v1.PlanLimitConfig2, // 15: bytebase.v1.PlanConfig.instance_features:type_name -> bytebase.v1.PlanFeature1, // 16: bytebase.v1.PlanLimitConfig.type:type_name -> bytebase.v1.PlanType2, // 17: bytebase.v1.PlanLimitConfig.features:type_name -> bytebase.v1.PlanFeature5, // 18: bytebase.v1.SubscriptionService.GetSubscription:input_type -> bytebase.v1.GetSubscriptionRequest- 6, // 19: bytebase.v1.SubscriptionService.UploadLicense:input_type -> bytebase.v1.UploadLicenseRequest- 7, // 20: bytebase.v1.SubscriptionService.CreatePurchase:input_type -> bytebase.v1.CreatePurchaseRequest- 11, // 21: bytebase.v1.SubscriptionService.UpdatePurchase:input_type -> bytebase.v1.UpdatePurchaseRequest- 12, // 22: bytebase.v1.SubscriptionService.CancelPurchase:input_type -> bytebase.v1.CancelPurchaseRequest- 13, // 23: bytebase.v1.SubscriptionService.GetPaymentInfo:input_type -> bytebase.v1.GetPaymentInfoRequest- 9, // 24: bytebase.v1.SubscriptionService.VerifyCheckoutSession:input_type -> bytebase.v1.VerifyCheckoutSessionRequest- 19, // 25: bytebase.v1.SubscriptionService.ListPurchasePlans:input_type -> bytebase.v1.ListPurchasePlansRequest- 21, // 26: bytebase.v1.SubscriptionService.GetSubscription:output_type -> bytebase.v1.Subscription- 21, // 27: bytebase.v1.SubscriptionService.UploadLicense:output_type -> bytebase.v1.Subscription- 8, // 28: bytebase.v1.SubscriptionService.CreatePurchase:output_type -> bytebase.v1.PurchaseResponse- 8, // 29: bytebase.v1.SubscriptionService.UpdatePurchase:output_type -> bytebase.v1.PurchaseResponse- 8, // 30: bytebase.v1.SubscriptionService.CancelPurchase:output_type -> bytebase.v1.PurchaseResponse- 14, // 31: bytebase.v1.SubscriptionService.GetPaymentInfo:output_type -> bytebase.v1.PaymentInfo- 10, // 32: bytebase.v1.SubscriptionService.VerifyCheckoutSession:output_type -> bytebase.v1.VerifyCheckoutSessionResponse- 20, // 33: bytebase.v1.SubscriptionService.ListPurchasePlans:output_type -> bytebase.v1.ListPurchasePlansResponse- 26, // [26:34] is the sub-list for method output_type- 18, // [18:26] is the sub-list for method input_type+ 6, // 19: bytebase.v1.SubscriptionService.ExportVCSProviderUsers:input_type -> bytebase.v1.ExportVCSProviderUsersRequest+ 7, // 20: bytebase.v1.SubscriptionService.UploadLicense:input_type -> bytebase.v1.UploadLicenseRequest+ 8, // 21: bytebase.v1.SubscriptionService.CreatePurchase:input_type -> bytebase.v1.CreatePurchaseRequest+ 12, // 22: bytebase.v1.SubscriptionService.UpdatePurchase:input_type -> bytebase.v1.UpdatePurchaseRequest+ 13, // 23: bytebase.v1.SubscriptionService.CancelPurchase:input_type -> bytebase.v1.CancelPurchaseRequest+ 14, // 24: bytebase.v1.SubscriptionService.GetPaymentInfo:input_type -> bytebase.v1.GetPaymentInfoRequest+ 10, // 25: bytebase.v1.SubscriptionService.VerifyCheckoutSession:input_type -> bytebase.v1.VerifyCheckoutSessionRequest+ 20, // 26: bytebase.v1.SubscriptionService.ListPurchasePlans:input_type -> bytebase.v1.ListPurchasePlansRequest+ 22, // 27: bytebase.v1.SubscriptionService.GetSubscription:output_type -> bytebase.v1.Subscription+ 26, // 28: bytebase.v1.SubscriptionService.ExportVCSProviderUsers:output_type -> google.api.HttpBody+ 22, // 29: bytebase.v1.SubscriptionService.UploadLicense:output_type -> bytebase.v1.Subscription+ 9, // 30: bytebase.v1.SubscriptionService.CreatePurchase:output_type -> bytebase.v1.PurchaseResponse+ 9, // 31: bytebase.v1.SubscriptionService.UpdatePurchase:output_type -> bytebase.v1.PurchaseResponse+ 9, // 32: bytebase.v1.SubscriptionService.CancelPurchase:output_type -> bytebase.v1.PurchaseResponse+ 15, // 33: bytebase.v1.SubscriptionService.GetPaymentInfo:output_type -> bytebase.v1.PaymentInfo+ 11, // 34: bytebase.v1.SubscriptionService.VerifyCheckoutSession:output_type -> bytebase.v1.VerifyCheckoutSessionResponse+ 21, // 35: bytebase.v1.SubscriptionService.ListPurchasePlans:output_type -> bytebase.v1.ListPurchasePlansResponse+ 27, // [27:36] is the sub-list for method output_type+ 18, // [18:27] is the sub-list for method input_type18, // [18:18] is the sub-list for extension type_name18, // [18:18] is the sub-list for extension extendee0, // [0:18] is the sub-list for field type_name@@ -1873,7 +1917,7 @@ func file_v1_subscription_service_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_subscription_service_proto_rawDesc), len(file_v1_subscription_service_proto_rawDesc)),NumEnums: 5,- NumMessages: 19,+ NumMessages: 20,NumExtensions: 0,NumServices: 1,},diff --git a/backend/generated-go/v1/subscription_service.pb.gw.go b/backend/generated-go/v1/subscription_service.pb.gw.goindex ab94da9f2f..0076885b59 100644--- a/backend/generated-go/v1/subscription_service.pb.gw.go+++ b/backend/generated-go/v1/subscription_service.pb.gw.go@@ -56,6 +56,27 @@ func local_request_SubscriptionService_GetSubscription_0(ctx context.Context, mareturn msg, metadata, err}+func request_SubscriptionService_ExportVCSProviderUsers_0(ctx context.Context, marshaler runtime.Marshaler, client SubscriptionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var (+ protoReq ExportVCSProviderUsersRequest+ metadata runtime.ServerMetadata+ )+ if req.Body != nil {+ _, _ = io.Copy(io.Discard, req.Body)+ }+ msg, err := client.ExportVCSProviderUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err+}++func local_request_SubscriptionService_ExportVCSProviderUsers_0(ctx context.Context, marshaler runtime.Marshaler, server SubscriptionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var (+ protoReq ExportVCSProviderUsersRequest+ metadata runtime.ServerMetadata+ )+ msg, err := server.ExportVCSProviderUsers(ctx, &protoReq)+ return msg, metadata, err+}+func request_SubscriptionService_UploadLicense_0(ctx context.Context, marshaler runtime.Marshaler, client SubscriptionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {var (protoReq UploadLicenseRequest@@ -271,6 +292,26 @@ func RegisterSubscriptionServiceHandlerServer(ctx context.Context, mux *runtime.}forward_SubscriptionService_GetSubscription_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)})+ mux.Handle(http.MethodGet, pattern_SubscriptionService_ExportVCSProviderUsers_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.SubscriptionService/ExportVCSProviderUsers", runtime.WithHTTPPathPattern("/v1/subscription:vcsProviderUsersExport"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_SubscriptionService_ExportVCSProviderUsers_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_SubscriptionService_ExportVCSProviderUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)+ })mux.Handle(http.MethodPatch, pattern_SubscriptionService_UploadLicense_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()@@ -468,6 +509,23 @@ func RegisterSubscriptionServiceHandlerClient(ctx context.Context, mux *runtime.}forward_SubscriptionService_GetSubscription_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)})+ mux.Handle(http.MethodGet, pattern_SubscriptionService_ExportVCSProviderUsers_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.SubscriptionService/ExportVCSProviderUsers", runtime.WithHTTPPathPattern("/v1/subscription:vcsProviderUsersExport"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_SubscriptionService_ExportVCSProviderUsers_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }+ forward_SubscriptionService_ExportVCSProviderUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)+ })mux.Handle(http.MethodPatch, pattern_SubscriptionService_UploadLicense_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()@@ -591,23 +649,25 @@ func RegisterSubscriptionServiceHandlerClient(ctx context.Context, mux *runtime.}var (- pattern_SubscriptionService_GetSubscription_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, ""))- pattern_SubscriptionService_UploadLicense_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "subscription", "license"}, ""))- pattern_SubscriptionService_CreatePurchase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, "purchase"))- pattern_SubscriptionService_UpdatePurchase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, "updatePurchase"))- pattern_SubscriptionService_CancelPurchase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, "cancelPurchase"))- pattern_SubscriptionService_GetPaymentInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "subscription", "paymentInfo"}, ""))- pattern_SubscriptionService_VerifyCheckoutSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "subscription", "checkoutSession", "session_id"}, ""))- pattern_SubscriptionService_ListPurchasePlans_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "subscription", "plans"}, ""))+ pattern_SubscriptionService_GetSubscription_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, ""))+ pattern_SubscriptionService_ExportVCSProviderUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, "vcsProviderUsersExport"))+ pattern_SubscriptionService_UploadLicense_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "subscription", "license"}, ""))+ pattern_SubscriptionService_CreatePurchase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, "purchase"))+ pattern_SubscriptionService_UpdatePurchase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, "updatePurchase"))+ pattern_SubscriptionService_CancelPurchase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, "cancelPurchase"))+ pattern_SubscriptionService_GetPaymentInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "subscription", "paymentInfo"}, ""))+ pattern_SubscriptionService_VerifyCheckoutSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "subscription", "checkoutSession", "session_id"}, ""))+ pattern_SubscriptionService_ListPurchasePlans_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "subscription", "plans"}, "")))var (- forward_SubscriptionService_GetSubscription_0 = runtime.ForwardResponseMessage- forward_SubscriptionService_UploadLicense_0 = runtime.ForwardResponseMessage- forward_SubscriptionService_CreatePurchase_0 = runtime.ForwardResponseMessage- forward_SubscriptionService_UpdatePurchase_0 = runtime.ForwardResponseMessage- forward_SubscriptionService_CancelPurchase_0 = runtime.ForwardResponseMessage- forward_SubscriptionService_GetPaymentInfo_0 = runtime.ForwardResponseMessage- forward_SubscriptionService_VerifyCheckoutSession_0 = runtime.ForwardResponseMessage- forward_SubscriptionService_ListPurchasePlans_0 = runtime.ForwardResponseMessage+ forward_SubscriptionService_GetSubscription_0 = runtime.ForwardResponseMessage+ forward_SubscriptionService_ExportVCSProviderUsers_0 = runtime.ForwardResponseMessage+ forward_SubscriptionService_UploadLicense_0 = runtime.ForwardResponseMessage+ forward_SubscriptionService_CreatePurchase_0 = runtime.ForwardResponseMessage+ forward_SubscriptionService_UpdatePurchase_0 = runtime.ForwardResponseMessage+ forward_SubscriptionService_CancelPurchase_0 = runtime.ForwardResponseMessage+ forward_SubscriptionService_GetPaymentInfo_0 = runtime.ForwardResponseMessage+ forward_SubscriptionService_VerifyCheckoutSession_0 = runtime.ForwardResponseMessage+ forward_SubscriptionService_ListPurchasePlans_0 = runtime.ForwardResponseMessage)diff --git a/backend/generated-go/v1/subscription_service_equal.pb.go b/backend/generated-go/v1/subscription_service_equal.pb.goindex b2ff63cbd6..fffa9bdbba 100644--- a/backend/generated-go/v1/subscription_service_equal.pb.go+++ b/backend/generated-go/v1/subscription_service_equal.pb.go@@ -13,6 +13,16 @@ func (x *GetSubscriptionRequest) Equal(y *GetSubscriptionRequest) bool {return true}+func (x *ExportVCSProviderUsersRequest) Equal(y *ExportVCSProviderUsersRequest) bool {+ if x == y {+ return true+ }+ if x == nil || y == nil {+ return x == nil && y == nil+ }+ return true+}+func (x *UploadLicenseRequest) Equal(y *UploadLicenseRequest) bool {if x == y {return truediff --git a/backend/generated-go/v1/subscription_service_grpc.pb.go b/backend/generated-go/v1/subscription_service_grpc.pb.goindex ce7c25fc42..ccd45606db 100644--- a/backend/generated-go/v1/subscription_service_grpc.pb.go+++ b/backend/generated-go/v1/subscription_service_grpc.pb.go@@ -8,6 +8,7 @@ package v1import (context "context"+ httpbody "google.golang.org/genproto/googleapis/api/httpbody"grpc "google.golang.org/grpc"codes "google.golang.org/grpc/codes"status "google.golang.org/grpc/status"@@ -19,14 +20,15 @@ import (const _ = grpc.SupportPackageIsVersion9const (- SubscriptionService_GetSubscription_FullMethodName = "/bytebase.v1.SubscriptionService/GetSubscription"- SubscriptionService_UploadLicense_FullMethodName = "/bytebase.v1.SubscriptionService/UploadLicense"- SubscriptionService_CreatePurchase_FullMethodName = "/bytebase.v1.SubscriptionService/CreatePurchase"- SubscriptionService_UpdatePurchase_FullMethodName = "/bytebase.v1.SubscriptionService/UpdatePurchase"- SubscriptionService_CancelPurchase_FullMethodName = "/bytebase.v1.SubscriptionService/CancelPurchase"- SubscriptionService_GetPaymentInfo_FullMethodName = "/bytebase.v1.SubscriptionService/GetPaymentInfo"- SubscriptionService_VerifyCheckoutSession_FullMethodName = "/bytebase.v1.SubscriptionService/VerifyCheckoutSession"- SubscriptionService_ListPurchasePlans_FullMethodName = "/bytebase.v1.SubscriptionService/ListPurchasePlans"+ SubscriptionService_GetSubscription_FullMethodName = "/bytebase.v1.SubscriptionService/GetSubscription"+ SubscriptionService_ExportVCSProviderUsers_FullMethodName = "/bytebase.v1.SubscriptionService/ExportVCSProviderUsers"+ SubscriptionService_UploadLicense_FullMethodName = "/bytebase.v1.SubscriptionService/UploadLicense"+ SubscriptionService_CreatePurchase_FullMethodName = "/bytebase.v1.SubscriptionService/CreatePurchase"+ SubscriptionService_UpdatePurchase_FullMethodName = "/bytebase.v1.SubscriptionService/UpdatePurchase"+ SubscriptionService_CancelPurchase_FullMethodName = "/bytebase.v1.SubscriptionService/CancelPurchase"+ SubscriptionService_GetPaymentInfo_FullMethodName = "/bytebase.v1.SubscriptionService/GetPaymentInfo"+ SubscriptionService_VerifyCheckoutSession_FullMethodName = "/bytebase.v1.SubscriptionService/VerifyCheckoutSession"+ SubscriptionService_ListPurchasePlans_FullMethodName = "/bytebase.v1.SubscriptionService/ListPurchasePlans")// SubscriptionServiceClient is the client API for SubscriptionService service.@@ -39,6 +41,8 @@ type SubscriptionServiceClient interface {// If there is no license, we will return a free plan subscription without expiration time.// If there is expired license, we will return a free plan subscription with the expiration time of the expired license.GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)+ // Exports active VCS users as CSV.+ ExportVCSProviderUsers(ctx context.Context, in *ExportVCSProviderUsersRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)// Uploads an enterprise license (self-hosted only).UploadLicense(ctx context.Context, in *UploadLicenseRequest, opts ...grpc.CallOption) (*Subscription, error)// CreatePurchase creates a new subscription purchase (SaaS only).@@ -75,6 +79,16 @@ func (c *subscriptionServiceClient) GetSubscription(ctx context.Context, in *Getreturn out, nil}+func (c *subscriptionServiceClient) ExportVCSProviderUsers(ctx context.Context, in *ExportVCSProviderUsersRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error) {+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)+ out := new(httpbody.HttpBody)+ err := c.cc.Invoke(ctx, SubscriptionService_ExportVCSProviderUsers_FullMethodName, in, out, cOpts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}+func (c *subscriptionServiceClient) UploadLicense(ctx context.Context, in *UploadLicenseRequest, opts ...grpc.CallOption) (*Subscription, error) {cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)out := new(Subscription)@@ -155,6 +169,8 @@ type SubscriptionServiceServer interface {// If there is no license, we will return a free plan subscription without expiration time.// If there is expired license, we will return a free plan subscription with the expiration time of the expired license.GetSubscription(context.Context, *GetSubscriptionRequest) (*Subscription, error)+ // Exports active VCS users as CSV.+ ExportVCSProviderUsers(context.Context, *ExportVCSProviderUsersRequest) (*httpbody.HttpBody, error)// Uploads an enterprise license (self-hosted only).UploadLicense(context.Context, *UploadLicenseRequest) (*Subscription, error)// CreatePurchase creates a new subscription purchase (SaaS only).@@ -184,6 +200,9 @@ type UnimplementedSubscriptionServiceServer struct{}func (UnimplementedSubscriptionServiceServer) GetSubscription(context.Context, *GetSubscriptionRequest) (*Subscription, error) {return nil, status.Error(codes.Unimplemented, "method GetSubscription not implemented")}+func (UnimplementedSubscriptionServiceServer) ExportVCSProviderUsers(context.Context, *ExportVCSProviderUsersRequest) (*httpbody.HttpBody, error) {+ return nil, status.Error(codes.Unimplemented, "method ExportVCSProviderUsers not implemented")+}func (UnimplementedSubscriptionServiceServer) UploadLicense(context.Context, *UploadLicenseRequest) (*Subscription, error) {return nil, status.Error(codes.Unimplemented, "method UploadLicense not implemented")}@@ -244,6 +263,24 @@ func _SubscriptionService_GetSubscription_Handler(srv interface{}, ctx context.Creturn interceptor(ctx, in, info, handler)}+func _SubscriptionService_ExportVCSProviderUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(ExportVCSProviderUsersRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(SubscriptionServiceServer).ExportVCSProviderUsers(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: SubscriptionService_ExportVCSProviderUsers_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(SubscriptionServiceServer).ExportVCSProviderUsers(ctx, req.(*ExportVCSProviderUsersRequest))+ }+ return interceptor(ctx, in, info, handler)+}+func _SubscriptionService_UploadLicense_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {in := new(UploadLicenseRequest)if err := dec(in); err != nil {@@ -381,6 +418,10 @@ var SubscriptionService_ServiceDesc = grpc.ServiceDesc{MethodName: "GetSubscription",Handler: _SubscriptionService_GetSubscription_Handler,},+ {+ MethodName: "ExportVCSProviderUsers",+ Handler: _SubscriptionService_ExportVCSProviderUsers_Handler,+ },{MethodName: "UploadLicense",Handler: _SubscriptionService_UploadLicense_Handler,diff --git a/backend/generated-go/v1/v1connect/subscription_service.connect.go b/backend/generated-go/v1/v1connect/subscription_service.connect.goindex 7992c74213..889ebef632 100644--- a/backend/generated-go/v1/v1connect/subscription_service.connect.go+++ b/backend/generated-go/v1/v1connect/subscription_service.connect.go@@ -9,6 +9,7 @@ import (context "context"errors "errors"v1 "github.com/bytebase/bytebase/backend/generated-go/v1"+ httpbody "google.golang.org/genproto/googleapis/api/httpbody"http "net/http"strings "strings")@@ -36,6 +37,9 @@ const (// SubscriptionServiceGetSubscriptionProcedure is the fully-qualified name of the// SubscriptionService's GetSubscription RPC.SubscriptionServiceGetSubscriptionProcedure = "/bytebase.v1.SubscriptionService/GetSubscription"+ // SubscriptionServiceExportVCSProviderUsersProcedure is the fully-qualified name of the+ // SubscriptionService's ExportVCSProviderUsers RPC.+ SubscriptionServiceExportVCSProviderUsersProcedure = "/bytebase.v1.SubscriptionService/ExportVCSProviderUsers"// SubscriptionServiceUploadLicenseProcedure is the fully-qualified name of the// SubscriptionService's UploadLicense RPC.SubscriptionServiceUploadLicenseProcedure = "/bytebase.v1.SubscriptionService/UploadLicense"@@ -65,6 +69,8 @@ type SubscriptionServiceClient interface {// If there is no license, we will return a free plan subscription without expiration time.// If there is expired license, we will return a free plan subscription with the expiration time of the expired license.GetSubscription(context.Context, *connect.Request[v1.GetSubscriptionRequest]) (*connect.Response[v1.Subscription], error)+ // Exports active VCS users as CSV.+ ExportVCSProviderUsers(context.Context, *connect.Request[v1.ExportVCSProviderUsersRequest]) (*connect.Response[httpbody.HttpBody], error)// Uploads an enterprise license (self-hosted only).UploadLicense(context.Context, *connect.Request[v1.UploadLicenseRequest]) (*connect.Response[v1.Subscription], error)// CreatePurchase creates a new subscription purchase (SaaS only).@@ -100,6 +106,12 @@ func NewSubscriptionServiceClient(httpClient connect.HTTPClient, baseURL string,connect.WithSchema(subscriptionServiceMethods.ByName("GetSubscription")),connect.WithClientOptions(opts...),),+ exportVCSProviderUsers: connect.NewClient[v1.ExportVCSProviderUsersRequest, httpbody.HttpBody](+ httpClient,+ baseURL+SubscriptionServiceExportVCSProviderUsersProcedure,+ connect.WithSchema(subscriptionServiceMethods.ByName("ExportVCSProviderUsers")),+ connect.WithClientOptions(opts...),+ ),uploadLicense: connect.NewClient[v1.UploadLicenseRequest, v1.Subscription](httpClient,baseURL+SubscriptionServiceUploadLicenseProcedure,@@ -147,14 +159,15 @@ func NewSubscriptionServiceClient(httpClient connect.HTTPClient, baseURL string,// subscriptionServiceClient implements SubscriptionServiceClient.type subscriptionServiceClient struct {- getSubscription *connect.Client[v1.GetSubscriptionRequest, v1.Subscription]- uploadLicense *connect.Client[v1.UploadLicenseRequest, v1.Subscription]- createPurchase *connect.Client[v1.CreatePurchaseRequest, v1.PurchaseResponse]- updatePurchase *connect.Client[v1.UpdatePurchaseRequest, v1.PurchaseResponse]- cancelPurchase *connect.Client[v1.CancelPurchaseRequest, v1.PurchaseResponse]- getPaymentInfo *connect.Client[v1.GetPaymentInfoRequest, v1.PaymentInfo]- verifyCheckoutSession *connect.Client[v1.VerifyCheckoutSessionRequest, v1.VerifyCheckoutSessionResponse]- listPurchasePlans *connect.Client[v1.ListPurchasePlansRequest, v1.ListPurchasePlansResponse]+ getSubscription *connect.Client[v1.GetSubscriptionRequest, v1.Subscription]+ exportVCSProviderUsers *connect.Client[v1.ExportVCSProviderUsersRequest, httpbody.HttpBody]+ uploadLicense *connect.Client[v1.UploadLicenseRequest, v1.Subscription]+ createPurchase *connect.Client[v1.CreatePurchaseRequest, v1.PurchaseResponse]+ updatePurchase *connect.Client[v1.UpdatePurchaseRequest, v1.PurchaseResponse]+ cancelPurchase *connect.Client[v1.CancelPurchaseRequest, v1.PurchaseResponse]+ getPaymentInfo *connect.Client[v1.GetPaymentInfoRequest, v1.PaymentInfo]+ verifyCheckoutSession *connect.Client[v1.VerifyCheckoutSessionRequest, v1.VerifyCheckoutSessionResponse]+ listPurchasePlans *connect.Client[v1.ListPurchasePlansRequest, v1.ListPurchasePlansResponse]}// GetSubscription calls bytebase.v1.SubscriptionService.GetSubscription.@@ -162,6 +175,11 @@ func (c *subscriptionServiceClient) GetSubscription(ctx context.Context, req *coreturn c.getSubscription.CallUnary(ctx, req)}+// ExportVCSProviderUsers calls bytebase.v1.SubscriptionService.ExportVCSProviderUsers.+func (c *subscriptionServiceClient) ExportVCSProviderUsers(ctx context.Context, req *connect.Request[v1.ExportVCSProviderUsersRequest]) (*connect.Response[httpbody.HttpBody], error) {+ return c.exportVCSProviderUsers.CallUnary(ctx, req)+}+// UploadLicense calls bytebase.v1.SubscriptionService.UploadLicense.func (c *subscriptionServiceClient) UploadLicense(ctx context.Context, req *connect.Request[v1.UploadLicenseRequest]) (*connect.Response[v1.Subscription], error) {return c.uploadLicense.CallUnary(ctx, req)@@ -203,6 +221,8 @@ type SubscriptionServiceHandler interface {// If there is no license, we will return a free plan subscription without expiration time.// If there is expired license, we will return a free plan subscription with the expiration time of the expired license.GetSubscription(context.Context, *connect.Request[v1.GetSubscriptionRequest]) (*connect.Response[v1.Subscription], error)+ // Exports active VCS users as CSV.+ ExportVCSProviderUsers(context.Context, *connect.Request[v1.ExportVCSProviderUsersRequest]) (*connect.Response[httpbody.HttpBody], error)// Uploads an enterprise license (self-hosted only).UploadLicense(context.Context, *connect.Request[v1.UploadLicenseRequest]) (*connect.Response[v1.Subscription], error)// CreatePurchase creates a new subscription purchase (SaaS only).@@ -234,6 +254,12 @@ func NewSubscriptionServiceHandler(svc SubscriptionServiceHandler, opts ...conneconnect.WithSchema(subscriptionServiceMethods.ByName("GetSubscription")),connect.WithHandlerOptions(opts...),)+ subscriptionServiceExportVCSProviderUsersHandler := connect.NewUnaryHandler(+ SubscriptionServiceExportVCSProviderUsersProcedure,+ svc.ExportVCSProviderUsers,+ connect.WithSchema(subscriptionServiceMethods.ByName("ExportVCSProviderUsers")),+ connect.WithHandlerOptions(opts...),+ )subscriptionServiceUploadLicenseHandler := connect.NewUnaryHandler(SubscriptionServiceUploadLicenseProcedure,svc.UploadLicense,@@ -280,6 +306,8 @@ func NewSubscriptionServiceHandler(svc SubscriptionServiceHandler, opts ...conneswitch r.URL.Path {case SubscriptionServiceGetSubscriptionProcedure:subscriptionServiceGetSubscriptionHandler.ServeHTTP(w, r)+ case SubscriptionServiceExportVCSProviderUsersProcedure:+ subscriptionServiceExportVCSProviderUsersHandler.ServeHTTP(w, r)case SubscriptionServiceUploadLicenseProcedure:subscriptionServiceUploadLicenseHandler.ServeHTTP(w, r)case SubscriptionServiceCreatePurchaseProcedure:@@ -307,6 +335,10 @@ func (UnimplementedSubscriptionServiceHandler) GetSubscription(context.Context,return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.SubscriptionService.GetSubscription is not implemented"))}+func (UnimplementedSubscriptionServiceHandler) ExportVCSProviderUsers(context.Context, *connect.Request[v1.ExportVCSProviderUsersRequest]) (*connect.Response[httpbody.HttpBody], error) {+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.SubscriptionService.ExportVCSProviderUsers is not implemented"))+}+func (UnimplementedSubscriptionServiceHandler) UploadLicense(context.Context, *connect.Request[v1.UploadLicenseRequest]) (*connect.Response[v1.Subscription], error) {return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.SubscriptionService.UploadLicense is not implemented"))}diff --git a/backend/migrator/migration/3.19/0000##vcs_provider_user.sql b/backend/migrator/migration/3.19/0000##vcs_provider_user.sqlnew file mode 100644index 0000000000..ac5c990498--- /dev/null+++ b/backend/migrator/migration/3.19/0000##vcs_provider_user.sql@@ -0,0 +1,14 @@+CREATE TABLE vcs_provider_user (+ workspace text NOT NULL REFERENCES workspace(resource_id),+ vcs_type text NOT NULL,+ user_id text NOT NULL,+ last_seen_at timestamptz NOT NULL DEFAULT now(),+ payload jsonb NOT NULL DEFAULT '{}',+ PRIMARY KEY (workspace, vcs_type, user_id)+);++CREATE INDEX idx_vcs_provider_user_workspace_last_seen_at+ ON vcs_provider_user(workspace, last_seen_at DESC);++CREATE INDEX idx_vcs_provider_user_last_seen_at+ ON vcs_provider_user(last_seen_at);diff --git a/backend/migrator/migration/LATEST.sql b/backend/migrator/migration/LATEST.sqlindex d0f65cc864..316a82bb69 100644--- a/backend/migrator/migration/LATEST.sql+++ b/backend/migrator/migration/LATEST.sql@@ -25,6 +25,21 @@ CREATE TABLE subscription (updated_at timestamptz NOT NULL DEFAULT now());+CREATE TABLE vcs_provider_user (+ workspace text NOT NULL REFERENCES workspace(resource_id),+ vcs_type text NOT NULL,+ user_id text NOT NULL,+ last_seen_at timestamptz NOT NULL DEFAULT now(),+ payload jsonb NOT NULL DEFAULT '{}',+ PRIMARY KEY (workspace, vcs_type, user_id)+);++CREATE INDEX idx_vcs_provider_user_workspace_last_seen_at+ ON vcs_provider_user(workspace, last_seen_at DESC);++CREATE INDEX idx_vcs_provider_user_last_seen_at+ ON vcs_provider_user(last_seen_at);+CREATE TABLE principal (id serial PRIMARY KEY,deleted boolean NOT NULL DEFAULT FALSE,diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.goindex 42850e8dbe..ad8f94551d 100644--- a/backend/migrator/migrator_test.go+++ b/backend/migrator/migrator_test.go@@ -15,8 +15,8 @@ import (func TestLatestVersion(t *testing.T) {files, err := getSortedVersionedFiles()require.NoError(t, err)- require.Equal(t, semver.MustParse("3.18.2"), *files[len(files)-1].version)- require.Equal(t, "migration/3.18/0002##oauth2_workspace_on_token.sql", files[len(files)-1].path)+ require.Equal(t, semver.MustParse("3.19.0"), *files[len(files)-1].version)+ require.Equal(t, "migration/3.19/0000##vcs_provider_user.sql", files[len(files)-1].path)}func TestVersionUnique(t *testing.T) {diff --git a/backend/runner/cleaner/data_cleaner.go b/backend/runner/cleaner/data_cleaner.goindex 054bc0b31d..b5ba2db7fa 100644--- a/backend/runner/cleaner/data_cleaner.go+++ b/backend/runner/cleaner/data_cleaner.go@@ -81,6 +81,7 @@ func (c *DataCleaner) cleanup(ctx context.Context) {c.cleanupWebRefreshTokens(ctx)c.cleanupEmailVerificationCodes(ctx)c.cleanupStaleHeartbeats(ctx)+ c.cleanupExpiredVCSProviderUsers(ctx)}func (c *DataCleaner) detectStaleTaskRuns(ctx context.Context) {@@ -127,6 +128,17 @@ func (c *DataCleaner) cleanupExportArchives(ctx context.Context) {}}+func (c *DataCleaner) cleanupExpiredVCSProviderUsers(ctx context.Context) {+ rowsAffected, err := c.store.DeleteExpiredVCSProviderUsers(ctx, store.VCSProviderUserActiveWindow)+ if err != nil {+ slog.Error("Failed to clean up expired VCS provider users", log.BBError(err))+ return+ }+ if rowsAffected > 0 {+ slog.Info("Cleaned up expired VCS provider users", slog.Int64("count", rowsAffected))+ }+}+func (c *DataCleaner) cleanupOAuth2Data(ctx context.Context) {// Clean up expired authorization codesif rowsAffected, err := c.store.DeleteExpiredOAuth2AuthorizationCodes(ctx); err != nil {diff --git a/backend/server/grpc_routes.go b/backend/server/grpc_routes.goindex dbdd474345..dc535ce4ff 100644--- a/backend/server/grpc_routes.go+++ b/backend/server/grpc_routes.go@@ -54,12 +54,15 @@ func configureGrpcRouters() error {// Note: the gateway response modifier takes the token duration on server startup. If the value is changed,// the user has to restart the server to take the latest value.- mux := grpcruntime.NewServeMux(- grpcruntime.WithMarshalerOption(grpcruntime.MIMEWildcard, newSuggestingMarshaler(&grpcruntime.JSONPb{+ gatewayMarshaler := &grpcruntime.HTTPBodyMarshaler{+ Marshaler: newSuggestingMarshaler(&grpcruntime.JSONPb{MarshalOptions: protojson.MarshalOptions{},//nolint:forbidigoUnmarshalOptions: protojson.UnmarshalOptions{},- })),+ }),+ }+ mux := grpcruntime.NewServeMux(+ grpcruntime.WithMarshalerOption(grpcruntime.MIMEWildcard, gatewayMarshaler),// pass through request headers that need to be used by connect rpc handlers.grpcruntime.WithIncomingHeaderMatcher(func(key string) (string, bool) {switch strings.ToLower(key) {@@ -104,7 +107,7 @@ func configureGrpcRouters(orgPolicyService := apiv1.NewOrgPolicyService(stores, licenseService, iamManager)planService := apiv1.NewPlanService(stores, bus, iamManager, webhookManager, licenseService)projectService := apiv1.NewProjectService(stores, profile, iamManager)- releaseService := apiv1.NewReleaseService(stores, sheetManager, dbFactory)+ releaseService := apiv1.NewReleaseService(stores, sheetManager, dbFactory, licenseService)reviewConfigService := apiv1.NewReviewConfigService(stores)revisionService := apiv1.NewRevisionService(stores)roleService := apiv1.NewRoleService(stores, iamManager, licenseService)diff --git a/backend/store/advisory_lock.go b/backend/store/advisory_lock.goindex f655708ca6..7220a64196 100644--- a/backend/store/advisory_lock.go+++ b/backend/store/advisory_lock.go@@ -19,6 +19,9 @@ const (// AdvisoryLockKeySchemaSyncer is used by the schema syncer to ensure only// one replica runs periodic schema sync at a time.AdvisoryLockKeySchemaSyncer AdvisoryLockKey = 1003+ // AdvisoryLockKeyVCSProviderUser is used as the namespace for active VCS+ // provider user limit checks and upserts.+ AdvisoryLockKeyVCSProviderUser AdvisoryLockKey = 1004)// AdvisoryLock holds a dedicated connection for a session-level advisory lock.@@ -61,6 +64,34 @@ func TryAdvisoryXactLock(ctx context.Context, tx *sql.Tx, key AdvisoryLockKey) (return acquired, nil}+// TryAdvisoryXactLockWithStringKey attempts to acquire a transaction-level+// advisory lock scoped by namespace and string key. Returns true if acquired,+// false if already held by another transaction. The lock is automatically+// released when the transaction ends.+func TryAdvisoryXactLockWithStringKey(ctx context.Context, tx *sql.Tx, namespace AdvisoryLockKey, key string) (bool, error) {+ var acquired bool+ if err := tx.QueryRowContext(ctx, "SELECT pg_try_advisory_xact_lock($1, hashtext($2))", int32(namespace), key).Scan(&acquired); err != nil {+ return false, err+ }+ return acquired, nil+}++// AcquireAdvisoryXactLock acquires a transaction-level advisory lock, blocking+// until the lock is available. The lock is automatically released when the+// transaction ends.+func AcquireAdvisoryXactLock(ctx context.Context, tx *sql.Tx, key AdvisoryLockKey) error {+ _, err := tx.ExecContext(ctx, "SELECT pg_advisory_xact_lock($1)", int64(key))+ return err+}++// AcquireAdvisoryXactLockWithStringKey acquires a transaction-level advisory+// lock scoped by namespace and string key, blocking until the lock is available.+// The lock is automatically released when the transaction ends.+func AcquireAdvisoryXactLockWithStringKey(ctx context.Context, tx *sql.Tx, namespace AdvisoryLockKey, key string) error {+ _, err := tx.ExecContext(ctx, "SELECT pg_advisory_xact_lock($1, hashtext($2))", int32(namespace), key)+ return err+}+// Release releases the advisory lock and returns the connection to the pool.// Uses context.Background() to ensure cleanup completes even if parent ctx is cancelled.func (l *AdvisoryLock) Release() error {diff --git a/backend/store/advisory_lock_test.go b/backend/store/advisory_lock_test.gonew file mode 100644index 0000000000..bcf5ad545d--- /dev/null+++ b/backend/store/advisory_lock_test.go@@ -0,0 +1,40 @@+package store_test++import (+ "context"+ "testing"++ "github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/backend/common/testcontainer"+ "github.com/bytebase/bytebase/backend/store"+)++func TestTryAdvisoryXactLockWithStringKeyScopesByKey(t *testing.T) {+ ctx := context.Background()+ container := testcontainer.GetTestPgContainer(ctx, t)+ t.Cleanup(func() { container.Close(ctx) })++ db := container.GetDB()+ tx1, err := db.BeginTx(ctx, nil)+ require.NoError(t, err)+ defer tx1.Rollback()+ tx2, err := db.BeginTx(ctx, nil)+ require.NoError(t, err)+ defer tx2.Rollback()+ tx3, err := db.BeginTx(ctx, nil)+ require.NoError(t, err)+ defer tx3.Rollback()++ acquired, err := store.TryAdvisoryXactLockWithStringKey(ctx, tx1, store.AdvisoryLockKeyVCSProviderUser, "workspace-a")+ require.NoError(t, err)+ require.True(t, acquired)++ acquired, err = store.TryAdvisoryXactLockWithStringKey(ctx, tx2, store.AdvisoryLockKeyVCSProviderUser, "workspace-a")+ require.NoError(t, err)+ require.False(t, acquired)++ acquired, err = store.TryAdvisoryXactLockWithStringKey(ctx, tx3, store.AdvisoryLockKeyVCSProviderUser, "workspace-b")+ require.NoError(t, err)+ require.True(t, acquired)+}diff --git a/backend/store/vcs_provider_user.go b/backend/store/vcs_provider_user.gonew file mode 100644index 0000000000..10c9468d63--- /dev/null+++ b/backend/store/vcs_provider_user.go@@ -0,0 +1,198 @@+package store++import (+ "context"+ "database/sql"+ "time"++ "github.com/pkg/errors"+ "google.golang.org/protobuf/encoding/protojson"++ "github.com/bytebase/bytebase/backend/common"+ storepb "github.com/bytebase/bytebase/backend/generated-go/store"+ v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"+)++const (+ // VCSProviderUserActiveWindow is the period in which a VCS provider user+ // counts toward license usage.+ VCSProviderUserActiveWindow = 90 * 24 * time.Hour++ countActiveVCSProviderUsersSQL = `+ SELECT COUNT(*)+ FROM vcs_provider_user+ WHERE workspace = $1+ AND last_seen_at >= now() - make_interval(secs => $2)+ `+)++// VCSProviderUserMessage is the store message for a VCS provider user.+type VCSProviderUserMessage struct {+ Workspace string+ VCSType v1pb.VCSType+ UserID string+ LastSeenAt time.Time+ Payload *storepb.VCSProviderUserPayload+}++// CountActiveVCSProviderUsers counts active VCS provider users in the workspace.+func (s *Store) CountActiveVCSProviderUsers(ctx context.Context, workspace string, activeWindow time.Duration) (int, error) {+ var count int+ if err := s.GetDB().QueryRowContext(ctx, countActiveVCSProviderUsersSQL, workspace, activeWindow.Seconds()).Scan(&count); err != nil {+ return 0, errors.Wrapf(err, "failed to count active VCS provider users")+ }+ return count, nil+}++// TouchVCSProviderUser refreshes an active VCS provider user, or inserts/reactivates+// one when doing so would not exceed the active user limit.+func (s *Store) TouchVCSProviderUser(ctx context.Context, workspace string, user *VCSProviderUserMessage, activeWindow time.Duration, limit int) (bool, error) {+ payload := user.Payload+ if payload == nil {+ payload = &storepb.VCSProviderUserPayload{}+ }+ payloadBytes, err := protojson.Marshal(payload)+ if err != nil {+ return false, errors.Wrapf(err, "failed to marshal VCS provider user payload")+ }++ vcsType := user.VCSType.String()+ var refreshed bool+ if err := s.GetDB().QueryRowContext(ctx, `+ UPDATE vcs_provider_user+ SET last_seen_at = now(), payload = $4+ WHERE workspace = $1 AND vcs_type = $2 AND user_id = $3+ AND last_seen_at >= now() - make_interval(secs => $5)+ RETURNING true+ `, workspace, vcsType, user.UserID, payloadBytes, activeWindow.Seconds()).Scan(&refreshed); err != nil {+ if err != sql.ErrNoRows {+ return false, errors.Wrapf(err, "failed to update active VCS provider user")+ }+ } else {+ return true, nil+ }++ tx, err := s.GetDB().BeginTx(ctx, nil)+ if err != nil {+ return false, errors.Wrapf(err, "failed to begin transaction")+ }+ defer tx.Rollback()++ if err := AcquireAdvisoryXactLockWithStringKey(ctx, tx, AdvisoryLockKeyVCSProviderUser, workspace); err != nil {+ return false, errors.Wrapf(err, "failed to acquire VCS provider user lock")+ }++ var active bool+ if err := tx.QueryRowContext(ctx, `+ SELECT last_seen_at >= now() - make_interval(secs => $4)+ FROM vcs_provider_user+ WHERE workspace = $1 AND vcs_type = $2 AND user_id = $3+ `, workspace, vcsType, user.UserID, activeWindow.Seconds()).Scan(&active); err != nil && err != sql.ErrNoRows {+ return false, errors.Wrapf(err, "failed to get VCS provider user")+ }++ if active {+ if _, err := tx.ExecContext(ctx, `+ UPDATE vcs_provider_user+ SET last_seen_at = now(), payload = $4+ WHERE workspace = $1 AND vcs_type = $2 AND user_id = $3+ `, workspace, vcsType, user.UserID, payloadBytes); err != nil {+ return false, errors.Wrapf(err, "failed to update VCS provider user")+ }+ if err := tx.Commit(); err != nil {+ return false, errors.Wrapf(err, "failed to commit transaction")+ }+ return true, nil+ }++ count, err := countActiveVCSProviderUsersTx(ctx, tx, workspace, activeWindow)+ if err != nil {+ return false, err+ }+ if count >= limit {+ if err := tx.Commit(); err != nil {+ return false, errors.Wrapf(err, "failed to commit transaction")+ }+ return false, nil+ }++ if _, err := tx.ExecContext(ctx, `+ INSERT INTO vcs_provider_user (workspace, vcs_type, user_id, last_seen_at, payload)+ VALUES ($1, $2, $3, now(), $4)+ ON CONFLICT (workspace, vcs_type, user_id) DO UPDATE SET+ last_seen_at = now(),+ payload = EXCLUDED.payload+ `, workspace, vcsType, user.UserID, payloadBytes); err != nil {+ return false, errors.Wrapf(err, "failed to upsert VCS provider user")+ }++ if err := tx.Commit(); err != nil {+ return false, errors.Wrapf(err, "failed to commit transaction")+ }+ return true, nil+}++func countActiveVCSProviderUsersTx(ctx context.Context, tx *sql.Tx, workspace string, activeWindow time.Duration) (int, error) {+ var count int+ if err := tx.QueryRowContext(ctx, countActiveVCSProviderUsersSQL, workspace, activeWindow.Seconds()).Scan(&count); err != nil {+ return 0, errors.Wrapf(err, "failed to count active VCS provider users")+ }+ return count, nil+}++// DeleteExpiredVCSProviderUsers deletes VCS provider users older than the active window.+func (s *Store) DeleteExpiredVCSProviderUsers(ctx context.Context, activeWindow time.Duration) (int64, error) {+ result, err := s.GetDB().ExecContext(ctx, `+ DELETE FROM vcs_provider_user+ WHERE last_seen_at < now() - make_interval(secs => $1)+ `, activeWindow.Seconds())+ if err != nil {+ return 0, errors.Wrapf(err, "failed to delete expired VCS provider users")+ }+ rowsAffected, err := result.RowsAffected()+ if err != nil {+ return 0, errors.Wrapf(err, "failed to get deleted VCS provider user count")+ }+ return rowsAffected, nil+}++// ListActiveVCSProviderUsers lists active VCS provider users in the workspace,+// sorted by most recently seen first.+func (s *Store) ListActiveVCSProviderUsers(ctx context.Context, workspace string, activeWindow time.Duration) ([]*VCSProviderUserMessage, error) {+ rows, err := s.GetDB().QueryContext(ctx, `+ SELECT workspace, vcs_type, user_id, last_seen_at, payload+ FROM vcs_provider_user+ WHERE workspace = $1+ AND last_seen_at >= now() - make_interval(secs => $2)+ ORDER BY last_seen_at DESC+ `, workspace, activeWindow.Seconds())+ if err != nil {+ return nil, errors.Wrapf(err, "failed to list active VCS provider users")+ }+ defer rows.Close()++ var users []*VCSProviderUserMessage+ for rows.Next() {+ user := &VCSProviderUserMessage{+ Payload: &storepb.VCSProviderUserPayload{},+ }+ var vcsType string+ var payload []byte+ if err := rows.Scan(&user.Workspace, &vcsType, &user.UserID, &user.LastSeenAt, &payload); err != nil {+ return nil, errors.Wrapf(err, "failed to scan VCS provider user")+ }+ value, ok := v1pb.VCSType_value[vcsType]+ if !ok {+ return nil, errors.Errorf("unknown VCS type %q", vcsType)+ }+ user.VCSType = v1pb.VCSType(value)+ if err := common.ProtojsonUnmarshaler.Unmarshal(payload, user.Payload); err != nil {+ return nil, errors.Wrapf(err, "failed to unmarshal VCS provider user payload")+ }+ users = append(users, user)+ }+ if err := rows.Err(); err != nil {+ return nil, errors.Wrapf(err, "failed to list active VCS provider users")+ }+ return users, nil+}diff --git a/backend/store/vcs_provider_user_test.go b/backend/store/vcs_provider_user_test.gonew file mode 100644index 0000000000..80d324e0b4--- /dev/null+++ b/backend/store/vcs_provider_user_test.go@@ -0,0 +1,266 @@+package store_test++import (+ "context"+ "database/sql"+ "fmt"+ "testing"+ "time"++ "github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/backend/common/testcontainer"+ storepb "github.com/bytebase/bytebase/backend/generated-go/store"+ v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"+ "github.com/bytebase/bytebase/backend/migrator"+ _ "github.com/bytebase/bytebase/backend/plugin/db/pg"+ "github.com/bytebase/bytebase/backend/store"+)++func TestVCSProviderUserTouchAndCount(t *testing.T) {+ ctx := context.Background()+ s, db := setupVCSProviderUserStore(ctx, t)++ const workspace = "default"+ user := &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITHUB,+ UserID: "1001",+ Payload: &storepb.VCSProviderUserPayload{+ UserName: "alice",+ DisplayName: "Alice",+ },+ }++ ok, err := s.TouchVCSProviderUser(ctx, workspace, user, store.VCSProviderUserActiveWindow, 1)+ require.NoError(t, err)+ require.True(t, ok)++ count, err := s.CountActiveVCSProviderUsers(ctx, workspace, store.VCSProviderUserActiveWindow)+ require.NoError(t, err)+ require.Equal(t, 1, count)++ var agedLastSeenAt time.Time+ require.NoError(t, db.QueryRowContext(ctx, `+ UPDATE vcs_provider_user+ SET last_seen_at = now() - interval '1 hour'+ WHERE workspace = $1 AND vcs_type = $2 AND user_id = $3+ RETURNING last_seen_at+ `, workspace, v1pb.VCSType_GITHUB.String(), "1001").Scan(&agedLastSeenAt))++ ok, err = s.TouchVCSProviderUser(ctx, workspace, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITHUB,+ UserID: "1001",+ Payload: &storepb.VCSProviderUserPayload{+ UserName: "alice2",+ DisplayName: "Alice Cooper",+ },+ }, store.VCSProviderUserActiveWindow, 1)+ require.NoError(t, err)+ require.True(t, ok)++ users, err := s.ListActiveVCSProviderUsers(ctx, workspace, store.VCSProviderUserActiveWindow)+ require.NoError(t, err)+ require.Len(t, users, 1)+ require.Equal(t, workspace, users[0].Workspace)+ require.Equal(t, v1pb.VCSType_GITHUB, users[0].VCSType)+ require.Equal(t, "1001", users[0].UserID)+ require.Equal(t, "alice2", users[0].Payload.GetUserName())+ require.Equal(t, "Alice Cooper", users[0].Payload.GetDisplayName())+ require.Greater(t, users[0].LastSeenAt, agedLastSeenAt)+}++func TestVCSProviderUserInactiveUsersDoNotCountAndLimitRejectionKeepsRows(t *testing.T) {+ ctx := context.Background()+ s, db := setupVCSProviderUserStore(ctx, t)++ const workspace = "default"+ _, err := db.ExecContext(ctx, `+ INSERT INTO vcs_provider_user (workspace, vcs_type, user_id, last_seen_at, payload)+ VALUES+ ($1, $2, 'active-1', now() - interval '1 day', '{"userName":"active"}'::jsonb),+ ($1, $2, 'inactive-1', now() - interval '91 days', '{"userName":"inactive"}'::jsonb)+ `, workspace, v1pb.VCSType_GITHUB.String())+ require.NoError(t, err)++ count, err := s.CountActiveVCSProviderUsers(ctx, workspace, store.VCSProviderUserActiveWindow)+ require.NoError(t, err)+ require.Equal(t, 1, count)++ var inactiveLastSeenAt time.Time+ var inactivePayload string+ require.NoError(t, db.QueryRowContext(ctx, `+ SELECT last_seen_at, payload::text+ FROM vcs_provider_user+ WHERE workspace = $1 AND vcs_type = $2 AND user_id = 'inactive-1'+ `, workspace, v1pb.VCSType_GITHUB.String()).Scan(&inactiveLastSeenAt, &inactivePayload))++ ok, err := s.TouchVCSProviderUser(ctx, workspace, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITHUB,+ UserID: "inactive-1",+ Payload: &storepb.VCSProviderUserPayload{+ UserName: "inactive-updated",+ DisplayName: "Inactive Updated",+ },+ }, store.VCSProviderUserActiveWindow, 1)+ require.NoError(t, err)+ require.False(t, ok)++ var gotInactiveLastSeenAt time.Time+ var gotInactivePayload string+ require.NoError(t, db.QueryRowContext(ctx, `+ SELECT last_seen_at, payload::text+ FROM vcs_provider_user+ WHERE workspace = $1 AND vcs_type = $2 AND user_id = 'inactive-1'+ `, workspace, v1pb.VCSType_GITHUB.String()).Scan(&gotInactiveLastSeenAt, &gotInactivePayload))+ require.Equal(t, inactiveLastSeenAt, gotInactiveLastSeenAt)+ require.JSONEq(t, inactivePayload, gotInactivePayload)++ ok, err = s.TouchVCSProviderUser(ctx, workspace, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITLAB,+ UserID: "new-1",+ Payload: &storepb.VCSProviderUserPayload{+ UserName: "new",+ },+ }, store.VCSProviderUserActiveWindow, 1)+ require.NoError(t, err)+ require.False(t, ok)++ var exists bool+ require.NoError(t, db.QueryRowContext(ctx, `+ SELECT EXISTS (+ SELECT 1+ FROM vcs_provider_user+ WHERE workspace = $1 AND vcs_type = $2 AND user_id = 'new-1'+ )+ `, workspace, v1pb.VCSType_GITLAB.String()).Scan(&exists))+ require.False(t, exists)+}++func TestVCSProviderUserTouchInactiveUserWhenUnderLimit(t *testing.T) {+ ctx := context.Background()+ s, db := setupVCSProviderUserStore(ctx, t)++ const workspace = "default"+ _, err := db.ExecContext(ctx, `+ INSERT INTO vcs_provider_user (workspace, vcs_type, user_id, last_seen_at, payload)+ VALUES ($1, $2, 'inactive-1', now() - interval '91 days', '{"userName":"inactive"}'::jsonb)+ `, workspace, v1pb.VCSType_GITHUB.String())+ require.NoError(t, err)++ ok, err := s.TouchVCSProviderUser(ctx, workspace, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITHUB,+ UserID: "inactive-1",+ Payload: &storepb.VCSProviderUserPayload{+ UserName: "active-again",+ DisplayName: "Active Again",+ },+ }, store.VCSProviderUserActiveWindow, 1)+ require.NoError(t, err)+ require.True(t, ok)++ users, err := s.ListActiveVCSProviderUsers(ctx, workspace, store.VCSProviderUserActiveWindow)+ require.NoError(t, err)+ require.Len(t, users, 1)+ require.Equal(t, "inactive-1", users[0].UserID)+ require.Equal(t, "active-again", users[0].Payload.GetUserName())+}++func TestVCSProviderUserListActiveUsersSortedDesc(t *testing.T) {+ ctx := context.Background()+ s, db := setupVCSProviderUserStore(ctx, t)++ const workspace = "default"+ _, err := db.ExecContext(ctx, `+ INSERT INTO vcs_provider_user (workspace, vcs_type, user_id, last_seen_at, payload)+ VALUES+ ($1, $2, 'old-active', now() - interval '2 days', '{"userName":"old"}'::jsonb),+ ($1, $2, 'new-active', now() - interval '1 hour', '{"userName":"new"}'::jsonb),+ ($1, $2, 'inactive', now() - interval '91 days', '{"userName":"inactive"}'::jsonb)+ `, workspace, v1pb.VCSType_GITHUB.String())+ require.NoError(t, err)++ users, err := s.ListActiveVCSProviderUsers(ctx, workspace, store.VCSProviderUserActiveWindow)+ require.NoError(t, err)+ require.Len(t, users, 2)+ require.Equal(t, "new-active", users[0].UserID)+ require.Equal(t, "old-active", users[1].UserID)+ require.Greater(t, users[0].LastSeenAt, users[1].LastSeenAt)+}++func TestVCSProviderUserTouchStoresEmptyPayloadWhenNil(t *testing.T) {+ ctx := context.Background()+ s, _ := setupVCSProviderUserStore(ctx, t)++ const workspace = "default"+ ok, err := s.TouchVCSProviderUser(ctx, workspace, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITHUB,+ UserID: "1001",+ }, store.VCSProviderUserActiveWindow, 1)+ require.NoError(t, err)+ require.True(t, ok)++ users, err := s.ListActiveVCSProviderUsers(ctx, workspace, store.VCSProviderUserActiveWindow)+ require.NoError(t, err)+ require.Len(t, users, 1)+ require.NotNil(t, users[0].Payload)+ require.Empty(t, users[0].Payload.GetUserName())+ require.Empty(t, users[0].Payload.GetDisplayName())+}++func TestDeleteExpiredVCSProviderUsers(t *testing.T) {+ ctx := context.Background()+ s, db := setupVCSProviderUserStore(ctx, t)++ const workspace = "default"+ _, err := db.ExecContext(ctx, `+ INSERT INTO vcs_provider_user (workspace, vcs_type, user_id, last_seen_at, payload)+ VALUES+ ($1, $2, 'active', now() - interval '89 days', '{"userName":"active"}'::jsonb),+ ($1, $2, 'expired', now() - interval '91 days', '{"userName":"expired"}'::jsonb)+ `, workspace, v1pb.VCSType_GITHUB.String())+ require.NoError(t, err)++ rowsAffected, err := s.DeleteExpiredVCSProviderUsers(ctx, store.VCSProviderUserActiveWindow)+ require.NoError(t, err)+ require.EqualValues(t, 1, rowsAffected)++ var userIDs []string+ rows, err := db.QueryContext(ctx, `+ SELECT user_id+ FROM vcs_provider_user+ WHERE workspace = $1+ ORDER BY user_id+ `, workspace)+ require.NoError(t, err)+ defer rows.Close()+ for rows.Next() {+ var userID string+ require.NoError(t, rows.Scan(&userID))+ userIDs = append(userIDs, userID)+ }+ require.NoError(t, rows.Err())+ require.Equal(t, []string{"active"}, userIDs)+}++func setupVCSProviderUserStore(ctx context.Context, t *testing.T) (*store.Store, *sql.DB) {+ t.Helper()++ container := testcontainer.GetTestPgContainer(ctx, t)+ t.Cleanup(func() { container.Close(ctx) })++ db := container.GetDB()+ require.NoError(t, migrator.MigrateSchema(ctx, db))++ _, err := db.ExecContext(ctx, `INSERT INTO workspace (resource_id) VALUES ('default')`)+ require.NoError(t, err)++ pgURL := fmt.Sprintf(+ "host=%s port=%s user=postgres password=root-password database=postgres",+ container.GetHost(), container.GetPort(),+ )+ s, err := store.New(ctx, pgURL, false)+ require.NoError(t, err)+ t.Cleanup(func() { require.NoError(t, s.Close()) })++ return s, db+}diff --git a/backend/tests/gitops_test.go b/backend/tests/gitops_test.goindex d9cc033521..589f8485cd 100644--- a/backend/tests/gitops_test.go+++ b/backend/tests/gitops_test.go@@ -2,17 +2,22 @@ package testsimport ("context"+ "encoding/csv""fmt"+ "strings""testing"+ "time""connectrpc.com/connect""github.com/google/uuid""github.com/stretchr/testify/require"+ "google.golang.org/genproto/googleapis/type/expr""github.com/bytebase/bytebase/backend/common"storepb "github.com/bytebase/bytebase/backend/generated-go/store"v1pb "github.com/bytebase/bytebase/backend/generated-go/v1""github.com/bytebase/bytebase/backend/plugin/advisor/code"+ "github.com/bytebase/bytebase/backend/store")func TestGitOpsCheck(t *testing.T) {@@ -149,6 +154,429 @@ func TestGitOpsCheck(t *testing.T) {a.Equal(2, checkedTargets[fmt.Sprintf("%s/databases/%s", prodInstance.Name, databaseName)])}+func TestGitOpsCheckReleaseVCSUserTracking(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ project := createGitOpsVCSUserTestProject(ctx, t, ctl)+ stores := getStore(t, ctl.server)+ workspaceID, err := stores.GetWorkspaceID(ctx)+ a.NoError(err)++ targets := []string{"instances/missing/databases/missing"}+ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: targets,+ }))+ a.Error(err)+ a.Equal(connect.CodeNotFound, connect.CodeOf(err))++ count, err := stores.CountActiveVCSProviderUsers(ctx, workspaceID, 90*24*time.Hour)+ a.NoError(err)+ a.Zero(count)++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: []string{"malformed-target"},+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: "malformed-target-user",+ UserName: "malformed-target-user",+ },+ }))+ a.Error(err)+ a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))++ count, err = stores.CountActiveVCSProviderUsers(ctx, workspaceID, 90*24*time.Hour)+ a.NoError(err)+ a.Zero(count)++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: targets,+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: "1001",+ UserName: "alice",+ DisplayName: "Alice",+ },+ }))+ a.Error(err)+ a.Equal(connect.CodeNotFound, connect.CodeOf(err))++ users, err := stores.ListActiveVCSProviderUsers(ctx, workspaceID, 90*24*time.Hour)+ a.NoError(err)+ a.Empty(users)++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITLAB,+ UserId: "1002",+ UserName: "bob",+ },+ }))+ a.Error(err)+ a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))++ count, err = stores.CountActiveVCSProviderUsers(ctx, workspaceID, 90*24*time.Hour)+ a.NoError(err)+ a.Zero(count)++ validTarget := createGitOpsVCSUserTestTarget(ctx, t, ctl, project)+ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: []string{validTarget},+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: "1001",+ UserName: "alice",+ DisplayName: "Alice",+ },+ }))+ a.NoError(err)++ users, err = stores.ListActiveVCSProviderUsers(ctx, workspaceID, 90*24*time.Hour)+ a.NoError(err)+ a.Len(users, 1)+ a.Equal(v1pb.VCSType_GITHUB, users[0].VCSType)+ a.Equal("1001", users[0].UserID)+ a.Equal("alice", users[0].Payload.GetUserName())+ a.Equal("Alice", users[0].Payload.GetDisplayName())+}++func TestGitOpsCheckReleaseVCSUserValidation(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ project := createGitOpsVCSUserTestProject(ctx, t, ctl)+ stores := getStore(t, ctl.server)+ workspaceID, err := stores.GetWorkspaceID(ctx)+ a.NoError(err)+ targets := []string{"instances/missing/databases/missing"}++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: targets,+ VcsUser: &v1pb.VCSUser{+ UserId: "1001",+ },+ }))+ a.Error(err)+ a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: targets,+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ },+ }))+ a.Error(err)+ a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Targets: targets,+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: "1001",+ },+ }))+ a.Error(err)+ a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: targets,+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType(999),+ UserId: "1001",+ },+ }))+ a.Error(err)+ a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: targets,+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: strings.Repeat("u", 257),+ },+ }))+ a.Error(err)+ a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: &v1pb.Release{+ Type: v1pb.Release_Type(999),+ Files: gitOpsVCSUserTestRelease().Files,+ },+ Targets: targets,+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: "1001",+ },+ }))+ a.Error(err)+ a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))++ count, err := stores.CountActiveVCSProviderUsers(ctx, workspaceID, 90*24*time.Hour)+ a.NoError(err)+ a.Zero(count)++ validTarget := createGitOpsVCSUserTestTarget(ctx, t, ctl, project)+ a.NoError(ctl.removeLicense(ctx))+ const freeUserLimit = 20+ for i := 0; i < freeUserLimit; i++ {+ _, err := stores.GetDB().ExecContext(ctx, `+ INSERT INTO vcs_provider_user (workspace, vcs_type, user_id, last_seen_at, payload)+ VALUES ($1, $2, $3, now(), '{}'::jsonb)+ `, workspaceID, v1pb.VCSType_GITHUB.String(), fmt.Sprintf("seed-%02d", i))+ a.NoError(err)+ }++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: []string{validTarget},+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITLAB,+ UserId: "limit-user",+ UserName: "limit-user",+ },+ }))+ a.Error(err)+ a.Equal(connect.CodeResourceExhausted, connect.CodeOf(err))++ count, err = stores.CountActiveVCSProviderUsers(ctx, workspaceID, 90*24*time.Hour)+ a.NoError(err)+ a.Equal(freeUserLimit, count)+}++func TestGitOpsCheckReleaseVCSUserMetadataTruncation(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ project := createGitOpsVCSUserTestProject(ctx, t, ctl)+ target := createGitOpsVCSUserTestTarget(ctx, t, ctl, project)++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: []string{target},+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: "long-metadata-user",+ UserName: strings.Repeat("n", 257),+ DisplayName: strings.Repeat("d", 257),+ },+ }))+ a.NoError(err)++ stores := getStore(t, ctl.server)+ workspaceID, err := stores.GetWorkspaceID(ctx)+ a.NoError(err)+ users, err := stores.ListActiveVCSProviderUsers(ctx, workspaceID, 90*24*time.Hour)+ a.NoError(err)+ a.Len(users, 1)+ a.Equal("long-metadata-user", users[0].UserID)+ a.Equal(strings.Repeat("n", 256), users[0].Payload.GetUserName())+ a.Equal(strings.Repeat("d", 256), users[0].Payload.GetDisplayName())+}++func TestGitOpsCheckReleaseVCSUserEmptyDatabaseGroup(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ project := createGitOpsVCSUserTestProject(ctx, t, ctl)+ databaseGroup, err := ctl.databaseGroupServiceClient.CreateDatabaseGroup(ctx, connect.NewRequest(&v1pb.CreateDatabaseGroupRequest{+ Parent: project.Name,+ DatabaseGroupId: "empty-vcs-user-group",+ DatabaseGroup: &v1pb.DatabaseGroup{+ Title: "empty VCS user group",+ DatabaseExpr: &expr.Expr{Expression: "false"},+ },+ }))+ a.NoError(err)++ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: gitOpsVCSUserTestRelease(),+ Targets: []string{databaseGroup.Msg.Name},+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: "empty-group-user",+ UserName: "empty-group-user",+ },+ }))+ a.NoError(err)++ stores := getStore(t, ctl.server)+ workspaceID, err := stores.GetWorkspaceID(ctx)+ a.NoError(err)+ users, err := stores.ListActiveVCSProviderUsers(ctx, workspaceID, 90*24*time.Hour)+ a.NoError(err)+ a.Len(users, 1)+ a.Equal("empty-group-user", users[0].UserID)+}++func TestVCSProviderUserActuatorAndExport(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ stores := getStore(t, ctl.server)+ workspaceID, err := stores.GetWorkspaceID(ctx)+ a.NoError(err)++ ok, err := stores.TouchVCSProviderUser(ctx, workspaceID, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITHUB,+ UserID: "1001",+ Payload: &storepb.VCSProviderUserPayload{+ UserName: "alice",+ DisplayName: "Alice",+ },+ }, 90*24*time.Hour, 20)+ a.NoError(err)+ a.True(ok)++ _, err = stores.GetDB().ExecContext(ctx, `+ INSERT INTO vcs_provider_user (workspace, vcs_type, user_id, last_seen_at, payload)+ VALUES ($1, $2, 'inactive-1', now() - interval '91 days', '{"userName":"inactive"}'::jsonb)+ `, workspaceID, v1pb.VCSType_GITHUB.String())+ a.NoError(err)++ info, err := ctl.actuatorServiceClient.GetActuatorInfo(ctx, connect.NewRequest(&v1pb.GetActuatorInfoRequest{}))+ a.NoError(err)+ a.Equal(int32(1), info.Msg.ActiveVcsUserCount)++ _, err = stores.GetDB().ExecContext(ctx, `+ INSERT INTO vcs_provider_user (workspace, vcs_type, user_id, last_seen_at, payload)+ VALUES ($1, $2, '1002', now(), '{"userName":"bob"}'::jsonb)+ `, workspaceID, v1pb.VCSType_GITHUB.String())+ a.NoError(err)+ info, err = ctl.actuatorServiceClient.GetActuatorInfo(ctx, connect.NewRequest(&v1pb.GetActuatorInfoRequest{}))+ a.NoError(err)+ a.Equal(int32(1), info.Msg.ActiveVcsUserCount)++ body, err := ctl.subscriptionServiceClient.ExportVCSProviderUsers(ctx, connect.NewRequest(&v1pb.ExportVCSProviderUsersRequest{}))+ a.NoError(err)+ a.Equal("text/csv; charset=utf-8", body.Msg.ContentType)+ csv := string(body.Msg.Data)+ a.Contains(csv, "vcs_type,user_id,user_name,display_name,last_seen_at")+ a.Contains(csv, "GITHUB,1001,alice,Alice,")+ a.Contains(csv, "GITHUB,1002,bob,,")+ a.NotContains(csv, "inactive-1")+}++func TestVCSProviderUserExportEscapesSpreadsheetFormulas(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ stores := getStore(t, ctl.server)+ workspaceID, err := stores.GetWorkspaceID(ctx)+ a.NoError(err)++ ok, err := stores.TouchVCSProviderUser(ctx, workspaceID, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITHUB,+ UserID: "=1001",+ Payload: &storepb.VCSProviderUserPayload{+ UserName: "+alice",+ DisplayName: "-Alice",+ },+ }, 90*24*time.Hour, 20)+ a.NoError(err)+ a.True(ok)++ body, err := ctl.subscriptionServiceClient.ExportVCSProviderUsers(ctx, connect.NewRequest(&v1pb.ExportVCSProviderUsersRequest{}))+ a.NoError(err)+ rows, err := csv.NewReader(strings.NewReader(string(body.Msg.Data))).ReadAll()+ a.NoError(err)+ a.Len(rows, 2)+ a.Equal([]string{"vcs_type", "user_id", "user_name", "display_name", "last_seen_at"}, rows[0])+ a.Equal("GITHUB", rows[1][0])+ a.Equal("'=1001", rows[1][1])+ a.Equal("'+alice", rows[1][2])+ a.Equal("'-Alice", rows[1][3])+}++func createGitOpsVCSUserTestProject(ctx context.Context, t *testing.T, ctl *controller) *v1pb.Project {+ t.Helper()+ projectID := generateRandomString("gitops-vcs-user")+ projectResp, err := ctl.projectServiceClient.CreateProject(ctx, connect.NewRequest(&v1pb.CreateProjectRequest{+ Project: &v1pb.Project{+ Name: fmt.Sprintf("projects/%s", projectID),+ Title: projectID,+ AllowSelfApproval: true,+ },+ ProjectId: projectID,+ }))+ require.NoError(t, err)+ return projectResp.Msg+}++func createGitOpsVCSUserTestTarget(ctx context.Context, t *testing.T, ctl *controller, project *v1pb.Project) string {+ t.Helper()+ instance := createSQLiteInstance(ctx, t, ctl, "gitops-vcs-user")+ databaseName := generateRandomString("gitops_vcs_user")+ require.NoError(t, ctl.createDatabase(ctx, project, instance, nil, databaseName, ""))+ return fmt.Sprintf("%s/databases/%s", instance.Name, databaseName)+}++func gitOpsVCSUserTestRelease() *v1pb.Release {+ return &v1pb.Release{+ Type: v1pb.Release_VERSIONED,+ Files: []*v1pb.Release_File{+ {+ Path: "migrations/001__create_table.sql",+ Version: "001",+ Statement: []byte("CREATE TABLE vcs_user_test(id INTEGER PRIMARY KEY);"),+ },+ },+ }+}+func TestGitOpsRollout(t *testing.T) {t.Parallel()a := require.New(t)diff --git a/docs/superpowers/plans/2026-05-28-vcs-provider-user-limit.md b/docs/superpowers/plans/2026-05-28-vcs-provider-user-limit.mdnew file mode 100644index 0000000000..77fcfdc681--- /dev/null+++ b/docs/superpowers/plans/2026-05-28-vcs-provider-user-limit.md@@ -0,0 +1,1375 @@+# VCS Provider User Limit Implementation Plan++> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.++**Goal:** Track VCS PR/MR creators from bytebase-release, enforce the active VCS user pool against the license seat limit, show the active count on the Subscription page, and export active VCS users as CSV.++**Architecture:** Add a workspace-scoped `vcs_provider_user` table keyed by `(workspace, vcs_type, user_id)` with display metadata in JSONB payload. `CheckRelease` validates attribution early and touches attributed users after target and release-file validation, `ActuatorInfo` exposes the active count, `SubscriptionService` exports active users as `google.api.HttpBody`, and bytebase-release submits optional VCS attribution for non-bot PR/MR creators.++**Tech Stack:** Go, PostgreSQL migrations, Connect/gRPC + grpc-gateway annotations, protobuf + buf, React, Tailwind, Vitest, Go test, bytebase-action CLI.++---++## File Structure++- Create `proto/store/store/vcs_provider_user.proto`: JSONB payload proto for VCS display metadata.+- Modify `proto/v1/v1/release_service.proto`: add `VCSUser` and optional `CheckReleaseRequest.vcs_user`.+- Modify `proto/v1/v1/actuator_service.proto`: add `active_vcs_user_count` to `ActuatorInfo`.+- Modify `proto/v1/v1/subscription_service.proto`: add `google.api.HttpBody` import and `ExportVCSProviderUsers`.+- Create `backend/migrator/migration/3.19/0000##vcs_provider_user.sql`: add table and index.+- Modify `backend/migrator/migration/LATEST.sql`: add table and index.+- Modify `backend/migrator/migrator_test.go`: update latest migration path.+- Create `backend/store/vcs_provider_user.go`: store model, count, touch, list/export helpers.+- Create `backend/store/vcs_provider_user_test.go`: store tests for touch, active window, limit rejection, and export ordering.+- Modify `backend/api/v1/release_service.go`: add `licenseService` dependency to `ReleaseService`.+- Modify `backend/server/grpc_routes.go`: pass `licenseService` into `NewReleaseService`.+- Modify `backend/api/v1/release_service_check.go`: validate VCS attribution early and touch it after target and release-file validation.+- Create `backend/api/v1/vcs_provider_user.go`: active-window constant shared by release, actuator, and subscription services.+- Modify `backend/api/v1/actuator_service.go`: populate `active_vcs_user_count`.+- Modify `backend/api/v1/subscription_service.go`: implement CSV export.+- Modify backend generated protobuf files after `buf generate`.+- Modify `action/world/world.go`: add optional VCS attribution field.+- Create `action/command/vcs_user.go`: provider-specific attribution extraction.+- Create `action/command/vcs_user_test.go`: environment/event parsing tests.+- Modify `action/command/check.go`: attach `VcsUser` to `CheckReleaseRequest`.+- Modify frontend generated proto-es files after `buf generate`.+- Modify `frontend/src/react/stores/app/types.ts`: add `activeVcsUserCount` selector to app-store type.+- Modify `frontend/src/react/stores/app/workspace.ts`: expose `activeVcsUserCount`.+- Modify `frontend/src/react/hooks/useAppState.ts`: return `activeVcsUserCount` from `useServerState`.+- Modify `frontend/src/react/pages/settings/SubscriptionPage.tsx`: render VCS count and CSV download action.+- Modify `frontend/src/react/pages/settings/SubscriptionPage.test.tsx`: add render and download coverage.+- Modify locale files under `frontend/src/locales/` and `frontend/src/react/locales/` for new user-facing strings.++---++### Task 1: Add Schema And Proto Contracts++**Files:**+- Create: `proto/store/store/vcs_provider_user.proto`+- Modify: `proto/v1/v1/release_service.proto`+- Modify: `proto/v1/v1/actuator_service.proto`+- Modify: `proto/v1/v1/subscription_service.proto`+- Create: `backend/migrator/migration/3.19/0000##vcs_provider_user.sql`+- Modify: `backend/migrator/migration/LATEST.sql`+- Modify: `backend/migrator/migrator_test.go`++- [ ] **Step 1: Add the store payload proto**++Create `proto/store/store/vcs_provider_user.proto`:++```proto+syntax = "proto3";++package bytebase.store;++option go_package = "generated-go/store";++message VCSProviderUserPayload {+ string user_name = 1;+ string display_name = 2;+}+```++- [ ] **Step 2: Add request attribution to release proto**++In `proto/v1/v1/release_service.proto`, add this message after `CheckReleaseRequest`:++```proto+message VCSUser {+ VCSType vcs_type = 1;+ string user_id = 2;+ string user_name = 3;+ string display_name = 4;+}+```++Then add field 5 to `CheckReleaseRequest`:++```proto+ // The non-bot VCS pull request or merge request creator observed by bytebase-release.+ // If absent, Bytebase skips VCS user tracking and VCS user limit enforcement.+ VCSUser vcs_user = 5;+```++- [ ] **Step 3: Add actuator count field**++In `proto/v1/v1/actuator_service.proto`, append field 28 to `ActuatorInfo`:++```proto+ // The number of active VCS users seen in the active window.+ int32 active_vcs_user_count = 28 [(google.api.field_behavior) = OUTPUT_ONLY];+```++- [ ] **Step 4: Add subscription CSV export RPC**++In `proto/v1/v1/subscription_service.proto`, add:++```proto+import "google/api/httpbody.proto";+```++Add this service method after `GetSubscription`:++```proto+ // Exports active VCS users as CSV.+ rpc ExportVCSProviderUsers(ExportVCSProviderUsersRequest) returns (google.api.HttpBody) {+ option (google.api.http) = {get: "/v1/subscription:vcsProviderUsersExport"};+ option (bytebase.v1.permission) = "bb.subscription.manage";+ option (bytebase.v1.auth_method) = IAM;+ }+```++Add this request message near `GetSubscriptionRequest`:++```proto+message ExportVCSProviderUsersRequest {}+```++- [ ] **Step 5: Add migration**++Create `backend/migrator/migration/3.19/0000##vcs_provider_user.sql`:++```sql+CREATE TABLE vcs_provider_user (+ workspace text NOT NULL REFERENCES workspace(resource_id),+ vcs_type text NOT NULL,+ user_id text NOT NULL,+ last_seen_at timestamptz NOT NULL DEFAULT now(),+ payload jsonb NOT NULL DEFAULT '{}',+ PRIMARY KEY (workspace, vcs_type, user_id)+);++CREATE INDEX idx_vcs_provider_user_workspace_last_seen_at+ ON vcs_provider_user(workspace, last_seen_at DESC);++CREATE INDEX idx_vcs_provider_user_last_seen_at+ ON vcs_provider_user(last_seen_at);+```++- [ ] **Step 6: Update latest schema**++Insert the same `CREATE TABLE` and `CREATE INDEX` into `backend/migrator/migration/LATEST.sql` in the workspace-scoped tables section after `subscription`.++- [ ] **Step 7: Update migrator latest test**++In `backend/migrator/migrator_test.go`, update:++```go+require.Equal(t, semver.MustParse("3.19.0"), *files[len(files)-1].version)+require.Equal(t, "migration/3.19/0000##vcs_provider_user.sql", files[len(files)-1].path)+```++- [ ] **Step 8: Generate proto code**++Run:++```bash+buf format -w proto+cd proto && buf generate+```++Expected: generated Go and frontend proto-es files update without errors.++- [ ] **Step 9: Verify migration test**++Run:++```bash+go test -v -count=1 ./backend/migrator -run ^TestLatestVersion$+```++Expected: PASS.++- [ ] **Step 10: Commit**++```bash+git add proto backend/migrator+git commit -m "feat: add vcs provider user schema"+```++---++### Task 2: Add VCS Provider User Store++**Files:**+- Create: `backend/store/vcs_provider_user.go`+- Create: `backend/store/vcs_provider_user_test.go`++- [ ] **Step 1: Write store tests**++Create `backend/store/vcs_provider_user_test.go` with these test cases:++```go+package store_test++import (+ "context"+ "fmt"+ "testing"+ "time"++ "github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/backend/common/testcontainer"+ storepb "github.com/bytebase/bytebase/backend/generated-go/store"+ v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"+ "github.com/bytebase/bytebase/backend/migrator"+ _ "github.com/bytebase/bytebase/backend/plugin/db/pg"+ "github.com/bytebase/bytebase/backend/store"+)++func TestVCSProviderUserTouchAndCount(t *testing.T) {+ ctx := context.Background()+ container := testcontainer.GetTestPgContainer(ctx, t)+ t.Cleanup(func() { container.Close(ctx) })+ db := container.GetDB()+ require.NoError(t, migrator.MigrateSchema(ctx, db))+ _, err := db.ExecContext(ctx, `INSERT INTO workspace (resource_id) VALUES ('default')`)+ require.NoError(t, err)+ pgURL := fmt.Sprintf(+ "host=%s port=%s user=postgres password=root-password database=postgres",+ container.GetHost(), container.GetPort(),+ )+ s, err := store.New(ctx, pgURL, false)+ require.NoError(t, err)++ const workspace = "default"+ activeWindow := 90 * 24 * time.Hour++ ok, err := s.TouchVCSProviderUser(ctx, workspace, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITHUB,+ UserID: "1001",+ Payload: &storepb.VCSProviderUserPayload{UserName: "alice", DisplayName: "Alice"},+ }, activeWindow, 1)+ require.NoError(t, err)+ require.True(t, ok)++ count, err := s.CountActiveVCSProviderUsers(ctx, workspace, activeWindow)+ require.NoError(t, err)+ require.Equal(t, 1, count)++ ok, err = s.TouchVCSProviderUser(ctx, workspace, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITHUB,+ UserID: "1001",+ Payload: &storepb.VCSProviderUserPayload{UserName: "alice2", DisplayName: "Alice Cooper"},+ }, activeWindow, 1)+ require.NoError(t, err)+ require.True(t, ok)++ users, err := s.ListActiveVCSProviderUsers(ctx, workspace, activeWindow)+ require.NoError(t, err)+ require.Len(t, users, 1)+ require.Equal(t, "alice2", users[0].Payload.GetUserName())+}++func TestVCSProviderUserLimitAndInactiveWindow(t *testing.T) {+ ctx := context.Background()+ container := testcontainer.GetTestPgContainer(ctx, t)+ t.Cleanup(func() { container.Close(ctx) })+ db := container.GetDB()+ require.NoError(t, migrator.MigrateSchema(ctx, db))+ _, err := db.ExecContext(ctx, `INSERT INTO workspace (resource_id) VALUES ('default')`)+ require.NoError(t, err)+ pgURL := fmt.Sprintf(+ "host=%s port=%s user=postgres password=root-password database=postgres",+ container.GetHost(), container.GetPort(),+ )+ s, err := store.New(ctx, pgURL, false)+ require.NoError(t, err)++ const workspace = "default"+ activeWindow := 90 * 24 * time.Hour++ _, err = db.ExecContext(ctx, `+ INSERT INTO vcs_provider_user (workspace, vcs_type, user_id, last_seen_at, payload)+ VALUES ($1, $2, $3, $4, '{}'::jsonb)+ `, workspace, v1pb.VCSType_GITHUB.String(), "old", time.Now().Add(-91*24*time.Hour))+ require.NoError(t, err)+ ok, err := s.TouchVCSProviderUser(ctx, workspace, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_GITLAB,+ UserID: "new",+ Payload: &storepb.VCSProviderUserPayload{UserName: "bob"},+ }, activeWindow, 1)+ require.NoError(t, err)+ require.True(t, ok)++ ok, err = s.TouchVCSProviderUser(ctx, workspace, &store.VCSProviderUserMessage{+ VCSType: v1pb.VCSType_BITBUCKET,+ UserID: "blocked",+ Payload: &storepb.VCSProviderUserPayload{UserName: "carol"},+ }, activeWindow, 1)+ require.NoError(t, err)+ require.False(t, ok)+}+```++- [ ] **Step 2: Run tests to verify they fail**++Run:++```bash+go test -v -count=1 ./backend/store -run ^TestVCSProviderUser+```++Expected: FAIL because store methods and message types do not exist.++- [ ] **Step 3: Implement store methods**++Create `backend/store/vcs_provider_user.go`:++```go+package store++import (+ "context"+ "database/sql"+ "time"++ "github.com/pkg/errors"+ "google.golang.org/protobuf/encoding/protojson"++ "github.com/bytebase/bytebase/backend/common"+ storepb "github.com/bytebase/bytebase/backend/generated-go/store"+ v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"+)++type VCSProviderUserMessage struct {+ Workspace string+ VCSType v1pb.VCSType+ UserID string+ LastSeenAt time.Time+ Payload *storepb.VCSProviderUserPayload+}++func vcsProviderUserActiveCutoff(activeWindow time.Duration) time.Time {+ return time.Now().Add(-activeWindow)+}++func (s *Store) CountActiveVCSProviderUsers(ctx context.Context, workspace string, activeWindow time.Duration) (int, error) {+ var count int+ if err := s.GetDB().QueryRowContext(ctx, `+ SELECT COUNT(*)+ FROM vcs_provider_user+ WHERE workspace = $1 AND last_seen_at >= $2+ `, workspace, vcsProviderUserActiveCutoff(activeWindow)).Scan(&count); err != nil {+ return 0, errors.Wrap(err, "failed to count active VCS provider users")+ }+ return count, nil+}++func (s *Store) TouchVCSProviderUser(ctx context.Context, workspace string, user *VCSProviderUserMessage, activeWindow time.Duration, limit int) (bool, error) {+ tx, err := s.GetDB().BeginTx(ctx, nil)+ if err != nil {+ return false, err+ }+ defer tx.Rollback()++ if _, err := tx.ExecContext(ctx, "SELECT pg_advisory_xact_lock(hashtext($1))", "vcs_provider_user/"+workspace); err != nil {+ return false, errors.Wrap(err, "failed to lock VCS provider user workspace")+ }++ cutoff := vcsProviderUserActiveCutoff(activeWindow)+ var lastSeenAt time.Time+ err = tx.QueryRowContext(ctx, `+ SELECT last_seen_at+ FROM vcs_provider_user+ WHERE workspace = $1 AND vcs_type = $2 AND user_id = $3+ `, workspace, user.VCSType.String(), user.UserID).Scan(&lastSeenAt)+ if err != nil && err != sql.ErrNoRows {+ return false, errors.Wrap(err, "failed to get VCS provider user")+ }++ if err == sql.ErrNoRows || lastSeenAt.Before(cutoff) {+ var activeCount int+ if err := tx.QueryRowContext(ctx, `+ SELECT COUNT(*)+ FROM vcs_provider_user+ WHERE workspace = $1 AND last_seen_at >= $2+ `, workspace, cutoff).Scan(&activeCount); err != nil {+ return false, errors.Wrap(err, "failed to count active VCS provider users")+ }+ if activeCount >= limit {+ return false, tx.Commit()+ }+ }++ payload := user.Payload+ if payload == nil {+ payload = &storepb.VCSProviderUserPayload{}+ }+ payloadBytes, err := protojson.Marshal(payload)+ if err != nil {+ return false, errors.Wrap(err, "failed to marshal VCS provider user payload")+ }+ if _, err := tx.ExecContext(ctx, `+ INSERT INTO vcs_provider_user (workspace, vcs_type, user_id, last_seen_at, payload)+ VALUES ($1, $2, $3, now(), $4)+ ON CONFLICT (workspace, vcs_type, user_id)+ DO UPDATE SET last_seen_at = now(), payload = EXCLUDED.payload+ `, workspace, user.VCSType.String(), user.UserID, string(payloadBytes)); err != nil {+ return false, errors.Wrap(err, "failed to touch VCS provider user")+ }+ return true, tx.Commit()+}++func (s *Store) ListActiveVCSProviderUsers(ctx context.Context, workspace string, activeWindow time.Duration) ([]*VCSProviderUserMessage, error) {+ rows, err := s.GetDB().QueryContext(ctx, `+ SELECT workspace, vcs_type, user_id, last_seen_at, payload+ FROM vcs_provider_user+ WHERE workspace = $1 AND last_seen_at >= $2+ ORDER BY last_seen_at DESC+ `, workspace, vcsProviderUserActiveCutoff(activeWindow))+ if err != nil {+ return nil, errors.Wrap(err, "failed to list active VCS provider users")+ }+ defer rows.Close()++ var users []*VCSProviderUserMessage+ for rows.Next() {+ var user VCSProviderUserMessage+ var vcsType string+ var payloadBytes []byte+ if err := rows.Scan(&user.Workspace, &vcsType, &user.UserID, &user.LastSeenAt, &payloadBytes); err != nil {+ return nil, err+ }+ user.VCSType = v1pb.VCSType(v1pb.VCSType_value[vcsType])+ payload := &storepb.VCSProviderUserPayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal(payloadBytes, payload); err != nil {+ return nil, errors.Wrap(err, "failed to unmarshal VCS provider user payload")+ }+ user.Payload = payload+ users = append(users, &user)+ }+ if err := rows.Err(); err != nil {+ return nil, err+ }+ return users, nil+}++```++- [ ] **Step 4: Run store tests**++Run:++```bash+go test -v -count=1 ./backend/store -run ^TestVCSProviderUser+```++Expected: PASS.++- [ ] **Step 5: Commit**++```bash+git add backend/store+git commit -m "feat: add vcs provider user store"+```++---++### Task 3: Enforce VCS User Limit In CheckRelease++**Files:**+- Modify: `backend/api/v1/release_service.go`+- Modify: `backend/server/grpc_routes.go`+- Modify: `backend/api/v1/release_service_check.go`+- Create: `backend/api/v1/vcs_provider_user.go`+- Modify: `backend/tests/gitops_test.go`++- [ ] **Step 1: Write CheckRelease integration tests**++Add tests to `backend/tests/gitops_test.go`:++```go+func setupGitOpsVCSCheckTarget(t *testing.T, ctx context.Context, ctl *controller, prefix string) (*v1pb.Project, string) {+ t.Helper()+ a := require.New(t)++ projectID := generateRandomString(prefix)+ projectResp, err := ctl.projectServiceClient.CreateProject(ctx, connect.NewRequest(&v1pb.CreateProjectRequest{+ Project: &v1pb.Project{+ Name: fmt.Sprintf("projects/%s", projectID),+ Title: projectID,+ AllowSelfApproval: true,+ },+ ProjectId: projectID,+ }))+ a.NoError(err)++ instanceRootDir := t.TempDir()+ instanceDir, err := ctl.provisionSQLiteInstance(instanceRootDir, prefix+"-instance")+ a.NoError(err)++ instanceResp, err := ctl.instanceServiceClient.CreateInstance(ctx, connect.NewRequest(&v1pb.CreateInstanceRequest{+ InstanceId: generateRandomString("instance"),+ Instance: &v1pb.Instance{+ Title: prefix + "-instance",+ Engine: v1pb.Engine_SQLITE,+ Environment: new("environments/test"),+ Activation: true,+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},+ },+ }))+ a.NoError(err)++ databaseName := prefix + "_db"+ a.NoError(ctl.createDatabase(ctx, projectResp.Msg, instanceResp.Msg, nil, databaseName, ""))+ return projectResp.Msg, fmt.Sprintf("%s/databases/%s", instanceResp.Msg.Name, databaseName)+}++func TestGitOpsCheckReleaseVCSUserTracking(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ project, target := setupGitOpsVCSCheckTarget(t, ctx, ctl, "vcs-user-tracking")++ checkResp, err := ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: &v1pb.Release{+ Type: v1pb.Release_VERSIONED,+ Files: []*v1pb.Release_File{{+ Path: "migrations/001.sql",+ Version: "001",+ Statement: []byte("CREATE TABLE vcs_tracking_test(id INT);"),+ }},+ },+ Targets: []string{target},+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: "1001",+ UserName: "alice",+ DisplayName: "Alice",+ },+ }))+ a.NoError(err)+ a.NotNil(checkResp.Msg)+}++func TestGitOpsCheckReleaseVCSUserValidation(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ project, target := setupGitOpsVCSCheckTarget(t, ctx, ctl, "vcs-user-validation")++ _, err := ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: &v1pb.Release{+ Type: v1pb.Release_VERSIONED,+ Files: []*v1pb.Release_File{{+ Path: "migrations/001.sql",+ Version: "001",+ Statement: []byte("SELECT 1;"),+ }},+ },+ Targets: []string{target},+ VcsUser: &v1pb.VCSUser{VcsType: v1pb.VCSType_GITHUB},+ }))+ a.Error(err)+ a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))+}+```++- [ ] **Step 2: Run tests to verify they fail**++Run:++```bash+go test -v -count=1 ./backend/tests -run '^(TestGitOpsCheckReleaseVCSUserTracking|TestGitOpsCheckReleaseVCSUserValidation)$' -timeout 5m+```++Expected: FAIL until service enforcement is implemented and generated protos are present.++- [ ] **Step 3: Inject LicenseService into ReleaseService**++In `backend/api/v1/release_service.go`, add:++```go+licenseService *enterprise.LicenseService+```++to `ReleaseService`, import `github.com/bytebase/bytebase/backend/enterprise`, and update constructor:++```go+func NewReleaseService(+ store *store.Store,+ sheetManager *sheet.Manager,+ dbFactory *dbfactory.DBFactory,+ licenseService *enterprise.LicenseService,+) *ReleaseService {+ return &ReleaseService{+ store: store,+ sheetManager: sheetManager,+ dbFactory: dbFactory,+ licenseService: licenseService,+ }+}+```++In `backend/server/grpc_routes.go`, change:++```go+releaseService := apiv1.NewReleaseService(stores, sheetManager, dbFactory, licenseService)+```++- [ ] **Step 4: Add attribution validation and touch helper**++In `backend/api/v1/release_service_check.go`, add:++```go+const vcsProviderUserActiveWindow = 90 * 24 * time.Hour++func (s *ReleaseService) touchVCSProviderUser(ctx context.Context, workspaceID string, vcsUser *v1pb.VCSUser) error {+ if vcsUser == nil {+ return nil+ }+ if vcsUser.VcsType == v1pb.VCSType_VCS_TYPE_UNSPECIFIED {+ return connect.NewError(connect.CodeInvalidArgument, errors.New("vcs_user.vcs_type is required"))+ }+ if vcsUser.UserId == "" {+ return connect.NewError(connect.CodeInvalidArgument, errors.New("vcs_user.user_id is required"))+ }+ ok, err := s.store.TouchVCSProviderUser(ctx, workspaceID, &store.VCSProviderUserMessage{+ VCSType: vcsUser.VcsType,+ UserID: vcsUser.UserId,+ Payload: &storepb.VCSProviderUserPayload{+ UserName: vcsUser.UserName,+ DisplayName: vcsUser.DisplayName,+ },+ }, vcsProviderUserActiveWindow, s.licenseService.GetUserLimit(ctx, workspaceID))+ if err != nil {+ return connect.NewError(connect.CodeInternal, errors.Wrap(err, "failed to touch VCS provider user"))+ }+ if !ok {+ return connect.NewError(connect.CodeResourceExhausted, errors.New("new VCS user would exceed the license user limit; increase the license user limit or wait for inactive VCS users to age out of the 90-day window"))+ }+ return nil+}+```++Validate attribution in `CheckRelease` immediately after the project exists check:++```go+if err := validateVCSProviderUser(request.VcsUser); err != nil {+ return nil, err+}+```++Call the touch helper after target resolution and release-file validation, before SQL review and database-heavy checks:++```go+if err := s.touchVCSProviderUser(ctx, workspaceID, request.VcsUser); err != nil {+ return nil, err+}+```++- [ ] **Step 5: Run CheckRelease tests**++Run:++```bash+go test -v -count=1 ./backend/tests -run '^(TestGitOpsCheckReleaseVCSUserTracking|TestGitOpsCheckReleaseVCSUserValidation)$' -timeout 5m+```++Expected: PASS.++- [ ] **Step 6: Commit**++```bash+git add backend/api/v1 backend/server backend/tests+git commit -m "feat: enforce vcs user limit in check release"+```++---++### Task 4: Add Actuator Count And Subscription CSV Export++**Files:**+- Modify: `backend/api/v1/actuator_service.go`+- Modify: `backend/api/v1/subscription_service.go`+- Modify: `backend/tests/gitops_test.go`++- [ ] **Step 1: Write service test for active count and export**++Add a focused backend test to `backend/tests/gitops_test.go`:++```go+func TestVCSProviderUserActuatorAndExport(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ project, target := setupGitOpsVCSCheckTarget(t, ctx, ctl, "vcs-user-export")+ _, err = ctl.releaseServiceClient.CheckRelease(ctx, connect.NewRequest(&v1pb.CheckReleaseRequest{+ Parent: project.Name,+ Release: &v1pb.Release{+ Type: v1pb.Release_VERSIONED,+ Files: []*v1pb.Release_File{{+ Path: "migrations/001.sql",+ Version: "001",+ Statement: []byte("CREATE TABLE vcs_export_test(id INT);"),+ }},+ },+ Targets: []string{target},+ VcsUser: &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: "1001",+ UserName: "alice",+ DisplayName: "Alice",+ },+ }))+ a.NoError(err)++ info, err := ctl.actuatorServiceClient.GetActuatorInfo(ctx, connect.NewRequest(&v1pb.GetActuatorInfoRequest{}))+ a.NoError(err)+ a.Equal(int32(1), info.Msg.ActiveVcsUserCount)++ body, err := ctl.subscriptionServiceClient.ExportVCSProviderUsers(ctx, connect.NewRequest(&v1pb.ExportVCSProviderUsersRequest{}))+ a.NoError(err)+ a.Equal("text/csv; charset=utf-8", body.Msg.ContentType)+ a.Contains(string(body.Msg.Data), "vcs_type,user_id,user_name,display_name,last_seen_at")+ a.Contains(string(body.Msg.Data), "GITHUB,1001,alice,Alice,")+}+```++- [ ] **Step 2: Run test to verify it fails**++Run:++```bash+go test -v -count=1 ./backend/tests -run ^TestVCSProviderUserActuatorAndExport$ -timeout 5m+```++Expected: FAIL because actuator field and export RPC implementation are missing.++- [ ] **Step 3: Populate actuator count**++In `backend/api/v1/actuator_service.go`, after `UserCountInIam` is computed, add:++```go+activeVCSUserCount, err := s.store.CountActiveVCSProviderUsers(ctx, workspaceID, vcsProviderUserActiveWindow)+if err != nil {+ return nil, connect.NewError(connect.CodeInternal, errors.Wrap(err, "failed to count active VCS users"))+}+serverInfo.ActiveVcsUserCount = int32(activeVCSUserCount)+```++Create `backend/api/v1/vcs_provider_user.go` with the shared active-window constant:++```go+package v1++import "time"++const vcsProviderUserActiveWindow = 90 * 24 * time.Hour+```++- [ ] **Step 4: Implement CSV export**++In `backend/api/v1/subscription_service.go`, import:++```go+import (+ "bytes"+ "encoding/csv"+)++httpbody "google.golang.org/genproto/googleapis/api/httpbody"+```++Add:++```go+func (s *SubscriptionService) ExportVCSProviderUsers(ctx context.Context, _ *connect.Request[v1pb.ExportVCSProviderUsersRequest]) (*connect.Response[httpbody.HttpBody], error) {+ workspaceID := common.GetWorkspaceIDFromContext(ctx)+ users, err := s.store.ListActiveVCSProviderUsers(ctx, workspaceID, vcsProviderUserActiveWindow)+ if err != nil {+ return nil, connect.NewError(connect.CodeInternal, errors.Wrap(err, "failed to list active VCS provider users"))+ }++ var buf bytes.Buffer+ writer := csv.NewWriter(&buf)+ if err := writer.Write([]string{"vcs_type", "user_id", "user_name", "display_name", "last_seen_at"}); err != nil {+ return nil, connect.NewError(connect.CodeInternal, err)+ }+ for _, user := range users {+ if err := writer.Write([]string{+ user.VCSType.String(),+ user.UserID,+ user.Payload.GetUserName(),+ user.Payload.GetDisplayName(),+ user.LastSeenAt.UTC().Format(time.RFC3339),+ }); err != nil {+ return nil, connect.NewError(connect.CodeInternal, err)+ }+ }+ writer.Flush()+ if err := writer.Error(); err != nil {+ return nil, connect.NewError(connect.CodeInternal, err)+ }++ return connect.NewResponse(&httpbody.HttpBody{+ ContentType: "text/csv; charset=utf-8",+ Data: buf.Bytes(),+ }), nil+}+```++- [ ] **Step 5: Run service test**++Run:++```bash+go test -v -count=1 ./backend/tests -run ^TestVCSProviderUserActuatorAndExport$ -timeout 5m+```++Expected: PASS.++- [ ] **Step 6: Commit**++```bash+git add backend/api/v1 backend/tests+git commit -m "feat: expose active vcs user usage"+```++---++### Task 5: Add bytebase-release VCS Attribution++**Files:**+- Modify: `action/world/world.go`+- Create: `action/command/vcs_user.go`+- Create: `action/command/vcs_user_test.go`+- Modify: `action/command/check.go`++- [ ] **Step 1: Write attribution tests**++Create `action/command/vcs_user_test.go`:++```go+package command++import (+ "os"+ "path/filepath"+ "testing"++ "github.com/stretchr/testify/require"++ v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"+ "github.com/bytebase/bytebase/action/world"+)++func TestGetVCSUserFromGitHubPullRequest(t *testing.T) {+ eventPath := filepath.Join(t.TempDir(), "event.json")+ require.NoError(t, os.WriteFile(eventPath, []byte(`{"pull_request":{"user":{"id":1001,"login":"alice","name":"Alice","type":"User"}}}`), 0600))+ t.Setenv("GITHUB_EVENT_NAME", "pull_request")+ t.Setenv("GITHUB_EVENT_PATH", eventPath)++ user := getVCSUser(world.GitHub)+ require.NotNil(t, user)+ require.Equal(t, v1pb.VCSType_GITHUB, user.VcsType)+ require.Equal(t, "1001", user.UserId)+ require.Equal(t, "alice", user.UserName)+ require.Equal(t, "Alice", user.DisplayName)+}++func TestGetVCSUserSkipsGitHubBot(t *testing.T) {+ eventPath := filepath.Join(t.TempDir(), "event.json")+ require.NoError(t, os.WriteFile(eventPath, []byte(`{"pull_request":{"user":{"id":41898282,"login":"github-actions[bot]","type":"Bot"}}}`), 0600))+ t.Setenv("GITHUB_EVENT_NAME", "pull_request")+ t.Setenv("GITHUB_EVENT_PATH", eventPath)+ require.Nil(t, getVCSUser(world.GitHub))+}++func TestGetVCSUserFromGitLabMergeRequest(t *testing.T) {+ t.Setenv("CI_PIPELINE_SOURCE", "merge_request_event")+ t.Setenv("GITLAB_USER_ID", "2002")+ t.Setenv("GITLAB_USER_LOGIN", "bob")+ t.Setenv("GITLAB_USER_NAME", "Bob")+ user := getVCSUser(world.GitLab)+ require.NotNil(t, user)+ require.Equal(t, v1pb.VCSType_GITLAB, user.VcsType)+ require.Equal(t, "2002", user.UserId)+ require.Equal(t, "bob", user.UserName)+ require.Equal(t, "Bob", user.DisplayName)+}++func TestGetVCSUserFromBitbucketPullRequest(t *testing.T) {+ t.Setenv("BITBUCKET_PR_ID", "10")+ t.Setenv("BITBUCKET_STEP_TRIGGERER_UUID", "{3003}")+ t.Setenv("BITBUCKET_STEP_TRIGGERER_USERNAME", "carol")+ user := getVCSUser(world.Bitbucket)+ require.NotNil(t, user)+ require.Equal(t, v1pb.VCSType_BITBUCKET, user.VcsType)+ require.Equal(t, "3003", user.UserId)+ require.Equal(t, "carol", user.UserName)+}+```++- [ ] **Step 2: Run tests to verify they fail**++Run:++```bash+go test -v -count=1 ./action/command -run ^TestGetVCSUser+```++Expected: FAIL because `getVCSUser` does not exist.++- [ ] **Step 3: Implement attribution helper**++Create `action/command/vcs_user.go`:++```go+package command++import (+ "encoding/json"+ "os"+ "strconv"+ "strings"++ "github.com/bytebase/bytebase/action/world"+ v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"+)++func getVCSUser(platform world.JobPlatform) *v1pb.VCSUser {+ switch platform {+ case world.GitHub:+ return getGitHubVCSUser()+ case world.GitLab:+ return getGitLabVCSUser()+ case world.Bitbucket:+ return getBitbucketVCSUser()+ default:+ return nil+ }+}++func getGitHubVCSUser() *v1pb.VCSUser {+ if os.Getenv("GITHUB_EVENT_NAME") != "pull_request" {+ return nil+ }+ eventPath := os.Getenv("GITHUB_EVENT_PATH")+ if eventPath == "" {+ return nil+ }+ data, err := os.ReadFile(eventPath)+ if err != nil {+ return nil+ }+ var event struct {+ PullRequest struct {+ User struct {+ ID int64 `json:"id"`+ Login string `json:"login"`+ Name string `json:"name"`+ Type string `json:"type"`+ } `json:"user"`+ } `json:"pull_request"`+ }+ if err := json.Unmarshal(data, &event); err != nil {+ return nil+ }+ if event.PullRequest.User.ID == 0 || strings.EqualFold(event.PullRequest.User.Type, "Bot") {+ return nil+ }+ return &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITHUB,+ UserId: strconv.FormatInt(event.PullRequest.User.ID, 10),+ UserName: event.PullRequest.User.Login,+ DisplayName: event.PullRequest.User.Name,+ }+}++func getGitLabVCSUser() *v1pb.VCSUser {+ if os.Getenv("CI_PIPELINE_SOURCE") != "merge_request_event" {+ return nil+ }+ userID := os.Getenv("GITLAB_USER_ID")+ if userID == "" {+ return nil+ }+ userName := os.Getenv("GITLAB_USER_LOGIN")+ if userName == "" {+ userName = os.Getenv("GITLAB_USER_NAME")+ }+ return &v1pb.VCSUser{+ VcsType: v1pb.VCSType_GITLAB,+ UserId: userID,+ UserName: userName,+ DisplayName: os.Getenv("GITLAB_USER_NAME"),+ }+}++func getBitbucketVCSUser() *v1pb.VCSUser {+ if os.Getenv("BITBUCKET_PR_ID") == "" {+ return nil+ }+ userID := strings.Trim(os.Getenv("BITBUCKET_STEP_TRIGGERER_UUID"), "{}")+ if userID == "" {+ return nil+ }+ return &v1pb.VCSUser{+ VcsType: v1pb.VCSType_BITBUCKET,+ UserId: userID,+ UserName: os.Getenv("BITBUCKET_STEP_TRIGGERER_USERNAME"),+ }+}+```++- [ ] **Step 4: Attach attribution in check command**++In `action/command/check.go`, change request construction:++```go+checkReleaseRequest := &v1pb.CheckReleaseRequest{+ Parent: w.Project,+ Release: &v1pb.Release{+ Files: releaseFiles,+ Type: releaseType,+ },+ Targets: w.Targets,+ CustomRules: w.CustomRules,+ VcsUser: getVCSUser(platform),+}+checkReleaseResponse, err := client.checkRelease(cmd.Context(), checkReleaseRequest)+```++- [ ] **Step 5: Run action tests**++Run:++```bash+go test -v -count=1 ./action/command -run ^TestGetVCSUser+```++Expected: PASS.++- [ ] **Step 6: Commit**++```bash+git add action+git commit -m "feat(action): send vcs user attribution"+```++---++### Task 6: Add Subscription Page VCS Count And Download++**Files:**+- Modify: `frontend/src/react/stores/app/types.ts`+- Modify: `frontend/src/react/stores/app/workspace.ts`+- Modify: `frontend/src/react/hooks/useAppState.ts`+- Modify: `frontend/src/react/pages/settings/SubscriptionPage.tsx`+- Modify: `frontend/src/react/pages/settings/SubscriptionPage.test.tsx`+- Modify: `frontend/src/locales/en-US.json`+- Modify: `frontend/src/locales/zh-CN.json`+- Modify: `frontend/src/locales/es-ES.json`+- Modify: `frontend/src/locales/ja-JP.json`+- Modify: `frontend/src/locales/vi-VN.json`+- Modify: `frontend/src/react/locales/en-US.json`+- Modify: `frontend/src/react/locales/zh-CN.json`+- Modify: `frontend/src/react/locales/es-ES.json`+- Modify: `frontend/src/react/locales/ja-JP.json`+- Modify: `frontend/src/react/locales/vi-VN.json`++- [ ] **Step 1: Write frontend tests**++In `frontend/src/react/pages/settings/SubscriptionPage.test.tsx`, add tests:++```tsx+it("renders active VCS user count separately from IAM user count", () => {+ mockUseServerState.mockReturnValue({+ isSaaSMode: false,+ userCountInIam: 4,+ activeVcsUserCount: 2,+ totalInstanceCount: 3,+ activatedInstanceCount: 3,+ workspaceResourceName: "workspaces/default",+ });+ mockUseSubscriptionState.mockReturnValue({+ userCountLimit: 20,+ instanceCountLimit: 10,+ instanceLicenseCount: Number.MAX_VALUE,+ currentPlan: PlanType.TEAM,+ isFreePlan: false,+ isTrialing: false,+ isExpired: false,+ showTrial: false,+ trialingDays: 0,+ expireAt: "",+ hasUnifiedInstanceLicense: true,+ uploadLicense: vi.fn(),+ });++ render(<SubscriptionPage />);+ expect(screen.getByText("Active VCS users")).toBeInTheDocument();+ expect(screen.getByText("2")).toBeInTheDocument();+ expect(screen.getAllByText("20")).not.toHaveLength(0);+});++it("downloads active VCS users csv", async () => {+ subscriptionServiceClientConnect.exportVCSProviderUsers = vi.fn().mockResolvedValue({+ contentType: "text/csv; charset=utf-8",+ data: new TextEncoder().encode("vcs_type,user_id,user_name,display_name,last_seen_at\n"),+ });+ render(<SubscriptionPage />);+ await userEvent.click(screen.getByRole("button", { name: "Download active VCS users" }));+ expect(subscriptionServiceClientConnect.exportVCSProviderUsers).toHaveBeenCalledWith({});+});+```++Adjust mocks to match the existing test file helpers and i18n test setup.++- [ ] **Step 2: Run tests to verify they fail**++Run:++```bash+pnpm --dir frontend test -- SubscriptionPage.test.tsx+```++Expected: FAIL because state selector and UI do not exist.++- [ ] **Step 3: Add app-store selector**++In `frontend/src/react/stores/app/types.ts`, add:++```ts+activeVcsUserCount: () => number;+```++In `frontend/src/react/stores/app/workspace.ts`, add:++```ts+activeVcsUserCount: () => get().serverInfo?.activeVcsUserCount ?? 0,+```++In `frontend/src/react/hooks/useAppState.ts`, read and return it:++```ts+const activeVcsUserCount = useAppStore((state) => state.activeVcsUserCount());+```++and include `activeVcsUserCount` in the returned object.++- [ ] **Step 4: Add UI and download action**++In `frontend/src/react/pages/settings/SubscriptionPage.tsx`, import:++```ts+import dayjs from "dayjs";+import { Download } from "lucide-react";+import { subscriptionServiceClientConnect } from "@/connect";+```++Read the new state:++```ts+const {+ isSaaSMode,+ userCountInIam,+ activeVcsUserCount,+ totalInstanceCount,+ activatedInstanceCount,+ workspaceResourceName,+} = useServerState();+```++Add a helper:++```ts+const handleDownloadVcsUsers = async () => {+ try {+ const response =+ await subscriptionServiceClientConnect.exportVCSProviderUsers({});+ const blob = new Blob([response.data], {+ type: response.contentType || "text/csv; charset=utf-8",+ });+ const url = URL.createObjectURL(blob);+ const link = document.createElement("a");+ link.href = url;+ link.download = `active-vcs-users.${dayjs().format("YYYY-MM-DDTHH-mm-ss")}.csv`;+ link.click();+ URL.revokeObjectURL(url);+ } catch (error) {+ notify({+ module: "bytebase",+ style: "CRITICAL",+ title: t("common.failed"),+ description: (error as { message?: string }).message,+ });+ }+};+```++Add a stat next to the existing user count:++```tsx+<div className="flex flex-col text-left">+ <div className="text-main flex items-center gap-x-2">+ {t("subscription.active-vcs-users")}+ {allowManage && (+ <Button+ variant="ghost"+ size="icon"+ aria-label={t("subscription.download-active-vcs-users")}+ onClick={handleDownloadVcsUsers}+ >+ <Download className="size-4" />+ </Button>+ )}+ </div>+ <div className="mt-1 text-4xl flex items-center gap-2">+ {activeVcsUserCount}+ <span className="font-mono text-control-light">/</span>+ {userLimit}+ </div>+</div>+```++- [ ] **Step 5: Add locale strings**++Add these keys under the existing `subscription` namespace in every locale file listed in this task. Use the English strings for locales where no translation is available:++```json+"active-vcs-users": "Active VCS users",+"download-active-vcs-users": "Download active VCS users"+```++Place the keys under the existing `subscription` namespace. Add matching keys to other locale JSON files using the English strings if translations are not available.++- [ ] **Step 6: Run frontend tests**++Run:++```bash+pnpm --dir frontend test -- SubscriptionPage.test.tsx+```++Expected: PASS.++- [ ] **Step 7: Commit**++```bash+git add frontend+git commit -m "feat(frontend): show active vcs user usage"+```++---++### Task 7: Final Verification++**Files:**+- All modified files from Tasks 1-6.++- [ ] **Step 1: Format Go files**++Run:++```bash+gofmt -w backend/store/vcs_provider_user.go backend/store/vcs_provider_user_test.go backend/api/v1/release_service.go backend/api/v1/release_service_check.go backend/api/v1/actuator_service.go backend/api/v1/subscription_service.go backend/tests/gitops_test.go action/command/vcs_user.go action/command/vcs_user_test.go action/command/check.go+```++Expected: command exits 0.++- [ ] **Step 2: Format and lint proto**++Run:++```bash+buf format -w proto+buf lint proto+cd proto && buf generate+```++Expected: all commands exit 0.++- [ ] **Step 3: Run focused backend tests**++Run:++```bash+go test -v -count=1 ./backend/migrator -run ^TestLatestVersion$+go test -v -count=1 ./backend/store -run ^TestVCSProviderUser+go test -v -count=1 ./backend/tests -run '^(TestGitOpsCheckReleaseVCSUserTracking|TestGitOpsCheckReleaseVCSUserValidation|TestVCSProviderUserActuatorAndExport)$' -timeout 5m+go test -v -count=1 ./action/command -run ^TestGetVCSUser+```++Expected: all PASS.++- [ ] **Step 4: Run frontend checks**++Run:++```bash+pnpm --dir frontend fix+pnpm --dir frontend check+pnpm --dir frontend type-check+pnpm --dir frontend test -- SubscriptionPage.test.tsx+```++Expected: all PASS.++- [ ] **Step 5: Run Go lint repeatedly until clean**++Run:++```bash+golangci-lint run --fix --allow-parallel-runners+golangci-lint run --allow-parallel-runners+```++If the second command reports issues, fix them and rerun `golangci-lint run --allow-parallel-runners` until it reports no issues.++- [ ] **Step 6: Build backend**++Run:++```bash+go build -ldflags "-w -s" -p=16 -o ./bytebase-build/bytebase ./backend/bin/server/main.go+```++Expected: build exits 0.++- [ ] **Step 7: Inspect final diff**++Run:++```bash+git status --short+git diff --stat+git diff --check+```++Expected: only intended files are modified and `git diff --check` exits 0.++- [ ] **Step 8: Final commit**++```bash+git add .+git commit -m "feat: track vcs provider users"+```++---++## Self-Review++- Spec coverage: Tasks cover schema, JSONB payload, request attribution, validated-request touch behavior, active limit enforcement, actuator count, `HttpBody` CSV export, Subscription UI count/download, bytebase-release provider attribution, bot omission, and required tests.+- Placeholder scan: This plan uses concrete filenames, commands, field names, messages, and test names. It does not leave open implementation markers.+- Type consistency: The plan consistently uses `VCSUser`, `vcs_user`, `vcs_provider_user`, `user_id`, `user_name`, `display_name`, `last_seen_at`, and `active_vcs_user_count`.diff --git a/docs/superpowers/specs/2026-05-28-vcs-provider-user-limit-design.md b/docs/superpowers/specs/2026-05-28-vcs-provider-user-limit-design.mdnew file mode 100644index 0000000000..1f750c246c--- /dev/null+++ b/docs/superpowers/specs/2026-05-28-vcs-provider-user-limit-design.md@@ -0,0 +1,244 @@+# VCS Provider User Limit Design++## Context++Bytebase license seats currently count Bytebase IAM users. In GitOps workflows, one Bytebase automation identity can represent many GitHub, GitLab, or Bitbucket users. The product needs to track VCS pull request or merge request creators, enforce a VCS user pool against the same license user limit, and show workspace admins the active VCS usage count.++This design follows the linked "GitOps User Limit Check" document with one explicit lifecycle change: Bytebase records VCS activity after a `CheckRelease` request has valid attribution, valid targets, and valid release files, before running the heavier release checks.++## Goals++- Track non-bot GitHub, GitLab, and Bitbucket pull request or merge request creators observed through bytebase-release `CheckRelease`.+- Enforce the active VCS user pool against `LicenseService.GetUserLimit`.+- Keep VCS users separate from Bytebase IAM users. The two pools are not unioned and are not deduplicated by email.+- Show `active_vcs_user_count` on the Subscription page through `ActuatorInfo`.+- Provide a CSV export of active VCS users.+- Preserve backward compatibility for old bytebase-release clients and manual callers that do not send VCS attribution.++## Non-Goals++- Do not create Bytebase principals for VCS users.+- Do not combine IAM user count and VCS user count into one limit calculation.+- Do not use email for VCS user identity or deduplication.+- Do not store bot-authored checks.+- Do not build a paginated VCS user table in the UI for this iteration.+- Do not add manual delete, deactivate, or override controls for VCS users.++## Definitions++- VCS user: a non-bot pull request or merge request creator submitted by bytebase-release in `CheckReleaseRequest.vcs_user`.+- Active VCS user: a tracked VCS user whose `last_seen_at` is within the active window.+- Active window: 90 days.+- Identity key: `(workspace, vcs_type, user_id)`.++## Database Schema++Add a workspace-scoped table:++```sql+CREATE TABLE vcs_provider_user (+ workspace text NOT NULL REFERENCES workspace(resource_id),+ vcs_type text NOT NULL,+ user_id text NOT NULL,+ last_seen_at timestamptz NOT NULL DEFAULT now(),+ payload jsonb NOT NULL DEFAULT '{}',+ PRIMARY KEY (workspace, vcs_type, user_id)+);++CREATE INDEX idx_vcs_provider_user_workspace_last_seen_at+ ON vcs_provider_user(workspace, last_seen_at DESC);++CREATE INDEX idx_vcs_provider_user_last_seen_at+ ON vcs_provider_user(last_seen_at);+```++Add a store payload proto:++```proto+message VCSProviderUserPayload {+ string user_name = 1;+ string display_name = 2;+}+```++Only identity and query fields are columns. Mutable display metadata lives in `payload` to match repository conventions for JSONB table payloads.++The composite primary key is intentional. `(workspace, vcs_type, user_id)` is the natural identity for a VCS user, prevents duplicate identity rows, and provides the `ON CONFLICT` target for race-safe touch/upsert behavior. The table does not need a surrogate `id` because no API or child table addresses a VCS user independently of that identity tuple.++## API Shape++Extend `CheckReleaseRequest` with optional attribution:++```proto+message CheckReleaseRequest {+ string parent = 1;+ Release release = 2;+ repeated string targets = 3;+ string custom_rules = 4;+ VCSUser vcs_user = 5;+}++message VCSUser {+ VCSType vcs_type = 1;+ string user_id = 2;+ string user_name = 3;+ string display_name = 4;+}+```++`vcs_user` is optional. When it is absent, Bytebase runs the existing `CheckRelease` behavior without VCS tracking or VCS user limit enforcement.++Add `active_vcs_user_count` to `ActuatorInfo`. `ActuatorService.GetActuatorInfo` computes it for the current workspace using the same 90-day active window.++Add a CSV export RPC to `SubscriptionService`:++```proto+import "google/api/httpbody.proto";++rpc ExportVCSProviderUsers(ExportVCSProviderUsersRequest) returns (google.api.HttpBody) {+ option (google.api.http) = {+ get: "/v1/subscription:vcsProviderUsersExport"+ };+ option (bytebase.v1.permission) = "bb.subscription.manage";+ option (bytebase.v1.auth_method) = IAM;+}++message ExportVCSProviderUsersRequest {}+```++The response uses:++- `content_type`: `text/csv; charset=utf-8`+- `data`: CSV bytes++CSV columns:++```text+vcs_type,user_id,user_name,display_name,last_seen_at+```++The export includes only active users, sorted by `last_seen_at DESC`. Empty exports still return the header row.++## CheckRelease Flow++For an attributed request:++1. Parse workspace and project from the request.+2. Validate the project exists.+3. Validate `vcs_user.vcs_type != VCS_TYPE_UNSPECIFIED` and `vcs_user.user_id != ""`.+4. Validate target databases or database groups exist.+5. Validate and sanitize release files.+6. Touch the VCS user before SQL review and database-heavy release checks.+7. If touch succeeds, continue with existing `CheckRelease`.+8. If touch rejects because the active VCS user limit is reached, return `ResourceExhausted`.++Touch behavior:++- If the VCS user exists and is active, update `last_seen_at = now()` and refresh payload.+- If the VCS user is new or inactive, count active VCS users in the workspace.+- If the active count is below `LicenseService.GetUserLimit`, insert or update the row with `last_seen_at = now()`.+- If the active count is at or above the limit, reject and leave the row unchanged.++This intentionally records activity only after Bytebase verifies the project exists, attribution fields pass validation, targets exist, and release files are valid. Invalid targets, empty targets, missing releases, malformed attribution, and invalid release files do not consume VCS seats. Later SQL review failures or internal check failures do not roll back `last_seen_at`.++For an unattributed request:++- Skip VCS tracking and VCS user limit enforcement.+- Preserve existing behavior for older bytebase-release versions and manual API callers.++For bot-authored provider events:++- bytebase-release sends no `vcs_user`.+- Bytebase does not track the bot event and does not show it in export output.++## Concurrency++The active-count decision and upsert must be atomic for new or inactive users. The store will provide `TouchVCSProviderUser`, taking the workspace, VCS user, active window, and limit.++The method should use a workspace-scoped advisory lock or equivalent transaction-level serialization around:++- checking whether the target user is already active,+- counting active VCS users,+- inserting or updating the row.++The lock must not wrap release SQL review or target database checks.++## UI++The Subscription page keeps the existing IAM user usage stat unchanged and adds a separate stat:++```text+Active VCS users+N / user limit+```++The value comes from `ActuatorInfo.active_vcs_user_count` and the existing subscription user limit computation.++Next to the stat, show a download action for users with `bb.subscription.manage`. The action calls `ExportVCSProviderUsers`, creates a CSV file from the `HttpBody` data, and downloads it as:++```text+active-vcs-users.<timestamp>.csv+```++No VCS user table is shown in this iteration.++## bytebase-release Attribution++bytebase-release should populate `CheckReleaseRequest.vcs_user` when it can identify a non-bot PR/MR creator:++- GitHub: pull request creator ID, login, and display name when available.+- GitLab: merge request creator ID, username, and display name when available.+- Bitbucket: pull request creator ID, username or nickname, and display name when available.++If the provider event identifies the creator as a bot, bytebase-release omits `vcs_user`.++## Error Handling++- Missing `vcs_user`: allowed, no VCS tracking.+- `vcs_user.vcs_type` unspecified: `InvalidArgument`.+- `vcs_user.user_id` empty: `InvalidArgument`.+- Active VCS user limit reached for a new or inactive user: `ResourceExhausted`.+- Export failures: surface the backend error through the standard frontend critical notification.++The limit error should explain that a new VCS user would exceed the license user limit and that admins can increase the license user limit or wait for inactive VCS users to age out of the 90-day window.++## Testing++Backend store tests:++- touching a new user inserts a row.+- touching an active existing user refreshes `last_seen_at`.+- inactive users older than 90 days do not count against the active limit.+- a new or inactive user is rejected when active count equals the limit.+- CSV export includes the header, active rows, sorted order, and excludes inactive rows.++Backend service tests:++- `CheckRelease` without `vcs_user` preserves existing behavior.+- valid `vcs_user` records activity after request target and release-file validation.+- invalid targets and empty targets do not record VCS activity.+- limit rejection returns `ResourceExhausted`.+- malformed attribution returns `InvalidArgument`.+- oversized or control-character attribution fields return `InvalidArgument`.+- `ActuatorInfo.active_vcs_user_count` reflects the active window.++Frontend tests:++- Subscription page renders active VCS user usage separately from IAM user usage.+- Download action calls the export RPC and downloads a CSV Blob.+- Locale strings cover the new label and download action.++Action tests:++- GitHub PR creator maps to `VCSUser`.+- GitLab MR creator maps to `VCSUser`.+- Bitbucket PR creator maps to `VCSUser`.+- Bot creators produce no attribution.+- The check command includes `vcs_user` when attribution is available.++## Migration And Generation++- Add a new migration file under the next migration version and update `backend/migrator/migration/LATEST.sql`.+- Update `TestLatestVersion` after adding the migration.+- Add the store payload proto and run proto generation.+- Update generated frontend proto-es files through the existing `buf generate` workflow.diff --git a/frontend/src/locales/subscription/en-US.json b/frontend/src/locales/subscription/en-US.jsonindex 73eb1e7710..3b53340dcc 100644--- a/frontend/src/locales/subscription/en-US.json+++ b/frontend/src/locales/subscription/en-US.json@@ -17,5 +17,13 @@},"title": "Community","try": "Start free trial"+ },+ "vcs-users": {+ "active": "Active VCS users",+ "download": "Download active VCS users",+ "download-failure": {+ "description": "Please try again later.",+ "title": "Failed to download active VCS users"+ }}}diff --git a/frontend/src/locales/subscription/es-ES.json b/frontend/src/locales/subscription/es-ES.jsonindex 66464cd667..c7e16aeba3 100644--- a/frontend/src/locales/subscription/es-ES.json+++ b/frontend/src/locales/subscription/es-ES.json@@ -17,5 +17,13 @@},"title": "Plan","try": "Empezar la prueba gratuita"+ },+ "vcs-users": {+ "active": "Usuarios VCS activos",+ "download": "Descargar usuarios VCS activos",+ "download-failure": {+ "description": "Inténtelo de nuevo más tarde.",+ "title": "No se pudieron descargar los usuarios VCS activos"+ }}}diff --git a/frontend/src/locales/subscription/ja-JP.json b/frontend/src/locales/subscription/ja-JP.jsonindex d8e9c45a77..fc11968cda 100644--- a/frontend/src/locales/subscription/ja-JP.json+++ b/frontend/src/locales/subscription/ja-JP.json@@ -17,5 +17,13 @@},"title": "コミュニティ","try": "無料トライアルを開始する"+ },+ "vcs-users": {+ "active": "アクティブな VCS ユーザー",+ "download": "アクティブな VCS ユーザーをダウンロード",+ "download-failure": {+ "description": "後でもう一度お試しください。",+ "title": "アクティブな VCS ユーザーのダウンロードに失敗しました"+ }}}diff --git a/frontend/src/locales/subscription/vi-VN.json b/frontend/src/locales/subscription/vi-VN.jsonindex 0aab66d7f8..5b247716e1 100644--- a/frontend/src/locales/subscription/vi-VN.json+++ b/frontend/src/locales/subscription/vi-VN.json@@ -17,5 +17,13 @@},"title": "Cộng đồng","try": "Bắt đầu dùng thử miễn phí"+ },+ "vcs-users": {+ "active": "Người dùng VCS đang hoạt động",+ "download": "Tải xuống người dùng VCS đang hoạt động",+ "download-failure": {+ "description": "Vui lòng thử lại sau.",+ "title": "Không thể tải xuống người dùng VCS đang hoạt động"+ }}}diff --git a/frontend/src/locales/subscription/zh-CN.json b/frontend/src/locales/subscription/zh-CN.jsonindex bfa8adc6d0..af03fcf3a6 100644--- a/frontend/src/locales/subscription/zh-CN.json+++ b/frontend/src/locales/subscription/zh-CN.json@@ -17,5 +17,13 @@},"title": "版本","try": "免费试用"+ },+ "vcs-users": {+ "active": "活跃 VCS 用户",+ "download": "下载活跃 VCS 用户",+ "download-failure": {+ "description": "请稍后重试。",+ "title": "下载活跃 VCS 用户失败"+ }}}diff --git a/frontend/src/react/hooks/useAppState.ts b/frontend/src/react/hooks/useAppState.tsindex 86d9242d59..e6d97f745f 100644--- a/frontend/src/react/hooks/useAppState.ts+++ b/frontend/src/react/hooks/useAppState.ts@@ -139,6 +139,7 @@ export function useServerState() {);const totalInstanceCount = useAppStore((state) => state.totalInstanceCount());const userCountInIam = useAppStore((state) => state.userCountInIam());+ const activeVcsUserCount = useAppStore((state) => state.activeVcsUserCount());useEffect(() => {void loadServerInfo();}, [loadServerInfo]);@@ -153,6 +154,7 @@ export function useServerState() {activatedInstanceCount,totalInstanceCount,userCountInIam,+ activeVcsUserCount,};}diff --git a/frontend/src/react/locales/en-US.json b/frontend/src/react/locales/en-US.jsonindex ec44cbc990..b68aad414c 100644--- a/frontend/src/react/locales/en-US.json+++ b/frontend/src/react/locales/en-US.json@@ -3762,6 +3762,14 @@"title": "User count limit","upgrade": "Upgrade to get more user quota."}+ },+ "vcs-users": {+ "active": "Active VCS users",+ "download": "Download active VCS users",+ "download-failure": {+ "description": "Please try again later.",+ "title": "Failed to download active VCS users"+ }}},"subscription.instance-assignment.assign-license": "Assign License",diff --git a/frontend/src/react/locales/es-ES.json b/frontend/src/react/locales/es-ES.jsonindex 318cea40bb..b739439009 100644--- a/frontend/src/react/locales/es-ES.json+++ b/frontend/src/react/locales/es-ES.json@@ -3751,6 +3751,14 @@"title": "Límite de conteo de usuarios","upgrade": "Actualizar para obtener más cuota de usuario."}+ },+ "vcs-users": {+ "active": "Usuarios VCS activos",+ "download": "Descargar usuarios VCS activos",+ "download-failure": {+ "description": "Inténtelo de nuevo más tarde.",+ "title": "No se pudieron descargar los usuarios VCS activos"+ }}},"subscription.instance-assignment.assign-license": "Asignar licencia",diff --git a/frontend/src/react/locales/ja-JP.json b/frontend/src/react/locales/ja-JP.jsonindex 3c85e9d5ec..ddad1d9140 100644--- a/frontend/src/react/locales/ja-JP.json+++ b/frontend/src/react/locales/ja-JP.json@@ -3751,6 +3751,14 @@"title": "ユーザー制限","upgrade": "アップグレード でユーザークォータをさらに取得します。"}+ },+ "vcs-users": {+ "active": "アクティブな VCS ユーザー",+ "download": "アクティブな VCS ユーザーをダウンロード",+ "download-failure": {+ "description": "後でもう一度お試しください。",+ "title": "アクティブな VCS ユーザーのダウンロードに失敗しました"+ }}},"subscription.instance-assignment.assign-license": "ライセンスの割り当て",diff --git a/frontend/src/react/locales/vi-VN.json b/frontend/src/react/locales/vi-VN.jsonindex d3677d6343..e21bbf949a 100644--- a/frontend/src/react/locales/vi-VN.json+++ b/frontend/src/react/locales/vi-VN.json@@ -3751,6 +3751,14 @@"title": "Giới hạn số lượng người dùng","upgrade": "Nâng cấp để có thêm hạn ngạch người dùng."}+ },+ "vcs-users": {+ "active": "Người dùng VCS đang hoạt động",+ "download": "Tải xuống người dùng VCS đang hoạt động",+ "download-failure": {+ "description": "Vui lòng thử lại sau.",+ "title": "Không thể tải xuống người dùng VCS đang hoạt động"+ }}},"subscription.instance-assignment.assign-license": "Gán giấy phép",diff --git a/frontend/src/react/locales/zh-CN.json b/frontend/src/react/locales/zh-CN.jsonindex 688d29ec3f..37c1ce214a 100644--- a/frontend/src/react/locales/zh-CN.json+++ b/frontend/src/react/locales/zh-CN.json@@ -3751,6 +3751,14 @@"title": "用户数量限制","upgrade": "升级来获取更多用户额度。"}+ },+ "vcs-users": {+ "active": "活跃 VCS 用户",+ "download": "下载活跃 VCS 用户",+ "download-failure": {+ "description": "请稍后重试。",+ "title": "下载活跃 VCS 用户失败"+ }}},"subscription.instance-assignment.assign-license": "分配证书",diff --git a/frontend/src/react/pages/settings/SubscriptionPage.test.tsx b/frontend/src/react/pages/settings/SubscriptionPage.test.tsxindex a809291776..c0ddec5af2 100644--- a/frontend/src/react/pages/settings/SubscriptionPage.test.tsx+++ b/frontend/src/react/pages/settings/SubscriptionPage.test.tsx@@ -1,12 +1,24 @@import { act } from "react";import { createRoot, type Root } from "react-dom/client";-import { beforeEach, describe, expect, test, vi } from "vitest";+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";import { PlanType } from "@/types/proto-es/v1/subscription_service_pb";(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;+const mocks = vi.hoisted(() => ({+ exportVCSProviderUsers: vi.fn(),+ hasWorkspacePermissionV2: vi.fn(),+ notify: vi.fn(),+}));++vi.mock("@/connect", () => ({+ subscriptionServiceClientConnect: {+ exportVCSProviderUsers: mocks.exportVCSProviderUsers,+ },+}));+vi.mock("react-i18next", () => ({useTranslation: () => ({t: (key: string) => key,@@ -47,8 +59,9 @@ vi.mock("@/react/components/ui/textarea", () => ({}));vi.mock("@/react/hooks/useAppState", () => ({- useNotify: () => vi.fn(),+ useNotify: () => mocks.notify,useServerState: () => ({+ activeVcsUserCount: 2,activatedInstanceCount: 2,isSaaSMode: false,totalInstanceCount: 3,@@ -77,7 +90,7 @@ vi.mock("@/types", () => ({}));vi.mock("@/utils", () => ({- hasWorkspacePermissionV2: () => true,+ hasWorkspacePermissionV2: mocks.hasWorkspacePermissionV2,}));vi.mock("./PurchaseSection", () => ({@@ -89,15 +102,43 @@ let SubscriptionPage: typeof import("./SubscriptionPage").SubscriptionPage;describe("SubscriptionPage", () => {let container: HTMLDivElement;let root: Root;+ class TestBlob {+ readonly parts: BlobPart[];+ readonly type: string;++ constructor(parts: BlobPart[] = [], options: BlobPropertyBag = {}) {+ this.parts = parts;+ this.type = options.type ?? "";+ }+ }beforeEach(async () => {vi.clearAllMocks();+ vi.useFakeTimers();+ vi.setSystemTime(new Date(2026, 4, 28, 17, 10, 11));+ mocks.hasWorkspacePermissionV2.mockReturnValue(true);+ mocks.exportVCSProviderUsers.mockResolvedValue({+ contentType: "text/csv; charset=utf-8",+ data: new TextEncoder().encode(+ "vcs_type,user_id,user_name,display_name,last_seen_at\ngithub,123,alice,Alice,2026-05-28T09:00:00Z\n"+ ),+ });+ vi.stubGlobal("Blob", TestBlob);+ URL.createObjectURL = vi.fn(() => "blob:vcs-users");+ URL.revokeObjectURL = vi.fn();+ vi.spyOn(HTMLAnchorElement.prototype, "click").mockImplementation(() => {});({ SubscriptionPage } = await import("./SubscriptionPage"));container = document.createElement("div");document.body.append(container);root = createRoot(container);});+ afterEach(() => {+ vi.useRealTimers();+ vi.restoreAllMocks();+ vi.unstubAllGlobals();+ });+test("displays unified instance usage as current count over limit", () => {act(() => {root.render(<SubscriptionPage />);@@ -113,4 +154,102 @@ describe("SubscriptionPage", () => {act(() => root.unmount());container.remove();});++ test("displays active VCS user usage separately from IAM user usage", () => {+ act(() => {+ root.render(<SubscriptionPage />);+ });++ expect(+ container.textContent?.includes("subscription.vcs-users.active")+ ).toBe(true);+ expect(container.textContent?.includes("2/20")).toBe(true);+ expect(container.textContent?.includes("4/20")).toBe(true);++ act(() => root.unmount());+ container.remove();+ });++ test("downloads active VCS users csv", async () => {+ await act(async () => {+ root.render(<SubscriptionPage />);+ });++ const button = container.querySelector(+ 'button[aria-label="subscription.vcs-users.download"]'+ );+ expect(button).not.toBeNull();++ await act(async () => {+ button?.dispatchEvent(new MouseEvent("click", { bubbles: true }));+ });++ expect(mocks.exportVCSProviderUsers).toHaveBeenCalledWith(+ {},+ expect.any(Object)+ );+ const createObjectURL = vi.mocked(URL.createObjectURL);+ expect(createObjectURL).toHaveBeenCalledTimes(1);+ const blob = createObjectURL.mock.calls[0][0] as unknown as TestBlob;+ expect(blob.parts).toEqual([+ "vcs_type,user_id,user_name,display_name,last_seen_at\ngithub,123,alice,Alice,2026-05-28T09:00:00Z\n",+ ]);+ expect(blob.type).toBe("text/csv; charset=utf-8");++ const click = vi.mocked(HTMLAnchorElement.prototype.click);+ expect(click).toHaveBeenCalledTimes(1);+ const anchor = click.mock.instances[0] as HTMLAnchorElement;+ expect(anchor.href).toBe("blob:vcs-users");+ expect(anchor.download).toBe("active-vcs-users.2026-05-28T17-10-11.csv");+ expect(URL.revokeObjectURL).toHaveBeenCalledWith("blob:vcs-users");++ act(() => root.unmount());+ container.remove();+ });++ test("hides active VCS users download without subscription permission", () => {+ mocks.hasWorkspacePermissionV2.mockImplementation(+ (permission) => permission !== "bb.subscription.manage"+ );++ act(() => {+ root.render(<SubscriptionPage />);+ });++ expect(+ container.querySelector(+ 'button[aria-label="subscription.vcs-users.download"]'+ )+ ).toBeNull();+ expect(mocks.exportVCSProviderUsers).not.toHaveBeenCalled();++ act(() => root.unmount());+ container.remove();+ });++ test("notifies when active VCS users csv download fails", async () => {+ mocks.exportVCSProviderUsers.mockRejectedValue(new Error("boom"));++ await act(async () => {+ root.render(<SubscriptionPage />);+ });++ const button = container.querySelector(+ 'button[aria-label="subscription.vcs-users.download"]'+ );+ await act(async () => {+ button?.dispatchEvent(new MouseEvent("click", { bubbles: true }));+ });++ expect(mocks.notify).toHaveBeenCalledWith({+ module: "bytebase",+ style: "CRITICAL",+ title: "subscription.vcs-users.download-failure.title",+ description: "subscription.vcs-users.download-failure.description",+ });+ expect(URL.createObjectURL).not.toHaveBeenCalled();++ act(() => root.unmount());+ container.remove();+ });});diff --git a/frontend/src/react/pages/settings/SubscriptionPage.tsx b/frontend/src/react/pages/settings/SubscriptionPage.tsxindex ebb79413b4..5b4aaeeeee 100644--- a/frontend/src/react/pages/settings/SubscriptionPage.tsx+++ b/frontend/src/react/pages/settings/SubscriptionPage.tsx@@ -1,6 +1,10 @@-import { Copy, Pencil } from "lucide-react";+import { createContextValues } from "@connectrpc/connect";+import dayjs from "dayjs";+import { Copy, Download, Pencil } from "lucide-react";import { type ChangeEvent, useState } from "react";import { useTranslation } from "react-i18next";+import { subscriptionServiceClientConnect } from "@/connect";+import { silentContextKey } from "@/connect/context-key";import { InstanceAssignmentSheet } from "@/react/components/InstanceAssignmentSheet";import { Badge } from "@/react/components/ui/badge";import { Button } from "@/react/components/ui/button";@@ -52,6 +56,7 @@ export function SubscriptionPage({userCountInIam,totalInstanceCount,activatedInstanceCount,+ activeVcsUserCount,workspaceResourceName,} = useServerState();const isSelfHostLicense =@@ -126,6 +131,36 @@ export function SubscriptionPage({}};+ const handleDownloadVCSUsers = async () => {+ try {+ const body =+ await subscriptionServiceClientConnect.exportVCSProviderUsers(+ {},+ {+ contextValues: createContextValues().set(silentContextKey, true),+ }+ );+ const blob = new Blob([new TextDecoder().decode(body.data)], {+ type: body.contentType || "text/csv; charset=utf-8",+ });+ const url = URL.createObjectURL(blob);+ const anchor = document.createElement("a");+ anchor.href = url;+ anchor.download = `active-vcs-users.${dayjs().format("YYYY-MM-DDTHH-mm-ss")}.csv`;+ document.body.appendChild(anchor);+ anchor.click();+ document.body.removeChild(anchor);+ URL.revokeObjectURL(url);+ } catch {+ notify({+ module: "bytebase",+ style: "CRITICAL",+ title: t("subscription.vcs-users.download-failure.title"),+ description: t("subscription.vcs-users.download-failure.description"),+ });+ }+ };+return (<div className="w-full px-4 py-4 mx-auto">{/* Plan stats grid */}@@ -210,6 +245,29 @@ export function SubscriptionPage({{userLimit}</div></div>++ {/* Active VCS user count */}+ <div className="flex flex-col text-left">+ <div className="flex items-center gap-x-2 text-main">+ {t("subscription.vcs-users.active")}+ {allowManage && (+ <Button+ variant="ghost"+ size="sm"+ onClick={() => void handleDownloadVCSUsers()}+ title={t("subscription.vcs-users.download")}+ aria-label={t("subscription.vcs-users.download")}+ >+ <Download className="h-4 w-4" />+ </Button>+ )}+ </div>+ <div className="mt-1 text-4xl flex items-center gap-2">+ {activeVcsUserCount}+ <span className="font-mono text-control-light">/</span>+ {userLimit}+ </div>+ </div></div>{/* Divider */}diff --git a/frontend/src/react/stores/app/types.ts b/frontend/src/react/stores/app/types.tsindex edb2cc8338..7b001d5096 100644--- a/frontend/src/react/stores/app/types.ts+++ b/frontend/src/react/stores/app/types.ts@@ -209,6 +209,7 @@ export type WorkspaceSlice = {activatedInstanceCount: () => number;totalInstanceCount: () => number;userCountInIam: () => number;+ activeVcsUserCount: () => number;};export type IamSlice = {diff --git a/frontend/src/react/stores/app/workspace.ts b/frontend/src/react/stores/app/workspace.tsindex 010a39c2f9..7f077c68f6 100644--- a/frontend/src/react/stores/app/workspace.ts+++ b/frontend/src/react/stores/app/workspace.ts@@ -595,4 +595,6 @@ export const createWorkspaceSlice: AppSliceCreator<WorkspaceSlice> = (totalInstanceCount: () => get().serverInfo?.totalInstanceCount ?? 0,userCountInIam: () => get().serverInfo?.userCountInIam ?? 0,++ activeVcsUserCount: () => get().serverInfo?.activeVcsUserCount ?? 0,});diff --git a/frontend/src/types/proto-es/google/api/httpbody_pb.d.ts b/frontend/src/types/proto-es/google/api/httpbody_pb.d.tsnew file mode 100644index 0000000000..39a2bc8d20--- /dev/null+++ b/frontend/src/types/proto-es/google/api/httpbody_pb.d.ts@@ -0,0 +1,104 @@+// Copyright 2025 Google LLC+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+// http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++// @generated by protoc-gen-es v2.12.0+// @generated from file google/api/httpbody.proto (package google.api, syntax proto3)+/* eslint-disable */++import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";+import type { Message } from "@bufbuild/protobuf";+import type { Any } from "@bufbuild/protobuf/wkt";++/**+ * Describes the file google/api/httpbody.proto.+ */+export declare const file_google_api_httpbody: GenFile;++/**+ * Message that represents an arbitrary HTTP body. It should only be used for+ * payload formats that can't be represented as JSON, such as raw binary or+ * an HTML page.+ *+ *+ * This message can be used both in streaming and non-streaming API methods in+ * the request as well as the response.+ *+ * It can be used as a top-level request field, which is convenient if one+ * wants to extract parameters from either the URL or HTTP template into the+ * request fields and also want access to the raw HTTP body.+ *+ * Example:+ *+ * message GetResourceRequest {+ * // A unique request id.+ * string request_id = 1;+ *+ * // The raw HTTP body is bound to this field.+ * google.api.HttpBody http_body = 2;+ *+ * }+ *+ * service ResourceService {+ * rpc GetResource(GetResourceRequest)+ * returns (google.api.HttpBody);+ * rpc UpdateResource(google.api.HttpBody)+ * returns (google.protobuf.Empty);+ *+ * }+ *+ * Example with streaming methods:+ *+ * service CaldavService {+ * rpc GetCalendar(stream google.api.HttpBody)+ * returns (stream google.api.HttpBody);+ * rpc UpdateCalendar(stream google.api.HttpBody)+ * returns (stream google.api.HttpBody);+ *+ * }+ *+ * Use of this type only changes how the request and response bodies are+ * handled, all other features will continue to work unchanged.+ *+ * @generated from message google.api.HttpBody+ */+export declare type HttpBody = Message<"google.api.HttpBody"> & {+ /**+ * The HTTP Content-Type header value specifying the content type of the body.+ *+ * @generated from field: string content_type = 1;+ */+ contentType: string;++ /**+ * The HTTP request/response body as raw binary.+ *+ * @generated from field: bytes data = 2;+ */+ data: Uint8Array;++ /**+ * Application specific response metadata. Must be set in the first response+ * for streaming APIs.+ *+ * @generated from field: repeated google.protobuf.Any extensions = 3;+ */+ extensions: Any[];+};++/**+ * Describes the message google.api.HttpBody.+ * Use `create(HttpBodySchema)` to create a new message.+ */+export declare const HttpBodySchema: GenMessage<HttpBody>;+diff --git a/frontend/src/types/proto-es/google/api/httpbody_pb.js b/frontend/src/types/proto-es/google/api/httpbody_pb.jsnew file mode 100644index 0000000000..4a4e675403--- /dev/null+++ b/frontend/src/types/proto-es/google/api/httpbody_pb.js@@ -0,0 +1,34 @@+// Copyright 2025 Google LLC+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+// http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++// @generated by protoc-gen-es v2.12.0+// @generated from file google/api/httpbody.proto (package google.api, syntax proto3)+/* eslint-disable */++import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";+import { file_google_protobuf_any } from "@bufbuild/protobuf/wkt";++/**+ * Describes the file google/api/httpbody.proto.+ */+export const file_google_api_httpbody = /*@__PURE__*/+ fileDesc("Chlnb29nbGUvYXBpL2h0dHBib2R5LnByb3RvEgpnb29nbGUuYXBpIlgKCEh0dHBCb2R5EhQKDGNvbnRlbnRfdHlwZRgBIAEoCRIMCgRkYXRhGAIgASgMEigKCmV4dGVuc2lvbnMYAyADKAsyFC5nb29nbGUucHJvdG9idWYuQW55QqUBCg5jb20uZ29vZ2xlLmFwaUINSHR0cGJvZHlQcm90b1ABWjtnb29nbGUuZ29sYW5nLm9yZy9nZW5wcm90by9nb29nbGVhcGlzL2FwaS9odHRwYm9keTtodHRwYm9keaICA0dBWKoCCkdvb2dsZS5BcGnKAgpHb29nbGVcQXBp4gIWR29vZ2xlXEFwaVxHUEJNZXRhZGF0YeoCC0dvb2dsZTo6QXBpYgZwcm90bzM", [file_google_protobuf_any]);++/**+ * Describes the message google.api.HttpBody.+ * Use `create(HttpBodySchema)` to create a new message.+ */+export const HttpBodySchema = /*@__PURE__*/+ messageDesc(file_google_api_httpbody, 0);+diff --git a/frontend/src/types/proto-es/v1/actuator_service_pb.d.ts b/frontend/src/types/proto-es/v1/actuator_service_pb.d.tsindex 167f4a7869..addb22f014 100644--- a/frontend/src/types/proto-es/v1/actuator_service_pb.d.ts+++ b/frontend/src/types/proto-es/v1/actuator_service_pb.d.ts@@ -256,6 +256,13 @@ export declare type ActuatorInfo = Message<"bytebase.v1.ActuatorInfo"> & {* @generated from field: int32 user_count_in_iam = 27;*/userCountInIam: number;++ /**+ * The number of active VCS users seen in the active window.+ *+ * @generated from field: int32 active_vcs_user_count = 28;+ */+ activeVcsUserCount: number;};/**diff --git a/frontend/src/types/proto-es/v1/actuator_service_pb.js b/frontend/src/types/proto-es/v1/actuator_service_pb.jsindex 3fff07ae5b..7f4996e983 100644--- a/frontend/src/types/proto-es/v1/actuator_service_pb.js+++ b/frontend/src/types/proto-es/v1/actuator_service_pb.js@@ -15,7 +15,7 @@ import { file_v1_setting_service } from "./setting_service_pb";* Describes the file v1/actuator_service.proto.*/export const file_v1_actuator_service = /*@__PURE__*/- fileDesc("Chl2MS9hY3R1YXRvcl9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSIUChJTZXR1cFNhbXBsZVJlcXVlc3QiQwoWR2V0Q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file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_timestamp, file_v1_annotation, file_v1_setting_service]);+ fileDesc("Chl2MS9hY3R1YXRvcl9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSIUChJTZXR1cFNhbXBsZVJlcXVlc3QiQwoWR2V0QWN0dWF0b3JJbmZvUmVxdWVzdBIpCgRuYW1lGAEgASgJQhv6QRgKFmJ5dGViYXNlLmNvbS9Xb3Jrc3BhY2UiFAoSRGVsZXRlQ2FjaGVSZXF1ZXN0IvoBCgtSZXN0cmljdGlvbhIcCg9kaXNhbGxvd19zaWdudXAYASABKAhCA+BBAxIlChhkaXNhbGxvd19wYXNzd29yZF9zaWduaW4YAiABKAhCA+BBAxJbChRwYXNzd29yZF9yZXN0cmljdGlvbhgDIAEoCzI4LmJ5dGViYXNlLnYxLldvcmtzcGFjZVByb2ZpbGVTZXR0aW5nLlBhc3N3b3JkUmVzdHJpY3Rpb25CA+BBAxIkChdhbGxvd19lbWFpbF9jb2RlX3NpZ25pbhgEIAEoCEID4EEDEiMKFnBhc3N3b3JkX3Jlc2V0X2VuYWJsZWQYBSABKAhCA+BBAyK8BQoMQWN0dWF0b3JJbmZvEhQKB3ZlcnNpb24YASABKAlCA+BBAxIXCgpnaXRfY29tbWl0GAIgASgJQgPgQQMSFQoIcmVhZG9ubHkYAyABKAhCA+BBAxIRCgRzYWFzGAQgASgIQgPgQQMSEQoEaG9zdBgGIAEoCUID4EEDEhEKBHBvcnQYByABKAlCA+BBAxIZCgxleHRlcm5hbF91cmwYCCABKAlCA+BBAxI5ChBsYXN0X2FjdGl2ZV90aW1lGAsgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEID4EEDEhYKCXdvcmtzcGFjZRgNIAEoCUID4EEDEiAKE3VubGljZW5zZWRfZmVhdHVyZXMYDyADKAlCA+BBAxITCgZkb2NrZXIYEiABKAhCA+BBAxIhChRhY3RpdmF0Z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Y29tLmJ5dGViYXNlLnYxQhRBY3R1YXRvclNlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_timestamp, file_v1_annotation, file_v1_setting_service]);/*** Describes the message bytebase.v1.SetupSampleRequest.diff --git a/frontend/src/types/proto-es/v1/release_service_pb.d.ts b/frontend/src/types/proto-es/v1/release_service_pb.d.tsindex f17d818761..63d8ecc070 100644--- a/frontend/src/types/proto-es/v1/release_service_pb.d.ts+++ b/frontend/src/types/proto-es/v1/release_service_pb.d.ts@@ -261,6 +261,14 @@ export declare type CheckReleaseRequest = Message<"bytebase.v1.CheckReleaseReque* @generated from field: string custom_rules = 4;*/customRules: string;++ /**+ * The non-bot VCS pull request or merge request creator observed by bytebase-release.+ * If absent, Bytebase skips VCS user tracking and VCS user limit enforcement.+ *+ * @generated from field: bytebase.v1.VCSUser vcs_user = 5;+ */+ vcsUser?: VCSUser | undefined;};/**@@ -269,6 +277,37 @@ export declare type CheckReleaseRequest = Message<"bytebase.v1.CheckReleaseReque*/export declare const CheckReleaseRequestSchema: GenMessage<CheckReleaseRequest>;+/**+ * @generated from message bytebase.v1.VCSUser+ */+export declare type VCSUser = Message<"bytebase.v1.VCSUser"> & {+ /**+ * @generated from field: bytebase.v1.VCSType vcs_type = 1;+ */+ vcsType: VCSType;++ /**+ * @generated from field: string user_id = 2;+ */+ userId: string;++ /**+ * @generated from field: string user_name = 3;+ */+ userName: string;++ /**+ * @generated from field: string display_name = 4;+ */+ displayName: string;+};++/**+ * Describes the message bytebase.v1.VCSUser.+ * Use `create(VCSUserSchema)` to create a new message.+ */+export declare const VCSUserSchema: GenMessage<VCSUser>;+/*** @generated from message bytebase.v1.CheckReleaseResponse*/diff --git a/frontend/src/types/proto-es/v1/release_service_pb.js b/frontend/src/types/proto-es/v1/release_service_pb.jsindex 62bbd76798..0189ea8b02 100644--- a/frontend/src/types/proto-es/v1/release_service_pb.js+++ b/frontend/src/types/proto-es/v1/release_service_pb.js@@ -16,7 +16,7 @@ import { file_v1_sql_service } from "./sql_service_pb";* Describes the file v1/release_service.proto.*/export const file_v1_release_service = /*@__PURE__*/- fileDesc("Chh2MS9yZWxlYXNlX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIj8KEUdldFJlbGVhc2VSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1JlbGVhc2UikAEKE0xpc3RSZWxlYXNlc1JlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0EhEKCXBhZ2Vfc2l6ZRgCIAEoBRISCgpwYWdlX3Rva2VuGAMgASgJEhQKDHNob3dfZGVsZXRlZBgEIAEoCBIOCgZmaWx0ZXIYBSABKAkiVwoUTGlzdFJlbGVhc2VzUmVzcG9uc2USJgoIcmVsZWFzZXMYASADKAsyFC5ieXRlYmFzZS52MS5SZWxlYXNlEhcKD25leHRfcGFnZV90b2tlbhgCIAEoCSKqAQoUQ3JlYXRlUmVsZWFzZVJlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0EioKB3JlbGVhc2UYAiABKAsyFC5ieXRlYmFzZS52MS5SZWxlYXNlQgPgQQISGwoTcmVsZWFzZV9pZF90ZW1wbGF0ZRgDIAEoCRIbChNyZWxlYXNlX2lkX3RpbWV6b25lGAQgASgJInMKFFVwZGF0ZVJlbGVhc2VSZXF1ZXN0EioKB3JlbGVhc2UYASABKAsyFC5ieXRlYmFzZS52MS5SZWxlY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wEKDENoZWNrUmVsZWFzZRIgLmJ5dGViYXNlLnYxLkNoZWNrUmVsZWFzZVJlcXVlc3QaIS5ieXRlYmFzZS52MS5DaGVja1JlbGVhc2VSZXNwb25zZSJKiuowEWJiLnJlbGVhc2VzLmNoZWNrkOowAYLT5JMCKzoBKiImL3YxL3twYXJlbnQ9cHJvamVjdHMvKn0vcmVsZWFzZXM6Y2hlY2sSyAEKFUxpc3RSZWxlYXNlQ2F0ZWdvcmllcxIpLmJ5dGViYXNlLnYxLkxpc3RSZWxlYXNlQ2F0ZWdvcmllc1JlcXVlc3QaKi5ieXRlYmFzZS52MS5MaXN0UmVsZWFzZUNhdGVnb3JpZXNSZXNwb25zZSJY2kEGcGFyZW50iuowEGJiLnJlbGVhc2VzLmxpc3SQ6jABgtPkkwIxEi8vdjEve3BhcmVudD1wcm9qZWN0cy8qfS9yZWxlYXNlczpsaXN0Q2F0ZWdvcmllc0KpAQoPY29tLmJ5dGViYXNlLnYxQhNSZWxlYXNlU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_sql_service]);+ fileDesc("Chh2MS9yZWxlYXNlX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIj8KEUdldFJlbGVhc2VSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1JlbGVhc2UikAEKE0xpc3RSZWxlYXNlc1JlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKF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xdWVzdBoqLmJ5dGViYXNlLnYxLkxpc3RSZWxlYXNlQ2F0ZWdvcmllc1Jlc3BvbnNlIljaQQZwYXJlbnSK6jAQYmIucmVsZWFzZXMubGlzdJDqMAGC0+STAjESLy92MS97cGFyZW50PXByb2plY3RzLyp9L3JlbGVhc2VzOmxpc3RDYXRlZ29yaWVzQqkBCg9jb20uYnl0ZWJhc2UudjFCE1JlbGVhc2VTZXJ2aWNlUHJvdG9QAVo0Z2l0aHViLmNvbS9ieXRlYmFzZS9ieXRlYmFzZS9iYWNrZW5kL2dlbmVyYXRlZC1nby92MaICA0JYWKoCC0J5dGViYXNlLlYxygILQnl0ZWJhc2VcVjHiAhdCeXRlYmFzZVxWMVxHUEJNZXRhZGF0YeoCDEJ5dGViYXNlOjpWMWIGcHJvdG8z", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_sql_service]);/*** Describes the message bytebase.v1.GetReleaseRequest.@@ -74,60 +74,67 @@ export const UndeleteReleaseRequestSchema = /*@__PURE__*/export const CheckReleaseRequestSchema = /*@__PURE__*/messageDesc(file_v1_release_service, 7);+/**+ * Describes the message bytebase.v1.VCSUser.+ * Use `create(VCSUserSchema)` to create a new message.+ */+export const VCSUserSchema = /*@__PURE__*/+ messageDesc(file_v1_release_service, 8);+/*** Describes the message bytebase.v1.CheckReleaseResponse.* Use `create(CheckReleaseResponseSchema)` to create a new message.*/export const CheckReleaseResponseSchema = /*@__PURE__*/- messageDesc(file_v1_release_service, 8);+ messageDesc(file_v1_release_service, 9);/*** Describes the message bytebase.v1.CheckReleaseResponse.CheckResult.* Use `create(CheckReleaseResponse_CheckResultSchema)` to create a new message.*/export const CheckReleaseResponse_CheckResultSchema = /*@__PURE__*/- messageDesc(file_v1_release_service, 8, 0);+ messageDesc(file_v1_release_service, 9, 0);/*** Describes the message bytebase.v1.ListReleaseCategoriesRequest.* Use `create(ListReleaseCategoriesRequestSchema)` to create a new message.*/export const ListReleaseCategoriesRequestSchema = /*@__PURE__*/- messageDesc(file_v1_release_service, 9);+ messageDesc(file_v1_release_service, 10);/*** Describes the message bytebase.v1.ListReleaseCategoriesResponse.* Use `create(ListReleaseCategoriesResponseSchema)` to create a new message.*/export const ListReleaseCategoriesResponseSchema = /*@__PURE__*/- messageDesc(file_v1_release_service, 10);+ messageDesc(file_v1_release_service, 11);/*** Describes the message bytebase.v1.Release.* Use `create(ReleaseSchema)` to create a new message.*/export const ReleaseSchema = /*@__PURE__*/- messageDesc(file_v1_release_service, 11);+ messageDesc(file_v1_release_service, 12);/*** Describes the message bytebase.v1.Release.File.* Use `create(Release_FileSchema)` to create a new message.*/export const Release_FileSchema = /*@__PURE__*/- messageDesc(file_v1_release_service, 11, 0);+ messageDesc(file_v1_release_service, 12, 0);/*** Describes the message bytebase.v1.Release.VCSSource.* Use `create(Release_VCSSourceSchema)` to create a new message.*/export const Release_VCSSourceSchema = /*@__PURE__*/- messageDesc(file_v1_release_service, 11, 1);+ messageDesc(file_v1_release_service, 12, 1);/*** Describes the enum bytebase.v1.Release.Type.*/export const Release_TypeSchema = /*@__PURE__*/- enumDesc(file_v1_release_service, 11, 0);+ enumDesc(file_v1_release_service, 12, 0);/*** The type of schema change.diff --git a/frontend/src/types/proto-es/v1/subscription_service_pb.d.ts b/frontend/src/types/proto-es/v1/subscription_service_pb.d.tsindex ee1bc716b9..b01dd7fbad 100644--- a/frontend/src/types/proto-es/v1/subscription_service_pb.d.ts+++ b/frontend/src/types/proto-es/v1/subscription_service_pb.d.ts@@ -5,6 +5,7 @@import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";import type { Message } from "@bufbuild/protobuf";import type { Timestamp } from "@bufbuild/protobuf/wkt";+import type { HttpBodySchema } from "../google/api/httpbody_pb";/*** Describes the file v1/subscription_service.proto.@@ -23,6 +24,18 @@ export declare type GetSubscriptionRequest = Message<"bytebase.v1.GetSubscriptio*/export declare const GetSubscriptionRequestSchema: GenMessage<GetSubscriptionRequest>;+/**+ * @generated from message bytebase.v1.ExportVCSProviderUsersRequest+ */+export declare type ExportVCSProviderUsersRequest = Message<"bytebase.v1.ExportVCSProviderUsersRequest"> & {+};++/**+ * Describes the message bytebase.v1.ExportVCSProviderUsersRequest.+ * Use `create(ExportVCSProviderUsersRequestSchema)` to create a new message.+ */+export declare const ExportVCSProviderUsersRequestSchema: GenMessage<ExportVCSProviderUsersRequest>;+/*** @generated from message bytebase.v1.UploadLicenseRequest*/@@ -1020,6 +1033,16 @@ export declare const SubscriptionService: GenService<{input: typeof GetSubscriptionRequestSchema;output: typeof SubscriptionSchema;},+ /**+ * Exports active VCS users as CSV.+ *+ * @generated from rpc bytebase.v1.SubscriptionService.ExportVCSProviderUsers+ */+ exportVCSProviderUsers: {+ methodKind: "unary";+ input: typeof ExportVCSProviderUsersRequestSchema;+ output: typeof HttpBodySchema;+ },/*** Uploads an enterprise license (self-hosted only).*diff --git a/frontend/src/types/proto-es/v1/subscription_service_pb.js b/frontend/src/types/proto-es/v1/subscription_service_pb.jsindex 9eeed3a1f1..e030ca04e7 100644--- a/frontend/src/types/proto-es/v1/subscription_service_pb.js+++ b/frontend/src/types/proto-es/v1/subscription_service_pb.js@@ -6,6 +6,7 @@ import { enumDesc, fileDesc, messageDesc, serviceDesc, tsEnum } from "@bufbuild/import { file_google_api_annotations } from "../google/api/annotations_pb";import { file_google_api_client } from "../google/api/client_pb";import { file_google_api_field_behavior } from "../google/api/field_behavior_pb";+import { file_google_api_httpbody } from "../google/api/httpbody_pb";import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";import { file_v1_annotation } from "./annotation_pb";@@ -13,7 +14,7 @@ import { file_v1_annotation } from "./annotation_pb";* Describes the file v1/subscription_service.proto.*/export const file_v1_subscription_service = /*@__PURE__*/- fileDesc("Ch12MS9zdWJzY3JpcHRpb25fc2VydmljZS5wcm90bxILYnl0ZWJhc2Uud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XltZW50SW5mbxLDAQoVVmVyaWZ5Q2hlY2tvdXRTZXNzaW9uEikuYnl0ZWJhc2UudjEuVmVyaWZ5Q2hlY2tvdXRTZXNzaW9uUmVxdWVzdBoqLmJ5dGViYXNlLnYxLlZlcmlmeUNoZWNrb3V0U2Vzc2lvblJlc3BvbnNlIlOK6jAWYmIuc3Vic2NyaXB0aW9uLm1hbmFnZZDqMAGC0+STAi8SLS92MS9zdWJzY3JpcHRpb24vY2hlY2tvdXRTZXNzaW9uL3tzZXNzaW9uX2lkfRKCAQoRTGlzdFB1cmNoYXNlUGxhbnMSJS5ieXRlYmFzZS52MS5MaXN0UHVyY2hhc2VQbGFuc1JlcXVlc3QaJi5ieXRlYmFzZS52MS5MaXN0UHVyY2hhc2VQbGFuc1Jlc3BvbnNlIh6C0+STAhgSFi92MS9zdWJzY3JpcHRpb24vcGxhbnNCrgEKD2NvbS5ieXRlYmFzZS52MUIYU3Vic2NyaXB0aW9uU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_protobuf_timestamp, file_v1_annotation]);+ fileDesc("Ch12MS9zdWJzY3JpcHRpb25fc2VydmljZS5wcm90bxILYnl0ZWJhc2UudjEiGAoWR2V0U3Vic2NyaXB0aW9uUmVxdWVzdCIfCh1FeHBvcnRWQ1NQcm92aWRlclVzZXJzUmVxdWVzdCInChRVcGxvYWRMaWNlbnNlUmVxdWVzdBIPCgdsaWNlbnNlGAEgASgJInsKFUNyZWF0ZVB1cmNoYXNlUmVxdWVzdBIjCgRwbGFuGAEgASgOMhUuYnl0ZWJhc2UudjEuUGxhblR5cGUSLgo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FnZZDqMAGC0+STAh4SHC92MS9zdWJzY3JpcHRpb24vcGF5bWVudEluZm8SwwEKFVZlcmlmeUNoZWNrb3V0U2Vzc2lvbhIpLmJ5dGViYXNlLnYxLlZlcmlmeUNoZWNrb3V0U2Vzc2lvblJlcXVlc3QaKi5ieXRlYmFzZS52MS5WZXJpZnlDaGVja291dFNlc3Npb25SZXNwb25zZSJTiuowFmJiLnN1YnNjcmlwdGlvbi5tYW5hZ2WQ6jABgtPkkwIvEi0vdjEvc3Vic2NyaXB0aW9uL2NoZWNrb3V0U2Vzc2lvbi97c2Vzc2lvbl9pZH0SggEKEUxpc3RQdXJjaGFzZVBsYW5zEiUuYnl0ZWJhc2UudjEuTGlzdFB1cmNoYXNlUGxhbnNSZXF1ZXN0GiYuYnl0ZWJhc2UudjEuTGlzdFB1cmNoYXNlUGxhbnNSZXNwb25zZSIegtPkkwIYEhYvdjEvc3Vic2NyaXB0aW9uL3BsYW5zQq4BCg9jb20uYnl0ZWJhc2UudjFCGFN1YnNjcmlwdGlvblNlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_httpbody, file_google_protobuf_timestamp, file_v1_annotation]);/*** Describes the message bytebase.v1.GetSubscriptionRequest.@@ -22,88 +23,95 @@ export const file_v1_subscription_service = /*@__PURE__*/export const GetSubscriptionRequestSchema = /*@__PURE__*/messageDesc(file_v1_subscription_service, 0);+/**+ * Describes the message bytebase.v1.ExportVCSProviderUsersRequest.+ * Use `create(ExportVCSProviderUsersRequestSchema)` to create a new message.+ */+export const ExportVCSProviderUsersRequestSchema = /*@__PURE__*/+ messageDesc(file_v1_subscription_service, 1);+/*** Describes the message bytebase.v1.UploadLicenseRequest.* Use `create(UploadLicenseRequestSchema)` to create a new message.*/export const UploadLicenseRequestSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 1);+ messageDesc(file_v1_subscription_service, 2);/*** Describes the message bytebase.v1.CreatePurchaseRequest.* Use `create(CreatePurchaseRequestSchema)` to create a new message.*/export const CreatePurchaseRequestSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 2);+ messageDesc(file_v1_subscription_service, 3);/*** Describes the message bytebase.v1.PurchaseResponse.* Use `create(PurchaseResponseSchema)` to create a new message.*/export const PurchaseResponseSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 3);+ messageDesc(file_v1_subscription_service, 4);/*** Describes the message bytebase.v1.VerifyCheckoutSessionRequest.* Use `create(VerifyCheckoutSessionRequestSchema)` to create a new message.*/export const VerifyCheckoutSessionRequestSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 4);+ messageDesc(file_v1_subscription_service, 5);/*** Describes the message bytebase.v1.VerifyCheckoutSessionResponse.* Use `create(VerifyCheckoutSessionResponseSchema)` to create a new message.*/export const VerifyCheckoutSessionResponseSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 5);+ messageDesc(file_v1_subscription_service, 6);/*** Describes the message bytebase.v1.UpdatePurchaseRequest.* Use `create(UpdatePurchaseRequestSchema)` to create a new message.*/export const UpdatePurchaseRequestSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 6);+ messageDesc(file_v1_subscription_service, 7);/*** Describes the message bytebase.v1.CancelPurchaseRequest.* Use `create(CancelPurchaseRequestSchema)` to create a new message.*/export const CancelPurchaseRequestSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 7);+ messageDesc(file_v1_subscription_service, 8);/*** Describes the message bytebase.v1.GetPaymentInfoRequest.* Use `create(GetPaymentInfoRequestSchema)` to create a new message.*/export const GetPaymentInfoRequestSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 8);+ messageDesc(file_v1_subscription_service, 9);/*** Describes the message bytebase.v1.PaymentInfo.* Use `create(PaymentInfoSchema)` to create a new message.*/export const PaymentInfoSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 9);+ messageDesc(file_v1_subscription_service, 10);/*** Describes the message bytebase.v1.PurchasePlan.* Use `create(PurchasePlanSchema)` to create a new message.*/export const PurchasePlanSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 10);+ messageDesc(file_v1_subscription_service, 11);/*** Describes the message bytebase.v1.PurchasePlanAdditional.* Use `create(PurchasePlanAdditionalSchema)` to create a new message.*/export const PurchasePlanAdditionalSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 11);+ messageDesc(file_v1_subscription_service, 12);/*** Describes the enum bytebase.v1.PurchasePlanAdditional.Type.*/export const PurchasePlanAdditional_TypeSchema = /*@__PURE__*/- enumDesc(file_v1_subscription_service, 11, 0);+ enumDesc(file_v1_subscription_service, 12, 0);/*** @generated from enum bytebase.v1.PurchasePlanAdditional.Type@@ -116,20 +124,20 @@ export const PurchasePlanAdditional_Type = /*@__PURE__*/* Use `create(PurchaseBillingMethodSchema)` to create a new message.*/export const PurchaseBillingMethodSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 12);+ messageDesc(file_v1_subscription_service, 13);/*** Describes the message bytebase.v1.PurchaseDiscount.* Use `create(PurchaseDiscountSchema)` to create a new message.*/export const PurchaseDiscountSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 13);+ messageDesc(file_v1_subscription_service, 14);/*** Describes the enum bytebase.v1.PurchaseDiscount.Type.*/export const PurchaseDiscount_TypeSchema = /*@__PURE__*/- enumDesc(file_v1_subscription_service, 13, 0);+ enumDesc(file_v1_subscription_service, 14, 0);/*** @generated from enum bytebase.v1.PurchaseDiscount.Type@@ -142,35 +150,35 @@ export const PurchaseDiscount_Type = /*@__PURE__*/* Use `create(ListPurchasePlansRequestSchema)` to create a new message.*/export const ListPurchasePlansRequestSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 14);+ messageDesc(file_v1_subscription_service, 15);/*** Describes the message bytebase.v1.ListPurchasePlansResponse.* Use `create(ListPurchasePlansResponseSchema)` to create a new message.*/export const ListPurchasePlansResponseSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 15);+ messageDesc(file_v1_subscription_service, 16);/*** Describes the message bytebase.v1.Subscription.* Use `create(SubscriptionSchema)` to create a new message.*/export const SubscriptionSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 16);+ messageDesc(file_v1_subscription_service, 17);/*** Describes the message bytebase.v1.PlanConfig.* Use `create(PlanConfigSchema)` to create a new message.*/export const PlanConfigSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 17);+ messageDesc(file_v1_subscription_service, 18);/*** Describes the message bytebase.v1.PlanLimitConfig.* Use `create(PlanLimitConfigSchema)` to create a new message.*/export const PlanLimitConfigSchema = /*@__PURE__*/- messageDesc(file_v1_subscription_service, 18);+ messageDesc(file_v1_subscription_service, 19);/*** Describes the enum bytebase.v1.BillingInterval.diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex c4520e4a6f..e08f361456 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -11159,6 +11159,12 @@ paths:Each rule should be a clear statement describing the desired schema constraint.Example: "All tables must have a primary key"Example: "VARCHAR columns should specify a maximum length"+ vcsUser:+ title: vcs_user+ description: |-+ The non-bot VCS pull request or merge request creator observed by bytebase-release.+ If absent, Bytebase skips VCS user tracking and VCS user limit enforcement.+ $ref: '#/components/schemas/bytebase.v1.VCSUser'title: CheckReleaseRequestrequired:- release@@ -14385,6 +14391,20 @@ paths:application/json:schema:$ref: '#/components/schemas/bytebase.v1.PurchaseResponse'+ /v1/subscription:vcsProviderUsersExport:+ get:+ tags:+ - SubscriptionService+ summary: ExportVCSProviderUsers+ description: Exports active VCS users as CSV.+ operationId: SubscriptionService_ExportVCSProviderUsers+ responses:+ "200":+ description: Success+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/google.api.HttpBody'/v1/users:get:tags:@@ -16938,6 +16958,12 @@ components:format: int32description: The number of users in the workspace IAM (for seat limit display).readOnly: true+ activeVcsUserCount:+ type: integer+ title: active_vcs_user_count+ format: int32+ description: The number of active VCS users seen in the active window.+ readOnly: truetitle: ActuatorInfoadditionalProperties: falsedescription: |-@@ -18284,6 +18310,12 @@ components:Each rule should be a clear statement describing the desired schema constraint.Example: "All tables must have a primary key"Example: "VARCHAR columns should specify a maximum length"+ vcsUser:+ title: vcs_user+ description: |-+ The non-bot VCS pull request or merge request creator observed by bytebase-release.+ If absent, Bytebase skips VCS user tracking and VCS user limit enforcement.+ $ref: '#/components/schemas/bytebase.v1.VCSUser'title: CheckReleaseRequestrequired:- parent@@ -20494,6 +20526,10 @@ components:description: The export file content.title: ExportResponseadditionalProperties: false+ bytebase.v1.ExportVCSProviderUsersRequest:+ type: object+ title: ExportVCSProviderUsersRequest+ additionalProperties: falsebytebase.v1.ExtensionMetadata:type: objectproperties:@@ -29515,6 +29551,23 @@ components:- BITBUCKET- AZURE_DEVOPSdescription: Version control system type.+ bytebase.v1.VCSUser:+ type: object+ properties:+ vcsType:+ title: vcs_type+ $ref: '#/components/schemas/bytebase.v1.VCSType'+ userId:+ type: string+ title: user_id+ userName:+ type: string+ title: user_name+ displayName:+ type: string+ title: display_name+ title: VCSUser+ additionalProperties: falsebytebase.v1.VerifyCheckoutSessionRequest:type: objectproperties:@@ -30036,6 +30089,72 @@ components:$ref: '#/components/schemas/google.protobuf.Duration'title: PasswordRestrictionadditionalProperties: false+ google.api.HttpBody:+ type: object+ properties:+ contentType:+ type: string+ title: content_type+ description: The HTTP Content-Type header value specifying the content type of the body.+ data:+ type: string+ title: data+ format: byte+ description: The HTTP request/response body as raw binary.+ extensions:+ type: array+ items:+ $ref: '#/components/schemas/google.protobuf.Any'+ title: extensions+ description: |-+ Application specific response metadata. Must be set in the first response+ for streaming APIs.+ title: HttpBody+ additionalProperties: false+ description: |-+ Message that represents an arbitrary HTTP body. It should only be used for+ payload formats that can't be represented as JSON, such as raw binary or+ an HTML page.+++ This message can be used both in streaming and non-streaming API methods in+ the request as well as the response.++ It can be used as a top-level request field, which is convenient if one+ wants to extract parameters from either the URL or HTTP template into the+ request fields and also want access to the raw HTTP body.++ Example:++ message GetResourceRequest {+ // A unique request id.+ string request_id = 1;++ // The raw HTTP body is bound to this field.+ google.api.HttpBody http_body = 2;++ }++ service ResourceService {+ rpc GetResource(GetResourceRequest)+ returns (google.api.HttpBody);+ rpc UpdateResource(google.api.HttpBody)+ returns (google.protobuf.Empty);++ }++ Example with streaming methods:++ service CaldavService {+ rpc GetCalendar(stream google.api.HttpBody)+ returns (stream google.api.HttpBody);+ rpc UpdateCalendar(stream google.api.HttpBody)+ returns (stream google.api.HttpBody);++ }++ Use of this type only changes how the request and response bodies are+ handled, all other features will continue to work unchanged.google.api.expr.v1alpha1.Constant:type: objectoneOf:diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 2776c75c18..6fa4251ed9 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -345,6 +345,9 @@- [PrincipalType](#bytebase-store-PrincipalType)- [WorkloadIdentityConfig.ProviderType](#bytebase-store-WorkloadIdentityConfig-ProviderType)+- [store/vcs_provider_user.proto](#store_vcs_provider_user-proto)+ - [VCSProviderUserPayload](#bytebase-store-VCSProviderUserPayload)+- [store/worksheet.proto](#store_worksheet-proto)- [WorkSheetOrganizerPayload](#bytebase-store-WorkSheetOrganizerPayload)@@ -5524,6 +5527,38 @@ ProviderType identifies the CI/CD platform.+<a name="store_vcs_provider_user-proto"></a>+<p align="right"><a href="#top">Top</a></p>++## store/vcs_provider_user.proto++++<a name="bytebase-store-VCSProviderUserPayload"></a>++### VCSProviderUserPayload++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| user_name | [string](#string) | | |+| display_name | [string](#string) | | |+++++++++++++++<a name="store_worksheet-proto"></a><p align="right"><a href="#top">Top</a></p>diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex 72177e8bf2..93f4a05640 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -1557,6 +1557,21 @@</li>+ <li>+ <a href="#store%2fvcs_provider_user.proto">store/vcs_provider_user.proto</a>+ <ul>++ <li>+ <a href="#bytebase.store.VCSProviderUserPayload"><span class="badge">M</span>VCSProviderUserPayload</a>+ </li>+++++ </ul>+ </li>++<li><a href="#store%2fworksheet.proto">store/worksheet.proto</a><ul>@@ -14690,6 +14705,51 @@ Used to auto-select workspace on next login instead of requiring a workspace pic+ <div class="file-heading">+ <h2 id="store/vcs_provider_user.proto">store/vcs_provider_user.proto</h2><a href="#title">Top</a>+ </div>+ <p></p>+++ <h3 id="bytebase.store.VCSProviderUserPayload">VCSProviderUserPayload</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>user_name</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>display_name</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>+++++++++++++<div class="file-heading"><h2 id="store/worksheet.proto">store/worksheet.proto</h2><a href="#title">Top</a></div>diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 788b3dc1ca..6cbb7b42fd 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -606,6 +606,7 @@- [Release.VCSSource](#bytebase-v1-Release-VCSSource)- [UndeleteReleaseRequest](#bytebase-v1-UndeleteReleaseRequest)- [UpdateReleaseRequest](#bytebase-v1-UpdateReleaseRequest)+ - [VCSUser](#bytebase-v1-VCSUser)- [Release.Type](#bytebase-v1-Release-Type)@@ -683,6 +684,7 @@- [v1/subscription_service.proto](#v1_subscription_service-proto)- [CancelPurchaseRequest](#bytebase-v1-CancelPurchaseRequest)- [CreatePurchaseRequest](#bytebase-v1-CreatePurchaseRequest)+ - [ExportVCSProviderUsersRequest](#bytebase-v1-ExportVCSProviderUsersRequest)- [GetPaymentInfoRequest](#bytebase-v1-GetPaymentInfoRequest)- [GetSubscriptionRequest](#bytebase-v1-GetSubscriptionRequest)- [ListPurchasePlansRequest](#bytebase-v1-ListPurchasePlansRequest)@@ -6836,6 +6838,7 @@ Actuator concept is similar to the Spring Boot Actuator.| restriction | [Restriction](#bytebase-v1-Restriction) | | || default_project | [string](#string) | | The default project for unassigned databases. Format: projects/{id} || user_count_in_iam | [int32](#int32) | | The number of users in the workspace IAM (for seat limit display). |+| active_vcs_user_count | [int32](#int32) | | The number of active VCS users seen in the active window. |@@ -9789,6 +9792,7 @@ ProjectService manages projects that group databases and changes.| release | [Release](#bytebase-v1-Release) | | The release to check. || targets | [string](#string) | repeated | The targets to dry-run the release. Can be database or databaseGroup. Format: projects/{project}/databaseGroups/{databaseGroup} instances/{instance}/databases/{database} || custom_rules | [string](#string) | | Custom linting rules in natural language for AI-powered validation. Each rule should be a clear statement describing the desired schema constraint. Example: "All tables must have a primary key" Example: "VARCHAR columns should specify a maximum length" |+| vcs_user | [VCSUser](#bytebase-v1-VCSUser) | | The non-bot VCS pull request or merge request creator observed by bytebase-release. If absent, Bytebase skips VCS user tracking and VCS user limit enforcement. |@@ -10039,6 +10043,24 @@ Version control system source information.++<a name="bytebase-v1-VCSUser"></a>++### VCSUser++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| vcs_type | [VCSType](#bytebase-v1-VCSType) | | |+| user_id | [string](#string) | | |+| user_name | [string](#string) | | |+| display_name | [string](#string) | | |+++++@@ -11119,6 +11141,16 @@ SheetService manages SQL scripts and saved queries.+<a name="bytebase-v1-ExportVCSProviderUsersRequest"></a>++### ExportVCSProviderUsersRequest+++++++<a name="bytebase-v1-GetPaymentInfoRequest"></a>### GetPaymentInfoRequest@@ -11539,6 +11571,7 @@ SubscriptionService manages enterprise subscriptions and licensing.| Method Name | Request Type | Response Type | Description || ----------- | ------------ | ------------- | ------------|| GetSubscription | [GetSubscriptionRequest](#bytebase-v1-GetSubscriptionRequest) | [Subscription](#bytebase-v1-Subscription) | GetSubscription returns the current subscription. If there is no license, we will return a free plan subscription without expiration time. If there is expired license, we will return a free plan subscription with the expiration time of the expired license. |+| ExportVCSProviderUsers | [ExportVCSProviderUsersRequest](#bytebase-v1-ExportVCSProviderUsersRequest) | [.google.api.HttpBody](#google-api-HttpBody) | Exports active VCS users as CSV. || UploadLicense | [UploadLicenseRequest](#bytebase-v1-UploadLicenseRequest) | [Subscription](#bytebase-v1-Subscription) | Uploads an enterprise license (self-hosted only). || CreatePurchase | [CreatePurchaseRequest](#bytebase-v1-CreatePurchaseRequest) | [PurchaseResponse](#bytebase-v1-PurchaseResponse) | CreatePurchase creates a new subscription purchase (SaaS only). Returns a Stripe Checkout URL for the user to complete payment. || UpdatePurchase | [UpdatePurchaseRequest](#bytebase-v1-UpdatePurchaseRequest) | [PurchaseResponse](#bytebase-v1-PurchaseResponse) | UpdatePurchase updates an existing subscription (SaaS only). May return a Stripe Checkout URL if payment method change is needed. |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex 6734be39cb..c3d337aafa 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -2498,6 +2498,10 @@<a href="#bytebase.v1.UpdateReleaseRequest"><span class="badge">M</span>UpdateReleaseRequest</a></li>+ <li>+ <a href="#bytebase.v1.VCSUser"><span class="badge">M</span>VCSUser</a>+ </li>+<li><a href="#bytebase.v1.Release.Type"><span class="badge">E</span>Release.Type</a>@@ -2784,6 +2788,10 @@<a href="#bytebase.v1.CreatePurchaseRequest"><span class="badge">M</span>CreatePurchaseRequest</a></li>+ <li>+ <a href="#bytebase.v1.ExportVCSProviderUsersRequest"><span class="badge">M</span>ExportVCSProviderUsersRequest</a>+ </li>+<li><a href="#bytebase.v1.GetPaymentInfoRequest"><span class="badge">M</span>GetPaymentInfoRequest</a></li>@@ -19934,6 +19942,13 @@ Format: projects/{id} </p></td><td><p>The number of users in the workspace IAM (for seat limit display). </p></td></tr>+ <tr>+ <td>active_vcs_user_count</td>+ <td><a href="#int32">int32</a></td>+ <td></td>+ <td><p>The number of active VCS users seen in the active window. </p></td>+ </tr>+</tbody></table>@@ -27697,6 +27712,14 @@ Example: "All tables must have a primary key"Example: "VARCHAR columns should specify a maximum length" </p></td></tr>+ <tr>+ <td>vcs_user</td>+ <td><a href="#bytebase.v1.VCSUser">VCSUser</a></td>+ <td></td>+ <td><p>The non-bot VCS pull request or merge request creator observed by bytebase-release.+If absent, Bytebase skips VCS user tracking and VCS user limit enforcement. </p></td>+ </tr>+</tbody></table>@@ -28256,6 +28279,51 @@ Format: projects/{project}/releases/{release} </p></td>+ <h3 id="bytebase.v1.VCSUser">VCSUser</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_type</td>+ <td><a href="#bytebase.v1.VCSType">VCSType</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>user_id</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>user_name</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>display_name</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>+++++<h3 id="bytebase.v1.Release.Type">Release.Type</h3>@@ -31416,6 +31484,13 @@ Required. </p></td>+ <h3 id="bytebase.v1.ExportVCSProviderUsersRequest">ExportVCSProviderUsersRequest</h3>+ <p></p>+++++<h3 id="bytebase.v1.GetPaymentInfoRequest">GetPaymentInfoRequest</h3><p></p>@@ -32580,6 +32655,13 @@ If there is no license, we will return a free plan subscription without expiratiIf there is expired license, we will return a free plan subscription with the expiration time of the expired license.</p></td></tr>+ <tr>+ <td>ExportVCSProviderUsers</td>+ <td><a href="#bytebase.v1.ExportVCSProviderUsersRequest">ExportVCSProviderUsersRequest</a></td>+ <td><a href="#google.api.HttpBody">.google.api.HttpBody</a></td>+ <td><p>Exports active VCS users as CSV.</p></td>+ </tr>+<tr><td>UploadLicense</td><td><a href="#bytebase.v1.UploadLicenseRequest">UploadLicenseRequest</a></td>@@ -32661,6 +32743,16 @@ May return a Stripe Checkout URL if payment method change is needed.</p></td>+ <tr>+ <td>ExportVCSProviderUsers</td>+ <td>GET</td>+ <td>/v1/subscription:vcsProviderUsersExport</td>+ <td></td>+ </tr>++++<tr><td>UploadLicense</td><td>PATCH</td>diff --git a/proto/store/store/vcs_provider_user.proto b/proto/store/store/vcs_provider_user.protonew file mode 100644index 0000000000..02cd4b5a74--- /dev/null+++ b/proto/store/store/vcs_provider_user.proto@@ -0,0 +1,10 @@+syntax = "proto3";++package bytebase.store;++option go_package = "generated-go/store";++message VCSProviderUserPayload {+ string user_name = 1;+ string display_name = 2;+}diff --git a/proto/v1/v1/actuator_service.proto b/proto/v1/v1/actuator_service.protoindex 368c83ee14..7070dcf624 100644--- a/proto/v1/v1/actuator_service.proto+++ b/proto/v1/v1/actuator_service.proto@@ -145,4 +145,7 @@ message ActuatorInfo {// The number of users in the workspace IAM (for seat limit display).int32 user_count_in_iam = 27 [(google.api.field_behavior) = OUTPUT_ONLY];++ // The number of active VCS users seen in the active window.+ int32 active_vcs_user_count = 28 [(google.api.field_behavior) = OUTPUT_ONLY];}diff --git a/proto/v1/v1/release_service.proto b/proto/v1/v1/release_service.protoindex 886e037a3d..aaed616a89 100644--- a/proto/v1/v1/release_service.proto+++ b/proto/v1/v1/release_service.proto@@ -218,6 +218,17 @@ message CheckReleaseRequest {// Example: "All tables must have a primary key"// Example: "VARCHAR columns should specify a maximum length"string custom_rules = 4;++ // The non-bot VCS pull request or merge request creator observed by bytebase-release.+ // If absent, Bytebase skips VCS user tracking and VCS user limit enforcement.+ VCSUser vcs_user = 5;+}++message VCSUser {+ VCSType vcs_type = 1;+ string user_id = 2;+ string user_name = 3;+ string display_name = 4;}message CheckReleaseResponse {diff --git a/proto/v1/v1/subscription_service.proto b/proto/v1/v1/subscription_service.protoindex 50ea6ad429..b7e7b14b08 100644--- a/proto/v1/v1/subscription_service.proto+++ b/proto/v1/v1/subscription_service.proto@@ -5,6 +5,7 @@ package bytebase.v1;import "google/api/annotations.proto";import "google/api/client.proto";import "google/api/field_behavior.proto";+import "google/api/httpbody.proto";import "google/protobuf/timestamp.proto";import "v1/annotation.proto";@@ -20,6 +21,13 @@ service SubscriptionService {option (google.api.method_signature) = "";}+ // Exports active VCS users as CSV.+ rpc ExportVCSProviderUsers(ExportVCSProviderUsersRequest) returns (google.api.HttpBody) {+ option (google.api.http) = {get: "/v1/subscription:vcsProviderUsersExport"};+ option (bytebase.v1.permission) = "bb.subscription.manage";+ option (bytebase.v1.auth_method) = IAM;+ }+// Uploads an enterprise license (self-hosted only).rpc UploadLicense(UploadLicenseRequest) returns (Subscription) {option (google.api.http) = {@@ -84,6 +92,8 @@ service SubscriptionService {message GetSubscriptionRequest {}+message ExportVCSProviderUsersRequest {}+message UploadLicenseRequest {string license = 1;}