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

Split googleapis into per-language modules #3472

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

fmeum
Copy link
Contributor

@fmeum fmeum commented Dec 21, 2024

Introduces new googleapis-* modules that contain the per-language module dependencies needed to support the individual rules used by the main googleapis module. This allows BCR modules to declare dependencies on language-specific rules in googleapis without requiring that module to depend on every possible language ruleset, which isn't sustainable.

This results in a breaking change for root modules that previously used the switched_rules extensions. These modules now need to explicitly declare deps on the googleapis-* flavors they need, but will be guided through the process by error messages.

In the future, new flavors can be added in a backwards compatible way.

googleapis-grpc-cc is blocked on #3470, which adds a release of grpc including grpc/grpc@3f001f7.

@bazel-io
Copy link
Member

Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (googleapis-cc, googleapis-go, googleapis-java, googleapis-python, googleapis) have been updated in this PR. Please review the changes.

@fmeum fmeum force-pushed the fmeum/googleapis-0.0.0-20241220-5e258e33 branch 2 times, most recently from dfcb309 to 0d8947f Compare December 21, 2024 12:49
@fmeum fmeum added presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval skip-url-stability-check Skip the URL stability check for the PR skip-source-repo-check In BCR presubmit, skip checking the source repository for the module added in the PR labels Dec 21, 2024
@fmeum fmeum force-pushed the fmeum/googleapis-0.0.0-20241220-5e258e33 branch 2 times, most recently from 8f7654a to c54877c Compare December 21, 2024 13:37
@bazel-io
Copy link
Member

Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (googleapis-cc, googleapis-go, googleapis-grpc-cc, googleapis-grpc-java, googleapis-java, googleapis-python, googleapis) have been updated in this PR. Please review the changes.

@fmeum fmeum force-pushed the fmeum/googleapis-0.0.0-20241220-5e258e33 branch from 4d80faa to 979ea95 Compare December 21, 2024 14:25
@bazel-io
Copy link
Member

Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (googleapis-cc, googleapis-go, googleapis-grpc-java, googleapis-java, googleapis-python, googleapis) have been updated in this PR. Please review the changes.

@fmeum fmeum force-pushed the fmeum/googleapis-0.0.0-20241220-5e258e33 branch from 60cfbd8 to 6617794 Compare December 21, 2024 15:03
@@ -0,0 +1,7 @@
{
"integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=",
"url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Replace with a better source after #3474.

Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't we just allow url to be not set when overlay is used?

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 could, but that would require raising the minimum Bazel version to at least 8.1.0 (the earliest we can ship this).

@fmeum fmeum changed the title Add googleapis 0.0.0-20241220-5e258e33 Split googleapis into different modules Dec 21, 2024
@fmeum fmeum marked this pull request as ready for review December 21, 2024 16:00
@fmeum fmeum changed the title Split googleapis into different modules Split googleapis into per-language modules Dec 21, 2024
@fmeum fmeum force-pushed the fmeum/googleapis-0.0.0-20241220-5e258e33 branch from 0d8efa5 to de336d6 Compare December 25, 2024 20:42
@fmeum fmeum force-pushed the fmeum/googleapis-0.0.0-20241220-5e258e33 branch from de336d6 to f733960 Compare December 25, 2024 20:43
@fmeum fmeum force-pushed the fmeum/googleapis-0.0.0-20241220-5e258e33 branch from 2ad8da5 to 432a13e Compare December 25, 2024 20:50
@fmeum fmeum marked this pull request as draft December 25, 2024 21:31
@mering
Copy link
Contributor

mering commented Dec 26, 2024

Another thing which just came to my mind: Uploading new versions will become much more work with this approach. This is especially relevant since we don't have active maintainers for this package and are even further away from release automation. So it will become less likely that people contribute version updates.

@fmeum
Copy link
Contributor Author

fmeum commented Dec 27, 2024

We should avoid making updates more complicated, but I don't see why this would make it so. Instead of the patches, there are now a few overlay files, but that's the only change I see. The "flavor" modules only need new versions if the targets generated in googleapis change in a fundamental way. Do you see other downsides to this approach?

I'm thinking of adding a tool to the repo that creates a new version of an existing module by symlinking over files that haven't changed and replacing the old version with the new version in module files, URLs and prefixes. That should make it very easy to update googleapis, regardless of which approach is used. What do you think about that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval skip-source-repo-check In BCR presubmit, skip checking the source repository for the module added in the PR skip-url-stability-check Skip the URL stability check for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants