-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ignore comment in BUILD #2492
Conversation
@@ -119,11 +123,16 @@ def parse( | |||
|
|||
def __parse_additional_protos(proto_library_target: str) -> str: | |||
res = [" "] | |||
if len(re.findall(resource_pattern, proto_library_target)) != 0: | |||
resource = re.findall(resource_pattern, proto_library_target) | |||
if len(resource) != 0 and (not str(resource[0]).strip().startswith("#")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nit: maybe use a __append_if_not_comment(resource, res, "google/cloud/common_resources.proto")
function that wraps this repeated if
condition. We can also use a capture group in resource_pattern
(and others) to exclude the comment characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re.findall
is designed to return the matching group, not the line itself.
I added a comment_pattern
to skip lines which the first non-blank char is #
.
Quality Gate passed for 'gapic-generator-java-root'Issues Measures |
Quality Gate passed for 'java_showcase_integration_tests'Issues Measures |
In this PR: - Ignore comment (leading with `#`) when parsing BUILD.bazel - Add unit tests Context: There's a [BUILD](https://github.com/googleapis/googleapis/blob/master/google/cloud/resourcemanager/v3/BUILD.bazel#L52C10-L52C50) in googleapis has common_resources.proto comment out. We need to adjust the regex pattern to adjust this case.
In this PR: - Ignore comment (leading with `#`) when parsing BUILD.bazel - Add unit tests Context: There's a [BUILD](https://github.com/googleapis/googleapis/blob/master/google/cloud/resourcemanager/v3/BUILD.bazel#L52C10-L52C50) in googleapis has common_resources.proto comment out. We need to adjust the regex pattern to adjust this case.
🤖 I have created a release *beep* *boop* --- <details><summary>2.36.0</summary> ## [2.36.0](v2.35.0...v2.36.0) (2024-02-29) ### Features * check library_name is unique among libraries ([#2490](#2490)) ([8123f0b](8123f0b)) ### Bug Fixes * cleanup @BetaApi from Resource Name Builder Methods ([#2450](#2450)) ([6e8d098](6e8d098)), closes [#2099](#2099) * Fix watchdog to start with WAITING state ([#2468](#2468)) ([dedc40f](dedc40f)) * ignore comment in BUILD ([#2492](#2492)) ([6ca20e5](6ca20e5)) * remove @BetaApi from ApiFutures and ApiService ([#2454](#2454)) ([f59e717](f59e717)), closes [#2098](#2098) ### Dependencies * grandfathering the dependencies for java-pubsublite and java-bigquery ([#2504](#2504)) ([9ceab23](9ceab23)) * update dependency gradle to v7.6.4 ([#2474](#2474)) ([607dc59](607dc59)) * update dependency org.graalvm.sdk:graal-sdk to v22.3.5 ([#2475](#2475)) ([2de487b](2de487b)) * update grpc dependencies to v1.62.2 ([#2506](#2506)) ([f438603](f438603)) ### Documentation * Add contribution guidelines. ([#2045](#2045)) ([9939b43](9939b43)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
In this PR:
#
) when parsing BUILD.bazelContext: There's a BUILD in googleapis has common_resources.proto comment out. We need to adjust the regex pattern to adjust this case.