Skip to content

Commit d59d232

Browse files
authored
Merge branch 'main' into spanner-occ
2 parents 7cf3f98 + 87293f8 commit d59d232

File tree

3,268 files changed

+360553
-4590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,268 files changed

+360553
-4590
lines changed

.github/run-package-tests.sh

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
set -e
17+
1618
DIRS=$(find * -maxdepth 0 -type d -name '[A-Z]*')
1719
PREFER_LOWEST=""
1820
if [ "$#" -eq 1 ]; then
@@ -42,45 +44,57 @@ fi
4244
export COMPOSER=composer-local.json
4345

4446
FAILED_FILE=$(mktemp -d)/failed
45-
for DIR in ${DIRS}; do {
46-
cp ${DIR}/composer.json ${DIR}/composer-local.json
47+
for DIR in ${DIRS}; do
48+
echo "--- Processing ${DIR} ---"
49+
cp "${DIR}/composer.json" "${DIR}/composer-local.json"
4750
# Update composer to use local packages
48-
for i in CommonProtos,common-protos,4.100 BigQuery,cloud-bigquery Core,cloud-core Logging,cloud-logging PubSub,cloud-pubsub Storage,cloud-storage ShoppingCommonProtos,shopping-common-protos GeoCommonProtos,geo-common-protos,0.1; do
49-
IFS=","; set -- $i;
50-
if grep -q "\"google/$2\":" ${DIR}/composer.json; then
51+
PACKAGE_DEPENDENCIES=(
52+
"CommonProtos,common-protos,4.100"
53+
"BigQuery,cloud-bigquery"
54+
"Core,cloud-core"
55+
"Logging,cloud-logging"
56+
"PubSub,cloud-pubsub"
57+
"Storage,cloud-storage"
58+
"ShoppingCommonProtos,shopping-common-protos"
59+
"GeoCommonProtos,geo-common-protos,0.1"
60+
)
61+
for i in "${PACKAGE_DEPENDENCIES[@]}"; do
62+
IFS="," read -r PKG_DIR PKG_NAME PKG_VERSION <<< "$i"
63+
if grep -q "\"google/${PKG_NAME}\":" "${DIR}/composer.json"; then
5164
# determine local package version
52-
if [ "$STRICT" = "true" ]; then VERSION=$(cat $1/VERSION); elif [ -z "$3" ]; then VERSION="1.100"; else VERSION=$3; fi
53-
echo "Use local package $1 as google/$2:$VERSION in $DIR"
65+
if [ "${STRICT}" = "true" ]; then
66+
VERSION=$(cat "${PKG_DIR}/VERSION")
67+
elif [ -z "${PKG_VERSION}" ]; then
68+
VERSION="1.100"
69+
else
70+
VERSION=${PKG_VERSION}
71+
fi
72+
echo "Use local package ${PKG_DIR} as google/${PKG_NAME}:${VERSION} in ${DIR}"
5473
# "canonical: false" ensures composer will try to install from packagist when the "--prefer-lowest" flag is set.
55-
composer config repositories.$2 -d ${DIR} "{\"type\": \"path\", \"url\": \"../$1\", \"options\":{\"versions\":{\"google/$2\":\"$VERSION\"}},\"canonical\":false}"
74+
JSON_CONFIG=$(printf '{"type":"path","url":"../%s","options":{"versions":{"google/%s":"%s"}},"canonical":false}' "${PKG_DIR}" "${PKG_NAME}" "${VERSION}")
75+
composer config "repositories.${PKG_NAME}" -d "${DIR}" "${JSON_CONFIG}"
5676
fi
5777
done
5878

59-
echo -n "Installing composer in $DIR"
60-
if [ "$PREFER_LOWEST" != "" ]; then
61-
echo -n " (with $PREFER_LOWEST)"
79+
echo -n "Installing composer in ${DIR}"
80+
if [ -n "${PREFER_LOWEST}" ]; then
81+
echo -n " (with ${PREFER_LOWEST})"
6282
fi
6383
echo ""
64-
composer -q --no-interaction --no-ansi --no-progress $PREFER_LOWEST update -d ${DIR};
65-
if [ $? != 0 ]; then
66-
echo "$DIR: composer install failed" >> "${FAILED_FILE}"
84+
composer -q --no-interaction --no-ansi --no-progress ${PREFER_LOWEST} update -d "${DIR}" || {
85+
echo "${DIR}: composer install failed" >> "${FAILED_FILE}"
6786
# run again but without "-q" so we can see the error
68-
composer --no-interaction --no-ansi --no-progress $PREFER_LOWEST update -d ${DIR};
87+
composer --no-interaction --no-ansi --no-progress ${PREFER_LOWEST} update -d "${DIR}"
6988
continue
70-
fi
71-
echo "Running $DIR Unit Tests"
72-
${DIR}/vendor/bin/phpunit -c ${DIR}/phpunit.xml.dist;
73-
if [ $? != 0 ]; then
74-
echo "$DIR: failed" >> "${FAILED_FILE}"
75-
fi
89+
}
90+
echo "Running ${DIR} Unit Tests"
91+
"${DIR}/vendor/bin/phpunit" -c "${DIR}/phpunit.xml.dist" || echo "${DIR}: failed" >> "${FAILED_FILE}"
92+
7693
if [ -f "${DIR}/phpunit-snippets.xml.dist" ]; then
77-
echo "Running $DIR Snippet Tests"
78-
${DIR}/vendor/bin/phpunit -c ${DIR}/phpunit-snippets.xml.dist;
79-
if [ $? != 0 ]; then
80-
echo "$DIR (snippets): failed" >> "${FAILED_FILE}"
81-
fi
94+
echo "Running ${DIR} Snippet Tests"
95+
"${DIR}/vendor/bin/phpunit" -c "${DIR}/phpunit-snippets.xml.dist" || echo "${DIR} (snippets): failed" >> "${FAILED_FILE}"
8296
fi
83-
}; done
97+
done
8498

8599
if [ -f "${FAILED_FILE}" ]; then
86100
echo "--------- Failed tests --------------"

.github/workflows/conformance-tests-bigtable-proxy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- name: Checkout code
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@v5
3535

3636
- name: Setup PHP
3737
uses: shivammathur/setup-php@v2
@@ -40,7 +40,7 @@ jobs:
4040
extensions: grpc
4141

4242
- name: Checkout Bigtable conformance tests
43-
uses: actions/checkout@v4
43+
uses: actions/checkout@v5
4444
with:
4545
repository: googleapis/cloud-bigtable-clients-test
4646
ref: v0.0.3

.github/workflows/conformance-tests-storage-emulator.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616

1717
services:
1818
emulator:
19-
image: gcr.io/cloud-devrel-public-resources/storage-testbench:v0.54.0
19+
image: gcr.io/cloud-devrel-public-resources/storage-testbench:v0.55.0
2020
ports:
2121
- 9000:9000
2222

2323
steps:
2424
- name: Checkout code
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v5
2626

2727
- name: Setup PHP
2828
uses: shivammathur/setup-php@v2

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
env:
1313
PHPDOC_ENV: prod
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
- name: Setup Python
1717
uses: actions/setup-python@v5
1818
with:

.github/workflows/lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
name: PHP Style Check
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
@@ -52,7 +52,7 @@ jobs:
5252
runs-on: ubuntu-latest
5353
name: PHPStan Static Analysis
5454
steps:
55-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v5
5656
- name: Install PHP
5757
uses: shivammathur/setup-php@v2
5858
with:

.github/workflows/owlbot-checks.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
if: github.event.pull_request.user.login == 'gcf-owl-bot[bot]'
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
with:
1717
fetch-depth: 0
1818
- name: "Install PHP"
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
if: github.event.pull_request.user.login == 'gcf-owl-bot[bot]' && github.event.pull_request.draft == false
4949
steps:
50-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@v5
5151
- name: Ensure
5252
run: |
5353
directory_to_check="owl-bot-staging"

.github/workflows/release-checks.yaml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ on:
33
pull_request:
44
types: [opened, synchronize, reopened, edited]
55
branches: ['main']
6+
permissions:
7+
contents: read
68
jobs:
79
# More info at https://github.com/Roave/BackwardCompatibilityCheck.
810
backwards-compatibility-check:
911
name: Breaking Change Detector
1012
runs-on: ubuntu-latest
1113
steps:
12-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1315
with:
1416
fetch-depth: 0
1517
- name: "Install PHP"
@@ -38,6 +40,7 @@ jobs:
3840
uses: pozetroninc/github-action-get-latest-release@master
3941
with:
4042
repository: ${{ github.repository }}
43+
token: ${{ secrets.GITHUB_TOKEN }}
4144
- name: "Check for BC breaks (Next Release)"
4245
if: github.event.pull_request.user.login == 'release-please[bot]'
4346
# We've already approved and justified the breaking changes. Run the check but continue on error
@@ -55,7 +58,7 @@ jobs:
5558
runs-on: ubuntu-latest
5659
if: github.event.pull_request.user.login == 'release-please[bot]'
5760
steps:
58-
- uses: actions/checkout@v4
61+
- uses: actions/checkout@v5
5962
with:
6063
fetch-depth: 0
6164
- name: Parse allowed major versions
@@ -88,3 +91,34 @@ jobs:
8891
echo "major version releases for those components"
8992
exit 1
9093
fi
94+
95+
# Ensure that if the release PR contains any NEW components, the new component's corresponding
96+
# sub-repo exists
97+
new-component-subrepo-check:
98+
name: New Component Sub-Repo Check
99+
runs-on: ubuntu-latest
100+
if: github.event.pull_request.user.login == 'release-please[bot]'
101+
steps:
102+
- uses: actions/checkout@v5
103+
with:
104+
fetch-depth: 0
105+
- name: "Verify the subrepos exist for new components"
106+
run: |
107+
COMPONENTS=$(git diff origin/main --name-only | grep VERSION | xargs dirname)
108+
FAIL=""
109+
for COMPONENT in ${COMPONENTS}; do {
110+
if [[ "$(cat $COMPONENT/VERSION)" == "0.1.0" ]]; then
111+
SUBREPO=$(cat $COMPONENT/composer.json | jq -r '.extra.component.target')
112+
echo "New component found: $COMPONENT"
113+
if curl --head --silent --fail "https://api.github.com/repos/$SUBREPO" -H 'Authorization: Bearer ${{secrets.SPLIT_TOKEN}}' > /dev/null; then
114+
echo "✅ Target Repo '$SUBREPO' exists"
115+
else
116+
echo "❌ Target Repo '$SUBREPO' DOES NOT EXIST"
117+
FAIL="true"
118+
fi
119+
fi
120+
}; done
121+
if [[ "$FAIL" == "true" ]]; then
122+
echo "Missing repositories for one or more new components"
123+
exit 1
124+
fi

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
go build -o splitsh-lite github.com/splitsh/lite
4242
mv splitsh-lite /usr/local/bin/splitsh-lite
4343
- name: Checkout google/cloud
44-
uses: actions/checkout@v4
44+
uses: actions/checkout@v5
4545
with:
4646
persist-credentials: false
4747
fetch-depth: 0

.github/workflows/system-tests-bigtable-emulator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323

2424
- run: ./.github/emulator/start-emulator.sh bigtable 419.0.0-emulators
2525

.github/workflows/system-tests-datastore-emulator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323

2424
- run: ./.github/emulator/start-emulator.sh datastore 419.0.0-emulators
2525

0 commit comments

Comments
 (0)