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

Update new-client.py to set transport based on Bazel #8747

Open
alicejli opened this issue Nov 8, 2022 · 2 comments
Open

Update new-client.py to set transport based on Bazel #8747

alicejli opened this issue Nov 8, 2022 · 2 comments
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@alicejli
Copy link
Contributor

alicejli commented Nov 8, 2022

Is your feature request related to a problem? Please describe.
new-client.py generates the repo-metadata.json file with the transport option set to grpc was default. This can lead to discrepancies between repo-metadata.json and the BUILD.bazel file which is technically the source of truth.

For instance, for java-api-gateway: the repo-metadata.json file shows transport: grpc: https://github.com/googleapis/java-api-gateway/blob/main/.repo-metadata.json#L8, however the BUILD.bazel file shows that actually transport: grpc+rest: https://github.com/googleapis/googleapis/blob/master/google/cloud/apigateway/v1/BUILD.bazel#L96.

This will not fix the issue where the BUILD.bazel file gets updated post initial library generation to a different transport; that can be addressed in a follow up.

Describe the solution you'd like
new-client.py should generate the transport option based on the BUILD.bazel file if possible.

Alternatively, if there's a way to automatically update repo-metadata.json based on the BUILD.bazel file in general, that could solve both new client generation and existing library updates.

@alicejli alicejli added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Nov 8, 2022
@meltsufin
Copy link
Member

This is a great observation! I think it points to the problem with the generator not doing the full job, and having to rely on post-processing to finish the generator's job. The generator should probably generate repo-metadata.json. Alternatively, new-client.py can try to auto-detect the transport based on the generated classes.

@suztomo
Copy link
Member

suztomo commented Nov 9, 2022

Who suffer from the wrong value in the repo-metadata.json files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants