Skip to content

Commit

Permalink
chor: updating stable/3.2.x branch with latest main commits (#709)
Browse files Browse the repository at this point in the history
* chore: fix release build (#659)

* chore: fix release build

Fix release build by migrating to secret manager secrets and use templated kokoro configs for docs/ and release/

* fix: fix config names

* chore: add populate secrets script

* docs: fix license

* chore: preserve original year

* chore: revert years in manually committed files

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

* chore: update lockfile

* chore: add .kokoro/docker directory

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>

* feat: Added support for check constraint (#679)

* feat: Added support for check constraint

* fix: change decimal out of scale ProgramingError to ValueError

* fix: skip check_constraints tests when running on emmulator

* fix: remove check constraint for emulator

* docs: update docs to show decimal field support and check constraints but no support for unsigned data type (#683)

* test: Performance Testing (#675)

* performance files

* test_benchmark

* performance testing changes

* changes in benchmark performance for prod

* changes to number of runs

* adding comments

* linting changes

* changes for 3.2

* Revert "changes for 3.2"

This reverts commit 488035c.

* adding licence

* chore: release 2.2.1b2 (#685)

Release-As: 2.2.1b2

* chore: release 2.2.1b2 (#687)

* chore: release 2.2.1b2

* Updated CHANGELOG.md

Corrected the change log msg.

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Vikash Singh <3116482+vi3k6i5@users.noreply.github.com>

* fix: Bump version number after 2.2.1b2 release (#688)

* chor: Update repo to say beta release instead of alpha (#691)

* fix: Bump version number after 2.2.1b2 release

* Update setup.py

Current release is beta so updating the same in setup.py

* chore: release 2.2.1b3 (#693)

Release-As: 2.2.1b3

* chore: release 2.2.1b3 (#694)

* chore: release 2.2.1b3

* Updated CHANGELOG.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Vikash Singh <3116482+vi3k6i5@users.noreply.github.com>

* fix: Bump version number after 2.2.1b3 release (#696)

* chore: release 2.2.1b3

Release-As: 2.2.1b3

* fix: Bump version number after 2.2.1b3 release

* fix: add test samples script and related kokoro files

* fix: correct repo name from python-spanner to python-spanner-django

* fix: correct license from Apache to BSD style

* docs: lint fix for samples (#697)

* Docs: fix changelog link and sample examples. (#700)

* docs: update docs to show decimal field support and check constraints but no support for unsigned data type

* docs: linked changelog correctly

* docs: fix doc links for sample examples

* fix: skip test cursor_executemany_with_empty_params_list as spanner support is not there

* docs: update dbapi location in overview asset file (#702)

* chore: migrate to main branch (#706)

* chore: migrate to main branch

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* use latest post processor image

* remove obsolete replacements in owlbot.py

* update post processor image

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>

Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Astha Mohta <35952883+asthamohta@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
7 people committed Sep 16, 2021
1 parent 306eeba commit 736a84a
Show file tree
Hide file tree
Showing 74 changed files with 1,106 additions and 230 deletions.
9 changes: 9 additions & 0 deletions .github/.OwlBot.lock.yaml
@@ -0,0 +1,9 @@
# Copyright 2021 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

docker:
image: gcr.io/repo-automation-bots/owlbot-python:latest
digest: sha256:0ffe3bdd6c7159692df5f7744da74e5ef19966288a6bf76023e8e04e0c424d7d
8 changes: 8 additions & 0 deletions .github/.OwlBot.yaml
@@ -0,0 +1,8 @@
# Copyright 2021 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

docker:
image: gcr.io/repo-automation-bots/owlbot-python:latest
2 changes: 1 addition & 1 deletion .github/workflows/django_tests_against_emulator0.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: django-tests0
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/django_tests_against_emulator1.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: django-tests1
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/django_tests_against_emulator2.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: django-tests2
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/django_tests_against_emulator3.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: django-tests3
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/django_tests_against_emulator4.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: django-tests4
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/django_tests_against_emulator5.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: django-tests5
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/django_tests_against_emulator6.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: django-tests6
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/django_tests_against_emulator7.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: django-tests7
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/django_tests_against_emulator8.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: django-tests8
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/django_tests_against_emulator9.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: django-tests9
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests-against-emulator.yml
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
name: Run Django Spanner integration tests against emulator
jobs:
Expand Down
14 changes: 3 additions & 11 deletions .kokoro/build.sh
@@ -1,17 +1,9 @@
#!/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.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

set -eo pipefail

Expand Down
49 changes: 5 additions & 44 deletions .kokoro/docker/docs/Dockerfile
@@ -1,16 +1,8 @@
# 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
#
# 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.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

from ubuntu:20.04

Expand Down Expand Up @@ -40,6 +32,7 @@ RUN apt-get update \
libssl-dev \
libsqlite3-dev \
portaudio19-dev \
python3-distutils \
redis-server \
software-properties-common \
ssh \
Expand All @@ -59,40 +52,8 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /var/cache/apt/archives/*.deb


COPY fetch_gpg_keys.sh /tmp
# Install the desired versions of Python.
RUN set -ex \
&& export GNUPGHOME="$(mktemp -d)" \
&& echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \
&& /tmp/fetch_gpg_keys.sh \
&& for PYTHON_VERSION in 3.7.8 3.8.5; do \
wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
&& wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \
&& rm -r python-${PYTHON_VERSION}.tar.xz.asc \
&& mkdir -p /usr/src/python-${PYTHON_VERSION} \
&& tar -xJC /usr/src/python-${PYTHON_VERSION} --strip-components=1 -f python-${PYTHON_VERSION}.tar.xz \
&& rm python-${PYTHON_VERSION}.tar.xz \
&& cd /usr/src/python-${PYTHON_VERSION} \
&& ./configure \
--enable-shared \
# This works only on Python 2.7 and throws a warning on every other
# version, but seems otherwise harmless.
--enable-unicode=ucs4 \
--with-system-ffi \
--without-ensurepip \
&& make -j$(nproc) \
&& make install \
&& ldconfig \
; done \
&& rm -rf "${GNUPGHOME}" \
&& rm -rf /usr/src/python* \
&& rm -rf ~/.cache/

RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
&& python3.7 /tmp/get-pip.py \
&& python3.8 /tmp/get-pip.py \
&& rm /tmp/get-pip.py

CMD ["python3.7"]
CMD ["python3.8"]
18 changes: 5 additions & 13 deletions .kokoro/docker/docs/fetch_gpg_keys.sh
@@ -1,21 +1,13 @@
#!/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
#
# 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.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

# A script to fetch gpg keys with retry.
# Avoid jinja parsing the file.
#
#

function retry {
if [[ "${#}" -le 1 ]]; then
Expand All @@ -42,4 +34,4 @@ retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
E3FF2839C048B25C084DEBE9B26995E310250568

#
#
2 changes: 1 addition & 1 deletion .kokoro/docs/common.cfg
Expand Up @@ -62,4 +62,4 @@ before_action {
keyname: "docuploader_service_account"
}
}
}
}
35 changes: 35 additions & 0 deletions .kokoro/populate-secrets.sh
@@ -0,0 +1,35 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

set -eo pipefail

function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;}
function msg { println "$*" >&2 ;}
function println { printf '%s\n' "$(now) $*" ;}


# Populates requested secrets set in SECRET_MANAGER_KEYS from service account:
# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}"
mkdir -p ${SECRET_LOCATION}
for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g")
do
msg "Retrieving secret ${key}"
docker run --entrypoint=gcloud \
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
gcr.io/google.com/cloudsdktool/cloud-sdk \
secrets versions access latest \
--project cloud-devrel-kokoro-resources \
--secret ${key} > \
"${SECRET_LOCATION}/${key}"
if [[ $? == 0 ]]; then
msg "Secret written to ${SECRET_LOCATION}/${key}"
else
msg "Error retrieving secret ${key}"
fi
done
14 changes: 3 additions & 11 deletions .kokoro/publish-docs.sh
@@ -1,17 +1,9 @@
#!/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.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

set -eo pipefail

Expand Down
20 changes: 5 additions & 15 deletions .kokoro/release.sh
@@ -1,19 +1,9 @@
#!/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.

#!/bin/bash
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

set -eo pipefail

Expand All @@ -28,7 +18,7 @@ python3 -m pip install --upgrade twine wheel setuptools
export PYTHONUNBUFFERED=1

# Move into the package, build the distribution and upload.
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google_cloud_pypi_password")
TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token")
cd github/python-spanner-django
python3 setup.py sdist bdist_wheel
twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/*
twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*
42 changes: 4 additions & 38 deletions .kokoro/release/common.cfg
Expand Up @@ -23,42 +23,8 @@ env_vars: {
value: "github/python-spanner-django/.kokoro/release.sh"
}

# Fetch the token needed for reporting release status to GitHub
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "yoshi-automation-github-key"
}
}
}

# Fetch PyPI password
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "google_cloud_pypi_password"
}
}
}

# Fetch magictoken to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "releasetool-magictoken"
}
}
}

# Fetch api key to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "magic-github-proxy-api-key"
}
}
# Tokens needed to report release status back to GitHub
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token"
}
2 changes: 1 addition & 1 deletion .kokoro/release/release.cfg
@@ -1 +1 @@
# Format: //devtools/kokoro/config/proto/build.proto
# Format: //devtools/kokoro/config/proto/build.proto

0 comments on commit 736a84a

Please sign in to comment.