Skip to content

Commit

Permalink
chore: add OwlBot as a required check (#891)
Browse files Browse the repository at this point in the history
* chore: add OwlBot as a required check

* 🦉 Updates from OwlBot post-processor

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

* add replacement in owlbot.py to customize .kokoro/build.sh

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
parthea and gcf-owl-bot[bot] authored Oct 24, 2022
1 parent 7dfeb62 commit f1dcc2b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ branchProtectionRules:
- 'Kokoro'
- 'cla/google'
- 'Kokoro system-3.8'
- 'OwlBot Post Processor'
- pattern: python2
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: true
Expand Down
18 changes: 9 additions & 9 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ cd "${PROJECT_ROOT}"
# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

# Debug: show build environment
env | grep KOKORO

# Setup service account credentials.
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json

# Setup project id.
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")

# Export variable to override api endpoint
export API_ENDPOINT_OVERRIDE

Expand All @@ -43,6 +34,15 @@ export API_VERSION_OVERRIDE
export DUAL_REGION_LOC_1
export DUAL_REGION_LOC_2

# Debug: show build environment
env | grep KOKORO

# Setup service account credentials.
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json

# Setup project id.
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")

# Remove old nox
python3 -m pip uninstall --yes --quiet nox-automation

Expand Down
15 changes: 15 additions & 0 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@
],
)

s.replace(
".kokoro/build.sh",
"export PYTHONUNBUFFERED=1",
"""export PYTHONUNBUFFERED=1
# Export variable to override api endpoint
export API_ENDPOINT_OVERRIDE
# Export variable to override api endpoint version
export API_VERSION_OVERRIDE
# Export dual region locations
export DUAL_REGION_LOC_1
export DUAL_REGION_LOC_2""")

python.py_samples(skip_readmes=True)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)

0 comments on commit f1dcc2b

Please sign in to comment.