Skip to content

Commit 5b9fbf4

Browse files
committed
chore(do not merge): demo of template files fix
1 parent b08b74c commit 5b9fbf4

File tree

10 files changed

+42
-20
lines changed

10 files changed

+42
-20
lines changed

.github/scripts/update_generation_config.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ set -e
1515
function get_latest_released_version() {
1616
local group_id=$1
1717
local artifact_id=$2
18-
latest=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json" | jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' | sort -V | tail -n 1)
19-
echo "${latest}"
18+
json_content=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json")
19+
latest=$(jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' <<< "${json_content}" | sort -V | tail -n 1)
20+
if [[ -z "${latest}" ]]; then
21+
echo "The latest version of ${group_id}:${artifact_id} is empty."
22+
echo "The returned json from maven.org is invalid: ${json_content}"
23+
exit 1
24+
else
25+
echo "${latest}"
26+
fi
2027
}
2128

2229
# Update a key to a new value in the generation config.

.github/workflows/ci.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
java: [8, 11, 17, 21]
28+
java: [11, 17, 21]
2929
steps:
3030
- uses: actions/checkout@v4
3131
- uses: actions/setup-java@v4
@@ -36,7 +36,28 @@ jobs:
3636
- run: .kokoro/build.sh
3737
env:
3838
JOB_TYPE: test
39-
JAVA_VERSION: ${{matrix.java}}
39+
units-java8:
40+
# Building using Java 17 and run the tests with Java 8 runtime
41+
name: "units (8)"
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-java@v4
46+
with:
47+
java-version: 8
48+
distribution: temurin
49+
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
50+
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
51+
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
52+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
53+
shell: bash
54+
- uses: actions/setup-java@v4
55+
with:
56+
java-version: 17
57+
distribution: temurin
58+
- run: .kokoro/build.sh
59+
env:
60+
JOB_TYPE: test
4061
windows:
4162
runs-on: windows-latest
4263
steps:

.github/workflows/renovate_config_check.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
renovate_bot_config_validation:
10-
runs-on: ubuntu-24.04
10+
runs-on: ubuntu-22.04
1111

1212
steps:
1313
- name: Checkout code
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Node.js
1717
uses: actions/setup-node@v4
1818
with:
19-
node-version: '22'
19+
node-version: '20'
2020

2121
- name: Install Renovate and Config Validator
2222
run: |

.github/workflows/samples.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/setup-java@v4
2525
with:
2626
distribution: temurin
27-
java-version: 11
27+
java-version: 8
2828
- name: Run checkstyle
2929
run: mvn -P lint --quiet --batch-mode checkstyle:check
3030
working-directory: samples/snippets

.github/workflows/update_generation_config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ on:
2121

2222
jobs:
2323
update-generation-config:
24-
runs-on: ubuntu-24.04
24+
runs-on: ubuntu-22.04
2525
env:
2626
# the branch into which the pull request is merged
2727
base_branch: main
2828
steps:
2929
- uses: actions/checkout@v4
3030
with:
31+
fetch-depth: 0
3132
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
3233
- name: Update params in generation config to latest
3334
shell: bash
@@ -36,7 +37,8 @@ jobs:
3637
[ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com"
3738
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
3839
bash .github/scripts/update_generation_config.sh \
39-
--base_branch "${base_branch}"\
40+
--base_branch "${base_branch}" \
4041
--repo ${{ github.repository }}
4142
env:
4243
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
44+

.kokoro/nightly/common.cfg

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,3 @@ env_vars: {
2323
key: "JOB_TYPE"
2424
value: "test"
2525
}
26-
27-
env_vars: {
28-
key: "GITHUB_ENV_VAR_KOKORO_JOB_TYPE"
29-
value: "nightly"
30-
}

.kokoro/presubmit/common.cfg

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ env_vars: {
2424
value: "test"
2525
}
2626

27-
env_vars: {
28-
key: "GITHUB_ENV_VAR_KOKORO_JOB_TYPE"
29-
value: "presubmit"
30-
}
31-
3227
before_action {
3328
fetch_keystore {
3429
keystore_resource {

.kokoro/trampoline.sh

100644100755
File mode changed.

generation_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gapic_generator_version: 2.55.1
1+
gapic_generator_version: 2.55.2-SNAPSHOT
22
googleapis_commitish: 53ca65d540dd1a7cb4746687daa87208dc9ea437
33
libraries_bom_version: 26.57.0
44
libraries:

owlbot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
java.common_templates(excludes=[
7979
# firestore uses a different project for its integration tests
8080
# due to the default project running datastore
81+
'.kokoro/continuous.cfg',
82+
'.kokoro/presubmit.cfg',
8183
'.kokoro/presubmit/integration.cfg',
8284
'.kokoro/presubmit/graalvm-native.cfg',
8385
'.kokoro/presubmit/graalvm-native-17.cfg',

0 commit comments

Comments
 (0)