Skip to content

Commit 23fede7

Browse files
chore: downstream check for all libraries in single job (#1554)
* chore: add downstream checks * chore: change java version to 8 * Update downstream-client-library-check.sh * Update downstream-client-library-check.sh * Update README.md * Update .OwlBot.lock.yaml * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update downstream-client-library-check.sh * Update downstream.yaml * Update downstream-client-library-check.sh Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent ba7021b commit 23fede7

File tree

3 files changed

+247
-1
lines changed

3 files changed

+247
-1
lines changed

.github/workflows/downstream.yaml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
on:
2+
pull_request:
3+
types: [ labeled ]
4+
branches:
5+
- main
6+
name: downstream
7+
jobs:
8+
dependencies:
9+
if: ${{ github.event.label.name == 'downstream-check:run' }}
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
java: [8]
15+
repo:
16+
# This list needs to be updated manually until an automated solution is in place.
17+
- accessapproval
18+
- accesscontextmanager
19+
- aiplatform
20+
- analytics-admin
21+
- analytics-data
22+
- api-gateway
23+
- apigee-connect
24+
- appengine-admin
25+
- area120-tables
26+
- artifact-registry
27+
- asset
28+
- assured-workloads
29+
- automl
30+
- bigquery
31+
- bigqueryconnection
32+
- bigquerydatatransfer
33+
- bigquerymigration
34+
- bigqueryreservation
35+
- bigtable
36+
- billing
37+
- billingbudgets
38+
- binary-authorization
39+
- channel
40+
- cloudbuild
41+
- compute
42+
- contact-center-insights
43+
- container
44+
- containeranalysis
45+
- data-fusion
46+
- datacatalog
47+
- dataflow
48+
- datalabeling
49+
- dataproc
50+
- dataproc-metastore
51+
- datastore
52+
- datastream
53+
- debugger-client
54+
- deploy
55+
- dialogflow
56+
- dialogflow-cx
57+
- dlp
58+
- dms
59+
- dns
60+
- document-ai
61+
- domains
62+
- errorreporting
63+
- essential-contacts
64+
- eventarc
65+
- filestore
66+
- firestore
67+
- functions
68+
- game-servers
69+
- gke-connect-gateway
70+
- gkehub
71+
- gsuite-addons
72+
- iam-admin
73+
- iamcredentials
74+
- iot
75+
- kms
76+
- language
77+
- life-sciences
78+
- logging
79+
- logging-logback
80+
- managed-identities
81+
- mediatranslation
82+
- memcache
83+
- monitoring
84+
- monitoring-dashboards
85+
- network-management
86+
- network-security
87+
- networkconnectivity
88+
- notebooks
89+
- orchestration-airflow
90+
- orgpolicy
91+
- os-config
92+
- os-login
93+
- phishingprotection
94+
- policy-troubleshooter
95+
- private-catalog
96+
- profiler
97+
- pubsublite
98+
- recaptchaenterprise
99+
- recommendations-ai
100+
- recommender
101+
- redis
102+
- resource-settings
103+
- resourcemanager
104+
- retail
105+
- scheduler
106+
- secretmanager
107+
- security-private-ca
108+
- securitycenter
109+
- securitycenter-settings
110+
- service-control
111+
- service-management
112+
- service-usage
113+
- servicedirectory
114+
- shell
115+
- spanner
116+
- spanner-jdbc
117+
- speech
118+
- storage
119+
- storage-nio
120+
- storage-transfer
121+
- talent
122+
- tasks
123+
- texttospeech
124+
- tpu
125+
- trace
126+
- translate
127+
- video-intelligence
128+
- video-transcoder
129+
- vision
130+
- vpcaccess
131+
- webrisk
132+
- websecurityscanner
133+
- workflow-executions
134+
- workflows
135+
steps:
136+
- uses: actions/checkout@v2
137+
- uses: actions/setup-java@v1
138+
with:
139+
java-version: ${{matrix.java}}
140+
- run: java -version
141+
- run: sudo apt-get install libxml2-utils
142+
- run: .kokoro/downstream-client-library-check.sh google-http-client-bom ${{matrix.repo}}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
#!/bin/bash
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
# Display commands being run.
18+
set -x
19+
20+
21+
CORE_LIBRARY_ARTIFACT=$1
22+
CLIENT_LIBRARY=$2
23+
## Get the directory of the build script
24+
scriptDir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
25+
## cd to the parent directory, i.e. the root of the git repo
26+
cd "${scriptDir}"/..
27+
28+
# Make java core library artifacts available for 'mvn verify' at the bottom
29+
mvn verify install -B -V -ntp -fae \
30+
-DskipTests=true \
31+
-Dmaven.javadoc.skip=true \
32+
-Dgcloud.download.skip=true \
33+
-Denforcer.skip=true
34+
35+
# Read the current version of this java core library in the POM. Example version: '0.116.1-alpha-SNAPSHOT'
36+
CORE_VERSION_POM=pom.xml
37+
# Namespace (xmlns) prevents xmllint from specifying tag names in XPath
38+
CORE_VERSION=$(sed -e 's/xmlns=".*"//' ${CORE_VERSION_POM} | xmllint --xpath '/project/version/text()' -)
39+
40+
if [ -z "${CORE_VERSION}" ]; then
41+
echo "Version is not found in ${CORE_VERSION_POM}"
42+
exit 1
43+
fi
44+
echo "Version: ${CORE_VERSION}"
45+
46+
# Round 1
47+
# Check this java core library against HEAD of java-shared dependencies
48+
49+
git clone "https://github.com/googleapis/java-shared-dependencies.git" --depth=1
50+
pushd java-shared-dependencies/first-party-dependencies
51+
52+
# replace version
53+
xmllint --shell <(cat pom.xml) << EOF
54+
setns x=http://maven.apache.org/POM/4.0.0
55+
cd .//x:artifactId[text()="${CORE_LIBRARY_ARTIFACT}"]
56+
cd ../x:version
57+
set ${CORE_VERSION}
58+
save pom.xml
59+
EOF
60+
61+
# run dependencies script
62+
cd ..
63+
mvn verify install -B -V -ntp -fae \
64+
-DskipTests=true \
65+
-Dmaven.javadoc.skip=true \
66+
-Dgcloud.download.skip=true \
67+
-Denforcer.skip=true
68+
69+
SHARED_DEPS_VERSION_POM=pom.xml
70+
# Namespace (xmlns) prevents xmllint from specifying tag names in XPath
71+
SHARED_DEPS_VERSION=$(sed -e 's/xmlns=".*"//' ${SHARED_DEPS_VERSION_POM} | xmllint --xpath '/project/version/text()' -)
72+
73+
if [ -z "${SHARED_DEPS_VERSION}" ]; then
74+
echo "Version is not found in ${SHARED_DEPS_VERSION_POM}"
75+
exit 1
76+
fi
77+
78+
# Round 2
79+
80+
# Check this BOM against java client libraries
81+
git clone "https://github.com/googleapis/java-${CLIENT_LIBRARY}.git" --depth=1
82+
pushd java-"${CLIENT_LIBRARY}"
83+
84+
if [[ $CLIENT_LIBRARY == "bigtable" ]]; then
85+
pushd google-cloud-bigtable-deps-bom
86+
fi
87+
88+
# replace version
89+
xmllint --shell <(cat pom.xml) << EOF
90+
setns x=http://maven.apache.org/POM/4.0.0
91+
cd .//x:artifactId[text()="google-cloud-shared-dependencies"]
92+
cd ../x:version
93+
set ${SHARED_DEPS_VERSION}
94+
save pom.xml
95+
EOF
96+
97+
if [[ $CLIENT_LIBRARY == "bigtable" ]]; then
98+
popd
99+
fi
100+
101+
mvn verify install -B -V -ntp -fae \
102+
-Dmaven.javadoc.skip=true \
103+
-Dgcloud.download.skip=true \
104+
-Denforcer.skip=true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ might result, and you are not guaranteed a compilation error.
5858
[ci-status-link]: https://github.com/googleapis/google-http-java-client/actions?query=event%3Apush
5959
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.http-client/google-http-client.svg
6060
[maven-version-link]: https://search.maven.org/search?q=g:com.google.http-client%20AND%20a:google-http-client&core=gav
61-
[stability-image]: https://img.shields.io/badge/stability-ga-green
61+
[stability-image]: https://img.shields.io/badge/stability-stable-green

0 commit comments

Comments
 (0)