diff --git a/tool/cmd/migrate/ruby.go b/tool/cmd/migrate/ruby.go index 4f9963b24a3..cb0f9cba957 100644 --- a/tool/cmd/migrate/ruby.go +++ b/tool/cmd/migrate/ruby.go @@ -26,13 +26,20 @@ import ( "slices" "strings" + "github.com/bazelbuild/buildtools/build" "github.com/googleapis/librarian/internal/config" "github.com/googleapis/librarian/internal/librarian" "github.com/googleapis/librarian/internal/yaml" ) var ( - versionedAPIPath = regexp.MustCompile(`^/(.+/(v\d+\w*))/(.+)-ruby/(.*)$`) + // regexAPIPath matches OwlBot deep-copy-regex source paths for Ruby libraries. + // Capturing groups: + // 1: Base API path (e.g. "google/cloud/automl") + // 2: API version (e.g. "v1") or empty string for unversioned wrapper libraries + // 3: Gem directory name token (e.g. "[^/]+" or "google-cloud-automl-v1") + // 4: Trailing path contents after "-ruby/" + regexAPIPath = regexp.MustCompile(`^/(.+?)(?:/(v\d+\w*))?/(\[\^/\]\+|[^/]+)-ruby/(.*)$`) // Skip these directories when searching for libraries. skippedDirs = []string{".github"} ) @@ -45,8 +52,14 @@ type owlbotSrc struct { Source string `yaml:"source"` } -// VersionedBuild represents build configuration parsed from BUILD.bazel for a Ruby API version. -type VersionedBuild struct { +// WrapperBuild represents build configuration parsed from BUILD.bazel for an unversioned Ruby wrapper library. +type WrapperBuild struct { + Path string + Params *ExtraProtoParams +} + +// ExtraProtoParams represents extra protoc parameters parsed from BUILD.bazel for a Ruby API version. +type ExtraProtoParams struct { EnvPrefix string ExtraDeps string GemNamespace string @@ -141,63 +154,94 @@ func findRubyLibraries(googleapisPath, repoPath string) ([]*config.Library, erro lib := &config.Library{ Name: name, } - api, err := parseAPIFromOwlBot(owlBotPath) + api, isWrapper, err := parseAPIFromOwlBot(owlBotPath) if err != nil { return nil, err } if api != "" { - lib.APIs = []*config.API{ - { - Path: api, - }, - } - vb, err := parseVersionedBuild(googleapisPath, api) - if err != nil { - return nil, err - } - if vb != nil { - lib.APIs[0].Ruby = &config.RubyAPI{ - RubyCloudOpts: &config.RubyCloudOpts{ - EnvPrefix: vb.EnvPrefix, - ExtraDependencies: vb.ExtraDeps, - GemNamespace: vb.GemNamespace, - NamespaceOverride: vb.NamespaceOverride, - PathOverride: vb.PathOverride, - ServiceOverride: vb.ServiceOverride, - WrapperGemOverride: vb.WrapperGemOverride, - YardStrict: vb.YardStrict, + if !isWrapper { + lib.APIs = []*config.API{ + { + Path: api, }, } + vb, err := parseVersionedBuild(googleapisPath, api) + if err != nil { + return nil, err + } + if vb != nil { + lib.APIs[0].Ruby = &config.RubyAPI{ + RubyCloudOpts: &config.RubyCloudOpts{ + EnvPrefix: vb.EnvPrefix, + ExtraDependencies: vb.ExtraDeps, + GemNamespace: vb.GemNamespace, + NamespaceOverride: vb.NamespaceOverride, + PathOverride: vb.PathOverride, + ServiceOverride: vb.ServiceOverride, + WrapperGemOverride: vb.WrapperGemOverride, + YardStrict: vb.YardStrict, + }, + } + } + } else { + wb, err := parseUnversionedBuild(googleapisPath, api) + if err != nil { + return nil, err + } + if wb != nil { + rubyAPI := &config.API{ + Path: wb.Path, + Ruby: &config.RubyAPI{ + RubyCloudOpts: &config.RubyCloudOpts{ + EnvPrefix: wb.Params.EnvPrefix, + ExtraDependencies: wb.Params.ExtraDeps, + GemNamespace: wb.Params.GemNamespace, + NamespaceOverride: wb.Params.NamespaceOverride, + PathOverride: wb.Params.PathOverride, + ServiceOverride: wb.Params.ServiceOverride, + WrapperGemOverride: wb.Params.WrapperGemOverride, + YardStrict: wb.Params.YardStrict, + }, + }, + } + lib.APIs = append(lib.APIs, rubyAPI) + } } + libraries = append(libraries, lib) } - libraries = append(libraries, lib) } parseWrapperOf(libraries) return libraries, nil } -func parseAPIFromOwlBot(owlBotPath string) (string, error) { +// parseAPIFromOwlBot parses API details from OwlBot config and determines if the library is a wrapper. +// It returns the API path, whether the library is a wrapper, and an error if parsing fails. +func parseAPIFromOwlBot(owlBotPath string) (string, bool, error) { data, err := os.ReadFile(owlBotPath) if err != nil { - return "", fmt.Errorf("reading OwlBot config %s: %w", owlBotPath, err) + return "", false, fmt.Errorf("reading OwlBot config %s: %w", owlBotPath, err) } owlbot, err := yaml.Unmarshal[owlbotYaml](data) if err != nil { - return "", fmt.Errorf("parsing OwlBot config %s: %w", owlBotPath, err) + return "", false, fmt.Errorf("parsing OwlBot config %s: %w", owlBotPath, err) } // Skip .github/.Owlbot.yaml. if len(owlbot.DeepCopyRegex) == 0 { - return "", nil + return "", false, nil } - // We only need the first entry since wrapper library will - // have different parsing logic. src := owlbot.DeepCopyRegex[0].Source - matches := versionedAPIPath.FindStringSubmatch(src) + matches := regexAPIPath.FindStringSubmatch(src) if len(matches) != 5 { - // A wrapper library doesn't have versioned API path. - return "", nil + return "", false, nil } - return matches[1], nil + basePath := matches[1] + version := matches[2] + if version == "" { + // Unversioned wrapper library + return basePath, true, nil + } + // Versioned library + return basePath + "/" + version, false, nil } // parseWrapperOf sets the WrapperOf field for wrapper libraries. @@ -206,10 +250,6 @@ func parseWrapperOf(libraries []*config.Library) { return strings.Compare(a.Name, b.Name) }) for i, lib := range libraries { - if len(lib.APIs) != 0 { - // Skip non-wrapper libraries. - continue - } var wrapperOf []string prefix := lib.Name + "-" // Since libraries are sorted by name, the wrapped libraries @@ -238,7 +278,7 @@ func parseWrapperOf(libraries []*config.Library) { } } -func parseVersionedBuild(googleapisDir, apiPath string) (*VersionedBuild, error) { +func parseVersionedBuild(googleapisDir, apiPath string) (*ExtraProtoParams, error) { file, err := parseBazel(googleapisDir, apiPath) if err != nil { return nil, err @@ -246,30 +286,34 @@ func parseVersionedBuild(googleapisDir, apiPath string) (*VersionedBuild, error) if file == nil { return nil, nil } - vb := &VersionedBuild{} - if rules := file.Rules("ruby_cloud_gapic_library"); len(rules) > 0 { - rule := rules[0] - if attr := rule.Attr("extra_protoc_parameters"); attr != nil { - for _, dep := range extractStrings(attr) { - switch { - case strings.HasPrefix(dep, "ruby-cloud-env-prefix="): - vb.EnvPrefix, _ = strings.CutPrefix(dep, "ruby-cloud-env-prefix=") - case strings.HasPrefix(dep, "ruby-cloud-extra-dependencies="): - vb.ExtraDeps, _ = strings.CutPrefix(dep, "ruby-cloud-extra-dependencies=") - case strings.HasPrefix(dep, "ruby-cloud-gem-namespace="): - vb.GemNamespace, _ = strings.CutPrefix(dep, "ruby-cloud-gem-namespace=") - case strings.HasPrefix(dep, "ruby-cloud-namespace-override="): - vb.NamespaceOverride, _ = strings.CutPrefix(dep, "ruby-cloud-namespace-override=") - case strings.HasPrefix(dep, "ruby-cloud-path-override="): - vb.PathOverride, _ = strings.CutPrefix(dep, "ruby-cloud-path-override=") - case strings.HasPrefix(dep, "ruby-cloud-service-override="): - vb.ServiceOverride, _ = strings.CutPrefix(dep, "ruby-cloud-service-override=") - case strings.HasPrefix(dep, "ruby-cloud-wrapper-gem-override="): - vb.WrapperGemOverride, _ = strings.CutPrefix(dep, "ruby-cloud-wrapper-gem-override=") - case strings.HasPrefix(dep, "ruby-cloud-yard-strict="): - vb.YardStrict, _ = strings.CutPrefix(dep, "ruby-cloud-yard-strict=") - } - } + return parseExtraProtoParams(file) +} + +func parseExtraProtoParams(file *build.File) (*ExtraProtoParams, error) { + vb := &ExtraProtoParams{} + rules := file.Rules("ruby_cloud_gapic_library") + if len(rules) == 0 || rules[0].Attr("extra_protoc_parameters") == nil { + return vb, nil + } + for _, dep := range extractStrings(rules[0].Attr("extra_protoc_parameters")) { + switch { + case strings.HasPrefix(dep, "ruby-cloud-env-prefix="): + vb.EnvPrefix, _ = strings.CutPrefix(dep, "ruby-cloud-env-prefix=") + case strings.HasPrefix(dep, "ruby-cloud-extra-dependencies="): + vb.ExtraDeps, _ = strings.CutPrefix(dep, "ruby-cloud-extra-dependencies=") + case strings.HasPrefix(dep, "ruby-cloud-gem-namespace="): + vb.GemNamespace, _ = strings.CutPrefix(dep, "ruby-cloud-gem-namespace=") + case strings.HasPrefix(dep, "ruby-cloud-namespace-override="): + vb.NamespaceOverride, _ = strings.CutPrefix(dep, "ruby-cloud-namespace-override=") + case strings.HasPrefix(dep, "ruby-cloud-path-override="): + vb.PathOverride, _ = strings.CutPrefix(dep, "ruby-cloud-path-override=") + case strings.HasPrefix(dep, "ruby-cloud-service-override="): + vb.ServiceOverride, _ = strings.CutPrefix(dep, "ruby-cloud-service-override=") + case strings.HasPrefix(dep, "ruby-cloud-wrapper-gem-override="): + vb.WrapperGemOverride, _ = strings.CutPrefix(dep, "ruby-cloud-wrapper-gem-override=") + case strings.HasPrefix(dep, "ruby-cloud-yard-strict="): + vb.YardStrict, _ = strings.CutPrefix(dep, "ruby-cloud-yard-strict=") + } } return vb, nil @@ -327,3 +371,43 @@ func readExistingConfig(repoPath string) (*config.Config, error) { } return cfg, nil } + +func parseUnversionedBuild(googleapisDir, apiPath string) (*WrapperBuild, error) { + file, err := parseBazel(googleapisDir, apiPath) + if err != nil { + return nil, err + } + if file == nil { + return nil, nil + } + api := parseAPIFromWrapperBuild(file) + if api == "" { + return nil, nil + } + params, err := parseExtraProtoParams(file) + if err != nil { + return nil, err + } + return &WrapperBuild{ + Path: api, + Params: params, + }, nil +} + +func parseAPIFromWrapperBuild(file *build.File) string { + rules := file.Rules("ruby_cloud_gapic_library") + if len(rules) == 0 || rules[0].Attr("srcs") == nil { + return "" + } + srcs := extractStrings(rules[0].Attr("srcs")) + if len(srcs) == 0 { + return "" + } + res := srcs[0] + parts := strings.SplitN(res, ":", 2) + if len(parts) > 0 { + res = parts[0] + } + res, _ = strings.CutPrefix(res, "//") + return res +} diff --git a/tool/cmd/migrate/ruby_test.go b/tool/cmd/migrate/ruby_test.go index 52f87550218..b490feb9c1c 100644 --- a/tool/cmd/migrate/ruby_test.go +++ b/tool/cmd/migrate/ruby_test.go @@ -90,6 +90,26 @@ func TestFindRubyLibraries(t *testing.T) { t.Fatal(err) } want := []*config.Library{ + { + Name: "google-cloud-compute", + APIs: []*config.API{ + { + Path: "google/cloud/compute/v1", + Ruby: &config.RubyAPI{ + RubyCloudOpts: &config.RubyCloudOpts{ + EnvPrefix: "COMPUTE", + ExtraDependencies: "google-cloud-common=~> 1.0", + WrapperGemOverride: "google-cloud-compute", + }, + }, + }, + }, + Ruby: &config.RubyPackage{ + WrapperOf: []string{ + "google-cloud-compute-v1", + }, + }, + }, { Name: "google-cloud-compute-v1", APIs: []*config.API{ @@ -107,6 +127,17 @@ func TestFindRubyLibraries(t *testing.T) { }, { Name: "google-cloud-secret_manager", + APIs: []*config.API{ + { + Path: "google/cloud/secretmanager/v1", + Ruby: &config.RubyAPI{ + RubyCloudOpts: &config.RubyCloudOpts{ + EnvPrefix: "SECRET_MANAGER", + GemNamespace: "Google::Cloud::SecretManager", + }, + }, + }, + }, Ruby: &config.RubyPackage{ WrapperOf: []string{ "google-cloud-secret_manager-v1", @@ -134,38 +165,46 @@ func TestFindRubyLibraries(t *testing.T) { func TestParseAPIFromOwlBot(t *testing.T) { for _, test := range []struct { - name string - path string - want string + name string + path string + wantPath string + wantWrapper bool }{ { - name: "apigeeconnect v1 api", - path: "testdata/ruby/parse_api_from_owlbot/apigeeconnect_v1.yaml", - want: "google/cloud/apigeeconnect/v1", + name: "apigeeconnect v1 api", + path: "testdata/ruby/parse_api_from_owlbot/apigeeconnect_v1.yaml", + wantPath: "google/cloud/apigeeconnect/v1", + wantWrapper: false, }, { - name: "marketingplatform admin v1alpha api", - path: "testdata/ruby/parse_api_from_owlbot/marketing_v1alpha.yaml", - want: "google/marketingplatform/admin/v1alpha", + name: "marketingplatform admin v1alpha api", + path: "testdata/ruby/parse_api_from_owlbot/marketing_v1alpha.yaml", + wantPath: "google/marketingplatform/admin/v1alpha", + wantWrapper: false, }, { - name: "video livestream v1 api", - path: "testdata/ruby/parse_api_from_owlbot/video_v1.yaml", - want: "google/cloud/video/livestream/v1", + name: "video livestream v1 api", + path: "testdata/ruby/parse_api_from_owlbot/video_v1.yaml", + wantPath: "google/cloud/video/livestream/v1", + wantWrapper: false, }, { - name: "wrapper library", - path: "testdata/ruby/parse_api_from_owlbot/wrapper.yaml", - want: "", + name: "wrapper library", + path: "testdata/ruby/parse_api_from_owlbot/wrapper.yaml", + wantPath: "google/cloud/apigeeconnect", + wantWrapper: true, }, } { t.Run(test.name, func(t *testing.T) { - got, err := parseAPIFromOwlBot(test.path) + gotPath, gotWrapper, err := parseAPIFromOwlBot(test.path) if err != nil { t.Fatal(err) } - if diff := cmp.Diff(test.want, got); diff != "" { - t.Errorf("mismatch (-want +got):\n%s", diff) + if diff := cmp.Diff(test.wantPath, gotPath); diff != "" { + t.Errorf("path mismatch (-want +got):\n%s", diff) + } + if diff := cmp.Diff(test.wantWrapper, gotWrapper); diff != "" { + t.Errorf("wrapper mismatch (-want +got):\n%s", diff) } }) } @@ -244,13 +283,13 @@ func TestParseVersionedBuild(t *testing.T) { name string googleapisDir string apiPath string - want *VersionedBuild + want *ExtraProtoParams }{ { name: "valid BUILD.bazel with env prefix", googleapisDir: "testdata/googleapis", apiPath: "google/cloud/secretmanager/v1", - want: &VersionedBuild{ + want: &ExtraProtoParams{ EnvPrefix: "SECRET_MANAGER", }, }, @@ -258,13 +297,13 @@ func TestParseVersionedBuild(t *testing.T) { name: "BUILD.bazel without ruby_cloud_gapic_library rule", googleapisDir: "testdata/googleapis", apiPath: "google/cloud/bigquery/connection/v1", - want: &VersionedBuild{}, + want: &ExtraProtoParams{}, }, { name: "BUILD.bazel with path override and yard strict", googleapisDir: "testdata/googleapis", apiPath: "google/cloud/automl/v1", - want: &VersionedBuild{ + want: &ExtraProtoParams{ EnvPrefix: "AUTOML", NamespaceOverride: "AutoMl=AutoML;Automl=AutoML", PathOverride: "auto_ml=automl", @@ -275,7 +314,7 @@ func TestParseVersionedBuild(t *testing.T) { name: "BUILD.bazel with service override", googleapisDir: "testdata/googleapis", apiPath: "google/cloud/alloydb/v1", - want: &VersionedBuild{ + want: &ExtraProtoParams{ GemNamespace: "Google::Cloud::AlloyDB::V1", ServiceOverride: "AlloyDBCSQLAdmin=AlloyDBCloudSQLAdmin", }, @@ -284,7 +323,7 @@ func TestParseVersionedBuild(t *testing.T) { name: "BUILD.bazel with wrapper gem override", googleapisDir: "testdata/googleapis", apiPath: "google/cloud/compute/v1", - want: &VersionedBuild{ + want: &ExtraProtoParams{ EnvPrefix: "COMPUTE", ExtraDeps: "google-cloud-common=~> 1.0", WrapperGemOverride: "value_for_testing", @@ -309,6 +348,77 @@ func TestParseVersionedBuild(t *testing.T) { } } +func TestParseUnversionedBuild(t *testing.T) { + for _, test := range []struct { + name string + googleapisDir string + apiPath string + want *WrapperBuild + }{ + { + name: "BUILD.bazel with env prefix and gem namespace", + googleapisDir: "testdata/googleapis", + apiPath: "google/cloud/secretmanager", + want: &WrapperBuild{ + Path: "google/cloud/secretmanager/v1", + Params: &ExtraProtoParams{ + EnvPrefix: "SECRET_MANAGER", + GemNamespace: "Google::Cloud::SecretManager", + }, + }, + }, + { + name: "BUILD.bazel with wrapper gem override and extra deps", + googleapisDir: "testdata/googleapis", + apiPath: "google/cloud/compute", + want: &WrapperBuild{ + Path: "google/cloud/compute/v1", + Params: &ExtraProtoParams{ + EnvPrefix: "COMPUTE", + ExtraDeps: "google-cloud-common=~> 1.0", + WrapperGemOverride: "google-cloud-compute", + }, + }, + }, + { + name: "BUILD.bazel with namespace and path overrides", + googleapisDir: "testdata/googleapis", + apiPath: "google/cloud/automl", + want: &WrapperBuild{ + Path: "google/cloud/automl/v1", + Params: &ExtraProtoParams{ + EnvPrefix: "AUTOML", + NamespaceOverride: "AutoMl=AutoML;Automl=AutoML", + PathOverride: "auto_ml=automl", + }, + }, + }, + { + name: "BUILD.bazel with service override and yard strict", + googleapisDir: "testdata/googleapis", + apiPath: "google/cloud/alloydb", + want: &WrapperBuild{ + Path: "google/cloud/alloydb/v1", + Params: &ExtraProtoParams{ + GemNamespace: "Google::Cloud::AlloyDB", + ServiceOverride: "AlloyDBCSQLAdmin=AlloyDBCloudSQLAdmin", + YardStrict: "false", + }, + }, + }, + } { + t.Run(test.name, func(t *testing.T) { + got, err := parseUnversionedBuild(test.googleapisDir, test.apiPath) + if err != nil { + t.Fatal(err) + } + if diff := cmp.Diff(test.want, got); diff != "" { + t.Errorf("mismatch (-want +got):\n%s", diff) + } + }) + } +} + func TestMergeLibs(t *testing.T) { for _, test := range []struct { name string diff --git a/tool/cmd/migrate/testdata/google-cloud-ruby/google-cloud-compute/.OwlBot.yaml b/tool/cmd/migrate/testdata/google-cloud-ruby/google-cloud-compute/.OwlBot.yaml new file mode 100644 index 00000000000..3427a2c35f6 --- /dev/null +++ b/tool/cmd/migrate/testdata/google-cloud-ruby/google-cloud-compute/.OwlBot.yaml @@ -0,0 +1,16 @@ +# Copyright 2026 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 +# +# https://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. +deep-copy-regex: + - source: /google/cloud/compute/[^/]+-ruby/(.*) + dest: /owl-bot-staging/google-cloud-compute/$1 diff --git a/tool/cmd/migrate/testdata/googleapis/google/cloud/alloydb/BUILD.bazel b/tool/cmd/migrate/testdata/googleapis/google/cloud/alloydb/BUILD.bazel new file mode 100644 index 00000000000..af34ccdd930 --- /dev/null +++ b/tool/cmd/migrate/testdata/googleapis/google/cloud/alloydb/BUILD.bazel @@ -0,0 +1,29 @@ +# Copyright 2026 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. + +# This file contains a wrapper build configuration for testing. +load( + "@com_google_googleapis_imports//:imports.bzl", + "ruby_cloud_gapic_library", +) + +ruby_cloud_gapic_library( + name = "alloydb_ruby_wrapper", + srcs = ["//google/cloud/alloydb/v1:alloydb_proto_with_info"], + extra_protoc_parameters = [ + "ruby-cloud-gem-namespace=Google::Cloud::AlloyDB", + "ruby-cloud-service-override=AlloyDBCSQLAdmin=AlloyDBCloudSQLAdmin", + "ruby-cloud-yard-strict=false", + ], +) diff --git a/tool/cmd/migrate/testdata/googleapis/google/cloud/automl/BUILD.bazel b/tool/cmd/migrate/testdata/googleapis/google/cloud/automl/BUILD.bazel new file mode 100644 index 00000000000..b1ba8525bee --- /dev/null +++ b/tool/cmd/migrate/testdata/googleapis/google/cloud/automl/BUILD.bazel @@ -0,0 +1,29 @@ +# Copyright 2026 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. + +# This file contains a wrapper build configuration for testing. +load( + "@com_google_googleapis_imports//:imports.bzl", + "ruby_cloud_gapic_library", +) + +ruby_cloud_gapic_library( + name = "automl_ruby_wrapper", + srcs = ["//google/cloud/automl/v1:automl_proto_with_info"], + extra_protoc_parameters = [ + "ruby-cloud-env-prefix=AUTOML", + "ruby-cloud-namespace-override=AutoMl=AutoML;Automl=AutoML", + "ruby-cloud-path-override=auto_ml=automl", + ], +) diff --git a/tool/cmd/migrate/testdata/googleapis/google/cloud/compute/BUILD.bazel b/tool/cmd/migrate/testdata/googleapis/google/cloud/compute/BUILD.bazel new file mode 100644 index 00000000000..29a5b3511d6 --- /dev/null +++ b/tool/cmd/migrate/testdata/googleapis/google/cloud/compute/BUILD.bazel @@ -0,0 +1,29 @@ +# Copyright 2026 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. + +# This file contains a wrapper build configuration for testing. +load( + "@com_google_googleapis_imports//:imports.bzl", + "ruby_cloud_gapic_library", +) + +ruby_cloud_gapic_library( + name = "compute_ruby_wrapper", + srcs = ["//google/cloud/compute/v1:compute_proto_with_info"], + extra_protoc_parameters = [ + "ruby-cloud-env-prefix=COMPUTE", + "ruby-cloud-wrapper-gem-override=google-cloud-compute", + "ruby-cloud-extra-dependencies=google-cloud-common=~> 1.0", + ], +) diff --git a/tool/cmd/migrate/testdata/googleapis/google/cloud/secretmanager/BUILD.bazel b/tool/cmd/migrate/testdata/googleapis/google/cloud/secretmanager/BUILD.bazel new file mode 100644 index 00000000000..db929c0e038 --- /dev/null +++ b/tool/cmd/migrate/testdata/googleapis/google/cloud/secretmanager/BUILD.bazel @@ -0,0 +1,29 @@ +# Copyright 2026 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. + +# This file contains a wrapper build configuration for testing. +load( + "@com_google_googleapis_imports//:imports.bzl", + "ruby_cloud_gapic_library", +) + +ruby_cloud_gapic_library( + name = "secretmanager_ruby_wrapper", + srcs = ["//google/cloud/secretmanager/v1:secretmanager_proto_with_info"], + extra_protoc_parameters = [ + "ruby-cloud-env-prefix=SECRET_MANAGER", + "ruby-cloud-gem-namespace=Google::Cloud::SecretManager", + "ruby-cloud-wrapper-of=v1", + ], +)