Skip to content

Commit dcd77c8

Browse files
authored
Merge branch 'main' into feat/deleteSourceObjects-compose-10602500430278326901
2 parents 8efd0a5 + cd60481 commit dcd77c8

36 files changed

Lines changed: 603 additions & 456 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,13 @@ jobs:
321321
- name: validate generation configuration
322322
shell: bash
323323
run: |
324-
docker run \
325-
--rm \
324+
bash generation/run_generator_docker.sh "${library_generation_image_tag}" "${{ github.base_ref || 'main' }}" \
325+
-e GENERATOR_VERSION="${library_generation_image_tag}" \
326326
--quiet \
327327
-u "$(id -u):$(id -g)" \
328328
-v "$(pwd):${workspace_name}" \
329329
--entrypoint python \
330-
gcr.io/cloud-devrel-public-resources/java-library-generation:"${library_generation_image_tag}" \
330+
-- \
331331
/src/library_generation/cli/entry_point.py validate-generation-config
332332
env:
333333
library_generation_image_tag: 2.68.0

.github/workflows/generated_files_sync.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ jobs:
2727
- name: Generate root pom.xml file
2828
shell: bash
2929
run: |
30-
docker run \
31-
--rm \
30+
bash generation/run_generator_docker.sh "${library_generation_image_tag}" "${{ github.base_ref }}" \
3231
--quiet \
3332
-u "$(id -u):$(id -g)" \
3433
-v "$(pwd):/workspace" \
3534
--entrypoint python \
36-
gcr.io/cloud-devrel-public-resources/java-library-generation:"${library_generation_image_tag}" \
35+
-- \
3736
/src/library_generation/cli/generate_monorepo_root_pom.py \
3837
generate \
3938
--repository-path=/workspace
@@ -48,13 +47,12 @@ jobs:
4847
- name: Generate gapic-libraries-bom/pom.xml
4948
shell: bash
5049
run: |
51-
docker run \
52-
--rm \
50+
bash generation/run_generator_docker.sh "${library_generation_image_tag}" "${{ github.base_ref }}" \
5351
--quiet \
5452
-u "$(id -u):$(id -g)" \
5553
-v "$(pwd):/workspace" \
5654
--entrypoint python \
57-
gcr.io/cloud-devrel-public-resources/java-library-generation:"${library_generation_image_tag}" \
55+
-- \
5856
/src/library_generation/cli/generate_monorepo_gapic_bom.py \
5957
generate \
6058
--repository-path=/workspace \

.github/workflows/sdk-platform-java-verify_library_generation.yaml renamed to .github/workflows/hermetic-build-scripts-ci.yaml

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
on:
22
pull_request:
33

4-
name: sdk-platform-java verify_library_generation
5-
env:
6-
BUILD_SUBDIR: sdk-platform-java
4+
name: hermetic build scripts
75
jobs:
86
filter:
97
runs-on: ubuntu-latest
@@ -16,48 +14,14 @@ jobs:
1614
with:
1715
filters: |
1816
library:
19-
- 'sdk-platform-java/**'
20-
should-run-library-generation-tests:
21-
needs: filter
22-
if: ${{ needs.filter.outputs.library == 'true' }}
23-
runs-on: ubuntu-22.04
24-
outputs:
25-
should_run: ${{ steps.get_changed_directories.outputs.should_run }}
26-
steps:
27-
- uses: actions/checkout@v4
28-
with:
29-
fetch-depth: 0
30-
- name: get changed directories in the pull request
31-
id: get_changed_directories
32-
shell: bash
33-
run: |
34-
set -ex
35-
# PRs that come from a fork need to be handled differently
36-
if [[ ${head_repo_name} == ${base_repo} ]]; then
37-
git checkout ${base_ref}
38-
git checkout ${head_ref}
39-
changed_directories="$(git diff --name-only ${base_ref} ${head_ref})"
40-
else
41-
git remote add fork ${head_repo_url}
42-
git fetch fork # create a mapping of the fork
43-
git checkout -b "${head_ref}" fork/${head_ref}
44-
changed_directories="$(git diff --name-only "fork/${head_ref}" "origin/${base_ref}")"
45-
fi
46-
if [[ ${changed_directories} =~ "sdk-platform-java/hermetic_build/" ]] || [[ ${changed_directories} =~ "sdk-platform-java/.cloudbuild/library_generation/" ]]; then
47-
echo "should_run=true" >> $GITHUB_OUTPUT
48-
else
49-
echo "should_run=false" >> $GITHUB_OUTPUT
50-
fi
51-
env:
52-
base_ref: ${{ github.event.pull_request.base.ref }}
53-
head_ref: ${{ github.event.pull_request.head.ref }}
54-
head_repo_url: ${{ github.event.pull_request.head.repo.html_url }}
55-
head_repo_name: ${{ github.event.pull_request.head.repo.full_name }}
56-
base_repo: ${{ github.repository }}
17+
- 'sdk-platform-java/hermetic_build/**'
18+
- 'sdk-platform-java/.cloudbuild/library_generation/**'
19+
- '.github/workflows/hermetic-build-scripts-ci.yaml'
5720
library-generation-unit-tests:
58-
needs: [filter, should-run-library-generation-tests]
59-
if: needs.filter.outputs.library == 'true' && needs.should-run-library-generation-tests.outputs.should_run == 'true'
21+
needs: filter
22+
if: needs.filter.outputs.library == 'true'
6023
runs-on: ubuntu-22.04
24+
name: hermetic build units (python)
6125
defaults:
6226
run:
6327
working-directory: sdk-platform-java
@@ -86,9 +50,10 @@ jobs:
8650
set -x
8751
python -m unittest discover -s hermetic_build -p "*unit_tests.py"
8852
library-generation-lint-shell:
89-
needs: [filter, should-run-library-generation-tests]
90-
if: needs.filter.outputs.library == 'true' && needs.should-run-library-generation-tests.outputs.should_run == 'true'
53+
needs: filter
54+
if: needs.filter.outputs.library == 'true'
9155
runs-on: ubuntu-22.04
56+
name: hermetic build lint (shell)
9257
defaults:
9358
run:
9459
working-directory: sdk-platform-java
@@ -103,9 +68,10 @@ jobs:
10368
ignore_paths:
10469
.kokoro
10570
library-generation-lint-python:
106-
needs: [filter, should-run-library-generation-tests]
107-
if: needs.filter.outputs.library == 'true' && needs.should-run-library-generation-tests.outputs.should_run == 'true'
71+
needs: filter
72+
if: needs.filter.outputs.library == 'true'
10873
runs-on: ubuntu-22.04
74+
name: hermetic build lint (python)
10975
defaults:
11076
run:
11177
working-directory: sdk-platform-java

.github/workflows/hermetic_library_generation.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
env:
2121
REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}
2222
GITHUB_REPOSITORY: ${{ github.repository }}
23+
# {x-version-update-start:gapic-generator-java:current}
24+
GENERATOR_VERSION: 2.71.0
25+
# {x-version-update-end}
2326
jobs:
2427
library_generation:
2528
runs-on: ubuntu-latest
@@ -44,4 +47,4 @@ jobs:
4447
head_ref: ${{ github.head_ref }}
4548
token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
4649
force_regenerate_all: ${{ github.event.pull_request.head.ref == 'generate-libraries-main' }}
47-
image_tag: 2.71.0 # {x-version-update:gapic-generator-java:current}
50+
image_tag: ${{ env.GENERATOR_VERSION }}

0 commit comments

Comments
 (0)