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

Migrate Beam Go to use the new Opaque Protocol Buffers #33434

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

lostluck
Copy link
Contributor

@lostluck lostluck commented Dec 20, 2024

See https://go.dev/blog/protobuf-opaque for details on Opaque Protocol Buffers for Go.

  • genproto.sh has been updated to force generation of the Hybrid API, which is compatible with the new Opaque API.
    • This required updating the Go proto plug in, which now reserves comments properly, simplifying the script.
  • The Go protocol buffers were regenerated. This yields the compatible APIs, such as accessor and setter methods and builder structs.
  • The open2opaque migration tool was run, and the fewer than a dozen spots that required manual intervention were fixed.

This PR has no functional changes, and is almost entirely generated.


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.

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 36.66818% with 1399 lines in your changes missing coverage. Please review.

Project coverage is 57.31%. Comparing base (d7502fa) to head (3a8a2b2).
Report is 88 commits behind head on master.

Files with missing lines Patch % Lines
...eam/model/jobmanagement_v1/beam_artifact_api.pb.go 33.65% 333 Missing and 8 partials ⚠️
...pkg/beam/model/jobmanagement_v1/beam_job_api.pb.go 36.94% 295 Missing and 2 partials ⚠️
sdks/go/pkg/beam/core/runtime/graphx/translate.go 30.08% 172 Missing ⚠️
...am/model/jobmanagement_v1/beam_expansion_api.pb.go 0.00% 135 Missing ⚠️
sdks/go/pkg/beam/core/runtime/harness/harness.go 0.00% 76 Missing ⚠️
...beam/model/fnexecution_v1/beam_provision_api.pb.go 28.43% 72 Missing and 1 partial ⚠️
sdks/go/pkg/beam/core/runtime/harness/statemgr.go 20.00% 71 Missing and 1 partial ⚠️
...odel/jobmanagement_v1/beam_artifact_api_grpc.pb.go 50.76% 28 Missing and 4 partials ⚠️
...eam/model/jobmanagement_v1/beam_job_api_grpc.pb.go 31.91% 31 Missing and 1 partial ⚠️
sdks/go/pkg/beam/artifact/materialize.go 58.06% 14 Missing and 12 partials ⚠️
... and 19 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #33434      +/-   ##
============================================
- Coverage     57.38%   57.31%   -0.08%     
  Complexity     1475     1475              
============================================
  Files           973      973              
  Lines        154978   157414    +2436     
  Branches       1076     1076              
============================================
+ Hits          88939    90225    +1286     
- Misses        63829    64948    +1119     
- Partials       2210     2241      +31     
Flag Coverage Δ
go 35.26% <36.66%> (+0.60%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lostluck lostluck marked this pull request as ready for review December 26, 2024 22:32
@lostluck
Copy link
Contributor Author

The failures are code coverage (Protos everywhere!), and unrelated typescript code.

Copy link
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@lostluck
Copy link
Contributor Author

assign set of reviewers

@lostluck
Copy link
Contributor Author

The typescript tests have been failing for 9 months https://github.com/apache/beam/actions/workflows/typescript_tests.yml?query=is%3Asuccess and can be ignored as unrelated.

Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @jrmccluskey for label python.
R: @robertwb for label java.
R: @jrmccluskey for label go.
R: @chamikaramj for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Contributor

github-actions bot commented Jan 4, 2025

Reminder, please take a look at this pr: @jrmccluskey @robertwb @jrmccluskey @chamikaramj

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @damccorm for label python.
R: @damondouglas for label java.
R: @jrmccluskey for label go.
R: @johnjcasey for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

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

I mostly just reviewed the genproto.sh changes and the steps you took, plus did a couple spot checks, but this LGTM once conflicts are resolved

@lostluck
Copy link
Contributor Author

Rebase done, and re-ran the updates, which only affected newer/copy pasted code, and some of the prism changes. Merging once the tests all pass.

@lostluck lostluck merged commit 4797d75 into apache:master Jan 16, 2025
114 of 116 checks passed
@lostluck lostluck deleted the hybridProtos branch January 16, 2025 19:18
@lostluck
Copy link
Contributor Author

Going to revert this, as it's causing unanticipated issues with the import to Google, where it was to have more of a benefit.

  1. It turns out that we would need to migrate to "editions" first, at least to 2023, in order to change the proto files properly, when moving to other code. That increases the scope to all Java and Python code as well, as a result (though in principle it's just a proto file change, not a generated code change See https://protobuf.dev/editions/overview/)
  2. Some of the conversions seem to have been missed somehow, leading to a scattering of build errors.

Some of the changes can be maintained, but will be re-added separately (such as improvements to the proto generator file, and a more prudent migration to edition=2023).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants