Skip to content

Commit 64a04ba

Browse files
chore: update templates (#85)
1 parent 5f3f79d commit 64a04ba

File tree

9 files changed

+59
-15
lines changed

9 files changed

+59
-15
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{"allowedCopyrightHolders": ["Google LLC"],
2+
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
3+
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
4+
"sourceFileExtensions": [
5+
"ts",
6+
"js",
7+
"java",
8+
"sh",
9+
"Dockerfile",
10+
"yaml",
11+
"py",
12+
"html",
13+
"txt"
14+
]
15+
}

packages/google-cloud-containeranalysis/.kokoro/build.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

1616
set -eo pipefail
1717

18-
cd github/python-containeranalysis
18+
if [[ -z "${PROJECT_ROOT:-}" ]]; then
19+
PROJECT_ROOT="github/python-containeranalysis"
20+
fi
21+
22+
cd "${PROJECT_ROOT}"
1923

2024
# Disable buffering, so that the logs stream through.
2125
export PYTHONUNBUFFERED=1
@@ -30,16 +34,16 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
3034
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
3135

3236
# Remove old nox
33-
python3.6 -m pip uninstall --yes --quiet nox-automation
37+
python3 -m pip uninstall --yes --quiet nox-automation
3438

3539
# Install nox
36-
python3.6 -m pip install --upgrade --quiet nox
37-
python3.6 -m nox --version
40+
python3 -m pip install --upgrade --quiet nox
41+
python3 -m nox --version
3842

3943
# If NOX_SESSION is set, it only runs the specified session,
4044
# otherwise run all the sessions.
4145
if [[ -n "${NOX_SESSION:-}" ]]; then
42-
python3.6 -m nox -s "${NOX_SESSION:-}"
46+
python3 -m nox -s ${NOX_SESSION:-}
4347
else
44-
python3.6 -m nox
48+
python3 -m nox
4549
fi

packages/google-cloud-containeranalysis/.kokoro/docs/docs-presubmit.cfg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ env_vars: {
1515
key: "TRAMPOLINE_IMAGE_UPLOAD"
1616
value: "false"
1717
}
18+
19+
env_vars: {
20+
key: "TRAMPOLINE_BUILD_FILE"
21+
value: "github/python-containeranalysis/.kokoro/build.sh"
22+
}
23+
24+
# Only run this nox session.
25+
env_vars: {
26+
key: "NOX_SESSION"
27+
value: "docs docfx"
28+
}

packages/google-cloud-containeranalysis/.kokoro/test-samples.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ for file in samples/**/requirements.txt; do
8787
python3.6 -m nox -s "$RUN_TESTS_SESSION"
8888
EXIT=$?
8989

90-
# If this is a periodic build, send the test log to the Build Cop Bot.
91-
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop.
90+
# If this is a periodic build, send the test log to the FlakyBot.
91+
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
9292
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
93-
chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop
94-
$KOKORO_GFILE_DIR/linux_amd64/buildcop
93+
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
94+
$KOKORO_GFILE_DIR/linux_amd64/flakybot
9595
fi
9696

9797
if [[ $EXIT -ne 0 ]]; then

packages/google-cloud-containeranalysis/.kokoro/trampoline_v2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ if [[ -n "${KOKORO_BUILD_ID:-}" ]]; then
159159
"KOKORO_GITHUB_COMMIT"
160160
"KOKORO_GITHUB_PULL_REQUEST_NUMBER"
161161
"KOKORO_GITHUB_PULL_REQUEST_COMMIT"
162-
# For Build Cop Bot
162+
# For FlakyBot
163163
"KOKORO_GITHUB_COMMIT_URL"
164164
"KOKORO_GITHUB_PULL_REQUEST_URL"
165165
)

packages/google-cloud-containeranalysis/.trampolinerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ required_envvars+=(
2424
pass_down_envvars+=(
2525
"STAGING_BUCKET"
2626
"V2_STAGING_BUCKET"
27+
"NOX_SESSION"
2728
)
2829

2930
# Prevent unintentional override on the default image.

packages/google-cloud-containeranalysis/noxfile.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@
3030
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
3131
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]
3232

33+
# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
34+
nox.options.sessions = [
35+
"unit",
36+
"system",
37+
"cover",
38+
"lint",
39+
"lint_setup_py",
40+
"blacken",
41+
"docs",
42+
]
43+
3344

3445
@nox.session(python=DEFAULT_PYTHON_VERSION)
3546
def lint(session):
@@ -75,6 +86,7 @@ def default(session):
7586
session.install(
7687
"mock", "pytest", "pytest-cov",
7788
)
89+
7890
session.install("-e", ".")
7991

8092
# Run py.test against the unit tests.

packages/google-cloud-containeranalysis/samples/snippets/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8585

8686
# DO NOT EDIT - automatically generated.
8787
# All versions used to tested samples.
88-
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
88+
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]
8989

9090
# Any default versions that should be ignored.
9191
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']

packages/google-cloud-containeranalysis/synth.metadata

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/python-containeranalysis.git",
7-
"sha": "b7f212bfb628366c90fd1d35a451fac01c8585aa"
7+
"sha": "87b9629c7fa91fc18f2c899430c3c14d2b386571"
88
}
99
},
1010
{
@@ -19,14 +19,14 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "41a4e56982620d3edcf110d76f4fcdfdec471ac8"
22+
"sha": "d1bb9173100f62c0cfc8f3138b62241e7f47ca6a"
2323
}
2424
},
2525
{
2626
"git": {
2727
"name": "synthtool",
2828
"remote": "https://github.com/googleapis/synthtool.git",
29-
"sha": "41a4e56982620d3edcf110d76f4fcdfdec471ac8"
29+
"sha": "d1bb9173100f62c0cfc8f3138b62241e7f47ca6a"
3030
}
3131
}
3232
],
@@ -49,6 +49,7 @@
4949
".github/ISSUE_TEMPLATE/feature_request.md",
5050
".github/ISSUE_TEMPLATE/support_request.md",
5151
".github/PULL_REQUEST_TEMPLATE.md",
52+
".github/header-checker-lint.yml",
5253
".github/release-please.yml",
5354
".github/snippet-bot.yml",
5455
".gitignore",

0 commit comments

Comments
 (0)