From 960a6bda4b1a14545843e701136ff186b871d189 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Tue, 22 Mar 2022 09:14:12 -0600 Subject: [PATCH 1/5] chore: set up CI on v0 branch (#155) Set up GitHub Actions, update release script on v0 --- .github/workflows/docs.yml | 22 +++++++++++++ .github/workflows/lint.yml | 25 +++++++++++++++ .github/workflows/unittest.yml | 57 ++++++++++++++++++++++++++++++++++ .kokoro/release.sh | 6 ++-- .kokoro/release/common.cfg | 34 +++----------------- 5 files changed, 111 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..fe1c768 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,22 @@ +on: + pull_request: + branches: + - v0 +name: docs +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docs + run: | + nox -s docs diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..9a6016c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +on: + pull_request: + branches: + - v0 +name: lint +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run lint + run: | + nox -s lint + - name: Run lint_setup_py + run: | + nox -s lint_setup_py diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 0000000..e551dbf --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,57 @@ +on: + pull_request: + branches: + - v0 +name: unittest +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + python: ['3.6', '3.7', '3.8'] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run unit tests + env: + COVERAGE_FILE: .coverage-${{ matrix.python }} + run: | + nox -s unit-${{ matrix.python }} + - name: Upload coverage results + uses: actions/upload-artifact@v3 + with: + name: coverage-artifacts + path: .coverage-${{ matrix.python }} + + cover: + runs-on: ubuntu-latest + needs: + - unit + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + - name: Install coverage + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install coverage + - name: Download coverage results + uses: actions/download-artifact@v3 + with: + name: coverage-artifacts + path: .coverage-results/ + - name: Report coverage results + run: | + coverage combine .coverage-results/.coverage* + coverage report --show-missing --fail-under=83 diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 435a387..81194ac 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -eo pipefail # Start the releasetool reporter @@ -28,7 +26,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_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") cd github/python-websecurityscanner python3 setup.py sdist bdist_wheel -twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/* +twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index aa62d0a..0d1ff8f 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,42 +23,18 @@ env_vars: { value: "github/python-websecurityscanner/.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" + keyname: "google-cloud-pypi-token-keystore-1" } } } -# 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" } From 2930307f776231b73cbd0d695ca571995f6485f9 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Fri, 25 Mar 2022 12:48:40 -0600 Subject: [PATCH 2/5] fix(deps): require google-api-core >= 1.31.5, >= 2.3.2 on v0 release (#154) * chore(deps): allow google-api-core v2 on v0 release * chore: run blacken * ci: run unittest/lint/docs as gh actions * ci: fix docs build Co-authored-by: Anthonios Partheniou --- noxfile.py | 2 +- setup.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 984ae5a..4bb9a93 100644 --- a/noxfile.py +++ b/noxfile.py @@ -138,7 +138,7 @@ def docs(session): """Build the docs for this library.""" session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") + session.install("sphinx<3.0.0", "alabaster", "recommonmark") shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( diff --git a/setup.py b/setup.py index 40eaf70..4e7086d 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,9 @@ # 'Development Status :: 4 - Beta' # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 3 - Alpha" -dependencies = ["google-api-core[grpc] >= 1.14.0, < 2.0.0dev"] +dependencies = [ + "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0" +] extras = {} From 211e105289c0deca78de1b27816635b947823770 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 16:49:10 -0600 Subject: [PATCH 3/5] chore(v0): release 0.4.1 (#157) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ebcfe1..7a5dda9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-websecurityscanner/#history +### [0.4.1](https://github.com/googleapis/python-websecurityscanner/compare/v0.4.0...v0.4.1) (2022-03-25) + + +### Bug Fixes + +* **deps:** require google-api-core >= 1.31.5, >= 2.3.2 on v0 release ([#154](https://github.com/googleapis/python-websecurityscanner/issues/154)) ([2930307](https://github.com/googleapis/python-websecurityscanner/commit/2930307f776231b73cbd0d695ca571995f6485f9)) + ## [0.4.0](https://www.github.com/googleapis/python-websecurityscanner/compare/v0.3.0...v0.4.0) (2020-01-30) diff --git a/setup.py b/setup.py index 4e7086d..c5d13ae 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-websecurityscanner" description = ("Google Cloud Web Security Scanner API client library",) -version = "0.4.0" +version = "0.4.1" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' From 0c21c12cf1964d805136a2d94b37ae69ff9a27e9 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 9 Jun 2022 11:13:45 -0400 Subject: [PATCH 4/5] fix(deps): require protobuf<4.0.0 on v0 branch (#206) --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c5d13ae..56396b0 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,8 @@ # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 3 - Alpha" dependencies = [ - "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0" + "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", + "protobuf<4.0.0dev", ] extras = {} From 4ec5419a8ccf16e50d09eab6eea67be3349f5db3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 9 Jun 2022 12:24:33 -0400 Subject: [PATCH 5/5] chore(v0): release 0.4.2 (#207) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a5dda9..93a5a57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-websecurityscanner/#history +## [0.4.2](https://github.com/googleapis/python-websecurityscanner/compare/v0.4.1...v0.4.2) (2022-06-09) + + +### Bug Fixes + +* **deps:** require protobuf<4.0.0 on v0 branch ([#206](https://github.com/googleapis/python-websecurityscanner/issues/206)) ([0c21c12](https://github.com/googleapis/python-websecurityscanner/commit/0c21c12cf1964d805136a2d94b37ae69ff9a27e9)) + ### [0.4.1](https://github.com/googleapis/python-websecurityscanner/compare/v0.4.0...v0.4.1) (2022-03-25) diff --git a/setup.py b/setup.py index 56396b0..bd23d07 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-websecurityscanner" description = ("Google Cloud Web Security Scanner API client library",) -version = "0.4.1" +version = "0.4.2" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta'