-
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
feat: dynamically determine protobuf version in build.gradle #1753
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5aefe55
feat: dynamically determine protobuf version in build.gradle
JoeWang1127 3176c3c
add code comment
JoeWang1127 04c513c
merge main
JoeWang1127 d297e27
add a method to sync versions from googleapis
JoeWang1127 09c9895
add a seperate dict for synced version
JoeWang1127 982d818
restore protobuf version in dependencies.properties
JoeWang1127 1370b23
add synced version after reading properties
JoeWang1127 d123a20
combine two properties
JoeWang1127 22d3d0c
remove protobuf version in dependencies.properties
JoeWang1127 7b2b7f2
empty commit
JoeWang1127 e265b65
Revert "remove protobuf version in dependencies.properties"
JoeWang1127 64cfb1b
add comment for protobuf version
JoeWang1127 530ea55
make a copy of properties
JoeWang1127 3eaa5aa
change comment
JoeWang1127 0ba592e
change comments
JoeWang1127 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,20 @@ | |
# limitations under the License. | ||
|
||
load("@com_google_api_gax_java_properties//:dependencies.properties.bzl", "PROPERTIES") | ||
load("@com_google_protobuf//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION") | ||
|
||
def _wrapPropertyNamesInBraces(properties): | ||
JoeWang1127 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
wrappedProperties = {} | ||
for k, v in properties.items(): | ||
wrappedProperties["{{%s}}" % k] = v | ||
return wrappedProperties | ||
|
||
_PROPERTIES = _wrapPropertyNamesInBraces(PROPERTIES) | ||
# Before this replacement, there was a problem (e.g., b/284292352) when | ||
# the version of protobuf defined in googleapis is higher than protobuf | ||
# defined in gax-java/dependencies.properties, use this replacement to | ||
# sync the two versions. | ||
SYNCED_PROPERTIES = PROPERTIES | {"version.com_google_protobuf": PROTOBUF_JAVA_VERSION} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @suztomo is this the idea of "making a copy"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is better than what I was thinking with "dict.copy()". |
||
_PROPERTIES = _wrapPropertyNamesInBraces(SYNCED_PROPERTIES) | ||
|
||
# ======================================================================== | ||
# General packaging helpers. | ||
|
@@ -63,7 +69,7 @@ def _gapic_pkg_tar_impl(ctx): | |
for f in dep.files.to_list(): | ||
deps.append(f) | ||
|
||
samples =[] | ||
samples = [] | ||
for s in ctx.attr.samples: | ||
for f in s.files.to_list(): | ||
samples.append(f) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this used by showcase? I think the protobuf runtime version in Showcase module extends from gapic-generator-java-parent-pom
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.
Correct me if I'm wrong.
Looking at the ci error log, showcase golden tests eventually invoke
bazelisk run //showcase:verify_gapic
.bazelisk run //showcase:verify_gapic
will fail ifversion.com_google_protobuf=3.23.2
is removed from dependencies.properties.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.
I see, I didn't notice that we are making sure showcase modules are compilable right after generation, they are still verified with the generated gradle files though.