8000 feat!: migrate to v2.0.0 (#147) · googleapis/python-spanner@bf4b278 · GitHub
[go: up one dir, main page]

Skip to content

Commit bf4b278

Browse files
larkeeskuruppu
andauthored
feat!: migrate to v2.0.0 (#147)
* chore: remove old generated files * chore: remove type files * refactor: move handwritten files to google/cloud/spanner * chore: update synth.py * chore: regen library via microgenerator * fix: update imports to use new files * fix: update _helper.py * update backup.py * fix: update batch.py * fix: update param_types.py * fix: update pool.py * test: update test_keyset.py * test: update test__opentelemetry_tracing.py * fix: update client.py * test: update test_client.py * fix: update database.py * test: update test_database.py * fix: update commmit call missing kwarg * test: update test_session.py * fix: update streamed.py * test: update TestStreamedResultSet tests in streamed.py * fix: update instance.py * test: update test_instance.py * fix: add _parse_value method to _helper.py * test: update test/_helper.py * fix: update transaction.py and test_transaction.py * fix: remove creating list_value_pb * fix: update snapshot.py and test_snapshot.py * fix: update setup.py * fix: use struct pb for partition_query * fix: support merging RepeatedComposite objects * fix: replace dict with Statements * fix: replace dict with Statements * lint: format code * fix: update synth.py * chore: regen with gapic-generator v0.33.4 * test: increase test coverage * fix: use backup pb instead of dict * fix: update api calls to use supported kwargs * fix: update api calls to use supported kwargs and remove unused function * test: update system tests * test: add tests for _parse_value function * test: update empty list Value to correctly reflect the format * refactor: use _parse_value in _parse_value_pb * refactor: remove unneeded wrapper classes * fix: use default retry (see golang) as ExecuteStreamingSql does not define retry settings * refactor: remove unneeded wrapper class * fix: use pb for params kwargs * test: increase coverage * test: correctly assert UNKNOWN error * chore: remove unneeded replacesments and regen with gapic-generator v0.33.6 * fix: update kwarg to type_ * refactor: remove unused imports * refactor: remove unused imports * fix: update kwarg to all_ * fix: update kwarg to type_ * fix: update kwarg and attribute to type_ * fix: update kwarg to type_ * test: fix test name * style: format code * fix: update kwarg to type_ * fix: update api calls * test: update param types to use param_types types * test: update numeric tests * test: remove unused variable * refactor: remove unused import * docs: update doc references * test: increase test coverage * chore: test with and without opentelemetry for full test coverage * chore: regen samples README * fix: update emulator Github action * docs: manually fix typo that breaks docs * docs: remove unsupported markdown and point to link with removed info * docs: fix broken hyperlink * chore: add replacement for docs formatting issue * chore: regen library (via synth) * chore: exclude noxfile.py from being generated * refator: move handwritten files back into google/cloud/spanner_v1 * style: fix lint * fix: update sample to use correct type * fix: create alias for proto types * fix: update imports * test: update test to use proto-plus structures * ci: update python version for emulator tests * fix: update backup pagination example * test: revert test_keyset for coverage * test: fix expected ranges * fix: ignore google/cloud/spanner_v1/__init__.py for regen * chore: regen (via synth) * docs: revert import changes * refactor: address comments * docs: add UPDATING guide * refactor: revert imports * feat: remove deprecated arguments * docs: update guide to mention deprecated arguments * test: lower required coverage to 99% * test: remove deprecated options * style: fix lint error * Update UPGRADING.md Co-authored-by: skuruppu <skuruppu@google.com> Co-authored-by: larkee <larkee@users.noreply.github.com> Co-authored-by: skuruppu <skuruppu@google.com>
1 parent 783fffb commit bf4b278

File tree

183 files changed

+35546
-27564
lines changed

Some content is hidden

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

183 files changed

+35546
-27564
lines changed

.github/workflows/integration-tests-against-emulator.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
- name: Setup Python
2222
uses: actions/setup-python@v2
2323
with:
24-
python-version: 3.7
24+
python-version: 3.8
2525
- name: Install nox
2626
run: python -m pip install nox
2727
- name: Run system tests
28-
run: nox -s system-3.7
28+
run: nox -s system
2929
env:
3030
SPANNER_EMULATOR_HOST: localhost:9010
3131
GOOGLE_CLOUD_PROJECT: emulator-test-project

.kokoro/docker/docs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from ubuntu:20.10
15+
from ubuntu:20.04
1616

1717
ENV DEBIAN_FRONTEND noninteractive
1818

.kokoro/docs/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ env_vars: {
3030

3131
env_vars: {
3232
key: "V2_STAGING_BUCKET"
33-
value: "docs-staging-v2-staging"
33+
value: "docs-staging-v2"
3434
}
3535

3636
# It will upload the docker image after successful builds.

.kokoro/populate-secrets.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# Copyright 2020 Google LLC.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;}
19+
function msg { println "$*" >&2 ;}
20+
function println { printf '%s\n' "$(now) $*" ;}
21+
22+
23+
# Populates requested secrets set in SECRET_MANAGER_KEYS from service account:
24+
# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com
25+
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
26+
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}"
27+
mkdir -p ${SECRET_LOCATION}
28+
for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g")
29+
do
30+
msg "Retrieving secret ${key}"
31+
docker run --entrypoint=gcloud \
32+
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
33+
gcr.io/google.com/cloudsdktool/cloud-sdk \
34+
secrets versions access latest \
35+
--project cloud-devrel-kokoro-resources \
36+
--secret ${key} > \
37+
"${SECRET_LOCATION}/${key}"
38+
if [[ $? == 0 ]]; then
39+
msg "Secret written to ${SECRET_LOCATION}/${key}"
40+
else
41+
msg "Error retrieving secret ${key}"
42+
fi
43+
done

.kokoro/release/common.cfg

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,18 @@ env_vars: {
2323
value: "github/python-spanner/.kokoro/release.sh"
2424
}
2525

26-
# Fetch the token needed for reporting release status to GitHub
27-
before_action {
28-
fetch_keystore {
29-
keystore_resource {
30-
keystore_config_id: 73713
31-
keyname: "yoshi-automation-github-key"
32-
}
33-
}
34-
}
35-
36-
# Fetch PyPI password
37-
before_action {
38-
fetch_keystore {
39-
keystore_resource {
40-
keystore_config_id: 73713
41-
keyname: "google_cloud_pypi_password"
42-
}
43-
}
44-
}
45-
46-
# Fetch magictoken to use with Magic Github Proxy
47-
before_action {
48-
fetch_keystore {
49-
keystore_resource {
50-
keystore_config_id: 73713
51-
keyname: "releasetool-magictoken"
52-
}
53-
}
26+
# Fetch PyPI password
27+
before_action {
28+
fetch_keystore {
29+
keystore_resource {
30+
keystore_config_id: 73713
31+
keyname: "google_cloud_pypi_password"
32+
}
33+
}
5434
}
5535

56-
# Fetch api key to use with Magic Github Proxy
57-
before_action {
58-
fetch_keystore {
59-
keystore_resource {
60-
keystore_config_id: 73713
61-
keyname: "magic-github-proxy-api-key"
62-
}
63-
}
64-
}
36+
# Tokens needed to report release status back to GitHub
37+
env_vars: {
38+
key: "SECRET_MANAGER_KEYS"
39+
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
40+
}

.kokoro/samples/python3.6/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.6"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py36"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-spanner/.kokoro/test-samples.sh"

.kokoro/samples/python3.7/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.7"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py37"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-spanner/.kokoro/test-samples.sh"

.kokoro/samples/python3.8/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.8"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py38"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-spanner/.kokoro/test-samples.sh"

.kokoro/test-samples.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
2828
git checkout $LATEST_RELEASE
2929
fi
3030

31+
# Exit early if samples directory doesn't exist
32+
if [ ! -d "./samples" ]; then
33+
echo "No tests run. `./samples` not found"
34+
exit 0
35+
fi
36+
3137
# Disable buffering, so that the logs stream through.
3238
export PYTHONUNBUFFERED=1
3339

@@ -101,4 +107,4 @@ cd "$ROOT"
101107
# Workaround for Kokoro permissions issue: delete secrets
102108
rm testing/{test-env.sh,client-secrets.json,service-account.json}
103109

104-
exit "$RTN"
110+
exit "$RTN"

0 commit comments

Comments
 (0)
0