Skip to content

Commit

Permalink
Merge branch 'main' into spanner-enable-emulator-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Feb 3, 2025
2 parents 71575d3 + 1709b97 commit ed765ae
Show file tree
Hide file tree
Showing 8,599 changed files with 424,160 additions and 230,018 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/run-package-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ FAILED_FILE=$(mktemp -d)/failed
for DIR in ${DIRS}; do {
cp ${DIR}/composer.json ${DIR}/composer-local.json
# Update composer to use local packages
for i in CommonProtos,common-protos,4.0 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
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
IFS=","; set -- $i;
if grep -q "\"google/$2\":" ${DIR}/composer.json; then
# determine local package version
Expand Down
88 changes: 0 additions & 88 deletions .github/workflows/backwards-compatibility-check.yaml

This file was deleted.

126 changes: 126 additions & 0 deletions .github/workflows/backwards-compatibility-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Backwards Compatibility
on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches: ['main']
jobs:
# More info at https://github.com/Roave/BackwardCompatibilityCheck.
backwards-compatibility-check:
name: Breaking Change Detector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
- name: "Install dependencies"
run: composer global require "roave/backward-compatibility-check:^8.2"
- name: "Check for BC breaks"
if: github.event.pull_request.user.login != 'release-please[bot]'
# Ensure the build still passes by adding BREAKING_CHANGE_REASON=[reason] to the PR description.
continue-on-error: ${{ contains(github.event.pull_request.body, 'BREAKING_CHANGE_REASON=') }}
run: |
~/.composer/vendor/bin/roave-backward-compatibility-check --from=origin/main --format=github-actions
- name: "Check for BC label"
# Ensure the build still passes by adding BREAKING_CHANGE_REASON=[reason] to the PR description.
continue-on-error: ${{ contains(github.event.pull_request.body, 'BREAKING_CHANGE_REASON=') }}
run: |
if [[ "true" == "${{ contains(github.event.pull_request.title, '!:') }}" ]]; then
echo "Breaking change label found in PR title"
exit 1
fi
- name: Get Latest Release
if: github.event.pull_request.user.login == 'release-please[bot]'
id: latest-release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
- name: "Check for BC breaks (Next Release)"
if: github.event.pull_request.user.login == 'release-please[bot]'
# We've already approved and justified the breaking changes. Run the check but continue on error
continue-on-error: true
run: |
~/.composer/vendor/bin/roave-backward-compatibility-check \
--from=${{ steps.latest-release.outputs.release }} \
--to=origin/main --format=github-actions
# Ensure that PRs labeled "feat" actually contain a new feature, PRs labeled
# "bug" or "chore" do not.
conventional-commit-check:
name: Conventional Commit Check
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'gcf-owl-bot[bot]'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
- name: "Install dependencies"
run: composer global require "roave/backward-compatibility-check:^8.2"
- name: "Check for an incorrect feat label in the PR"
id: compatibility-checker
continue-on-error: true
# OwlBot PRs which are not labelled feat should not add new files or methods
run: |
~/.composer/vendor/bin/roave-backward-compatibility-check \
--from=origin/${{ github.head_ref || github.ref_name }} \
--to=origin/main
- name: "Print the action item"
run: |
if [[ "${{ steps.compatibility-checker.outcome }}" == 'failure' ]]; then
if [[ "${{ startsWith(github.event.pull_request.title, 'feat') }}" == "false" ]]; then
echo "Action item: Change the conventional commit to use 'feat'"
exit 1
fi
elif [[ "${{ startsWith(github.event.pull_request.title, 'feat') }}" == "true" ]]; then
echo "Action item: No features found, do not use 'feat' for the conventional commit"
exit 1
fi
# Ensure the release PR does not contain an unexpected (e.g. 2.0.0) major version release
# Add "MAJOR_VERSION_ALLOWED=component1,component2" to the PR description to allow major version
# releases for those components
unexpected-major-version-check:
name: Unexpected Major Version Check
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'release-please[bot]'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Parse allowed major versions
uses: actions-ecosystem/action-regex-match@v2
id: allowed-major-versions
with:
text: ${{ github.event.pull_request.body }}
regex: '^MAJOR_VERSION_ALLOWED=(.*)$'
flags: gm
- name: "Check for unexpected major version"
run: |
# parse allowed major versions into an array
IFS=', ' read -r -a ALLOWED_MAJOR_VERSIONS <<< "${{ steps.allowed-major-versions.outputs.group1 }}"
# get all changed components
COMPONENTS=$(git diff origin/main --name-only | grep VERSION | xargs dirname)
FAIL=""
for COMPONENT in ${COMPONENTS}; do {
if [[ "$(cat $COMPONENT/VERSION)" == [123456789].0.0 ]]; then
# A new version is being released - make sure it's allowed
if [[ ${ALLOWED_MAJOR_VERSIONS[@]} =~ $COMPONENT ]]; then
echo "Major version release allowed: $COMPONENT"
else
echo "Unexpected major version release found: $COMPONENT"
FAIL="true"
fi
fi
}; done
if [[ "$FAIL" == "true" ]]; then
echo "Add \"MAJOR_VERSION_ALLOWED=component1,component2\" to the PR description to allow "
echo "major version releases for those components"
exit 1
fi
45 changes: 0 additions & 45 deletions .github/workflows/bigtable-emulator-system-tests.yaml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/conformance-tests-bigtable-emulator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2025 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
paths:
- 'Bigtable/**'
- '.github/workflows/conformance-tests-bigtable-emulator.yaml'
pull_request:
paths:
- 'Bigtable/**'
- '.github/workflows/conformance-tests-bigtable-emulator.yaml'
workflow_dispatch:
name: Run Bigtable Conformance Tests With Emulator
jobs:
conformance:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: grpc

- name: Checkout Bigtable conformance tests
uses: actions/checkout@v4
with:
repository: googleapis/cloud-bigtable-clients-test
ref: main
path: cloud-bigtable-clients-test

- uses: actions/setup-go@v5
with:
go-version: '>=1.20.2'

- name: Install Road Runner PHP
run: |
wget https://github.com/roadrunner-server/roadrunner/releases/download/v2024.3.1/roadrunner-2024.3.1-linux-amd64.deb
sudo dpkg -i roadrunner-2024.3.1-linux-amd64.deb
- run: bash Bigtable/tests/Conformance/proxy/conformance.sh
40 changes: 40 additions & 0 deletions .github/workflows/conformance-tests-storage-emulator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
push:
branches:
- main
paths:
- 'Storage/**'
- '.github/workflows/conformance-tests-storage-emulator.yaml'
pull_request:
paths:
- 'Storage/**'
- '.github/workflows/conformance-tests-storage-emulator.yaml'
name: Run Storage Retry Conformance Tests With Emulator
jobs:
test:
runs-on: ubuntu-20.04

services:
emulator:
image: gcr.io/cloud-devrel-public-resources/storage-testbench:v0.52.0
ports:
- 9000:9000

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'

- name: Install dependencies
run: |
composer update --prefer-dist --no-interaction --no-suggest
- name: Run storage retry conformance tests
run: |
vendor/bin/phpunit -c Storage/phpunit-conformance.xml.dist
env:
STORAGE_EMULATOR_HOST: http://localhost:9000
Loading

0 comments on commit ed765ae

Please sign in to comment.