Skip to content

Commit

Permalink
chore: enable owlbot (googleapis#23)
Browse files Browse the repository at this point in the history
* chore: enable owlbot

Change-Id: Idb2a03ab01d414f136a846d18f90329a9a50e4aa

* 🦉 Updates from OwlBot post-processor

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

* revert some owlbot changes

Change-Id: Iabe654bf693d82f5f1afdef7e9663577ded96025

* only exclude common.cfg

Change-Id: I1199737edca971b648ec2cfddb82b4f378b3f97d

* 🦉 Updates from OwlBot post-processor

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

* use correct path in build.sh

Change-Id: I407dc0500f52c52ccd90e108ba821fd518a7fe1d

* decrease coverage and use repo name in 'nightly' build

Change-Id: I7d450364dd234c640d905c9ac2c2a96e7df08d02

* 🦉 Updates from OwlBot post-processor

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

* restore pre-commit checks

Change-Id: Iaf059d5b197d9cc9e87e3d17adf6c7c48ca41cb8

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
tswast and gcf-owl-bot[bot] authored Sep 7, 2023
1 parent e76b5e7 commit ffad464
Show file tree
Hide file tree
Showing 82 changed files with 1,652 additions and 366 deletions.
39 changes: 39 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
#
# Copyright 2023 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.

# Generated by synthtool. DO NOT EDIT!
[run]
branch = True
omit =
google/__init__.py
google/cloud/__init__.py

[report]
fail_under = 35
show_missing = True
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore abstract methods
raise NotImplementedError
omit =
*/gapic/*.py
*/proto/*.py
*/core/*.py
*/site-packages/*.py
google/cloud/__init__.py
4 changes: 1 addition & 3 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,8 +18,6 @@
[flake8]
ignore = E203, E231, E266, E501, W503
exclude =
third_party/**

# Exclude generated code.
**/proto/**
**/gapic/**
Expand Down
17 changes: 17 additions & 0 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2023 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.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:3e3800bb100af5d7f9e810d48212b37812c1856d20ffeafb99ebe66461b61fc7
# created: 2023-08-02T10:53:29.114535628Z
18 changes: 18 additions & 0 deletions .github/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2021 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.

docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest

begin-after-commit-hash: 92006bb3cdc84677aa93c7f5235424ec2b157146
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# For syntax help see:
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
# Note: This file is autogenerated. To make changes to the codeowner team, please update .repo-metadata.json.

# @googleapis/yoshi-python @googleapis/api-bigquery-dataframe are the default owners for changes in this repo
* @googleapis/yoshi-python @googleapis/api-bigquery-dataframe

Expand Down
14 changes: 7 additions & 7 deletions .github/header-checker-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
"java",
"sh",
"Dockerfile",
"yaml",
"ts",
"js",
"java",
"sh",
"Dockerfile",
"yaml",
"py",
"html",
"txt"
]
}
}
2 changes: 1 addition & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ branchProtectionRules:
- 'unit (3.10)'
- 'unit (3.11)'
- 'cover'
# TODO(tswast): add Kokoro once we've enabled it
- 'Kokoro presubmit'
permissionRules:
- team: actools-python
permission: admin
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.8"
- name: Install nox
run: |
python -m pip install --upgrade setuptools pip wheel
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.8"
- name: Install coverage
run: |
python -m pip install --upgrade setuptools pip wheel
Expand All @@ -54,4 +54,4 @@ jobs:
- name: Report coverage results
run: |
coverage combine .coverage-results/.coverage*
coverage report --show-missing --fail-under=40
coverage report --show-missing --fail-under=35
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ pip-log.txt

# Unit test / coverage reports
.coverage
.coverage.*
.nox
.cache
.mypy_cache
.pytest_cache
.pytype


# Mac
Expand All @@ -53,7 +50,6 @@ docs.metadata

# Virtual environment
env/
venv/

# Test logs
coverage.xml
Expand All @@ -65,6 +61,3 @@ system_tests/local_test_setup
# Make sure a generated file isn't accidentally committed.
pylintrc
pylintrc.test

# Notebook scratch
.ipynb_checkpoints
6 changes: 3 additions & 3 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
set -eo pipefail

if [[ -z "${KOKORO_GOB_COMMIT}" ]]; then
PROJECT_SCM="github"
PROJECT_SCM="github/python-bigquery-dataframes"
else
PROJECT_SCM="git"
PROJECT_SCM="git/bigframes"
fi

if [[ -z "${PROJECT_ROOT:-}" ]]; then
PROJECT_ROOT="${KOKORO_ARTIFACTS_DIR}/${PROJECT_SCM}/bigframes"
PROJECT_ROOT="${KOKORO_ARTIFACTS_DIR}/${PROJECT_SCM}"
fi

cd "${PROJECT_ROOT}"
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/continuous/continuous.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Format: //devtools/kokoro/config/proto/build.proto
# Format: //devtools/kokoro/config/proto/build.proto
7 changes: 7 additions & 0 deletions .kokoro/continuous/prerelease-deps.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "prerelease_deps"
}
2 changes: 1 addition & 1 deletion .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
# Test pip
RUN python3 -m pip

CMD ["python3.9"]
CMD ["python3.8"]
14 changes: 10 additions & 4 deletions .kokoro/docs/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "bigframes/.kokoro/trampoline_v2.sh"
build_file: "python-bigquery-dataframes/.kokoro/trampoline_v2.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand All @@ -20,12 +20,18 @@ env_vars: {
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: ".kokoro/publish-docs.sh"
value: "github/python-bigquery-dataframes/.kokoro/publish-docs.sh"
}

env_vars: {
key: "STAGING_BUCKET"
value: "docs-staging"
}

env_vars: {
key: "V2_STAGING_BUCKET"
# Push google cloud library docs to the Cloud RAD bucket `docs-staging-v2`
# Push non-cloud library docs to `docs-staging-v2-staging` instead of the
# Cloud RAD bucket `docs-staging-v2`
value: "docs-staging-v2"
}

Expand Down Expand Up @@ -58,4 +64,4 @@ before_action {
keyname: "docuploader_service_account"
}
}
}
}
9 changes: 7 additions & 2 deletions .kokoro/docs/docs-presubmit.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "STAGING_BUCKET"
value: "gcloud-python-test"
}

env_vars: {
key: "V2_STAGING_BUCKET"
value: "gcloud-python-test"
Expand All @@ -13,11 +18,11 @@ env_vars: {

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: ".kokoro/build.sh"
value: "github/python-bigquery-dataframes/.kokoro/build.sh"
}

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "docfx"
value: "docs docfx"
}
2 changes: 1 addition & 1 deletion .kokoro/docs/docs.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Format: //devtools/kokoro/config/proto/build.proto
# Format: //devtools/kokoro/config/proto/build.proto
43 changes: 43 additions & 0 deletions .kokoro/populate-secrets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
# Copyright 2023 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.

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
2 changes: 1 addition & 1 deletion .kokoro/presubmit/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ action {
}
}

build_file: "bigframes/.kokoro/build.sh"
build_file: "python-bigquery-dataframes/.kokoro/build.sh"
7 changes: 7 additions & 0 deletions .kokoro/presubmit/prerelease-deps.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "prerelease_deps"
}
2 changes: 1 addition & 1 deletion .kokoro/presubmit/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Format: //devtools/kokoro/config/proto/build.proto
# Format: //devtools/kokoro/config/proto/build.proto
19 changes: 19 additions & 0 deletions .kokoro/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ export PATH="${HOME}/.local/bin:${PATH}"
python3 -m pip install --require-hashes -r .kokoro/requirements.txt
python3 -m nox --version

# build docs
nox -s docs

# create metadata
python3 -m docuploader create-metadata \
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
--version=$(python3 setup.py --version) \
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
--distribution-name=$(python3 setup.py --name) \
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)

cat docs.metadata

# upload docs
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket "${STAGING_BUCKET}"


# docfx yaml files
nox -s docfx

Expand Down
Loading

0 comments on commit ffad464

Please sign in to comment.