fix(codegen): modify generator scripts after separation of bazel rules - #1351
Conversation
zhumin8
left a comment
There was a problem hiding this comment.
I agree on unblocking the generation workflow. So we could probably merge this in while working on improvements.
On making it more robust, I found this buildozer tool that looks neat. E.g. these two commands can achieve most of what we want building the java_gapic_spring_library rule.
# Add a new rule at the end of the file
buildozer 'new java_library foo' //pkg:__pkg__
# Copy an attribute from `protolib` to `py_protolib`.
buildozer 'copy testonly protolib' //pkg:py_protolib
Drawback is that it has dependencies on Go. But GithubAction does have https://github.com/actions/setup-go, so I guess it's not that bad.
Oh buildozer does look like a better tool for handling BUILD.bazel file changes (esp. copying over attributes) - thanks for the suggestion @zhumin8 ! I’ll look into how to bring it in for our workflow, and will mark this PR as ready for review in the meanwhile. |
|
Kudos, SonarCloud Quality Gate passed! |








This PR: edits generator scripts given the separation of the
java_gapic_spring_libraryrule in googleapis/sdk-platform-java#1065 (please see its description for context of edits).The script now makes local edits to:
googleapis/repository_rules.bzl(add switch)google/cloud/<client_lib_name>/v1/BUILD.bazel(add rule name to load, and rule definition using similar arguments asjava_gapic_library)Note for review: the initial goal of these changes is to have something to unblock the code generation workflow, but there's currently a lot of perl mess so any suggestions on cleaner/more reliable file processing would be welcomed!