Skip to content

build: remove logic to normalize the repo-metadata values, keep original values instead#13586

Open
sofisl wants to merge 3 commits into
mainfrom
fixJavaTransport
Open

build: remove logic to normalize the repo-metadata values, keep original values instead#13586
sofisl wants to merge 3 commits into
mainfrom
fixJavaTransport

Conversation

@sofisl

@sofisl sofisl commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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.

@sofisl sofisl requested review from a team as code owners June 30, 2026 00:20
@sofisl sofisl changed the title build: remove logic to normalize the repo-metadata values build: remove logic to normalize the repo-metadata values, keep original values instead Jun 30, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +160 to 163
{% 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
{% 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.

sofisl added a commit to googleapis/librarian that referenced this pull request Jun 30, 2026
…etadata (#6582)

Remove the Java-specific mapping in RepoMetadataTransport that
translated transport values to "http" or "both". Now it returns the
standard values ("grpc", "rest", "grpc+rest") directly, aligning Java
with other languages.

After merging, we will merge
googleapis/google-cloud-java#13586, once we
update the librarian pseudo-version and regenerate the repo-metadata
values.

Fixes #4854
@sofisl sofisl requested review from a team as code owners June 30, 2026 18:47
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant