KEMBAR78
fix(hermetic-build): use public maven metadata for latest version inference by diegomarquezp · Pull Request #3853 · googleapis/sdk-platform-java · GitHub
Skip to content

Conversation

@diegomarquezp
Copy link
Contributor

Currently, the get_latest_released_version() function returns 2.59.0 for gapic-generator-java. This is not correct and is due to an ongoing issue with Maven.
This PR uses the alternative maven-metadata.xml files instead, which contains a metadata/versioning/latest entry always pointing to the latest version.

[hi on] diegomarquezp:~$ function get_latest_released_version() {
    local group_id=$1
    local artifact_id=$2
    group_id_url_path="$(sed 's|\.|/|g' <<< "${group_id}")"
    url="https://repo1.maven.org/maven2/${group_id_url_path}/${artifact_id}/maven-metadata.xml"
    xml_content=$(curl -s --fail "${url}")
    latest=$(xmllint --xpath 'metadata/versioning/latest/text()' - <<< "${xml_content}")
    if [[ -z "${latest}" ]]; then
        echo "The latest version of ${group_id}:${artifact_id} is empty."
        echo "The returned json from maven.org is invalid: ${json_content}"
        exit 1
    else
        echo "${latest}"
    fi
}
[hi on] diegomarquezp:~$ get_latest_released_version com.google.api gapic-generator-java
2.60.0

@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Jun 30, 2025
@diegomarquezp
Copy link
Contributor Author

Follow up: HW libraries without hermetic build (e.g. java-bigquery).

JoeWang1127
JoeWang1127 previously approved these changes Jun 30, 2025
suztomo
suztomo previously approved these changes Jun 30, 2025
Copy link
Member

@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.

Can you check xmllint is available in the container before merging this?

@diegomarquezp diegomarquezp dismissed stale reviews from suztomo and JoeWang1127 via 5e51016 June 30, 2025 20:27
@diegomarquezp
Copy link
Contributor Author

Can you check xmllint is available in the container before merging this?

Confirming manually in java-storage: googleapis/java-storage#3181
The action resulted in xmllint: command not found

Installing using sudo apt install -y libxml2-utils solves the problem.

I modified the template.

Thanks a lot for the catch, @suztomo!

@suztomo
Copy link
Member

suztomo commented Jun 30, 2025

Thank you.

@diegomarquezp diegomarquezp enabled auto-merge (squash) June 30, 2025 20:36
@sonarqubecloud
Copy link

@sonarqubecloud
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

@diegomarquezp diegomarquezp merged commit 0be1e96 into main Jun 30, 2025
57 of 60 checks passed
@diegomarquezp diegomarquezp deleted the fix-maven-search-template branch June 30, 2025 20:51
mpeddada1 pushed a commit that referenced this pull request Jul 8, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>2.60.1</summary>

##
[2.60.1](v2.60.0...v2.60.1)
(2025-07-08)


### Bug Fixes

* **hermetic-build:** use public maven metadata for latest version
inference
([#3853](#3853))
([0be1e96](0be1e96))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
diegomarquezp added a commit to googleapis/java-spanner that referenced this pull request Jul 24, 2025
Unfortunately, googleapis/sdk-platform-java#3853 cannot be automatically propagated. 

This PR manually updates this script with the latest.
diegomarquezp added a commit to googleapis/java-storage that referenced this pull request Jul 24, 2025
Unfortunately, googleapis/sdk-platform-java#3853 cannot be automatically propagated. 

This PR manually updates this script with the latest.
BenWhitehead pushed a commit to googleapis/java-storage that referenced this pull request Jul 24, 2025
Unfortunately, googleapis/sdk-platform-java#3853 cannot be automatically propagated. 

This PR manually updates this script with the latest.
diegomarquezp added a commit to googleapis/java-datastore that referenced this pull request Jul 24, 2025
Unfortunately, googleapis/sdk-platform-java#3853 cannot be automatically propagated.

This PR manually updates this script with the latest.
diegomarquezp added a commit to googleapis/java-spanner that referenced this pull request Jul 28, 2025
* chore: manual update of update_generation_config.sh

Unfortunately, googleapis/sdk-platform-java#3853 cannot be automatically propagated. 

This PR manually updates this script with the latest.

* chore: generate libraries at Thu Jul 24 16:12:02 UTC 2025

* chore: update yaml as well

* chore: bring back the script

* chore: generate libraries at Thu Jul 24 16:17:24 UTC 2025

* chore: include yaml changes as well

* chore: generate libraries at Thu Jul 24 17:52:43 UTC 2025

* Revert "chore: generate libraries at Thu Jul 24 17:52:43 UTC 2025"

This reverts commit 3322513.

* chore: generate libraries at Thu Jul 24 18:50:37 UTC 2025

* Revert "chore: generate libraries at Thu Jul 24 18:50:37 UTC 2025"

This reverts commit a1c5956.

* chore: generate libraries at Thu Jul 24 18:54:36 UTC 2025

* Revert "chore: generate libraries at Thu Jul 24 18:54:36 UTC 2025"

This reverts commit 53c4dd7.

---------

Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
diegomarquezp added a commit to googleapis/google-cloud-java that referenced this pull request Jul 28, 2025
Unfortunately, googleapis/sdk-platform-java#3853 cannot be automatically propagated. 

This PR manually updates this script with the latest.
diegomarquezp added a commit to googleapis/google-cloud-java that referenced this pull request Jul 28, 2025
Unfortunately, googleapis/sdk-platform-java#3853
cannot be automatically propagated.

This PR manually updates this script with the latest.
diegomarquezp added a commit to googleapis/java-datastore that referenced this pull request Jul 28, 2025
Unfortunately, googleapis/sdk-platform-java#3853 cannot be automatically propagated.

This PR manually updates this script with the latest.
lqiu96 pushed a commit that referenced this pull request Aug 21, 2025
…erence (#3853)

Currently, the `get_latest_released_version()` function returns `2.59.0`
for gapic-generator-java. This is not correct and is due to an ongoing
issue with Maven.
This PR uses the alternative `maven-metadata.xml` files instead, which
contains a `metadata/versioning/latest` entry always pointing to the
latest version.

```bash
[hi on] diegomarquezp:~$ function get_latest_released_version() {
    local group_id=$1
    local artifact_id=$2
    group_id_url_path="$(sed 's|\.|/|g' <<< "${group_id}")"
    url="https://repo1.maven.org/maven2/${group_id_url_path}/${artifact_id}/maven-metadata.xml"
    xml_content=$(curl -s --fail "${url}")
    latest=$(xmllint --xpath 'metadata/versioning/latest/text()' - <<< "${xml_content}")
    if [[ -z "${latest}" ]]; then
        echo "The latest version of ${group_id}:${artifact_id} is empty."
        echo "The returned json from maven.org is invalid: ${json_content}"
        exit 1
    else
        echo "${latest}"
    fi
}
[hi on] diegomarquezp:~$ get_latest_released_version com.google.api gapic-generator-java
2.60.0
```
lqiu96 pushed a commit that referenced this pull request Aug 21, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>2.60.1</summary>

##
[2.60.1](v2.60.0...v2.60.1)
(2025-07-08)


### Bug Fixes

* **hermetic-build:** use public maven metadata for latest version
inference
([#3853](#3853))
([0be1e96](0be1e96))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
lqiu96 pushed a commit that referenced this pull request Aug 27, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>2.60.1</summary>

##
[2.60.1](v2.60.0...v2.60.1)
(2025-07-08)


### Bug Fixes

* **hermetic-build:** use public maven metadata for latest version
inference
([#3853](#3853))
([0be1e96](0be1e96))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Sep 7, 2025
| Package | Type | Package file | Manager | Update | Change |
|---|---|---|---|---|---|
|
[com.google.api.grpc:proto-google-common-protos](https://github.com/googleapis/sdk-platform-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.61.0` -> `2.61.1` |
|
[com.google.cloud:google-cloud-core-http](https://github.com/googleapis/sdk-platform-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.60.0` -> `2.60.1` |
|
[com.google.cloud:google-cloud-core](https://github.com/googleapis/sdk-platform-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.60.0` -> `2.60.1` |
| [com.google.api:gax](https://github.com/googleapis/sdk-platform-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.70.0` -> `2.70.1` |
| [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.33.3` -> `2.33.4` |
| [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.33.3` -> `2.33.4` |
| [software.amazon.awssdk:s3](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.33.3` -> `2.33.4` |
| [software.amazon.awssdk:regions](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.33.3` -> `2.33.4` |
|
[software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.33.3` -> `2.33.4` |
| [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.33.3` -> `2.33.4` |
| [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.33.3` -> `2.33.4` |
| [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.33.3` -> `2.33.4` |
| [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.33.3` -> `2.33.4` |
| [com.amazonaws:aws-java-sdk-sqs](https://aws.amazon.com/sdkforjava)
([source](https://github.com/aws/aws-sdk-java)) | dependencies |
misk/gradle/libs.versions.toml | gradle | patch | `1.12.790` ->
`1.12.791` |
| [com.amazonaws:aws-java-sdk-s3](https://aws.amazon.com/sdkforjava)
([source](https://github.com/aws/aws-sdk-java)) | dependencies |
misk/gradle/libs.versions.toml | gradle | patch | `1.12.790` ->
`1.12.791` |
|
[com.amazonaws:aws-java-sdk-dynamodb](https://aws.amazon.com/sdkforjava)
([source](https://github.com/aws/aws-sdk-java)) | dependencies |
misk/gradle/libs.versions.toml | gradle | patch | `1.12.790` ->
`1.12.791` |
| [com.amazonaws:aws-java-sdk-core](https://aws.amazon.com/sdkforjava)
([source](https://github.com/aws/aws-sdk-java)) | dependencies |
misk/gradle/libs.versions.toml | gradle | patch | `1.12.790` ->
`1.12.791` |

---

### Release Notes

<details>
<summary>googleapis/sdk-platform-java
(com.google.cloud:google-cloud-core-http)</summary>

###
[`v2.60.1`](https://github.com/googleapis/sdk-platform-java/blob/HEAD/CHANGELOG.md#2601-2025-07-08)

##### Bug Fixes

- **hermetic-build:** use public maven metadata for latest version
inference
([#&#8203;3853](googleapis/sdk-platform-java#3853))
([0be1e96](googleapis/sdk-platform-java@0be1e96))

</details>

<details>
<summary>aws/aws-sdk-java (com.amazonaws:aws-java-sdk-sqs)</summary>

###
[`v1.12.791`](https://github.com/aws/aws-sdk-java/blob/HEAD/CHANGELOG.md#112791-2025-09-05)

[Compare
Source](aws/aws-sdk-java@1.12.790...1.12.791)

#### **AWS Kinesis Video**

- ### Features
  - Update Netty to `4.1.126.Final`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am
every weekday" in timezone Australia/Melbourne, Automerge - At any time
(no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

GitOrigin-RevId: c0ebffa6f441074f7a7a961e7d32f903bbbb7c27
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.

3 participants