Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: update vcs api (#11334)
Danny Xubde95feaaab6
diff --git a/frontend/src/components/RepositorySetupWizard.vue b/frontend/src/components/RepositorySetupWizard.vueindex e046ac8c26..330f2678e8 100644--- a/frontend/src/components/RepositorySetupWizard.vue+++ b/frontend/src/components/RepositorySetupWizard.vue@@ -154,11 +154,12 @@ const tryFinishSetup = async () => {const repositoryCreate: Partial<ProjectGitOpsInfo> = {vcs: state.config.vcs.name,title: state.config.repositoryInfo.name,+ externalId: externalId,+ baseDirectory: state.config.repositoryConfig.baseDirectory,+ branch: state.config.repositoryConfig.branch,+ // TODO(d): move these to create VCS connector.fullPath: state.config.repositoryInfo.fullPath,webUrl: state.config.repositoryInfo.webUrl,- branch: state.config.repositoryConfig.branch,- baseDirectory: state.config.repositoryConfig.baseDirectory,- externalId: externalId,};await repositoryV1Store.upsertRepository(props.project.name,diff --git a/frontend/src/types/proto/v1/vcs_provider_service.ts b/frontend/src/types/proto/v1/vcs_provider_service.tsindex 1a970ee59f..1dbe6a2b7e 100644--- a/frontend/src/types/proto/v1/vcs_provider_service.ts+++ b/frontend/src/types/proto/v1/vcs_provider_service.ts@@ -188,18 +188,21 @@ export interface ProjectGitOpsInfo {vcs: string;/** The title of the repository. For axample: sample. */title: string;- /** The full_path of the repository. For example: bytebase/sample. */- fullPath: string;- /** The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. */- webUrl: string;- /** The branch Bytebase listens to for changes. For example: main. */- branch: string;- /** The root directory where Bytebase observes the file change. If empty, then it observes the entire repository. */- baseDirectory: string;/** The reposition external id in target VCS. */externalId: string;+ /** The root directory where Bytebase observes the file change. If empty, then it observes the entire repository. */+ baseDirectory: string;+ /** The branch Bytebase listens to for changes. For example: main. */+ branch: string;/** The webhook endpoint ID of the repository. */webhookEndpointId: string;+ /**+ * TODO(d): move these to create VCS connector API.+ * The full_path of the repository. For example: bytebase/sample.+ */+ fullPath: string;+ /** The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. */+ webUrl: string;}function createBaseCreateVCSProviderRequest(): CreateVCSProviderRequest {@@ -1084,12 +1087,12 @@ function createBaseProjectGitOpsInfo(): ProjectGitOpsInfo {name: "",vcs: "",title: "",- fullPath: "",- webUrl: "",- branch: "",- baseDirectory: "",externalId: "",+ baseDirectory: "",+ branch: "",webhookEndpointId: "",+ fullPath: "",+ webUrl: "",};}@@ -1104,23 +1107,23 @@ export const ProjectGitOpsInfo = {if (message.title !== "") {writer.uint32(26).string(message.title);}- if (message.fullPath !== "") {- writer.uint32(34).string(message.fullPath);+ if (message.externalId !== "") {+ writer.uint32(34).string(message.externalId);}- if (message.webUrl !== "") {- writer.uint32(42).string(message.webUrl);+ if (message.baseDirectory !== "") {+ writer.uint32(42).string(message.baseDirectory);}if (message.branch !== "") {writer.uint32(50).string(message.branch);}- if (message.baseDirectory !== "") {- writer.uint32(58).string(message.baseDirectory);+ if (message.webhookEndpointId !== "") {+ writer.uint32(58).string(message.webhookEndpointId);}- if (message.externalId !== "") {- writer.uint32(90).string(message.externalId);+ if (message.fullPath !== "") {+ writer.uint32(66).string(message.fullPath);}- if (message.webhookEndpointId !== "") {- writer.uint32(106).string(message.webhookEndpointId);+ if (message.webUrl !== "") {+ writer.uint32(74).string(message.webUrl);}return writer;},@@ -1158,14 +1161,14 @@ export const ProjectGitOpsInfo = {break;}- message.fullPath = reader.string();+ message.externalId = reader.string();continue;case 5:if (tag !== 42) {break;}- message.webUrl = reader.string();+ message.baseDirectory = reader.string();continue;case 6:if (tag !== 50) {@@ -1179,21 +1182,21 @@ export const ProjectGitOpsInfo = {break;}- message.baseDirectory = reader.string();+ message.webhookEndpointId = reader.string();continue;- case 11:- if (tag !== 90) {+ case 8:+ if (tag !== 66) {break;}- message.externalId = reader.string();+ message.fullPath = reader.string();continue;- case 13:- if (tag !== 106) {+ case 9:+ if (tag !== 74) {break;}- message.webhookEndpointId = reader.string();+ message.webUrl = reader.string();continue;}if ((tag & 7) === 4 || tag === 0) {@@ -1209,12 +1212,12 @@ export const ProjectGitOpsInfo = {name: isSet(object.name) ? globalThis.String(object.name) : "",vcs: isSet(object.vcs) ? globalThis.String(object.vcs) : "",title: isSet(object.title) ? globalThis.String(object.title) : "",- fullPath: isSet(object.fullPath) ? globalThis.String(object.fullPath) : "",- webUrl: isSet(object.webUrl) ? globalThis.String(object.webUrl) : "",- branch: isSet(object.branch) ? globalThis.String(object.branch) : "",- baseDirectory: isSet(object.baseDirectory) ? globalThis.String(object.baseDirectory) : "",externalId: isSet(object.externalId) ? globalThis.String(object.externalId) : "",+ baseDirectory: isSet(object.baseDirectory) ? globalThis.String(object.baseDirectory) : "",+ branch: isSet(object.branch) ? globalThis.String(object.branch) : "",webhookEndpointId: isSet(object.webhookEndpointId) ? globalThis.String(object.webhookEndpointId) : "",+ fullPath: isSet(object.fullPath) ? globalThis.String(object.fullPath) : "",+ webUrl: isSet(object.webUrl) ? globalThis.String(object.webUrl) : "",};},@@ -1229,24 +1232,24 @@ export const ProjectGitOpsInfo = {if (message.title !== "") {obj.title = message.title;}- if (message.fullPath !== "") {- obj.fullPath = message.fullPath;- }- if (message.webUrl !== "") {- obj.webUrl = message.webUrl;- }- if (message.branch !== "") {- obj.branch = message.branch;+ if (message.externalId !== "") {+ obj.externalId = message.externalId;}if (message.baseDirectory !== "") {obj.baseDirectory = message.baseDirectory;}- if (message.externalId !== "") {- obj.externalId = message.externalId;+ if (message.branch !== "") {+ obj.branch = message.branch;}if (message.webhookEndpointId !== "") {obj.webhookEndpointId = message.webhookEndpointId;}+ if (message.fullPath !== "") {+ obj.fullPath = message.fullPath;+ }+ if (message.webUrl !== "") {+ obj.webUrl = message.webUrl;+ }return obj;},@@ -1258,12 +1261,12 @@ export const ProjectGitOpsInfo = {message.name = object.name ?? "";message.vcs = object.vcs ?? "";message.title = object.title ?? "";- message.fullPath = object.fullPath ?? "";- message.webUrl = object.webUrl ?? "";- message.branch = object.branch ?? "";- message.baseDirectory = object.baseDirectory ?? "";message.externalId = object.externalId ?? "";+ message.baseDirectory = object.baseDirectory ?? "";+ message.branch = object.branch ?? "";message.webhookEndpointId = object.webhookEndpointId ?? "";+ message.fullPath = object.fullPath ?? "";+ message.webUrl = object.webUrl ?? "";return message;},};diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex a78416c649..205428019f 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -5727,12 +5727,12 @@ This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. || name | [string](#string) | | The name of the linked repository, generated by the server, and also is the unique identifier. Format: projects/{project}/gitOpsInfo || vcs | [string](#string) | | The name of the VCS. || title | [string](#string) | | The title of the repository. For axample: sample. |-| full_path | [string](#string) | | The full_path of the repository. For example: bytebase/sample. |-| web_url | [string](#string) | | The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. |-| branch | [string](#string) | | The branch Bytebase listens to for changes. For example: main. |-| base_directory | [string](#string) | | The root directory where Bytebase observes the file change. If empty, then it observes the entire repository. || external_id | [string](#string) | | The reposition external id in target VCS. |+| base_directory | [string](#string) | | The root directory where Bytebase observes the file change. If empty, then it observes the entire repository. |+| branch | [string](#string) | | The branch Bytebase listens to for changes. For example: main. || webhook_endpoint_id | [string](#string) | | The webhook endpoint ID of the repository. |+| full_path | [string](#string) | | TODO(d): move these to create VCS connector API. The full_path of the repository. For example: bytebase/sample. |+| web_url | [string](#string) | | The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex 3f2504f341..c97b47b064 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -16381,17 +16381,17 @@ Format: projects/{project}/gitOpsInfo </p></td></tr><tr>- <td>full_path</td>+ <td>external_id</td><td><a href="#string">string</a></td><td></td>- <td><p>The full_path of the repository. For example: bytebase/sample. </p></td>+ <td><p>The reposition external id in target VCS. </p></td></tr><tr>- <td>web_url</td>+ <td>base_directory</td><td><a href="#string">string</a></td><td></td>- <td><p>The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. </p></td>+ <td><p>The root directory where Bytebase observes the file change. If empty, then it observes the entire repository. </p></td></tr><tr>@@ -16402,24 +16402,25 @@ Format: projects/{project}/gitOpsInfo </p></td></tr><tr>- <td>base_directory</td>+ <td>webhook_endpoint_id</td><td><a href="#string">string</a></td><td></td>- <td><p>The root directory where Bytebase observes the file change. If empty, then it observes the entire repository. </p></td>+ <td><p>The webhook endpoint ID of the repository. </p></td></tr><tr>- <td>external_id</td>+ <td>full_path</td><td><a href="#string">string</a></td><td></td>- <td><p>The reposition external id in target VCS. </p></td>+ <td><p>TODO(d): move these to create VCS connector API.+The full_path of the repository. For example: bytebase/sample. </p></td></tr><tr>- <td>webhook_endpoint_id</td>+ <td>web_url</td><td><a href="#string">string</a></td><td></td>- <td><p>The webhook endpoint ID of the repository. </p></td>+ <td><p>The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. </p></td></tr></tbody>diff --git a/proto/generated-go/v1/vcs_provider_service.pb.go b/proto/generated-go/v1/vcs_provider_service.pb.goindex b33d84600b..e2813cc431 100644--- a/proto/generated-go/v1/vcs_provider_service.pb.go+++ b/proto/generated-go/v1/vcs_provider_service.pb.go@@ -705,18 +705,19 @@ type ProjectGitOpsInfo struct {Vcs string `protobuf:"bytes,2,opt,name=vcs,proto3" json:"vcs,omitempty"`// The title of the repository. For axample: sample.Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`- // The full_path of the repository. For example: bytebase/sample.- FullPath string `protobuf:"bytes,4,opt,name=full_path,json=fullPath,proto3" json:"full_path,omitempty"`- // The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample.- WebUrl string `protobuf:"bytes,5,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"`+ // The reposition external id in target VCS.+ ExternalId string `protobuf:"bytes,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`+ // The root directory where Bytebase observes the file change. If empty, then it observes the entire repository.+ BaseDirectory string `protobuf:"bytes,5,opt,name=base_directory,json=baseDirectory,proto3" json:"base_directory,omitempty"`// The branch Bytebase listens to for changes. For example: main.Branch string `protobuf:"bytes,6,opt,name=branch,proto3" json:"branch,omitempty"`- // The root directory where Bytebase observes the file change. If empty, then it observes the entire repository.- BaseDirectory string `protobuf:"bytes,7,opt,name=base_directory,json=baseDirectory,proto3" json:"base_directory,omitempty"`- // The reposition external id in target VCS.- ExternalId string `protobuf:"bytes,11,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`// The webhook endpoint ID of the repository.- WebhookEndpointId string `protobuf:"bytes,13,opt,name=webhook_endpoint_id,json=webhookEndpointId,proto3" json:"webhook_endpoint_id,omitempty"`+ WebhookEndpointId string `protobuf:"bytes,7,opt,name=webhook_endpoint_id,json=webhookEndpointId,proto3" json:"webhook_endpoint_id,omitempty"`+ // TODO(d): move these to create VCS connector API.+ // The full_path of the repository. For example: bytebase/sample.+ FullPath string `protobuf:"bytes,8,opt,name=full_path,json=fullPath,proto3" json:"full_path,omitempty"`+ // The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample.+ WebUrl string `protobuf:"bytes,9,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"`}func (x *ProjectGitOpsInfo) Reset() {@@ -772,16 +773,16 @@ func (x *ProjectGitOpsInfo) GetTitle() string {return ""}-func (x *ProjectGitOpsInfo) GetFullPath() string {+func (x *ProjectGitOpsInfo) GetExternalId() string {if x != nil {- return x.FullPath+ return x.ExternalId}return ""}-func (x *ProjectGitOpsInfo) GetWebUrl() string {+func (x *ProjectGitOpsInfo) GetBaseDirectory() string {if x != nil {- return x.WebUrl+ return x.BaseDirectory}return ""}@@ -793,23 +794,23 @@ func (x *ProjectGitOpsInfo) GetBranch() string {return ""}-func (x *ProjectGitOpsInfo) GetBaseDirectory() string {+func (x *ProjectGitOpsInfo) GetWebhookEndpointId() string {if x != nil {- return x.BaseDirectory+ return x.WebhookEndpointId}return ""}-func (x *ProjectGitOpsInfo) GetExternalId() string {+func (x *ProjectGitOpsInfo) GetFullPath() string {if x != nil {- return x.ExternalId+ return x.FullPath}return ""}-func (x *ProjectGitOpsInfo) GetWebhookEndpointId() string {+func (x *ProjectGitOpsInfo) GetWebUrl() string {if x != nil {- return x.WebhookEndpointId+ return x.WebUrl}return ""}@@ -993,20 +994,20 @@ var file_v1_vcs_provider_service_proto_rawDesc = []byte{0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52,0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x63, 0x73, 0x18, 0x02, 0x20, 0x01,0x28, 0x09, 0x52, 0x03, 0x76, 0x63, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,- 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a,- 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65,- 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62,- 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x06, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x62,- 0x61, 0x73, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f,- 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69,- 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61,- 0x6c, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x13, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x65,- 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09,- 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x11, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x6e,- 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x64, 0x32, 0x83, 0x08, 0x0a, 0x12, 0x56, 0x43, 0x53,+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1f, 0x0a,+ 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x25,+ 0x0a, 0x0e, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79,+ 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x44, 0x69, 0x72, 0x65,+ 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18,+ 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x33, 0x0a,+ 0x13, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e,+ 0x74, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52,+ 0x11, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74,+ 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18,+ 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12,+ 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09,+ 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x32, 0x83, 0x08, 0x0a, 0x12, 0x56, 0x43, 0x53,0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,0x78, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x56, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,0x72, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,diff --git a/proto/v1/vcs_provider_service.proto b/proto/v1/vcs_provider_service.protoindex 40c01dffc9..819a3c53f3 100644--- a/proto/v1/vcs_provider_service.proto+++ b/proto/v1/vcs_provider_service.proto@@ -176,21 +176,22 @@ message ProjectGitOpsInfo {// The title of the repository. For axample: sample.string title = 3;- // The full_path of the repository. For example: bytebase/sample.- string full_path = 4;+ // The reposition external id in target VCS.+ string external_id = 4;- // The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample.- string web_url = 5;+ // The root directory where Bytebase observes the file change. If empty, then it observes the entire repository.+ string base_directory = 5;// The branch Bytebase listens to for changes. For example: main.string branch = 6;- // The root directory where Bytebase observes the file change. If empty, then it observes the entire repository.- string base_directory = 7;+ // The webhook endpoint ID of the repository.+ string webhook_endpoint_id = 7 [(google.api.field_behavior) = OUTPUT_ONLY];- // The reposition external id in target VCS.- string external_id = 11;+ // TODO(d): move these to create VCS connector API.+ // The full_path of the repository. For example: bytebase/sample.+ string full_path = 8;- // The webhook endpoint ID of the repository.- string webhook_endpoint_id = 13 [(google.api.field_behavior) = OUTPUT_ONLY];+ // The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample.+ string web_url = 9;}