-
Notifications
You must be signed in to change notification settings - Fork 83
feat!: Begin using new microgenerator for v2 firestore #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
53836c6
Update synth.py to use new generator
crwilcox 538cb05
Run generator
crwilcox 01e891b
Delete gapic, proto directories, old generated surface
crwilcox 29f891d
manual changes for regeneration
crwilcox 59d781b
Merge branch 'v2-staging' of github.com:googleapis/python-firestore i…
crwilcox 9dd9af5
docs: use multiprocessing includes instead of note for multiprocessing
crwilcox 94210e3
test: drop coverage to get merged, open tracking issue to raise again
crwilcox fdf9826
update README
crwilcox da7b55c
fixes from rafilong review
crwilcox 9aa7d12
fixes from rafilong review
crwilcox 034e42a
remove commented out code
crwilcox ef2cf4f
undo lint changes for trailing commas
crwilcox 756fe8d
accidental ' in checks
crwilcox ab37350
feedback
crwilcox ae343f6
feedback
crwilcox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| # Build logs will be here | ||
| action { | ||
| define_artifacts { | ||
| regex: "**/*sponge_log.xml" | ||
| } | ||
| } | ||
|
|
||
| # Specify which tests to run | ||
| env_vars: { | ||
| key: "RUN_TESTS_SESSION" | ||
| value: "lint" | ||
| } | ||
|
|
||
| env_vars: { | ||
| key: "TRAMPOLINE_BUILD_FILE" | ||
| value: "github/python-firestore/.kokoro/test-samples.sh" | ||
| } | ||
|
|
||
| # Configure the docker image for kokoro-trampoline. | ||
| env_vars: { | ||
| key: "TRAMPOLINE_IMAGE" | ||
| value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" | ||
| } | ||
|
|
||
| # Download secrets for samples | ||
| gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" | ||
|
|
||
| # Download trampoline resources. | ||
| gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" | ||
|
|
||
| # Use the trampoline script to run in docker. | ||
| build_file: "python-firestore/.kokoro/trampoline.sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "True" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "False" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "True" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| # Build logs will be here | ||
| action { | ||
| define_artifacts { | ||
| regex: "**/*sponge_log.xml" | ||
| } | ||
| } | ||
|
|
||
| # Specify which tests to run | ||
| env_vars: { | ||
| key: "RUN_TESTS_SESSION" | ||
| value: "py-3.6" | ||
| } | ||
|
|
||
| env_vars: { | ||
| key: "TRAMPOLINE_BUILD_FILE" | ||
| value: "github/python-firestore/.kokoro/test-samples.sh" | ||
| } | ||
|
|
||
| # Configure the docker image for kokoro-trampoline. | ||
| env_vars: { | ||
| key: "TRAMPOLINE_IMAGE" | ||
| value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" | ||
| } | ||
|
|
||
| # Download secrets for samples | ||
| gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" | ||
|
|
||
| # Download trampoline resources. | ||
| gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" | ||
|
|
||
| # Use the trampoline script to run in docker. | ||
| build_file: "python-firestore/.kokoro/trampoline.sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "True" | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "False" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "True" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| # Build logs will be here | ||
| action { | ||
| define_artifacts { | ||
| regex: "**/*sponge_log.xml" | ||
| } | ||
| } | ||
|
|
||
| # Specify which tests to run | ||
| env_vars: { | ||
| key: "RUN_TESTS_SESSION" | ||
| value: "py-3.7" | ||
| } | ||
|
|
||
| env_vars: { | ||
| key: "TRAMPOLINE_BUILD_FILE" | ||
| value: "github/python-firestore/.kokoro/test-samples.sh" | ||
| } | ||
|
|
||
| # Configure the docker image for kokoro-trampoline. | ||
| env_vars: { | ||
| key: "TRAMPOLINE_IMAGE" | ||
| value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" | ||
| } | ||
|
|
||
| # Download secrets for samples | ||
| gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" | ||
|
|
||
| # Download trampoline resources. | ||
| gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" | ||
|
|
||
| # Use the trampoline script to run in docker. | ||
| build_file: "python-firestore/.kokoro/trampoline.sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "True" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "False" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "True" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| # Build logs will be here | ||
| action { | ||
| define_artifacts { | ||
| regex: "**/*sponge_log.xml" | ||
| } | ||
| } | ||
|
|
||
| # Specify which tests to run | ||
| env_vars: { | ||
| key: "RUN_TESTS_SESSION" | ||
| value: "py-3.8" | ||
| } | ||
|
|
||
| env_vars: { | ||
| key: "TRAMPOLINE_BUILD_FILE" | ||
| value: "github/python-firestore/.kokoro/test-samples.sh" | ||
| } | ||
|
|
||
| # Configure the docker image for kokoro-trampoline. | ||
| env_vars: { | ||
| key: "TRAMPOLINE_IMAGE" | ||
| value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" | ||
| } | ||
|
|
||
| # Download secrets for samples | ||
| gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" | ||
|
|
||
| # Download trampoline resources. | ||
| gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" | ||
|
|
||
| # Use the trampoline script to run in docker. | ||
| build_file: "python-firestore/.kokoro/trampoline.sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "True" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "False" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| env_vars: { | ||
| key: "INSTALL_LIBRARY_FROM_SOURCE" | ||
| value: "True" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| #!/bin/bash | ||
| # Copyright 2020 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 | ||
| # | ||
| # https://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. | ||
|
|
||
|
|
||
| # `-e` enables the script to automatically fail when a command fails | ||
| # `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero | ||
| set -eo pipefail | ||
| # Enables `**` to include files nested inside sub-folders | ||
| shopt -s globstar | ||
|
|
||
| cd github/python-firestore | ||
|
|
||
| # Run periodic samples tests at latest release | ||
| if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then | ||
| LATEST_RELEASE=$(git describe --abbrev=0 --tags) | ||
| git checkout $LATEST_RELEASE | ||
| fi | ||
|
|
||
| # Disable buffering, so that the logs stream through. | ||
| export PYTHONUNBUFFERED=1 | ||
|
|
||
| # Debug: show build environment | ||
| env | grep KOKORO | ||
|
|
||
| # Install nox | ||
| python3.6 -m pip install --upgrade --quiet nox | ||
|
|
||
| # Use secrets acessor service account to get secrets | ||
| if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then | ||
| gcloud auth activate-service-account \ | ||
| --key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \ | ||
| --project="cloud-devrel-kokoro-resources" | ||
| fi | ||
|
|
||
| # This script will create 3 files: | ||
| # - testing/test-env.sh | ||
| # - testing/service-account.json | ||
| # - testing/client-secrets.json | ||
| ./scripts/decrypt-secrets.sh | ||
|
|
||
| source ./testing/test-env.sh | ||
| export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json | ||
|
|
||
| # For cloud-run session, we activate the service account for gcloud sdk. | ||
| gcloud auth activate-service-account \ | ||
| --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" | ||
|
|
||
| export GOOGLE_CLIENT_SECRETS=$(pwd)/testing/client-secrets.json | ||
|
|
||
| echo -e "\n******************** TESTING PROJECTS ********************" | ||
|
|
||
| # Switch to 'fail at end' to allow all tests to complete before exiting. | ||
| set +e | ||
| # Use RTN to return a non-zero value if the test fails. | ||
| RTN=0 | ||
| ROOT=$(pwd) | ||
| # Find all requirements.txt in the samples directory (may break on whitespace). | ||
| for file in samples/**/requirements.txt; do | ||
| cd "$ROOT" | ||
| # Navigate to the project folder. | ||
| file=$(dirname "$file") | ||
| cd "$file" | ||
|
|
||
| echo "------------------------------------------------------------" | ||
| echo "- testing $file" | ||
| echo "------------------------------------------------------------" | ||
|
|
||
| # Use nox to execute the tests for the project. | ||
| python3.6 -m nox -s "$RUN_TESTS_SESSION" | ||
| EXIT=$? | ||
|
|
||
| # If this is a periodic build, send the test log to the Build Cop Bot. | ||
| # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop. | ||
| if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then | ||
| chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop | ||
| $KOKORO_GFILE_DIR/linux_amd64/buildcop | ||
| fi | ||
|
|
||
| if [[ $EXIT -ne 0 ]]; then | ||
| RTN=1 | ||
| echo -e "\n Testing failed: Nox returned a non-zero exit code. \n" | ||
| else | ||
| echo -e "\n Testing completed.\n" | ||
| fi | ||
|
|
||
| done | ||
| cd "$ROOT" | ||
|
|
||
| # Workaround for Kokoro permissions issue: delete secrets | ||
| rm testing/{test-env.sh,client-secrets.json,service-account.json} | ||
|
|
||
| exit "$RTN" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.