build: remove logic to normalize the repo-metadata values, keep original values instead#13586
build: remove logic to normalize the repo-metadata values, keep original values instead#13586sofisl wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request simplifies transport handling by removing the conversion mapping in utilities.py and directly using the transport value. It also updates the README Jinja template to support rest and grpc+rest transport types, and updates the golden test metadata accordingly. The review feedback suggests using the in operator with a list of values in the Jinja template instead of multiple or conditions to make the code more concise and maintainable.
| {% elif metadata['repo']['transport'] == 'http' or metadata['repo']['transport'] == 'rest' -%} | ||
| {{metadata['repo']['name_pretty']}} uses HTTP/JSON for the transport layer. | ||
| {% elif metadata['repo']['transport'] == 'both' -%} | ||
| {% elif metadata['repo']['transport'] == 'both' or metadata['repo']['transport'] == 'grpc+rest' -%} | ||
| {{metadata['repo']['name_pretty']}} uses both gRPC and HTTP/JSON for the transport layer. |
There was a problem hiding this comment.
Using the in operator with a list of values is more concise and idiomatic in Jinja templates than multiple or conditions. This also makes it easier to maintain if more transport types are added in the future.
| {% elif metadata['repo']['transport'] == 'http' or metadata['repo']['transport'] == 'rest' -%} | |
| {{metadata['repo']['name_pretty']}} uses HTTP/JSON for the transport layer. | |
| {% elif metadata['repo']['transport'] == 'both' -%} | |
| {% elif metadata['repo']['transport'] == 'both' or metadata['repo']['transport'] == 'grpc+rest' -%} | |
| {{metadata['repo']['name_pretty']}} uses both gRPC and HTTP/JSON for the transport layer. | |
| {% elif metadata['repo']['transport'] in ['http', 'rest'] -%} | |
| {{metadata['repo']['name_pretty']}} uses HTTP/JSON for the transport layer. | |
| {% elif metadata['repo']['transport'] in ['both', 'grpc+rest'] -%} | |
| {{metadata['repo']['name_pretty']}} uses both gRPC and HTTP/JSON for the transport layer. |
|
|



This PR is an accompaniment to googleapis/librarian#6582. Opening this just so that it is clear to the PR reviewers what else will need to be done. However, before merging this PR, we should update the pseudo-version of librarian and regenerate all of the values after 6582 is merged.