Skip to content

Commit 209f419

Browse files
committed
chore(java-cloud-bom): migrate java-cloud-bom into monorepo
1 parent 2d9d01c commit 209f419

64 files changed

Lines changed: 14759 additions & 9 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/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@
2020
/java-bigtable/ @googleapis/bigtable-team @googleapis/cloud-sdk-java-team @googleapis/cloud-sdk-librarian-team
2121
/java-firestore/ @googleapis/firestore-team @googleapis/cloud-sdk-java-team @googleapis/cloud-sdk-librarian-team
2222
/librarian.yaml @googleapis/cloud-sdk-java-team @googleapis/cloud-sdk-librarian-team
23+
/java-cloud-bom/ @blakeli0 @googleapis/cloud-sdk-java-team

.github/workflows/ci.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
workflows:
4747
- '.github/workflows/**'
4848
src:
49-
- '!(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'
50-
- '!(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'
49+
- '!(google-auth-library-java|grpc-gcp-java|java-bigquery|java-bigquery-jdbc|java-bigquerystorage|java-bigtable|java-cloud-bom|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/*.java'
50+
- '!(google-auth-library-java|grpc-gcp-java|java-bigquery|java-bigquery-jdbc|java-bigquerystorage|java-bigtable|java-cloud-bom|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/pom.xml'
5151
- 'pom.xml'
5252
ci:
5353
- '.github/workflows/ci.yaml'
@@ -219,6 +219,13 @@ jobs:
219219
- 'sdk-platform-java/**/*.java'
220220
- 'sdk-platform-java/java-shared-dependencies/**/pom.xml'
221221
- 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml'
222+
java-cloud-bom:
223+
- 'java-cloud-bom/**'
224+
- 'google-auth-library-java/**/*.java'
225+
- 'google-auth-library-java/**/pom.xml'
226+
- 'sdk-platform-java/**/*.java'
227+
- 'sdk-platform-java/java-shared-dependencies/**/pom.xml'
228+
- 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml'
222229
split-units:
223230
runs-on: ubuntu-latest
224231
needs: changes
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
name: java-cloud-bom ci
7+
env:
8+
BUILD_SUBDIR: java-cloud-bom
9+
jobs:
10+
filter:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
library: ${{ steps.filter.outputs.library }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: dorny/paths-filter@v3
17+
id: filter
18+
with:
19+
filters: |
20+
library:
21+
- 'java-cloud-bom/**'
22+
bom-content-test:
23+
needs: filter
24+
if: ${{ needs.filter.outputs.library == 'true' }}
25+
runs-on: ubuntu-latest
26+
if: github.repository_owner == 'googleapis'
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-java@v5
30+
with:
31+
distribution: temurin
32+
java-version: 11
33+
cache: maven
34+
- run: java -version
35+
- name: Pre-install all BOM modules to populate local cache
36+
run: |
37+
for f in $(find . -mindepth 2 -name "pom.xml" | grep "\-bom/pom.xml" | grep -v "samples" | grep -v "/tests/" | grep -v "/resources/"); do
38+
grep -q "<packaging>pom</packaging>" "$f" && echo "$f"
39+
done | sed 's|^\./||' | sed 's|/pom.xml$||' | tr '\n' ',' | sed 's/,$//' > bom_projects.txt
40+
mvn install -pl $(cat bom_projects.txt) -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
41+
rm bom_projects.txt
42+
shell: bash
43+
- name: Install BOMs
44+
run: |
45+
mvn -B -V -ntp install -f java-cloud-bom/pom.xml
46+
- name: Ensure the members of the Libraries BOM exist in Maven Central
47+
uses: ./java-cloud-bom/tests/validate-bom
48+
with:
49+
bom-path: java-cloud-bom/libraries-bom/pom.xml
50+
- name: Ensure the BOM has valid content (at releases)
51+
if: github.head_ref == 'release-please--branches--main'
52+
run: |
53+
mvn -B -V -ntp verify -Dtest="BomContentTest#testLibrariesBom"
54+
working-directory: java-cloud-bom/tests
55+
56+
bom-assertion-test:
57+
needs: filter
58+
if: ${{ needs.filter.outputs.library == 'true' }}
59+
name: BomContentAssertionsTest (Test for assertion logic in BomContentTest)
60+
runs-on: ubuntu-latest
61+
if: github.repository_owner == 'googleapis'
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: actions/setup-java@v5
65+
with:
66+
distribution: zulu
67+
java-version: 11
68+
- run: java -version
69+
- name: Pre-install all BOM modules to populate local cache
70+
run: |
71+
for f in $(find . -mindepth 2 -name "pom.xml" | grep "\-bom/pom.xml" | grep -v "samples" | grep -v "/tests/" | grep -v "/resources/"); do
72+
grep -q "<packaging>pom</packaging>" "$f" && echo "$f"
73+
done | sed 's|^\./||' | sed 's|/pom.xml$||' | tr '\n' ',' | sed 's/,$//' > bom_projects.txt
74+
mvn install -pl $(cat bom_projects.txt) -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
75+
rm bom_projects.txt
76+
shell: bash
77+
- name: Install BOMs
78+
run: |
79+
mvn -B -V -ntp install -f java-cloud-bom/pom.xml
80+
- run: |
81+
mvn -B -V -ntp verify -Dtest="BomContentAssertionsTest"
82+
working-directory: java-cloud-bom/tests
83+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
on:
2+
pull_request:
3+
paths:
4+
- 'release-note-generation/**'
5+
name: java-cloud-bom release-note-generation-test
6+
env:
7+
BUILD_SUBDIR: java-cloud-bom
8+
jobs:
9+
filter:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
library: ${{ steps.filter.outputs.library }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: dorny/paths-filter@v3
16+
id: filter
17+
with:
18+
filters: |
19+
library:
20+
- 'java-cloud-bom/**'
21+
test:
22+
needs: filter
23+
if: ${{ needs.filter.outputs.library == 'true' }}
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-java@v5
28+
with:
29+
distribution: temurin
30+
java-version: 11
31+
cache: maven
32+
- run: java -version
33+
- name: Run test in release-note-generation
34+
shell: bash
35+
run: |
36+
mvn -B -ntp verify -f java-cloud-bom/release-note-generation/pom.xml
37+
working-directory: java-cloud-bom/release-note-generation
38+
env:
39+
GH_TOKEN: ${{ github.token }}
40+
41+
dry-run:
42+
needs: filter
43+
if: ${{ needs.filter.outputs.library == 'true' }}
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: actions/setup-java@v5
48+
with:
49+
distribution: temurin
50+
java-version: 11
51+
cache: maven
52+
- run: java -version
53+
- name: Dry-run release-note-generation
54+
shell: bash
55+
run: |
56+
mvn -B -ntp compile -f java-cloud-bom/release-note-generation/pom.xml
57+
# This generates release_note.md file
58+
mvn -B -ntp exec:java -f java-cloud-bom/release-note-generation/pom.xml \
59+
-Dlibraries-bom.version="26.2.0" \
60+
-Dgoogle-cloud-java.version="1.1.0"
61+
working-directory: java-cloud-bom/release-note-generation
62+
env:
63+
GH_TOKEN: ${{ github.token }}
64+
- name: Show generated release note
65+
shell: bash
66+
run: |
67+
# This fails if the file does not exist
68+
cat release_note.md
69+
working-directory: java-cloud-bom/release-note-generation
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copyright 2023 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+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
push:
18+
branches:
19+
- main
20+
pull_request:
21+
name: java-cloud-bom test for tests/validate-bom logic
22+
env:
23+
BUILD_SUBDIR: java-cloud-bom
24+
jobs:
25+
filter:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
library: ${{ steps.filter.outputs.library }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: dorny/paths-filter@v3
32+
id: filter
33+
with:
34+
filters: |
35+
library:
36+
- 'java-cloud-bom/**'
37+
test-invalid-bom:
38+
needs: filter
39+
if: ${{ needs.filter.outputs.library == 'true' }}
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Fetch the bad protobuf-bom version 3.22.1
44+
shell: bash
45+
# 3.22.1 had a issue in their pom.xml
46+
# https://github.com/protocolbuffers/protobuf/issues/12170
47+
run: |
48+
mkdir -p bad-protobuf-bom
49+
curl https://repo1.maven.org/maven2/com/google/protobuf/protobuf-bom/3.22.1/protobuf-bom-3.22.1.pom \
50+
--output bad-protobuf-bom/pom.xml
51+
- name: Check the bad BOM
52+
uses: ./java-cloud-bom/tests/validate-bom
53+
id: validate-bom
54+
with:
55+
bom-path: bad-protobuf-bom/pom.xml
56+
continue-on-error: true
57+
- name: Ensure the validate-bom invalidated the bad BOM
58+
shell: bash
59+
if: steps.validate-bom.outcome != 'failure'
60+
run: |
61+
echo "The validate-bom check should have invalidated the bad BOM"
62+
exit 1

0 commit comments

Comments
 (0)