Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3c59412
build: fall back to previous image version on release PRs
meltsufin Apr 18, 2026
5fa7830
build: extract image name to variable in hermetic script
meltsufin Apr 18, 2026
823b98c
build: improve robustness of fallback version extraction
meltsufin Apr 18, 2026
832af4c
build: force fallback by using non-existent image version
meltsufin Apr 18, 2026
c1395d2
build: prevent script termination on empty fallback match
meltsufin Apr 18, 2026
5abc6a2
build: fetch target branch in Kokoro to resolve diff error
meltsufin Apr 20, 2026
59659b4
chore: update *all* instances of gapic-generator-java markers to 9.99…
meltsufin Apr 21, 2026
53d67a1
refactor: centralize generator docker execution and fallback logic
meltsufin Apr 21, 2026
16cfa1b
refactor: extract fallback tag from versions.txt instead of workflow …
meltsufin Apr 21, 2026
3c3f97c
Merge branch 'release-please--fix-12825' into release-please--simulation
meltsufin Apr 21, 2026
ef92609
refactor: remove unused gapic_generator_version from generation_confi…
meltsufin Apr 21, 2026
54269dc
fix: use remote ref origin/ for fallback tag extraction in CI
meltsufin Apr 21, 2026
b74fe50
Merge branch 'main' into release-please--fix-12825
meltsufin Apr 21, 2026
8fbacd0
Merge branch 'release-please--fix-12825' into release-please--simulation
meltsufin Apr 21, 2026
1ae26cc
fix: fetch target branch to get fallback tag in CI
meltsufin Apr 21, 2026
d19bfbb
Merge branch 'release-please--fix-12825' of github.com:googleapis/goo…
meltsufin Apr 21, 2026
43835e2
impl: add GENERATOR_VERSION to final stage of Dockerfile
meltsufin Apr 21, 2026
3137fc8
test: simulate version update to 9.99.9
meltsufin Apr 21, 2026
b020e53
Merge branch 'release-please--fix-12825' into release-please--simulation
meltsufin Apr 21, 2026
e9fd280
test: simulate update of GENERATOR_VERSION to 9.99.9
meltsufin Apr 21, 2026
68519fb
chore: pass GENERATOR_VERSION to validation container in CI
meltsufin Apr 21, 2026
e5bdba9
Merge branch 'release-please--fix-12825' into release-please--simulation
meltsufin Apr 21, 2026
2cbaa3c
chore: pass GENERATOR_VERSION to hermetic_library_generation workflow
meltsufin Apr 21, 2026
bcee69f
Merge branch 'release-please--fix-12825' into release-please--simulation
meltsufin Apr 21, 2026
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
12 changes: 5 additions & 7 deletions .github/workflows/generated_files_sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
pull_request:
name: generation diff
env:
library_generation_image_tag: 2.71.0 # {x-version-update:gapic-generator-java:current}
library_generation_image_tag: 9.99.9 # {x-version-update:gapic-generator-java:current}
jobs:
root-pom:
# root pom.xml does not have diff from generated one
Expand All @@ -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 }}
1 change: 1 addition & 0 deletions .kokoro/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ function generate_modified_modules_list() {
# grep returns 1 (error code) and exits the pipeline if there is no match
# If there is no match, it will return true so the rest of the commands can run
git config --global --add safe.directory $(realpath .)
git fetch origin "${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}" || true
modified_files=$(git diff --name-only "${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}...${KOKORO_GITHUB_PULL_REQUEST_COMMIT}")
printf "Modified files:\n%s\n" "${modified_files}"

Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS")
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS")

_gapic_generator_java_version = "2.71.0" # {x-version-update:gapic-generator-java:current}
_gapic_generator_java_version = "9.99.9" # {x-version-update:gapic-generator-java:current}

maven_install(
artifacts = [
Expand Down
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
googleapis_commitish: 62e4ecb2f4390728990514fea14aad0431881a52
libraries_bom_version: 26.79.0
libraries:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ WORKDIR /google-cloud-java

COPY . .
# {x-version-update-start:gapic-generator-java:current}
ENV DOCKER_GAPIC_GENERATOR_VERSION="2.71.0"
ENV DOCKER_GAPIC_GENERATOR_VERSION="9.99.9"
# {x-version-update-end}

# Download the java formatter
Expand All @@ -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="9.99.9"
# {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
2 changes: 1 addition & 1 deletion sdk-platform-java/api-common-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down
6 changes: 3 additions & 3 deletions sdk-platform-java/gapic-generator-java-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-bom</artifactId>
<packaging>pom</packaging>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<name>GAPIC Generator Java BOM</name>
<description>
BOM for the libraries in gapic-generator-java repository. Users should not
Expand All @@ -15,7 +15,7 @@
<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down Expand Up @@ -100,7 +100,7 @@
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<packaging>pom</packaging>
<name>GAPIC Generator Java POM Parent</name>
<url>https://github.com/googleapis/sdk-platform-java</url>
Expand Down
6 changes: 3 additions & 3 deletions sdk-platform-java/gapic-generator-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<name>GAPIC Generator Java</name>
<description>GAPIC generator Java</description>

Expand All @@ -23,7 +23,7 @@
<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand All @@ -32,7 +32,7 @@
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-bom</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion sdk-platform-java/gax-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ maven_install(
repositories = ["https://repo.maven.apache.org/maven2/"],
)

_gapic_generator_java_version = "2.25.1-SNAPSHOT" # {x-version-update:gapic-generator-java:current}
_gapic_generator_java_version = "9.99.9" # {x-version-update:gapic-generator-java:current}

maven_install(
artifacts = [
Expand Down
2 changes: 1 addition & 1 deletion sdk-platform-java/java-common-protos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sdk-platform-java/java-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sdk-platform-java/java-iam/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<!-- This BOM declares the versions gRPC, Protobuf, Guava, etc. -->
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-bom</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion sdk-platform-java/java-shared-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.71.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>9.99.9</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down
Loading