Skip to content
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

Add an automatic GCP-BOM dependency upgrader #30262

Merged
merged 2 commits into from
Feb 14, 2024
Merged

Conversation

Abacn
Copy link
Contributor

@Abacn Abacn commented Feb 8, 2024

Command: python scripts/tools/gcpbomupgrader.py 26.30.0

If run python scripts/tools/gcpbomupgrader.py 26.31.0 based on this PR, it would give:

INFO:root:Changed com.google.api:gax: 2.39.0 -> 2.41.0
INFO:root:Changed com.google.cloud:google-cloud-spanner: 6.56.0 -> 6.57.0
INFO:root:Changed io.grpc:grpc-netty: 1.60.0 -> 1.61.0
INFO:root:Unchanged: io.netty:netty-transport:4.1.100.Final
INFO:root:Changed com.google.protobuf:protobuf-java: 3.25.1 -> 3.25.2
INFO:root:Changed org.apache.arrow:arrow-memory-core: 14.0.2 -> 15.0.0

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@Abacn
Copy link
Contributor Author

Abacn commented Feb 8, 2024

CC: @dhruvdua @shunping

*('-q dependencies --configuration implementation --console=plain'
.split())
],
cwd=self.BUILD_DIR,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits: the format looks strange here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the result that I have run yapf on the script.

Copy link
Contributor

@shunping shunping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great tool to facilitate libraries-bom version upgrade. Thanks Yi!

There are few reasons we need to declare the version numbers:
1. Sync the dependency that not included in GCP-BOM with those included with BOM
For example, "com.google.cloud:google-cloud-spanner" does while "com.google.cloud:google-cloud-spanner:():test" doesn't
2. There are Beam artifacts not depending on GCP-BOM but used dependency managed
Copy link
Contributor

@shunping shunping Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also document what we should change BeamModulePlugin if we have a new dep that we want to pin and we want to leverage this tool later (or at least don't break the standardization)?

There are two cases here:

  1. adding a new dep from a project that is already tracked in BeamModulePlugin, and
  2. adding a new dep from a new project.

Copy link
Contributor Author

@Abacn Abacn Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Definitely will clean up this script when marked as ready for review. Currently it just serves as an "unoffical" tool.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Abacn Abacn marked this pull request as ready for review February 12, 2024 15:47
// Try to keep grpc_version consistent with gRPC version in google_cloud_platform_libraries_bom
def grpc_version = "1.60.0"
// [bomupgrader] determined by: io.grpc:grpc-netty, consistent with: google_cloud_platform_libraries_bom
def grpc_version = "1.61.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we again have the grpc version mismatch after #30181, my bad, fixed by this script

@Abacn
Copy link
Contributor Author

Abacn commented Feb 12, 2024

R: @shunping ready for review now

Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@shunping
Copy link
Contributor

The code looks good. I am also wondering if we can use your script to add a presubmit test, so if the version is not right, the update cannot be submitted.

This may need to change your script to support two modes: in-place updating (which is already implemented) and reporting only. Then a new test can be added to call this script in reporting mode and check if there is any version mismatch.

WDYT?

@Abacn
Copy link
Contributor Author

Abacn commented Feb 12, 2024

The code looks good. I am also wondering if we can use your script to add a presubmit test, so if the version is not right, the update cannot be submitted.

This may need to change your script to support two modes: in-place updating (which is already implemented) and reporting only. Then a new test can be added to call this script in reporting mode and check if there is any version mismatch.

WDYT?

This sounds good, similar to .github/workflows/update_python_dependencies.yml . We can setup a "test" to generate a PR / or fail like the referred workflow.

However in practice we already have many tests and there are infra related workflow no one cares and red for months. So the actual benefit I am not sure. As of the scope of this PR I am not intend to setup a test.

@shunping
Copy link
Contributor

LGTM!

@Abacn Abacn merged commit bfa26a4 into apache:master Feb 14, 2024
22 checks passed
@Abacn Abacn deleted the gcpbomupgrader branch February 14, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants