Skip to content

Commit

Permalink
Merge branch 'main' into add-functions-preload-sample
Browse files Browse the repository at this point in the history
  • Loading branch information
iennae authored Sep 28, 2023
2 parents 3802013 + 7f4be92 commit 38d433b
Show file tree
Hide file tree
Showing 1,629 changed files with 61,885 additions and 25,371 deletions.
35 changes: 35 additions & 0 deletions .github/blunderbuss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
assign_issues_by:
- labels:
- 'api: bigtable'
- 'api: datastore'
- 'api: firestore'
to:
- GoogleCloudPlatform/cloud-native-db-dpes
- labels:
- 'api: cloudsql'
to:
- GoogleCloudPlatform/infra-db-sdk
- labels:
- 'api: cloudiot'
to:
- laszlokorossy
- labels:
- 'api: spanner'
to:
- shivgautam

assign_prs_by:
- labels:
- 'api: bigtable'
- 'api: datastore'
- 'api: firestore'
to:
- GoogleCloudPlatform/cloud-native-db-dpes
- labels:
- 'api: cloudsql'
to:
- GoogleCloudPlatform/infra-db-sdk
- labels:
- 'api: cloudiot'
to:
- laszlokorossy
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Lint

on:
push:
branches: [ main ]
pull_request:

jobs:
styles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'

- name: Run Script
run: testing/run_cs_check.sh

staticanalysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'

- name: Run Script
run: |
composer global require phpstan/phpstan
for dir in $(find * -type d -name src -not -path 'appengine/*' -not -path '*/vendor/*' -exec dirname {} \;);
do
echo -e "\n RUNNING for => $dir\n"
composer install --working-dir=$dir --ignore-platform-reqs
echo "<?php require_once 'testing/sample_helpers.php';require_once '$dir/vendor/autoload.php';" > autoload.php
~/.composer/vendor/bin/phpstan analyse $dir/src --autoload-file=autoload.php
done
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ credentials.*
**/vendor/
**/build/
.php_cs.cache
.php-cs-fixer.cache
.vscode/
.kokoro/secrets.sh
.phpunit.result.cache
.DS_Store
19 changes: 19 additions & 0 deletions .kokoro/deploy_gae.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/php80"
}

# Run the deployment tests
env_vars: {
key: "RUN_DEPLOYMENT_TESTS"
value: "true"
}

# Only run deployment tests for App Engine Standard
env_vars: {
key: "TEST_DIRECTORIES"
value: "appengine/standard"
}
19 changes: 19 additions & 0 deletions .kokoro/deploy_gcf.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/php80"
}

# Run the deployment tests
env_vars: {
key: "RUN_DEPLOYMENT_TESTS"
value: "true"
}

# Only run deployment tests for Cloud Functions
env_vars: {
key: "TEST_DIRECTORIES"
value: "functions"
}
19 changes: 19 additions & 0 deletions .kokoro/deploy_misc.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/php80"
}

# Run the deployment tests
env_vars: {
key: "RUN_DEPLOYMENT_TESTS"
value: "true"
}

# Run deployment tests for Cloud Run, EventArc Endpoints
env_vars: {
key: "TEST_DIRECTORIES"
value: "endpoints eventarc run"
}
6 changes: 1 addition & 5 deletions .kokoro/php74.cfg → .kokoro/php81.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/php74"
value: "gcr.io/cloud-devrel-kokoro-resources/php81"
}

# Give the docker image a unique project ID and credentials per PHP version
Expand All @@ -15,7 +15,3 @@ env_vars: {
key: "GOOGLE_ALT_CREDENTIALS_FILENAME"
value: "service-account-kokoro1.json"
}
env_vars: {
key: "RUN_CS_CHECK"
value: "true"
}
2 changes: 1 addition & 1 deletion .kokoro/php73.cfg → .kokoro/php82.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/php73"
value: "gcr.io/cloud-devrel-kokoro-resources/php82"
}

# Give the docker image a unique project ID and credentials per PHP version
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/php_rest.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/php73"
value: "gcr.io/cloud-devrel-kokoro-resources/php80"
}

# Set this project to run REST tests only
Expand Down
15 changes: 15 additions & 0 deletions .kokoro/secrets-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export POSTGRES_DSN=
export POSTGRES_DATABASE=
export POSTGRES_USER=
export POSTGRES_PASSWORD=
export SQLSERVER_DSN=
export SQLSERVER_DATABASE=
export SQLSERVER_USER=
export SQLSERVER_PASSWORD=
export DB_SOCKET_DIR=

# Datastore
export CLOUD_DATASTORE_NAMESPACE=
Expand All @@ -69,6 +74,9 @@ export DATASTORE_EVENTUALLY_CONSISTENT_RETRY_COUNT=
export DLP_DEID_WRAPPED_KEY=
export DLP_DEID_KEY_NAME=projects/$GOOGLE_PROJECT_ID/locations/global/keyRings/ci/cryptoKeys/ci

# DocumentAI
export GOOGLE_DOCUMENTAI_PROCESSOR_ID=

# Firestore
export FIRESTORE_PROJECT_ID=

Expand Down Expand Up @@ -97,6 +105,10 @@ export REDIS_PORT=
# PubSub
export GOOGLE_PUBSUB_SUBSCRIPTION=php-example-subscription
export GOOGLE_PUBSUB_TOPIC=php-example-topic
# GOOGLE_PUBSUB_BIGQUERY_TABLE excludes project_id
# for example if table is ${PROJECT_ID}.pubsub_test_dataset.pubsub_test_table
# the value of GOOGLE_PUBSUB_BIGQUERY_TABLE should be pubsub_test_dataset.pubsub_test_table
export GOOGLE_PUBSUB_BIGQUERY_TABLE=

# Security Center
export GOOGLE_ORGANIZATION_ID=
Expand Down Expand Up @@ -140,3 +152,6 @@ export SYMFONY_DB_PASSWORD=$CLOUDSQL_PASSWORD

# Functions
export BLURRED_BUCKET_NAME=$GCLOUD_PROJECT-functions

# Google Analytics APIs
export GA_TEST_PROPERTY_ID=
Binary file modified .kokoro/secrets.sh.enc
Binary file not shown.
8 changes: 3 additions & 5 deletions .kokoro/system_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ mkdir -p build/logs

export PULL_REQUEST_NUMBER=$KOKORO_GITHUB_PULL_REQUEST_NUMBER

# Run code standards check when appropriate
if [ "${RUN_CS_CHECK}" = "true" ]; then
bash testing/run_cs_check.sh
fi

# If we are running REST tests, disable gRPC
if [ "${RUN_REST_TESTS_ONLY}" = "true" ]; then
GRPC_INI=$(php -i | grep grpc.ini | sed 's/^Additional .ini files parsed => //g' | sed 's/,*$//g' )
Expand All @@ -64,5 +59,8 @@ fi
# Install global test dependencies
composer install -d testing/

# Configure the current directory as a safe directory
git config --global --add safe.directory $(pwd)

# Run tests
bash testing/run_test_suite.sh
42 changes: 42 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

// php-cs-fixer 3.0 distributed config file

$config = new PhpCsFixer\Config();
$config
->setRules([
'@PSR2' => true,
'concat_space' => ['spacing' => 'one'],
'no_unused_imports' => true,
'whitespace_after_comma_in_array' => true,
'method_argument_space' => [
'keep_multiple_spaces_after_comma' => true,
'on_multiline' => 'ignore'
],
'return_type_declaration' => [
'space_before' => 'none'
],
// only converts simple strings in double quotes to single quotes
// ignores strings using variables, escape characters or single quotes inside
'single_quote' => true,
// there should be a single space b/w the cast and it's operand
'cast_spaces' => ['space' => 'single'],
// there shouldn't be any trailing whitespace at the end of a non-blank line
'no_trailing_whitespace' => true,
// there shouldn't be any trailing whitespace at the end of a blank line
'no_whitespace_in_blank_line' => true,
// there should be a space around binary operators like (=, => etc)
'binary_operator_spaces' => ['default' => 'single_space'],
// deals with rogue empty blank lines
'no_extra_blank_lines' => ['tokens' => ['extra']],
// reduces multi blank lines b/w phpdoc description and @param to a single line
// NOTE: Doesn't add a blank line if none exist
'phpdoc_trim_consecutive_blank_line_separation' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
)
;

return $config;
21 changes: 0 additions & 21 deletions .php_cs.dist

This file was deleted.

68 changes: 55 additions & 13 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,17 +1,59 @@
# Code owners file.
# This file controls who is tagged for review for any given pull request.
# Code owners file

# This file controls who is tagged for review for any given pull request

#
# For syntax help see:
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax

# For syntax help see

# <https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax>

# The php-admins team is the default owner for anything not
# explicitly taken by someone else.
* @GoogleCloudPlatform/php-admins

/bigtable/ @GoogleCloudPlatform/bigtable-dpe @GoogleCloudPlatform/php-admins
/cloud_sql/ @GoogleCloudPlatform/cloud-sql-dpes @GoogleCloudPlatform/php-admins
/datastore/ @GoogleCloudPlatform/firestore-dpe @GoogleCloudPlatform/php-admins
/firestore/ @GoogleCloudPlatform/firestore-dpe @GoogleCloudPlatform/php-admins
/iot/ @gcseh @GoogleCloudPlatform/api-iot @GoogleCloudPlatform/php-admins
/storage/ @GoogleCloudPlatform/storage-dpe @GoogleCloudPlatform/php-admins

# explicitly taken by someone else

* @GoogleCloudPlatform/php-samples-reviewers

# Kokoro

.kokoro @GoogleCloudPlatform/php-admins

/bigtable/**/*.php @GoogleCloudPlatform/cloud-native-db-dpes @GoogleCloudPlatform/php-samples-reviewers
/cloud_sql/**/*.php @GoogleCloudPlatform/infra-db-sdk @GoogleCloudPlatform/php-samples-reviewers
/datastore/**/*.php @GoogleCloudPlatform/cloud-native-db-dpes @GoogleCloudPlatform/php-samples-reviewers
/firestore/**/*.php @GoogleCloudPlatform/cloud-native-db-dpes @GoogleCloudPlatform/php-samples-reviewers
/storage/ @GoogleCloudPlatform/cloud-storage-dpe @GoogleCloudPlatform/php-samples-reviewers
/spanner/ @GoogleCloudPlatform/api-spanner @GoogleCloudPlatform/php-samples-reviewers

# Serverless, Orchestration, DevOps

/appengine/ @GoogleCloudPlatform/torus-dpe @GoogleCloudPlatform/php-samples-reviewers
/functions/ @GoogleCloudPlatform/torus-dpe @GoogleCloudPlatform/php-samples-reviewers
/run/ @GoogleCloudPlatform/torus-dpe @GoogleCloudPlatform/php-samples-reviewers
/eventarc/ @GoogleCloudPlatform/torus-dpe @GoogleCloudPlatform/php-samples-reviewers

# Functions samples owned by the Firebase team

/functions/firebase_analytics @schandel

# DLP samples owned by DLP team

/dlp/ @GoogleCloudPlatform/googleapis-dlp

# Brent is taking ownership of these samples as they are not supported by the ML team

/dialogflow/ @bshaffer
/language/ @bshaffer
/speech/ @bshaffer
/translate/ @bshaffer
/texttospeech/ @bshaffer
/vision/ @bshaffer
/video/ @bshaffer

# Compute samples owned by Remik

/compute/cloud-client/ @rsamborski

# Deprecated

/iot/ @GoogleCloudPlatform/php-samples-reviewers
Loading

0 comments on commit 38d433b

Please sign in to comment.