Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,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: 9.99.9
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,28 @@ changed_libraries="$(cat "${changed_libraries_file}")"
echo "Changed libraries are: ${changed_libraries:-"No changed library"}."

# run hermetic code generation docker image.
# Attempt to pull the image to see if it exists on release PRs.
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}."
previous_tag=$(git show "${target_branch}":.github/workflows/hermetic_library_generation.yaml | grep -m 1 "^[[:space:]]*image_tag:" | cut -d ':' -f 2- | cut -d '#' -f 1 | xargs)
Comment thread
meltsufin marked this conversation as resolved.
Outdated
if [ -n "$previous_tag" ]; then
echo "Using previous image version: $previous_tag"
image_tag="$previous_tag"
else
echo "Failed to extract previous version from ${target_branch}. Proceeding with original tag."
fi
fi
fi

docker run \
--rm \
-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}" \
"${IMAGE_NAME}:${image_tag}" \
--generation-config-path="${workspace_name}/${generation_config}" \
--library-names="${changed_libraries}" \
--api-definitions-path="${workspace_name}/googleapis"
Expand Down
Loading