Skip to content

fix: make generation config update logs verbose #3764

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

diegomarquezp
Copy link
Contributor

@diegomarquezp diegomarquezp commented Apr 23, 2025

https://github.com/googleapis/java-storage/actions/runs/14629392782/job/41048556919 was a failed run of update_generation_config.sh.

The error message was misleading since jq failed because the command that produced the input for such jq command had silently failed:

Updating files: 100% (7136/7136), done.
~/work/java-storage/java-storage/tmp-googleapis ~/work/java-storage/java-storage
Already up to date.
~/work/java-storage/java-storage
Update googleapis_commitish to 03baf05e13d9241ec8c19bdedb1d991b6ed7e115 in generation_config.yaml
jq: parse error: Invalid numeric literal at line 1, column 7
Error: Process completed with exit code 1.

If we enable the xtrace flag, we can see it was due to a 502 when fetching the latest version of the generator:

Updating files: 100% (7136/7136), done.
+ pushd tmp-googleapis
~/google/java-storage/tmp-googleapis ~/google/java-storage
+ git pull
Already up to date.
++ git rev-parse HEAD
+ latest_commit=03baf05e13d9241ec8c19bdedb1d991b6ed7e115
+ popd
~/google/java-storage
+ rm -rf tmp-googleapis
+ update_config googleapis_commitish 03baf05e13d9241ec8c19bdedb1d991b6ed7e115 generation_config.yaml
+ local key_word=googleapis_commitish
+ local new_value=03baf05e13d9241ec8c19bdedb1d991b6ed7e115
+ local file=generation_config.yaml
+ echo 'Update googleapis_commitish to 03baf05e13d9241ec8c19bdedb1d991b6ed7e115 in generation_config.yaml'
Update googleapis_commitish to 03baf05e13d9241ec8c19bdedb1d991b6ed7e115 in generation_config.yaml
+ sed -i -e 's/^googleapis_commitish.*$/googleapis_commitish: 03baf05e13d9241ec8c19bdedb1d991b6ed7e115/' generation_config.yaml
++ get_latest_released_version com.google.api gapic-generator-java
++ local group_id=com.google.api
++ local artifact_id=gapic-generator-java
+++ curl -s 'https://search.maven.org/solrsearch/select?q=g:com.google.api+AND+a:gapic-generator-java&core=gav&rows=500&wt=json'
++ json_content='<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>'
+++ jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v'
+++ sort -V
+++ tail -n 1
jq: parse error: Invalid numeric literal at line 2, column 0
++ latest=
++ [[ -z '' ]]
++ echo 'The latest version of com.google.api:gapic-generator-java is empty.'
++ echo 'The returned json from maven.org is invalid: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>'
++ exit 1
+ latest_version='The latest version of com.google.api:gapic-generator-java is empty.
The returned json from maven.org is invalid: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>'

Such flag saves the developer a round trip for local reproduction.

@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Apr 23, 2025
Copy link

Copy link

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant