Skip to content

Commit 135744f

Browse files
chore: merge main into generate-libraries-main
2 parents b75dac6 + fd8f666 commit 135744f

568 files changed

Lines changed: 541789 additions & 852 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: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,62 +56,71 @@ jobs:
5656
units:
5757
runs-on: ubuntu-latest
5858
needs: bulk-filter
59-
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
6059
strategy:
6160
fail-fast: false
6261
matrix:
6362
java: [11, 17, 21, 25]
6463
steps:
6564
- name: Get current week within the year
6665
id: date
66+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
6767
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
6868
- uses: actions/checkout@v4
69+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
6970
- uses: actions/setup-java@v4
71+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
7072
with:
7173
distribution: temurin
7274
java-version: ${{matrix.java}}
7375
- run: java -version
76+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
7477
- uses: actions/cache@v4
7578
id: mvn-cache
79+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
7680
with:
7781
path: ~/.m2/repository
7882
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
7983
- run: .kokoro/build.sh
80-
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') }}
8185
env:
8286
JOB_TYPE: test
8387
JOB_NAME: units-${{matrix.java}}
8488
units-8-runtime:
8589
runs-on: ubuntu-latest
8690
needs: bulk-filter
87-
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
8891
name: "units (8)"
8992
steps:
9093
- name: Get current week within the year
9194
id: date
95+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
9296
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
9397
- uses: actions/checkout@v4
98+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
9499
- uses: actions/setup-java@v4
100+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
95101
with:
96102
java-version: 8
97103
distribution: temurin
98104
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
99105
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
100106
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
107+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
101108
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
102109
shell: bash
103110
- uses: actions/setup-java@v4
111+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
104112
with:
105113
java-version: 11
106114
distribution: temurin
107115
cache: maven
108116
- uses: actions/cache@v4
109117
id: mvn-cache
118+
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
110119
with:
111120
path: ~/.m2/repository
112121
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
113122
- run: .kokoro/build.sh
114-
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') }}
115124
shell: bash
116125
env:
117126
JOB_TYPE: test
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
# https://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+
15+
name: Showcase Version Check
16+
17+
on:
18+
schedule:
19+
- cron: '30 3 * * *' # Run daily at 3:30 AM UTC
20+
workflow_dispatch: # Allow manual trigger
21+
pull_request:
22+
paths:
23+
- 'librarian.yaml'
24+
- 'java-showcase/gapic-showcase/pom.xml'
25+
- '.github/workflows/showcase-version-check.yaml'
26+
27+
jobs:
28+
check-version:
29+
runs-on: ubuntu-latest
30+
permissions:
31+
issues: write
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Extract showcase version from pom.xml
35+
id: extract_version
36+
shell: bash
37+
run: |
38+
version=$(awk -F'[<>]' '/gapic-showcase.version/{print $3; exit}' java-showcase/gapic-showcase/pom.xml)
39+
echo "version=$version" >> "$GITHUB_OUTPUT"
40+
- name: Set up Go
41+
uses: actions/setup-go@v5
42+
with:
43+
go-version: '1.24'
44+
- name: Extract showcase commit from librarian.yaml
45+
id: extract_commit
46+
shell: bash
47+
run: |
48+
version=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version)
49+
commit=$(go run "github.com/googleapis/librarian/cmd/librarian@${version}" config get sources.showcase.commit)
50+
echo "commit=$commit" >> "$GITHUB_OUTPUT"
51+
- name: Verify showcase version and commit match
52+
shell: bash
53+
run: |
54+
# 1. Query the remote repository for the specific version tag
55+
REMOTE_URL="https://github.com/googleapis/gapic-showcase.git"
56+
TAG_NAME="v${{ steps.extract_version.outputs.version }}"
57+
58+
OUTPUT=$(git ls-remote "$REMOTE_URL" "refs/tags/$TAG_NAME")
59+
60+
if [ -z "$OUTPUT" ]; then
61+
echo "Error: Tag $TAG_NAME not found on remote $REMOTE_URL"
62+
exit 1
63+
fi
64+
65+
# 2. Grab the commit hash from the very last line of the output
66+
EXPECTED_COMMIT=$(echo "$OUTPUT" | tail -n 1 | awk '{print $1}')
67+
68+
echo "Expected commit for tag $TAG_NAME: $EXPECTED_COMMIT"
69+
echo "Current librarian commit: ${{ steps.extract_commit.outputs.commit }}"
70+
71+
# 3. Cross-reference with librarian.yaml
72+
if [ "${{ steps.extract_commit.outputs.commit }}" != "$EXPECTED_COMMIT" ]; then
73+
echo "Mismatch: librarian.yaml has commit '${{ steps.extract_commit.outputs.commit }}', but tag '$TAG_NAME' is at commit '$EXPECTED_COMMIT'"
74+
echo "MISMATCH=true" >> "$GITHUB_ENV"
75+
exit 2
76+
fi
77+
78+
echo "Showcase version and commit are in sync!"
79+
- name: Create issue on mismatch
80+
if: failure() && env.MISMATCH == 'true'
81+
env:
82+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
run: |
84+
gh issue create \
85+
-R "${{ github.repository }}" \
86+
-t "Showcase Version Mismatch: librarian.yaml and pom.xml out of sync" \
87+
-b "The Showcase version in java-showcase/gapic-showcase/pom.xml and the commit in librarian.yaml do not match. Please update them to match. See logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
88+
- name: Create issue on workflow failure
89+
if: failure() && env.MISMATCH != 'true'
90+
env:
91+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
run: |
93+
gh issue create \
94+
-R "${{ github.repository }}" \
95+
-t "Showcase Version Check Workflow Failure" \
96+
-b "The Showcase Version Check workflow has failed due to an unexpected execution error. Please check the logs at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} for details."

gapic-libraries-bom/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@
175175
<type>pom</type>
176176
<scope>import</scope>
177177
</dependency>
178+
<dependency>
179+
<groupId>com.google.cloud</groupId>
180+
<artifactId>google-cloud-backstory-bom</artifactId>
181+
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-backstory:current} -->
182+
<type>pom</type>
183+
<scope>import</scope>
184+
</dependency>
178185
<dependency>
179186
<groupId>com.google.cloud</groupId>
180187
<artifactId>google-cloud-backupdr-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 = {

generation_config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,21 @@ libraries:
284284
GAPICs:
285285
- proto_path: google/cloud/automl/v1
286286
- proto_path: google/cloud/automl/v1beta1
287+
- api_shortname: backstory
288+
name_pretty: Malachite Common Protos
289+
product_documentation: https://cloud.google.com/chronicle/docs/secops/secops-overview
290+
api_description: Common Universal Data Model (UDM) and Entity protos used by Chronicle.
291+
client_documentation:
292+
https://cloud.google.com/java/docs/reference/google-cloud-backstory/latest/overview
293+
release_level: preview
294+
distribution_name: com.google.cloud:google-cloud-backstory
295+
api_id: backstory.googleapis.com
296+
library_type: GAPIC_AUTO
297+
group_id: com.google.cloud
298+
cloud_api: true
299+
GAPICs:
300+
- proto_path: backstory
301+
requires_billing: true
287302
- api_shortname: backupdr
288303
name_pretty: Backup and DR Service API
289304
product_documentation: https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-dr
@@ -1277,6 +1292,7 @@ libraries:
12771292
group_id: com.google.cloud
12781293
cloud_api: true
12791294
GAPICs:
1295+
- proto_path: google/cloud/geminidataanalytics/v1
12801296
- proto_path: google/cloud/geminidataanalytics/v1beta
12811297
requires_billing: true
12821298
rpc_documentation: https://cloud.google.com/gemini/docs/conversational-analytics-api/reference
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2024 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+
15+
16+
deep-remove-regex:
17+
- "/java-backstory/grpc-google-.*/src"
18+
- "/java-backstory/proto-google-.*/src"
19+
- "/java-backstory/google-.*/src"
20+
- "/java-backstory/samples/snippets/generated"
21+
22+
deep-preserve-regex:
23+
- "/java-backstory/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
24+
25+
deep-copy-regex:
26+
- source: "/backstory/.*-java/proto-google-.*/src"
27+
dest: "/owl-bot-staging/java-backstory/proto-google-cloud-backstory/src"
28+
- source: "/backstory/.*-java/grpc-google-.*/src"
29+
dest: "/owl-bot-staging/java-backstory/grpc-google-cloud-backstory/src"
30+
- source: "/backstory/.*-java/gapic-google-.*/src"
31+
dest: "/owl-bot-staging/java-backstory/google-cloud-backstory/src"
32+
- source: "/backstory/.*-java/samples/snippets/generated"
33+
dest: "/owl-bot-staging/java-backstory/samples/snippets/generated"
34+
35+
api-name: backstory

java-backstory/.repo-metadata.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"api_shortname": "backstory",
3+
"name_pretty": "Malachite Common Protos",
4+
"product_documentation": "https://cloud.google.com/chronicle/docs/secops/secops-overview",
5+
"api_description": "Common Universal Data Model (UDM) and Entity protos used by Chronicle.",
6+
"client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-backstory/latest/overview",
7+
"release_level": "preview",
8+
"transport": "grpc",
9+
"language": "java",
10+
"repo": "googleapis/google-cloud-java",
11+
"repo_short": "java-backstory",
12+
"distribution_name": "com.google.cloud:google-cloud-backstory",
13+
"api_id": "backstory.googleapis.com",
14+
"library_type": "GAPIC_AUTO",
15+
"requires_billing": true
16+
}

0 commit comments

Comments
 (0)