Skip to content

Simplify BUILD.bazel parsing in .generator/parse_googleapis_content.py #14389

@parthea

Description

@parthea

See feedback from @ohmayr in #14386 (comment) referring to the code block below:

_PY_CALLABLES = (
"py_gapic_assembly_pkg",
"py_gapic_library",
"py_test",
"py_proto_library",
"py_grpc_library",
"py_import",
)
_JAVA_CALLABLES = (
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)
_GO_CALLABLES = (
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_grpc_library",
)
_PHP_CALLABLES = (
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
)
_NODEJS_CALLABLES = ("nodejs_gapic_assembly_pkg", "nodejs_gapic_library")
_RUBY_CALLABLES = (
"ruby_ads_gapic_library",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
_CSHARP_CALLABLES = (
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)
_CC_CALLABLES = ("cc_grpc_library", "cc_gapic_library", "cc_proto_library")
_MISC_CALLABLES = (
"moved_proto_library",
"proto_library",
"proto_library_with_info",
"upb_c_proto_library",
)

The name of the bazel build rules are hardcoded in parse_googleapis_content.py. An alternate, more robust approach would be to read the bazel rules from BUILD.bazel files rather than relying on the hardcoded rules in parse_googleapis_content.py.

This tracking bug will be used to follow up making this improvement

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: processA process-related concern. May include testing, release, or the like.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions