From ebcd1a9c65ee36e4afb38e290ee6beb78454780f Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 1 Oct 2025 19:09:46 +0000 Subject: [PATCH 1/2] chore(librarian): fix generation for google-cloud-compute --- .generator/parse_googleapis_content.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.generator/parse_googleapis_content.py b/.generator/parse_googleapis_content.py index ba41f3a31f59..070987cd6363 100644 --- a/.generator/parse_googleapis_content.py +++ b/.generator/parse_googleapis_content.py @@ -95,8 +95,15 @@ "proto_library", "java_proto_library", "genrule", + "gapic_yaml_from_disco", + "grpc_service_config_from_disco", + "proto_from_disco", ) +_GLOB_CALLABLES = ( + "exports_files", + "glob", +) def parse_content(content: str) -> dict: """Parses content from BUILD.bazel and returns a dictionary @@ -119,11 +126,20 @@ def bazel_target(**args): def noop_bazel_rule(**args): pass - for noop_callable in _NOOP_CALLABLES: - mod.add_callable(noop_callable, noop_bazel_rule) + def fake_glob(paths=[], **args): + return [] + + mod.add_callable("package", noop_bazel_rule) + + for glob_callable in _GLOB_CALLABLES: + mod.add_callable(glob_callable, fake_glob) def load(name): mod = sl.Module() + + for noop_callable in _NOOP_CALLABLES: + mod.add_callable(noop_callable, noop_bazel_rule) + for callable_name in _CALLABLE_MAP.get(name, []): mod.add_callable(callable_name, bazel_target) return mod.freeze() From c032db898234e09e35730e538acf6ea7d4fed167 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 1 Oct 2025 19:15:30 +0000 Subject: [PATCH 2/2] update test case --- .generator/test-resources/librarian/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/.generator/test-resources/librarian/BUILD.bazel b/.generator/test-resources/librarian/BUILD.bazel index d135efe5126b..e50df9bee544 100644 --- a/.generator/test-resources/librarian/BUILD.bazel +++ b/.generator/test-resources/librarian/BUILD.bazel @@ -13,6 +13,7 @@ # limitations under the License. package(default_visibility = ["//visibility:public"]) +exports_files(glob(["*.yaml"])) load("@rules_proto//proto:defs.bzl", "proto_library") load( "@com_google_googleapis_imports//:imports.bzl",