Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
/java-bigtable/ @googleapis/bigtable-team @googleapis/cloud-sdk-java-team @googleapis/cloud-sdk-librarian-team
/java-firestore/ @googleapis/firestore-team @googleapis/cloud-sdk-java-team @googleapis/cloud-sdk-librarian-team
/librarian.yaml @googleapis/cloud-sdk-java-team @googleapis/cloud-sdk-librarian-team
/java-cloud-bom/ @blakeli0 @googleapis/cloud-sdk-java-team
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
workflows:
- '.github/workflows/**'
src:
- '!(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'
- '!(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'
- '!(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'
- '!(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'
- 'pom.xml'
ci:
- '.github/workflows/ci.yaml'
Expand Down Expand Up @@ -219,6 +219,7 @@ jobs:
- 'sdk-platform-java/**/*.java'
- 'sdk-platform-java/java-shared-dependencies/**/pom.xml'
- 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml'

split-units:
runs-on: ubuntu-latest
needs: changes
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/java-cloud-bom-bom-content-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
on:
push:
branches:
- main
pull_request:
name: java-cloud-bom ci
env:
BUILD_SUBDIR: java-cloud-bom
jobs:
filter:
runs-on: ubuntu-latest
outputs:
library: ${{ steps.filter.outputs.library }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
library:
- 'java-cloud-bom/**'
bom-content-test:
needs: filter
if: ${{ needs.filter.outputs.library == 'true' }}
runs-on: ubuntu-latest
if: github.repository_owner == 'googleapis'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 11
cache: maven
- run: java -version
- name: Pre-install all BOM modules to populate local cache
run: |
for f in $(find . -mindepth 2 -name "pom.xml" | grep "\-bom/pom.xml" | grep -v "samples" | grep -v "/tests/" | grep -v "/resources/"); do
grep -q "<packaging>pom</packaging>" "$f" && echo "$f"
done | sed 's|^\./||' | sed 's|/pom.xml$||' | tr '\n' ',' | sed 's/,$//' > bom_projects.txt
mvn install -pl $(cat bom_projects.txt) -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
rm bom_projects.txt
shell: bash
- name: Install BOMs
run: |
mvn -B -V -ntp install -f java-cloud-bom/pom.xml
- name: Ensure the members of the Libraries BOM exist in Maven Central
uses: ./java-cloud-bom/tests/validate-bom
with:
bom-path: java-cloud-bom/libraries-bom/pom.xml
- name: Ensure the BOM has valid content (at releases)
if: github.head_ref == 'release-please--branches--main'
run: |
mvn -B -V -ntp verify -Dtest="BomContentTest#testLibrariesBom"
working-directory: java-cloud-bom/tests

bom-assertion-test:
needs: filter
if: ${{ needs.filter.outputs.library == 'true' }}
name: BomContentAssertionsTest (Test for assertion logic in BomContentTest)
runs-on: ubuntu-latest
if: github.repository_owner == 'googleapis'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 11
- run: java -version
- name: Pre-install all BOM modules to populate local cache
run: |
for f in $(find . -mindepth 2 -name "pom.xml" | grep "\-bom/pom.xml" | grep -v "samples" | grep -v "/tests/" | grep -v "/resources/"); do
grep -q "<packaging>pom</packaging>" "$f" && echo "$f"
done | sed 's|^\./||' | sed 's|/pom.xml$||' | tr '\n' ',' | sed 's/,$//' > bom_projects.txt
mvn install -pl $(cat bom_projects.txt) -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
rm bom_projects.txt
shell: bash
- name: Install BOMs
run: |
mvn -B -V -ntp install -f java-cloud-bom/pom.xml
- run: |
mvn -B -V -ntp verify -Dtest="BomContentAssertionsTest"
working-directory: java-cloud-bom/tests

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
on:
pull_request:
paths:
- 'release-note-generation/**'
name: java-cloud-bom release-note-generation-test
env:
BUILD_SUBDIR: java-cloud-bom
jobs:
filter:
runs-on: ubuntu-latest
outputs:
library: ${{ steps.filter.outputs.library }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
library:
- 'java-cloud-bom/**'
test:
needs: filter
if: ${{ needs.filter.outputs.library == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 11
cache: maven
- run: java -version
- name: Run test in release-note-generation
shell: bash
run: |
mvn -B -ntp verify -f java-cloud-bom/release-note-generation/pom.xml
working-directory: java-cloud-bom/release-note-generation
env:
GH_TOKEN: ${{ github.token }}

dry-run:
needs: filter
if: ${{ needs.filter.outputs.library == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 11
cache: maven
- run: java -version
- name: Dry-run release-note-generation
shell: bash
run: |
mvn -B -ntp compile -f java-cloud-bom/release-note-generation/pom.xml
# This generates release_note.md file
mvn -B -ntp exec:java -f java-cloud-bom/release-note-generation/pom.xml \
-Dlibraries-bom.version="26.2.0" \
-Dgoogle-cloud-java.version="1.1.0"
working-directory: java-cloud-bom/release-note-generation
env:
GH_TOKEN: ${{ github.token }}
- name: Show generated release note
shell: bash
run: |
# This fails if the file does not exist
cat release_note.md
working-directory: java-cloud-bom/release-note-generation
62 changes: 62 additions & 0 deletions .github/workflows/java-cloud-bom-ci-validate-bom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Github action job to test core java library features on
# downstream client libraries before they are released.
on:
push:
branches:
- main
pull_request:
name: java-cloud-bom test for tests/validate-bom logic
env:
BUILD_SUBDIR: java-cloud-bom
jobs:
filter:
runs-on: ubuntu-latest
outputs:
library: ${{ steps.filter.outputs.library }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
library:
- 'java-cloud-bom/**'
test-invalid-bom:
needs: filter
if: ${{ needs.filter.outputs.library == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch the bad protobuf-bom version 3.22.1
shell: bash
# 3.22.1 had a issue in their pom.xml
# https://github.com/protocolbuffers/protobuf/issues/12170
run: |
mkdir -p bad-protobuf-bom
curl https://repo1.maven.org/maven2/com/google/protobuf/protobuf-bom/3.22.1/protobuf-bom-3.22.1.pom \
--output bad-protobuf-bom/pom.xml
- name: Check the bad BOM
uses: ./java-cloud-bom/tests/validate-bom
id: validate-bom
with:
bom-path: bad-protobuf-bom/pom.xml
continue-on-error: true
- name: Ensure the validate-bom invalidated the bad BOM
shell: bash
if: steps.validate-bom.outcome != 'failure'
run: |
echo "The validate-bom check should have invalidated the bad BOM"
exit 1
Loading
Loading