Skip to content

chore: README template fix in google-cloud-java#1785

Merged
suztomo merged 4 commits intomasterfrom
java_readme_template_libraries-bom_monorepo
Mar 31, 2023
Merged

chore: README template fix in google-cloud-java#1785
suztomo merged 4 commits intomasterfrom
java_readme_template_libraries-bom_monorepo

Conversation

@suztomo
Copy link
Copy Markdown
Member

@suztomo suztomo commented Mar 31, 2023

The README.md files in the google-cloud-java monorepo to have instructions about how to use the Libraries BOM. This is part of b/274518727.

How I confirmed the change

I built the Docker image:

suztomo@suztomo:~/synthtool$  docker build -f docker/owlbot/java/Dockerfile .
...
Successfully built d50554d0e398

Checked with google-cloud-java repository

In google-cloud-java clone, I touched different Java files in java-api-gateway, java-language and java-notification.

for M in java-api-gateway java-language java-notification; do
   echo "" >> $(find $M -name '*.java' |head -1)
done

git commit -a -m 'chore: touch files to invoke OwlBot post processor'

Then I ran the code with google-cloud-java repository:

suztomo@suztomo:~/google-cloud-java$ docker run --rm -v $(pwd):/workspace  fd14d77283ae

The three modules got the channge in their README files googleapis/google-cloud-java#9299. Notice the README files have Libraries BOM instruction now.

Checked with java-storage repository

The change worked as expected for java-storage module:

suztomo@suztomo:~/java-storage$ docker run --rm -v $(pwd):/workspace d50554d0e398
...

image

This actually fixes an existing bug where it wasn't adding <!-- {x-version-update-start:google-cloud-storage:released} --> when a repository has snippet for Libraries BOM usage.

[developer-console]: https://console.developers.google.com/
[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects
[cloud-cli]: https://cloud.google.com/cli
[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The old link was dead.

Copy link
Copy Markdown
Member Author

@suztomo suztomo left a comment

Choose a reason for hiding this comment

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

@ddixit14 PTAL.

If you are using Maven without the BOM, add this to your dependencies:
{% else %}
If you are using Maven, add this to your pom.xml file:
<!-- {x-version-update-start:{{ artifact_id }}:released} -->
Copy link
Copy Markdown
Member Author

@suztomo suztomo Mar 31, 2023

Choose a reason for hiding this comment

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

@ddixit14 I found that this annotation should appear regardless of {% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['api_shortname'] + '_install_with_bom'] -%} condition.

For example, java-storage's README.md has been missing this "x-version-update-start" annotation

@suztomo suztomo changed the title chore: Java template to show libraries-bom README in google-cloud-java chore: README template fix in google-cloud-java Mar 31, 2023
@suztomo suztomo merged commit 43c709a into master Mar 31, 2023
@suztomo suztomo deleted the java_readme_template_libraries-bom_monorepo branch March 31, 2023 17:29
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.

3 participants