Skip to content

Commit f017d2f

Browse files
authored
Merge branch 'main' into showcase-version-check-workflow
2 parents bda6edf + 5efbb46 commit f017d2f

1,944 files changed

Lines changed: 631165 additions & 29421 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yaml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,22 @@ jobs:
2929
outputs:
3030
src: ${{ steps.filter.outputs.src }}
3131
ci: ${{ steps.filter.outputs.ci }}
32+
# runnable is true if there are changes outside the .github/workflows directory OR if ci.yaml itself (or kokoro scripts) is modified.
33+
runnable: ${{ fromJSON(steps.filter.outputs.all_count) > fromJSON(steps.filter.outputs.workflows_count) || fromJSON(steps.filter.outputs.ci_count) > 0 }}
3234
steps:
33-
- uses: actions/checkout@v4
35+
- uses: actions/checkout@v6
36+
# Use this action, rather than a file filter so that we can make this
37+
# mandatory.
38+
# See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-including-branches
39+
# for more details.
3440
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
3541
id: filter
3642
with:
3743
filters: |
44+
all:
45+
- '**'
46+
workflows:
47+
- '.github/workflows/**'
3848
src:
3949
- '!(google-auth-library-java|grpc-gcp-java|java-bigquery|java-bigquery-jdbc|java-bigquerystorage|java-bigtable|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/*.java'
4050
- '!(google-auth-library-java|grpc-gcp-java|java-bigquery|java-bigquery-jdbc|java-bigquerystorage|java-bigtable|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/pom.xml'
@@ -53,20 +63,25 @@ jobs:
5363
steps:
5464
- name: Get current week within the year
5565
id: date
66+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
5667
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
5768
- uses: actions/checkout@v4
69+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
5870
- uses: actions/setup-java@v4
71+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
5972
with:
6073
distribution: temurin
6174
java-version: ${{matrix.java}}
6275
- run: java -version
76+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
6377
- uses: actions/cache@v4
6478
id: mvn-cache
79+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
6580
with:
6681
path: ~/.m2/repository
6782
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
6883
- run: .kokoro/build.sh
69-
if: ${{ needs.bulk-filter.outputs.src == 'true' || needs.bulk-filter.outputs.ci == 'true' }}
84+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' && (needs.bulk-filter.outputs.src == 'true' || needs.bulk-filter.outputs.ci == 'true') }}
7085
env:
7186
JOB_TYPE: test
7287
JOB_NAME: units-${{matrix.java}}
@@ -77,42 +92,50 @@ jobs:
7792
steps:
7893
- name: Get current week within the year
7994
id: date
95+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
8096
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
8197
- uses: actions/checkout@v4
98+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
8299
- uses: actions/setup-java@v4
100+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
83101
with:
84102
java-version: 8
85103
distribution: temurin
86104
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
87105
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
88106
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
107+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
89108
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
90109
shell: bash
91110
- uses: actions/setup-java@v4
111+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
92112
with:
93113
java-version: 11
94114
distribution: temurin
95115
cache: maven
96116
- uses: actions/cache@v4
97117
id: mvn-cache
118+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
98119
with:
99120
path: ~/.m2/repository
100121
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
101122
- run: .kokoro/build.sh
102-
if: ${{ needs.bulk-filter.outputs.src == 'true' || needs.bulk-filter.outputs.ci == 'true' }}
123+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' && (needs.bulk-filter.outputs.src == 'true' || needs.bulk-filter.outputs.ci == 'true') }}
103124
shell: bash
104125
env:
105126
JOB_TYPE: test
106127
JOB_NAME: units-8-runtime-${{matrix.java}}
107128
# detect which libraries have changed
108129
changes:
130+
needs: bulk-filter
131+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
109132
runs-on: ubuntu-latest
110133
permissions:
111134
pull-requests: read
112135
outputs:
113136
packages: ${{ steps.filter.outputs.changes }}
114137
steps:
115-
- uses: actions/checkout@v4
138+
- uses: actions/checkout@v6
116139
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
117140
id: filter
118141
with:
@@ -302,7 +325,7 @@ jobs:
302325
env:
303326
BUILD_SUBDIR: ${{matrix.package}}
304327
required:
305-
needs: [ changes, split-units, split-clirr, split-dependencies ]
328+
needs: [ bulk-filter, changes, split-units, split-clirr, split-dependencies ]
306329
name: conditional-required-check
307330
if: ${{ always() }} # Always run even if any "needs" jobs fail
308331
runs-on: ubuntu-22.04
@@ -313,6 +336,8 @@ jobs:
313336
- name: Success otherwise
314337
run: echo "Success!"
315338
windows:
339+
needs: bulk-filter
340+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
316341
runs-on: windows-latest
317342
steps:
318343
- name: Support longpaths
@@ -329,6 +354,8 @@ jobs:
329354
JOB_TYPE: test
330355
JOB_NAME: windows-units
331356
lint:
357+
needs: bulk-filter
358+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
332359
runs-on: ubuntu-latest
333360
steps:
334361
- uses: actions/checkout@v4
@@ -345,6 +372,8 @@ jobs:
345372
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
346373
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
347374
enforcer:
375+
needs: bulk-filter
376+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
348377
runs-on: ubuntu-latest
349378
steps:
350379
- name: Get current week within the year
@@ -364,6 +393,8 @@ jobs:
364393
- run: java -version
365394
- run: mvn -B -ntp enforcer:enforce@enforce -T 1C
366395
gapic-libraries-bom:
396+
needs: bulk-filter
397+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
367398
runs-on: ubuntu-latest
368399
steps:
369400
- uses: actions/checkout@v4
@@ -381,6 +412,8 @@ jobs:
381412
with:
382413
bom-path: gapic-libraries-bom/pom.xml
383414
generation-config-check:
415+
needs: bulk-filter
416+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
384417
runs-on: ubuntu-latest
385418
steps:
386419
- uses: actions/checkout@v4
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
name: Librarian generate diff check on pull requests
15+
on:
16+
pull_request:
17+
18+
jobs:
19+
library_generation:
20+
runs-on: ubuntu-24.04
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
- uses: actions/setup-go@v5
26+
with:
27+
go-version: 'stable'
28+
- name: Install Librarian
29+
run: |
30+
V=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version)
31+
echo "Installing librarian version $V"
32+
go install github.com/googleapis/librarian/cmd/librarian@$V
33+
- name: Install protoc
34+
run: |
35+
set -e
36+
VERSION="33.2"
37+
curl -fsSL --retry 5 --retry-delay 15 -o /tmp/protoc.zip "https://github.com/protocolbuffers/protobuf/releases/download/v$VERSION/protoc-$VERSION-linux-x86_64.zip"
38+
cd /usr/local
39+
sudo unzip -o /tmp/protoc.zip
40+
protoc --version
41+
- uses: actions/setup-java@v4
42+
with:
43+
java-version: "17"
44+
distribution: "temurin"
45+
cache: "maven"
46+
- name: Verify Java and Maven installation
47+
run: |
48+
java -version
49+
if ! command -v mvn &> /dev/null; then
50+
sudo apt-get update && sudo apt-get install -y maven
51+
fi
52+
mvn -version
53+
- uses: actions/setup-python@v5
54+
with:
55+
python-version: "3.12"
56+
cache: 'pip'
57+
- name: Run librarian install
58+
run: |
59+
librarian install
60+
echo "$HOME/java_tools/bin" >> $GITHUB_PATH
61+
- name: Run librarian generate
62+
env:
63+
PYTHONPATH: ${{ github.workspace }}/sdk-platform-java/hermetic_build/library_generation/owlbot
64+
run: |
65+
librarian generate --all
66+
- name: Check for generated code changes
67+
run: |
68+
git diff --exit-code

.github/workflows/sdk-platform-java-downstream_protobuf_compatibility_check_nightly.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,10 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
repo:
30-
- java-bigtable
31-
- java-firestore
32-
- java-pubsub
3330
- java-pubsublite
3431
# Default Protobuf-Java versions to use are specified here. Without this, the nightly workflow won't know
3532
# which values to use and would resolve to ''.
36-
protobuf-version: ${{ fromJSON(format('[{0}]', inputs.protobuf_runtime_versions || '"4.33.5"')) }}
33+
protobuf-version: ${{ fromJSON(format('[{0}]', inputs.protobuf_runtime_versions || '"4.35.0"')) }}
3734
steps:
3835
- name: Checkout sdk-platform-java repo
3936
uses: actions/checkout@v4

gapic-libraries-bom/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,13 @@
560560
<type>pom</type>
561561
<scope>import</scope>
562562
</dependency>
563+
<dependency>
564+
<groupId>com.google.cloud</groupId>
565+
<artifactId>google-cloud-developer-knowledge-bom</artifactId>
566+
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-developer-knowledge:current} -->
567+
<type>pom</type>
568+
<scope>import</scope>
569+
</dependency>
563570
<dependency>
564571
<groupId>com.google.cloud</groupId>
565572
<artifactId>google-cloud-developerconnect-bom</artifactId>

generation/new_client_hermetic_build/add-new-client-config.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ def main(ctx):
6161
required=True,
6262
type=str,
6363
default=None,
64-
help="Path to proto file from the root of the googleapis repository to the"
65-
"directory that contains the proto files (without the version)."
64+
help="Path to proto file from the root of the googleapis repository to the "
65+
"directory that contains the proto files (including the version). "
6666
"For example, to generate the library for 'google/maps/routing/v2', "
67-
"then you specify this value as 'google/maps/routing'",
67+
"then you specify this value as 'google/maps/routing/v2'",
6868
)
6969
@click.option(
7070
"--product-docs",
@@ -221,9 +221,10 @@ def add_new_library(
221221
version_re = re.compile(r"v\d[\w\d]*")
222222
is_library_version = lambda p: version_re.match(p.split("/")[-1]) is not None
223223
if not is_library_version(proto_path):
224-
raise ValueError(
225-
"Only versioned proto_paths are supported. "
226-
"For example `google/datastore/v1` instead of `google/datastore`."
224+
print(
225+
f"WARNING: proto_path '{proto_path}' does not end with a version (e.g., v1). "
226+
"Please ensure this is intentional and that this represents a non-versioned "
227+
"or custom proto path."
227228
)
228229

229230
new_library = {

0 commit comments

Comments
 (0)