From 7f2977104d5024d61e033e4970d88e57a5edfb4e Mon Sep 17 00:00:00 2001 From: Julian Figueroa Date: Mon, 27 Nov 2023 11:55:49 -0500 Subject: [PATCH 1/4] Split create repo and sync module into different steps (#2624) --- .../buf/bufsync/bufsyncapi/sync_handler.go | 85 ++++++------------- 1 file changed, 28 insertions(+), 57 deletions(-) diff --git a/private/buf/bufsync/bufsyncapi/sync_handler.go b/private/buf/bufsync/bufsyncapi/sync_handler.go index 2f0ecbb698..cd9415fc96 100644 --- a/private/buf/bufsync/bufsyncapi/sync_handler.go +++ b/private/buf/bufsync/bufsyncapi/sync_handler.go @@ -54,6 +54,7 @@ type syncHandler struct { moduleIdentityToRepositoryIDCache map[string]string moduleIdentityToDefaultBranchCache map[string]string + existingModuleIdentityCache map[string]struct{} } func newSyncHandler( @@ -75,6 +76,7 @@ func newSyncHandler( createWithVisibility: createWithVisibility, moduleIdentityToRepositoryIDCache: make(map[string]string), moduleIdentityToDefaultBranchCache: make(map[string]string), + existingModuleIdentityCache: make(map[string]struct{}), syncServiceClientFactory: syncServiceClientFactory, referenceServiceClientFactory: referenceServiceClientFactory, repositoryServiceClientFactory: repositoryServiceClientFactory, @@ -244,7 +246,12 @@ func (h *syncHandler) SyncModuleBranch(ctx context.Context, moduleBranch bufsync if err != nil { return fmt.Errorf("read bucket for commit %q: %w", moduleCommit.Commit().Hash(), err) } - syncPoint, err := h.pushOrCreate( + if h.createWithVisibility != nil { + if err := h.createRepository(ctx, moduleBranch.TargetModuleIdentity()); err != nil { + return fmt.Errorf("create repo %s: %w", moduleBranch.TargetModuleIdentity(), err) + } + } + syncPoint, err := h.syncCommitModule( ctx, moduleCommit.Commit(), moduleBranch.BranchName(), @@ -253,26 +260,26 @@ func (h *syncHandler) SyncModuleBranch(ctx context.Context, moduleBranch bufsync bucket, ) if err != nil { - // We failed to push. We fail hard on this because the error may be recoverable + // We failed to sync. We fail hard on this because the error may be recoverable // (i.e., the BSR may be down) and we should re-attempt this commit. return fmt.Errorf( - "failed to push or create %s at %s: %w", + "sync module %s at branch %s commit %s directory %s: %w", moduleBranch.TargetModuleIdentity().IdentityString(), + moduleBranch.BranchName(), moduleCommit.Commit().Hash(), + moduleBranch.Directory(), err, ) } - _, err = h.container.Stderr().Write([]byte( + syncMsg := fmt.Sprintf( // from local -> to remote // :: -> : - fmt.Sprintf( - "%s:%s:%s -> %s:%s\n", - moduleBranch.Directory(), moduleBranch.BranchName(), moduleCommit.Commit().Hash().Hex(), - moduleBranch.TargetModuleIdentity().IdentityString(), syncPoint.BsrCommitName, - )), + "%s:%s:%s -> %s:%s\n", + moduleBranch.Directory(), moduleBranch.BranchName(), moduleCommit.Commit().Hash().Hex(), + moduleBranch.TargetModuleIdentity().IdentityString(), syncPoint.BsrCommitName, ) - if err != nil { - return err + if _, err := h.container.Stderr().Write([]byte(syncMsg)); err != nil { + return fmt.Errorf("write %q to stderr: %w", syncMsg, err) } } return nil @@ -427,48 +434,7 @@ func (h *syncHandler) bsrTagExists( return true, nil } -func (h *syncHandler) pushOrCreate( - ctx context.Context, - commit git.Commit, - branchName string, - tags []string, - moduleIdentity bufmoduleref.ModuleIdentity, - moduleBucket storage.ReadBucket, -) (*registryv1alpha1.GitSyncPoint, error) { - modulePin, err := h.push( - ctx, - commit, - branchName, - tags, - moduleIdentity, - moduleBucket, - ) - if err != nil { - // We rely on Push* returning a NotFound error to denote the repository is not created. - // This technically could be a NotFound error for some other entity than the repository - // in question, however if it is, then this Create call will just fail as the repository - // is already created, and there is no side effect. The 99% case is that a NotFound - // error is because the repository does not exist, and we want to avoid having to do - // a GetRepository RPC call for every call to push --create. - if h.createWithVisibility != nil && connect.CodeOf(err) == connect.CodeNotFound { - if err := h.create(ctx, moduleIdentity); err != nil { - return nil, fmt.Errorf("create repo: %w", err) - } - return h.push( - ctx, - commit, - branchName, - tags, - moduleIdentity, - moduleBucket, - ) - } - return nil, fmt.Errorf("push: %w", err) - } - return modulePin, nil -} - -func (h *syncHandler) push( +func (h *syncHandler) syncCommitModule( ctx context.Context, commit git.Commit, branchName string, @@ -510,10 +476,13 @@ func (h *syncHandler) push( return resp.Msg.SyncPoint, nil } -func (h *syncHandler) create( +func (h *syncHandler) createRepository( ctx context.Context, moduleIdentity bufmoduleref.ModuleIdentity, ) error { + if _, alreadyExists := h.existingModuleIdentityCache[moduleIdentity.IdentityString()]; alreadyExists { + return nil + } service := h.repositoryServiceClientFactory(moduleIdentity.Remote()) fullName := moduleIdentity.Owner() + "/" + moduleIdentity.Repository() _, err := service.CreateRepositoryByFullName( @@ -523,8 +492,10 @@ func (h *syncHandler) create( Visibility: *h.createWithVisibility, }), ) - if err != nil && connect.CodeOf(err) == connect.CodeAlreadyExists { - return connect.NewError(connect.CodeInternal, fmt.Errorf("expected repository %s to be missing but found the repository to already exist", fullName)) + if err != nil && connect.CodeOf(err) != connect.CodeAlreadyExists { + return err } - return err + // if created successfully or if it already existed, cache it + h.existingModuleIdentityCache[moduleIdentity.IdentityString()] = struct{}{} + return nil } From 4eab82bbd07ac62faf00281104e8fd3f7a378c42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 12:18:29 -0500 Subject: [PATCH 2/4] Bump buf.build/gen/go/bufbuild/registry/protocolbuffers/go from 1.31.0-20231115201000-c928b3e4cf35.2 to 1.31.0-20231124180711-402ed9081590.2 (#2625) [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=buf.build/gen/go/bufbuild/registry/protocolbuffers/go&package-manager=go_modules&previous-version=1.31.0-20231115201000-c928b3e4cf35.2&new-version=1.31.0-20231124180711-402ed9081590.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7e3cadb45e..cb587c8d99 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2 - buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.31.0-20231115201000-c928b3e4cf35.2 + buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.31.0-20231124180711-402ed9081590.2 connectrpc.com/connect v1.12.0 connectrpc.com/otelconnect v0.6.0 github.com/bufbuild/protocompile v0.6.1-0.20231108163138-146b831231f7 diff --git a/go.sum b/go.sum index ee6dfae86d..3e966993c3 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20230914171853-63dfe56cc2c4.2/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew= buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2 h1:iEPA5SBtdLJNwQis/SrcCuDWJh5E1V0mVO4Ih7/mRbg= buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew= -buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.31.0-20231115201000-c928b3e4cf35.2 h1:RtQRybrXO6b9O7zUlmsTprwABT3akDyO+uxLj2LhxnY= -buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.31.0-20231115201000-c928b3e4cf35.2/go.mod h1:3Ion4eJWjUDfJyrUXSgtB3zO5ZweZtyvNuEc+fyMBCk= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.31.0-20231124180711-402ed9081590.2 h1:d5m46CpbNFAjhFYNk3h3irffcWQD9AM7XNpZMUZQCcg= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.31.0-20231124180711-402ed9081590.2/go.mod h1:3Ion4eJWjUDfJyrUXSgtB3zO5ZweZtyvNuEc+fyMBCk= connectrpc.com/connect v1.12.0 h1:HwKdOY0lGhhoHdsza+hW55aqHEC64pYpObRNoAgn70g= connectrpc.com/connect v1.12.0/go.mod h1:3AGaO6RRGMx5IKFfqbe3hvK1NqLosFNP2BxDYTPmNPo= connectrpc.com/otelconnect v0.6.0 h1:VJAdQL9+sgdUw9+7+J+jq8pQo/h1S7tSFv2+vDcR7bU= From 57a9b07c78333e1ba8365a6b443c072ada4ff0ff Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Mon, 27 Nov 2023 19:30:53 -0600 Subject: [PATCH 3/4] Add support for C language plugins (#2626) --- private/bufpkg/bufplugin/bufplugin_test.go | 3 +- .../registry/v1alpha1/plugin_curation.pb.go | 179 +++++++++--------- .../registry/v1alpha1/plugin_curation.proto | 1 + 3 files changed, 95 insertions(+), 88 deletions(-) diff --git a/private/bufpkg/bufplugin/bufplugin_test.go b/private/bufpkg/bufplugin/bufplugin_test.go index 8d4a33116f..29e6c52b24 100644 --- a/private/bufpkg/bufplugin/bufplugin_test.go +++ b/private/bufpkg/bufplugin/bufplugin_test.go @@ -203,12 +203,13 @@ func TestLanguagesToProtoLanguages(t *testing.T) { }, protoLanguages, ) - protoLanguages, err = OutputLanguagesToProtoLanguages([]string{"java", "kotlin"}) + protoLanguages, err = OutputLanguagesToProtoLanguages([]string{"java", "kotlin", "c"}) require.NoError(t, err) assert.Equal(t, []registryv1alpha1.PluginLanguage{ registryv1alpha1.PluginLanguage_PLUGIN_LANGUAGE_JAVA, registryv1alpha1.PluginLanguage_PLUGIN_LANGUAGE_KOTLIN, + registryv1alpha1.PluginLanguage_PLUGIN_LANGUAGE_C, }, protoLanguages, ) diff --git a/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin_curation.pb.go b/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin_curation.pb.go index 1098728eb7..a245ab06eb 100644 --- a/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin_curation.pb.go +++ b/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin_curation.pb.go @@ -167,6 +167,7 @@ const ( PluginLanguage_PLUGIN_LANGUAGE_PHP PluginLanguage = 13 PluginLanguage_PLUGIN_LANGUAGE_CSHARP PluginLanguage = 14 PluginLanguage_PLUGIN_LANGUAGE_SCALA PluginLanguage = 15 + PluginLanguage_PLUGIN_LANGUAGE_C PluginLanguage = 16 ) // Enum value maps for PluginLanguage. @@ -188,6 +189,7 @@ var ( 13: "PLUGIN_LANGUAGE_PHP", 14: "PLUGIN_LANGUAGE_CSHARP", 15: "PLUGIN_LANGUAGE_SCALA", + 16: "PLUGIN_LANGUAGE_C", } PluginLanguage_value = map[string]int32{ "PLUGIN_LANGUAGE_UNSPECIFIED": 0, @@ -206,6 +208,7 @@ var ( "PLUGIN_LANGUAGE_PHP": 13, "PLUGIN_LANGUAGE_CSHARP": 14, "PLUGIN_LANGUAGE_SCALA": 15, + "PLUGIN_LANGUAGE_C": 16, } ) @@ -3197,7 +3200,7 @@ var file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDesc = []byte{ 0x1a, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x57, 0x49, 0x46, 0x54, 0x10, 0x04, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x10, 0x05, 0x2a, 0xce, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x10, 0x05, 0x2a, 0xe5, 0x03, 0x0a, 0x0e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, @@ -3226,99 +3229,101 @@ var file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDesc = []byte{ 0x47, 0x45, 0x5f, 0x50, 0x48, 0x50, 0x10, 0x0d, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x43, 0x53, 0x48, 0x41, 0x52, 0x50, 0x10, 0x0e, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, - 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x53, 0x43, 0x41, 0x4c, 0x41, 0x10, 0x0f, 0x2a, - 0x6e, 0x0a, 0x0e, 0x4e, 0x50, 0x4d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x79, 0x6c, - 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x4e, 0x50, 0x4d, 0x5f, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, - 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x50, 0x4d, 0x5f, 0x49, 0x4d, 0x50, 0x4f, 0x52, - 0x54, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x55, 0x4c, 0x45, 0x10, 0x01, - 0x12, 0x1d, 0x0a, 0x19, 0x4e, 0x50, 0x4d, 0x5f, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x53, - 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x4a, 0x53, 0x10, 0x02, 0x2a, - 0xb3, 0x01, 0x0a, 0x11, 0x53, 0x77, 0x69, 0x66, 0x74, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x1f, 0x53, 0x57, 0x49, 0x46, 0x54, 0x5f, 0x50, - 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x53, 0x57, - 0x49, 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x4d, 0x41, 0x43, 0x4f, 0x53, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x57, 0x49, - 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x49, 0x4f, 0x53, 0x10, 0x02, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x57, 0x49, 0x46, 0x54, 0x5f, - 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x57, 0x41, - 0x54, 0x43, 0x48, 0x4f, 0x53, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x57, 0x49, 0x46, 0x54, - 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, - 0x56, 0x4f, 0x53, 0x10, 0x04, 0x2a, 0x7c, 0x0a, 0x11, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x50, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x59, - 0x54, 0x48, 0x4f, 0x4e, 0x5f, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x1f, 0x0a, 0x1b, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x5f, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, - 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, - 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x5f, 0x50, 0x41, 0x43, 0x4b, 0x41, - 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x55, 0x42, 0x5f, 0x4f, 0x4e, 0x4c, - 0x59, 0x10, 0x02, 0x32, 0xdd, 0x04, 0x0a, 0x15, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8a, 0x01, - 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x73, 0x12, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x62, + 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x53, 0x43, 0x41, 0x4c, 0x41, 0x10, 0x0f, 0x12, + 0x15, 0x0a, 0x11, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, + 0x47, 0x45, 0x5f, 0x43, 0x10, 0x10, 0x2a, 0x6e, 0x0a, 0x0e, 0x4e, 0x50, 0x4d, 0x49, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x4e, 0x50, 0x4d, 0x5f, + 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x50, + 0x4d, 0x5f, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x4d, + 0x4f, 0x44, 0x55, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x4e, 0x50, 0x4d, 0x5f, 0x49, + 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, + 0x4f, 0x4e, 0x4a, 0x53, 0x10, 0x02, 0x2a, 0xb3, 0x01, 0x0a, 0x11, 0x53, 0x77, 0x69, 0x66, 0x74, + 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x1f, + 0x53, 0x57, 0x49, 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x53, 0x57, 0x49, 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, + 0x4f, 0x52, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x43, 0x4f, 0x53, 0x10, 0x01, + 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x57, 0x49, 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, + 0x52, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4f, 0x53, 0x10, 0x02, 0x12, 0x1f, 0x0a, + 0x1b, 0x53, 0x57, 0x49, 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x54, 0x43, 0x48, 0x4f, 0x53, 0x10, 0x03, 0x12, 0x1c, + 0x0a, 0x18, 0x53, 0x57, 0x49, 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x56, 0x4f, 0x53, 0x10, 0x04, 0x2a, 0x7c, 0x0a, 0x11, + 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x5f, 0x50, 0x41, 0x43, 0x4b, + 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, + 0x5f, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x55, + 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x59, 0x54, 0x48, 0x4f, + 0x4e, 0x5f, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, + 0x54, 0x55, 0x42, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x32, 0xdd, 0x04, 0x0a, 0x15, 0x50, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x75, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x36, 0x2e, 0x62, 0x75, + 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x75, + 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, + 0x01, 0x12, 0x8d, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, + 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x75, + 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, + 0x02, 0x12, 0x96, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, + 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, - 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x8d, 0x01, 0x0a, 0x13, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, + 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x8d, 0x01, 0x0a, 0x13, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x96, 0x01, 0x0a, 0x16, 0x47, - 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x75, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, - 0x90, 0x02, 0x01, 0x12, 0x8d, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x75, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x37, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x32, 0x8c, 0x01, 0x0a, 0x15, 0x43, + 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x73, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, - 0x90, 0x02, 0x02, 0x32, 0x8c, 0x01, 0x0a, 0x15, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x73, 0x0a, - 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x30, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0xa0, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x13, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, - 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa0, 0x02, 0x0a, 0x1f, 0x63, 0x6f, + 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x13, 0x50, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, + 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, + 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/buf/alpha/registry/v1alpha1/plugin_curation.proto b/proto/buf/alpha/registry/v1alpha1/plugin_curation.proto index 251003568b..17b7042c68 100644 --- a/proto/buf/alpha/registry/v1alpha1/plugin_curation.proto +++ b/proto/buf/alpha/registry/v1alpha1/plugin_curation.proto @@ -56,6 +56,7 @@ enum PluginLanguage { PLUGIN_LANGUAGE_PHP = 13; PLUGIN_LANGUAGE_CSHARP = 14; PLUGIN_LANGUAGE_SCALA = 15; + PLUGIN_LANGUAGE_C = 16; } // NPMImportStyle is used to specify the import style the plugin supports. From 9e97711a32d0423b8415066a3246990506cef565 Mon Sep 17 00:00:00 2001 From: Julian Figueroa Date: Tue, 28 Nov 2023 18:15:01 -0500 Subject: [PATCH 4/4] merge conflicts --- .../buf/bufsync/bufsyncapi/sync_handler.go | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/private/buf/bufsync/bufsyncapi/sync_handler.go b/private/buf/bufsync/bufsyncapi/sync_handler.go index b77577341b..a751c20dfd 100644 --- a/private/buf/bufsync/bufsyncapi/sync_handler.go +++ b/private/buf/bufsync/bufsyncapi/sync_handler.go @@ -23,6 +23,7 @@ import ( "github.com/bufbuild/buf/private/bufpkg/bufcas" "github.com/bufbuild/buf/private/bufpkg/bufcas/bufcasalpha" "github.com/bufbuild/buf/private/bufpkg/bufmodule" + "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" "github.com/bufbuild/buf/private/pkg/app/appflag" @@ -52,9 +53,9 @@ type syncHandler struct { repositoryTagServiceClientFactory RepositoryTagServiceClientFactory repositoryCommitServiceClientFactory RepositoryCommitServiceClientFactory - moduleIdentityToRepositoryIDCache map[string]string - moduleIdentityToDefaultBranchCache map[string]string - existingModuleIdentityCache map[string]struct{} + moduleFullNameToRepositoryIDCache map[string]string + moduleFullNameToDefaultBranchCache map[string]string + existingModuleFullNameCache map[string]struct{} } func newSyncHandler( @@ -74,9 +75,9 @@ func newSyncHandler( container: container, repo: repo, createWithVisibility: createWithVisibility, - moduleIdentityToRepositoryIDCache: make(map[string]string), - moduleIdentityToDefaultBranchCache: make(map[string]string), - existingModuleIdentityCache: make(map[string]struct{}), + moduleFullNameToRepositoryIDCache: make(map[string]string), + moduleFullNameToDefaultBranchCache: make(map[string]string), + existingModuleFullNameCache: make(map[string]struct{}), syncServiceClientFactory: syncServiceClientFactory, referenceServiceClientFactory: referenceServiceClientFactory, repositoryServiceClientFactory: repositoryServiceClientFactory, @@ -186,11 +187,11 @@ func (h *syncHandler) SyncModuleTags( if err != nil { return err } - referenceService := h.referenceServiceClientFactory(moduleTags.TargetModuleFullName().Remote()) - repositoryTagService := h.repositoryTagServiceClientFactory(moduleTags.TargetModuleFullName().Remote()) + referenceService := h.referenceServiceClientFactory(moduleTags.TargetModuleFullName().Registry()) + repositoryTagService := h.repositoryTagServiceClientFactory(moduleTags.TargetModuleFullName().Registry()) commitRes, err := referenceService.GetReferenceByName(ctx, connect.NewRequest(®istryv1alpha1.GetReferenceByNameRequest{ Owner: moduleTags.TargetModuleFullName().Owner(), - RepositoryName: moduleTags.TargetModuleFullName().Repository(), + RepositoryName: moduleTags.TargetModuleFullName().Name(), Name: commit.Commit().Hash().Hex(), })) if err != nil { @@ -198,7 +199,7 @@ func (h *syncHandler) SyncModuleTags( return fmt.Errorf( "git commit %q is not known to module %q", commit.Commit().Hash(), - moduleTags.TargetModuleFullName().IdentityString(), + moduleTags.TargetModuleFullName().String(), ) } return fmt.Errorf("get reference by name %q: %w", commit.Commit().Hash(), err) @@ -207,7 +208,7 @@ func (h *syncHandler) SyncModuleTags( return fmt.Errorf( "git commit %q is not synced to module %q", commit.Commit().Hash(), - moduleTags.TargetModuleFullName().IdentityString(), + moduleTags.TargetModuleFullName().String(), ) } for _, tag := range commit.Tags() { @@ -222,7 +223,7 @@ func (h *syncHandler) SyncModuleTags( CommitName: commitRes.Msg.Reference.GetVcsCommit().CommitName, })) if err != nil { - return fmt.Errorf("create new tag %q on module %q: %w", tag, moduleTags.TargetModuleFullName().IdentityString(), err) + return fmt.Errorf("create new tag %q on module %q: %w", tag, moduleTags.TargetModuleFullName().String(), err) } } else { // TODO: don't do this unless we need to @@ -232,7 +233,7 @@ func (h *syncHandler) SyncModuleTags( CommitName: &commitRes.Msg.Reference.GetVcsCommit().CommitName, })) if err != nil { - return fmt.Errorf("update existing tag %q on module %q: %w", tag, moduleTags.TargetModuleFullName().IdentityString(), err) + return fmt.Errorf("update existing tag %q on module %q: %w", tag, moduleTags.TargetModuleFullName().String(), err) } } } @@ -247,8 +248,8 @@ func (h *syncHandler) SyncModuleBranch(ctx context.Context, moduleBranch bufsync return fmt.Errorf("read bucket for commit %q: %w", moduleCommit.Commit().Hash(), err) } if h.createWithVisibility != nil { - if err := h.createRepository(ctx, moduleBranch.TargetModuleIdentity()); err != nil { - return fmt.Errorf("create repo %s: %w", moduleBranch.TargetModuleIdentity(), err) + if err := h.createRepository(ctx, moduleBranch.TargetModuleFullName()); err != nil { + return fmt.Errorf("create repo %s: %w", moduleBranch.TargetModuleFullName().String(), err) } } syncPoint, err := h.syncCommitModule( @@ -264,7 +265,7 @@ func (h *syncHandler) SyncModuleBranch(ctx context.Context, moduleBranch bufsync // (i.e., the BSR may be down) and we should re-attempt this commit. return fmt.Errorf( "sync module %s at branch %s commit %s directory %s: %w", - moduleBranch.TargetModuleIdentity().IdentityString(), + moduleBranch.TargetModuleFullName().String(), moduleBranch.BranchName(), moduleCommit.Commit().Hash(), moduleBranch.Directory(), @@ -276,7 +277,7 @@ func (h *syncHandler) SyncModuleBranch(ctx context.Context, moduleBranch bufsync // :: -> : "%s:%s:%s -> %s:%s\n", moduleBranch.Directory(), moduleBranch.BranchName(), moduleCommit.Commit().Hash().Hex(), - moduleBranch.TargetModuleIdentity().IdentityString(), syncPoint.BsrCommitName, + moduleBranch.TargetModuleFullName().String(), syncPoint.BsrCommitName, ) if _, err := h.container.Stderr().Write([]byte(syncMsg)); err != nil { return fmt.Errorf("write %q to stderr: %w", syncMsg, err) @@ -480,11 +481,11 @@ func (h *syncHandler) createRepository( ctx context.Context, moduleFullName bufmodule.ModuleFullName, ) error { - if _, alreadyExists := h.existingModuleIdentityCache[moduleIdentity.IdentityString()]; alreadyExists { + if _, alreadyExists := h.existingModuleFullNameCache[moduleFullName.String()]; alreadyExists { return nil } - service := h.repositoryServiceClientFactory(moduleIdentity.Remote()) - fullName := moduleIdentity.Owner() + "/" + moduleIdentity.Repository() + service := h.repositoryServiceClientFactory(moduleFullName.Registry()) + fullName := moduleFullName.Owner() + "/" + moduleFullName.Name() _, err := service.CreateRepositoryByFullName( ctx, connect.NewRequest(®istryv1alpha1.CreateRepositoryByFullNameRequest{ @@ -496,6 +497,6 @@ func (h *syncHandler) createRepository( return err } // if created successfully or if it already existed, cache it - h.existingModuleIdentityCache[moduleIdentity.IdentityString()] = struct{}{} + h.existingModuleFullNameCache[moduleFullName.String()] = struct{}{} return nil }