Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,13 @@ jobs:
- name: validate generation configuration
shell: bash
run: |
docker run \
--rm \
bash generation/run_generator_docker.sh "${library_generation_image_tag}" "${{ github.base_ref || 'main' }}" \
-e GENERATOR_VERSION="${library_generation_image_tag}" \
--quiet \
-u "$(id -u):$(id -g)" \
-v "$(pwd):${workspace_name}" \
--entrypoint python \
gcr.io/cloud-devrel-public-resources/java-library-generation:"${library_generation_image_tag}" \
-- \
/src/library_generation/cli/entry_point.py validate-generation-config
env:
library_generation_image_tag: 2.68.0
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/generated_files_sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ jobs:
- name: Generate root pom.xml file
shell: bash
run: |
docker run \
--rm \
bash generation/run_generator_docker.sh "${library_generation_image_tag}" "${{ github.base_ref }}" \
--quiet \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/workspace" \
--entrypoint python \
gcr.io/cloud-devrel-public-resources/java-library-generation:"${library_generation_image_tag}" \
-- \
/src/library_generation/cli/generate_monorepo_root_pom.py \
generate \
--repository-path=/workspace
Expand All @@ -48,13 +47,12 @@ jobs:
- name: Generate gapic-libraries-bom/pom.xml
shell: bash
run: |
docker run \
--rm \
bash generation/run_generator_docker.sh "${library_generation_image_tag}" "${{ github.base_ref }}" \
--quiet \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/workspace" \
--entrypoint python \
gcr.io/cloud-devrel-public-resources/java-library-generation:"${library_generation_image_tag}" \
-- \
/src/library_generation/cli/generate_monorepo_gapic_bom.py \
generate \
--repository-path=/workspace \
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
env:
REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}
GITHUB_REPOSITORY: ${{ github.repository }}
# {x-version-update-start:gapic-generator-java:current}
GENERATOR_VERSION: 2.71.0
# {x-version-update-end}
jobs:
library_generation:
runs-on: ubuntu-latest
Expand All @@ -44,4 +47,4 @@ jobs:
head_ref: ${{ github.head_ref }}
token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
force_regenerate_all: ${{ github.event.pull_request.head.ref == 'generate-libraries-main' }}
image_tag: 2.71.0 # {x-version-update:gapic-generator-java:current}
image_tag: ${{ env.GENERATOR_VERSION }}
62 changes: 62 additions & 0 deletions generation/run_generator_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -exo pipefail

REQUESTED_TAG="$1"
TARGET_BRANCH="$2"
shift 2

# Parse arguments using '--' as delimiter
DOCKER_OPTS=()
CONTAINER_CMD=()
found_delimiter=false

for arg in "$@"; do
if [ "$arg" == "--" ]; then
found_delimiter=true
continue
fi
if $found_delimiter; then
CONTAINER_CMD+=("$arg")
else
DOCKER_OPTS+=("$arg")
fi
done

IMAGE_NAME="gcr.io/cloud-devrel-public-resources/java-library-generation"
# Support both local git and GitHub Actions environment variables
CURRENT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-$(git branch --show-current)}}"
IMAGE_TAG="$REQUESTED_TAG"

# Fallback logic on Release PR branches
if [[ "$CURRENT_BRANCH" =~ ^release-please-- ]]; then
echo "Detected release PR branch: $CURRENT_BRANCH"
if ! docker pull "${IMAGE_NAME}:${IMAGE_TAG}"; then
echo "Image not found for version ${IMAGE_TAG}. Falling back to previous version from ${TARGET_BRANCH}."
# Extract tag from target branch's versions.txt using explicit fetch
git fetch origin "${TARGET_BRANCH}" --depth=1 || true
PREVIOUS_TAG=$(git show FETCH_HEAD:versions.txt | grep "^gapic-generator-java:" | cut -d ':' -f 2 || true)
if [ -n "$PREVIOUS_TAG" ]; then
echo "Using previous image version: $PREVIOUS_TAG"
IMAGE_TAG="$PREVIOUS_TAG"
else
echo "Failed to extract fallback tag. Proceeding with requested tag."
fi
fi
fi

# Execute Docker run with proper ordering
docker run --rm "${DOCKER_OPTS[@]}" "${IMAGE_NAME}:${IMAGE_TAG}" "${CONTAINER_CMD[@]}"
1 change: 0 additions & 1 deletion generation_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
gapic_generator_version: 2.70.0
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.

@blakeli0 Note that I'm removing this version declaration because it's confusing as it doesn't get updated, and it's not used anyway.

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.

Agreed. We used to update this version in the daily generation PR to trigger a full generation, but we always use the latest snapshot version now after monorepo migration.

googleapis_commitish: 62e4ecb2f4390728990514fea14aad0431881a52
libraries_bom_version: 26.79.0
libraries:
Expand Down
8 changes: 4 additions & 4 deletions java-vectorsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ If you are using Maven without the BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vectorsearch</artifactId>
<version>0.12.0</version>
<version>0.13.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-vectorsearch:0.12.0'
implementation 'com.google.cloud:google-cloud-vectorsearch:0.13.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-vectorsearch" % "0.12.0"
libraryDependencies += "com.google.cloud" % "google-cloud-vectorsearch" % "0.13.0"
```

## Authentication
Expand Down Expand Up @@ -181,7 +181,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-vectorsearch/latest/overview
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-vectorsearch.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-vectorsearch/0.12.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-vectorsearch/0.13.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ ARG GRPC_VERSION=1.80.0
ENV HOME=/home
ENV OS_ARCHITECTURE="linux-x86_64"

# {x-version-update-start:gapic-generator-java:current}
ENV GENERATOR_VERSION="2.71.0"
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.

I don't think this is needed?

# {x-version-update-end}

# install OS tools
RUN apt update && apt install -y curl unzip rsync jq nodejs npm git openjdk-17-jdk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ set -exo pipefail
# the default value is generation_config.yaml in the repository root.
# 5. [optional] showcase_mode, true if we wish to download the showcase api
# definitions, which are necessary for generating the showcase library.
IMAGE_NAME="gcr.io/cloud-devrel-public-resources/java-library-generation"
while [[ $# -gt 0 ]]; do
key="$1"
case "${key}" in
Expand Down Expand Up @@ -123,13 +124,12 @@ changed_libraries="$(cat "${changed_libraries_file}")"
echo "Changed libraries are: ${changed_libraries:-"No changed library"}."

# run hermetic code generation docker image.
docker run \
--rm \
bash generation/run_generator_docker.sh "${image_tag}" "${target_branch}" \
-u "$(id -u):$(id -g)" \
-v "$(pwd):${workspace_name}" \
-v "${api_def_dir}:${workspace_name}/googleapis" \
-e GENERATOR_VERSION="${image_tag}" \
gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \
-- \
--generation-config-path="${workspace_name}/${generation_config}" \
--library-names="${changed_libraries}" \
--api-definitions-path="${workspace_name}/googleapis"
Expand Down
Loading