Skip to content

fix: do not generate Version.java files by default#12955

Draft
diegomarquezp wants to merge 15 commits intomainfrom
fix/no-version-java-self-service
Draft

fix: do not generate Version.java files by default#12955
diegomarquezp wants to merge 15 commits intomainfrom
fix/no-version-java-self-service

Conversation

@diegomarquezp
Copy link
Copy Markdown
Contributor

This prevents self-service libraries from having these files.

Copy link
Copy Markdown
Contributor

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

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 introduces a generate_version_java flag to control the generation of Version.java files, updating Bazel rules, the Java generator, and hermetic build scripts. It also adds several well-known type proto files for testing. The review feedback correctly identifies that the flag's default value should be changed to False to align with the objective of disabling generation by default and suggests using Collections.emptyList() for more idiomatic and efficient code.

# possible values are: "grpc", "rest", "grpc+rest"
transport,
rest_numeric_enums,
generate_version_java = True,
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.

high

The default value for generate_version_java is set to True, which contradicts the pull request title "do not generate Version.java files by default". To align with the intended goal of disabling generation by default, this should be set to False.

Suggested change
generate_version_java = True,
generate_version_java = False,

# possible values are: "grpc", "rest", "grpc+rest"
transport = None,
rest_numeric_enums = False,
generate_version_java = True,
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.

high

As noted in the previous comment, the default value here should be False to match the pull request's objective of disabling Version.java generation by default.

Suggested change
generate_version_java = True,
generate_version_java = False,

service_yaml = None,
transport = None,
rest_numeric_enums = False,
generate_version_java = True,
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.

high

As noted in the previous comments, the default value here should be False to match the pull request's objective of disabling Version.java generation by default.

Suggested change
generate_version_java = True,
generate_version_java = False,

fi

if [ -z "${generate_version_java}" ]; then
generate_version_java="true"
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.

high

The default value for generate_version_java is set to "true", which contradicts the pull request title. It should be set to "false" to ensure that Version.java files are not generated by default in the hermetic build process.

Suggested change
generate_version_java="true"
generate_version_java="false"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is for our open source library generation, which does require Version.java generation

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@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