Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,6 @@ jobs:
java-version: ${{matrix.java}}
cache: maven
- run: java -version
- name: Install xmllint
timeout-minutes: 5
run: |
# Retry apt-get update and install up to 3 times with a 15-second per-request timeout.
# Retries protect against transient network glitches, mirror timeouts, and apt lock contention on runner startup.
for i in {1..3}; do
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 update && \
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 -y install libxml2-utils && \
break || sleep 5
done
- name: Install java-shared-dependencies and common dependencies
run: |
.kokoro/build.sh
Expand All @@ -81,4 +71,3 @@ jobs:
fi
mvn install -pl ${TARGET_PATH} -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
- run: .kokoro/client-library-check.sh ${{matrix.repo}} dependencies

Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,6 @@ jobs:
java-version: ${{matrix.java}}
cache: maven
- run: java -version
- name: Install xmllint
timeout-minutes: 5
run: |
# Retry apt-get update and install up to 3 times with a 15-second per-request timeout.
# Retries protect against transient network glitches, mirror timeouts, and apt lock contention on runner startup.
for i in {1..3}; do
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 update && \
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 -y install libxml2-utils && \
break || sleep 5
done
- run: .kokoro/client-library-check.sh ${{matrix.repo}} ${{matrix.job-type}}
lint:
needs: filter
Expand All @@ -104,16 +94,6 @@ jobs:
java-version: ${{matrix.java}}
cache: maven
- run: java -version
- name: Install xmllint
timeout-minutes: 5
run: |
# Retry apt-get update and install up to 3 times with a 15-second per-request timeout.
# Retries protect against transient network glitches, mirror timeouts, and apt lock contention on runner startup.
for i in {1..3}; do
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 update && \
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 -y install libxml2-utils && \
break || sleep 5
done
- name: Install java-shared-dependencies and common dependencies
run: |
.kokoro/build.sh
Expand Down Expand Up @@ -167,16 +147,6 @@ jobs:
java-version: 17
cache: maven
- run: java -version
- name: Install xmllint
timeout-minutes: 5
run: |
# Retry apt-get update and install up to 3 times with a 15-second per-request timeout.
# Retries protect against transient network glitches, mirror timeouts, and apt lock contention on runner startup.
for i in {1..3}; do
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 update && \
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 -y install libxml2-utils && \
break || sleep 5
done
- name: Install java-shared-dependencies and common dependencies
run: |
.kokoro/build.sh
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/sdk-platform-java-downstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ jobs:
distribution: temurin
cache: maven
- run: mvn -version
- name: Install xmllint
timeout-minutes: 5
run: |
# Retry apt-get update and install up to 3 times with a 15-second per-request timeout.
# Retries protect against transient network glitches, mirror timeouts, and apt lock contention on runner startup.
for i in {1..3}; do
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 update && \
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 -y install libxml2-utils && \
break || sleep 5
done
- name: Test helper scripts
run: .kokoro/common_test.sh
- name: Perform downstream compatibility testing
Expand All @@ -82,16 +72,6 @@ jobs:
distribution: temurin
cache: maven
- run: mvn -version
- name: Install xmllint
timeout-minutes: 5
run: |
# Retry apt-get update and install up to 3 times with a 15-second per-request timeout.
# Retries protect against transient network glitches, mirror timeouts, and apt lock contention on runner startup.
for i in {1..3}; do
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 update && \
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 -y install libxml2-utils && \
break || sleep 5
done
- name: Perform downstream compatibility testing
run: .kokoro/downstream-compatibility-spring.sh
required:
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ jobs:
github.repository_owner == 'googleapis' && github.head_ref == 'release-please--branches--main' &&
!endsWith(github.event.pull_request.title, 'SNAPSHOT')
steps:
- name: Install xmllint
timeout-minutes: 5
run: |
# Retry apt-get update and install up to 3 times with a 15-second per-request timeout.
# Retries protect against transient network glitches, mirror timeouts, and apt lock contention on runner startup.
for i in {1..3}; do
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 update && \
sudo apt-get -o Acquire::http::Timeout="15" -o Acquire::Retries=3 -y install libxml2-utils && \
break || sleep 5
done
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
persist-credentials: false
Expand Down
73 changes: 50 additions & 23 deletions .kokoro/client-library-check-doclet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,54 @@ function get_released_version_from_versions_txt() {
function replace_java_shared_config_version() {
version=$1
# replace version
xmllint --shell <(cat pom.xml) << EOF
setns x=http://maven.apache.org/POM/4.0.0
cd .//x:artifactId[text()="google-cloud-shared-config"]
cd ../x:version
set ${version}
save pom.xml
EOF
python3 -c "
import xml.etree.ElementTree as ET, sys
file = 'pom.xml'
ET.register_namespace('', 'http://maven.apache.org/POM/4.0.0')
tree = ET.parse(file)
root = tree.getroot()
for elem in root.iter():
art = elem.find('{*}artifactId')
ver = elem.find('{*}version')
if art is not None and art.text == 'google-cloud-shared-config' and ver is not None:
ver.text = sys.argv[1]
tree.write(file, encoding='utf-8', xml_declaration=True)
" "${version}"
}

function replace_java_shared_dependencies_version() {
version=$1
# replace version
xmllint --shell <(cat pom.xml) << EOF
setns x=http://maven.apache.org/POM/4.0.0
cd .//x:properties/x:google-cloud-shared-dependencies.version
set ${version}
save pom.xml
EOF
python3 -c "
import xml.etree.ElementTree as ET, sys
file = 'pom.xml'
ET.register_namespace('', 'http://maven.apache.org/POM/4.0.0')
tree = ET.parse(file)
root = tree.getroot()
for prop in root.findall('.//{*}properties'):
target = prop.find('{*}google-cloud-shared-dependencies.version')
if target is not None:
target.text = sys.argv[1]
tree.write(file, encoding='utf-8', xml_declaration=True)
" "${version}"
}

function replace_sdk_platform_java_config_version() {
version=$1
# replace version in the shared parent POM
xmllint --shell <(cat ../google-cloud-pom-parent/pom.xml) << EOF
setns x=http://maven.apache.org/POM/4.0.0
cd .//x:artifactId[text()="sdk-platform-java-config"]
cd ../x:version
set ${version}
save ../google-cloud-pom-parent/pom.xml
EOF
python3 -c "
import xml.etree.ElementTree as ET, sys
file = '../google-cloud-pom-parent/pom.xml'
ET.register_namespace('', 'http://maven.apache.org/POM/4.0.0')
tree = ET.parse(file)
root = tree.getroot()
for elem in root.iter():
art = elem.find('{*}artifactId')
ver = elem.find('{*}version')
if art is not None and art.text == 'sdk-platform-java-config' and ver is not None:
ver.text = sys.argv[1]
tree.write(file, encoding='utf-8', xml_declaration=True)
" "${version}"
}
REPO=$1
# Get the directory of the build script
Expand All @@ -94,8 +112,12 @@ echo "This is the doclet path: ${docletPath}"

# Read the current version of this BOM in the POM. Example version: '0.116.1-alpha-SNAPSHOT'
VERSION_POM=java-shared-config/java-shared-config/pom.xml
# Namespace (xmlns) prevents xmllint from specifying tag names in XPath
JAVA_SHARED_CONFIG_VERSION=`sed -e 's/xmlns=".*"//' ${VERSION_POM} | xmllint --xpath '/project/version/text()' -`
JAVA_SHARED_CONFIG_VERSION=$(python3 -c "
import xml.etree.ElementTree as ET
root = ET.parse('${VERSION_POM}').getroot()
v = root.find('{*}version') or root.find('{*}parent/{*}version')
print(v.text if v is not None and v.text else '')
")

if [ -z "${JAVA_SHARED_CONFIG_VERSION}" ]; then
echo "Version is not found in ${VERSION_POM}"
Expand All @@ -110,7 +132,12 @@ LATEST_TAG=$(git ls-remote --tags https://github.com/googleapis/google-cloud-jav
echo "Cloning google-cloud-java at tag: ${LATEST_TAG}"
git clone "https://github.com/googleapis/google-cloud-java.git" -b "${LATEST_TAG}" --depth=1
pushd google-cloud-java/sdk-platform-java
SDK_PLATFORM_JAVA_CONFIG_VERSION=$(sed -e 's/xmlns=".*"//' sdk-platform-java-config/pom.xml | xmllint --xpath '/project/version/text()' -)
SDK_PLATFORM_JAVA_CONFIG_VERSION=$(python3 -c "
import xml.etree.ElementTree as ET
root = ET.parse('sdk-platform-java-config/pom.xml').getroot()
v = root.find('{*}version') or root.find('{*}parent/{*}version')
print(v.text if v is not None and v.text else '')
")

pushd sdk-platform-java-config
# Use released version of google-cloud-shared-dependencies to avoid verifying SNAPSHOT changes.
Expand Down
73 changes: 50 additions & 23 deletions .kokoro/client-library-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,54 @@ function get_released_version_from_versions_txt() {
function replace_java_shared_config_version() {
version=$1
# replace version
xmllint --shell <(cat pom.xml) << EOF
setns x=http://maven.apache.org/POM/4.0.0
cd .//x:artifactId[text()="google-cloud-shared-config"]
cd ../x:version
set ${version}
save pom.xml
EOF
python3 -c "
import xml.etree.ElementTree as ET, sys
file = 'pom.xml'
ET.register_namespace('', 'http://maven.apache.org/POM/4.0.0')
tree = ET.parse(file)
root = tree.getroot()
for elem in root.iter():
art = elem.find('{*}artifactId')
ver = elem.find('{*}version')
if art is not None and art.text == 'google-cloud-shared-config' and ver is not None:
ver.text = sys.argv[1]
tree.write(file, encoding='utf-8', xml_declaration=True)
" "${version}"
}

function replace_java_shared_dependencies_version() {
version=$1
# replace version
xmllint --shell <(cat pom.xml) << EOF
setns x=http://maven.apache.org/POM/4.0.0
cd .//x:properties/x:google-cloud-shared-dependencies.version
set ${version}
save pom.xml
EOF
python3 -c "
import xml.etree.ElementTree as ET, sys
file = 'pom.xml'
ET.register_namespace('', 'http://maven.apache.org/POM/4.0.0')
tree = ET.parse(file)
root = tree.getroot()
for prop in root.findall('.//{*}properties'):
target = prop.find('{*}google-cloud-shared-dependencies.version')
if target is not None:
target.text = sys.argv[1]
tree.write(file, encoding='utf-8', xml_declaration=True)
" "${version}"
}

function replace_sdk_platform_java_config_version() {
version=$1
# replace version in the shared parent POM
xmllint --shell <(cat ../google-cloud-pom-parent/pom.xml) << EOF
setns x=http://maven.apache.org/POM/4.0.0
cd .//x:artifactId[text()="sdk-platform-java-config"]
cd ../x:version
set ${version}
save ../google-cloud-pom-parent/pom.xml
EOF
python3 -c "
import xml.etree.ElementTree as ET, sys
file = '../google-cloud-pom-parent/pom.xml'
ET.register_namespace('', 'http://maven.apache.org/POM/4.0.0')
tree = ET.parse(file)
root = tree.getroot()
for elem in root.iter():
art = elem.find('{*}artifactId')
ver = elem.find('{*}version')
if art is not None and art.text == 'sdk-platform-java-config' and ver is not None:
ver.text = sys.argv[1]
tree.write(file, encoding='utf-8', xml_declaration=True)
" "${version}"
}

if [[ $# -ne 2 ]];
Expand All @@ -93,8 +111,12 @@ popd

# Read the current version of this BOM in the POM. Example version: '0.116.1-alpha-SNAPSHOT'
VERSION_POM=java-shared-config/java-shared-config/pom.xml
# Namespace (xmlns) prevents xmllint from specifying tag names in XPath
JAVA_SHARED_CONFIG_VERSION=`sed -e 's/xmlns=".*"//' ${VERSION_POM} | xmllint --xpath '/project/version/text()' -`
JAVA_SHARED_CONFIG_VERSION=$(python3 -c "
import xml.etree.ElementTree as ET
root = ET.parse('${VERSION_POM}').getroot()
v = root.find('{*}version') or root.find('{*}parent/{*}version')
print(v.text if v is not None and v.text else '')
")

if [ -z "${JAVA_SHARED_CONFIG_VERSION}" ]; then
echo "Version is not found in ${VERSION_POM}"
Expand All @@ -109,7 +131,12 @@ LATEST_TAG=$(git ls-remote --tags https://github.com/googleapis/google-cloud-jav
echo "Cloning google-cloud-java at tag: ${LATEST_TAG}"
git clone "https://github.com/googleapis/google-cloud-java.git" -b "${LATEST_TAG}" --depth=1
pushd google-cloud-java/sdk-platform-java
SDK_PLATFORM_JAVA_CONFIG_VERSION=$(sed -e 's/xmlns=".*"//' sdk-platform-java-config/pom.xml | xmllint --xpath '/project/version/text()' -)
SDK_PLATFORM_JAVA_CONFIG_VERSION=$(python3 -c "
import xml.etree.ElementTree as ET
root = ET.parse('sdk-platform-java-config/pom.xml').getroot()
v = root.find('{*}version') or root.find('{*}parent/{*}version')
print(v.text if v is not None and v.text else '')
")

pushd sdk-platform-java-config
# Use released version of google-cloud-shared-dependencies to avoid verifying SNAPSHOT changes.
Expand Down
Loading
Loading