-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat: migrate code from googleapis/python-cloudbuild #8473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
78d493b
feat!: migrate to use microgenerator (#23)
arithmetic1728 438080d
docs: Adding samples (#69)
dinagraves e5290de
chore(deps): update dependency google-cloud-build to v3.1.0 (#76)
renovate-bot fbf10ce
chore(deps): update dependency google-cloud-build to v3.1.1 (#77)
renovate-bot 4a1354b
chore(deps): update dependency google-cloud-build to v3.2.0 (#80)
renovate-bot de7e062
chore(deps): update dependency google-auth to v1.28.1 (#83)
renovate-bot 466b593
chore(deps): update dependency pytest to v6.2.3 (#85)
renovate-bot 9098a56
chore(deps): update dependency google-auth to v1.30.0 (#87)
renovate-bot 67b2ff1
chore(deps): update dependency pytest to v6.2.4 (#92)
renovate-bot 3b7ad5f
chore(deps): update dependency google-cloud-build to v3.2.1 (#103)
renovate-bot fdc359b
chore(deps): update dependency google-auth to v1.30.1 (#107)
renovate-bot 89a0e56
chore(deps): update dependency google-auth to v1.30.2 (#109)
renovate-bot 9c91ec0
chore(deps): update dependency google-auth to v1.31.0 (#110)
renovate-bot 85ad643
chore(deps): update dependency google-auth to v1.32.0 (#117)
renovate-bot 84df89e
chore(deps): update dependency google-auth to v1.32.1 (#124)
renovate-bot 5ba12d4
chore(deps): update dependency google-cloud-build to v3.3.0 (#125)
renovate-bot 2dec2f3
chore(deps): update dependency google-auth to v1.33.0 (#128)
renovate-bot 3eb3348
chore(deps): update dependency google-auth to v1.33.1 (#133)
renovate-bot b334022
chore(deps): update dependency google-cloud-build to v3.3.1 (#140)
renovate-bot 76e526d
chore(deps): update dependency google-auth to v1.34.0 (#141)
renovate-bot 7a2a3af
chore(deps): update dependency google-cloud-build to v3.3.2 (#144)
renovate-bot bae2d11
chore(deps): update dependency google-auth to v1.35.0 (#148)
renovate-bot aea1f78
chore: add missing import in owlbot.py (#152)
parthea 295e129
chore(deps): update dependency google-auth to v2 (#150)
renovate-bot 943e888
chore(deps): update dependency google-cloud-build to v3.4.0 (#153)
renovate-bot 0aa4f1a
chore(deps): update dependency google-cloud-build to v3.5.0 (#162)
renovate-bot 927ba3a
chore(deps): update dependency pytest to v6.2.5 (#161)
renovate-bot 1c489d0
chore(deps): update dependency google-auth to v2.0.2 (#163)
renovate-bot 20804d7
chore(deps): update dependency google-auth to v2.1.0 (#167)
renovate-bot feec642
chore: blacken samples noxfile template (#168)
gcf-owl-bot[bot] 44284d8
chore(deps): update dependency google-cloud-build to v3.5.1 (#174)
renovate-bot 447a8d9
chore(deps): update dependency google-auth to v2.2.0 (#175)
renovate-bot a66b340
chore(deps): update dependency google-auth to v2.2.1 (#176)
renovate-bot 627fa17
chore: fail samples nox session if python version is missing (#179)
gcf-owl-bot[bot] 36b5d9f
chore(python): Add kokoro configs for python 3.10 samples testing (#186)
gcf-owl-bot[bot] ace00b5
chore(deps): update dependency google-cloud-build to v3.5.2 (#180)
renovate-bot a14ff57
chore(deps): update dependency google-auth to v2.3.0 (#187)
renovate-bot dac754d
chore(deps): update dependency google-cloud-build to v3.6.0 (#188)
renovate-bot 6965596
chore(deps): update dependency google-cloud-build to v3.7.0 (#191)
renovate-bot dea2200
chore(deps): update dependency google-auth to v2.3.1 (#192)
renovate-bot a661fce
chore(deps): update dependency google-auth to v2.3.2 (#194)
renovate-bot 7649cb6
chore(deps): update dependency google-auth to v2.3.3 (#197)
renovate-bot b47ae12
chore(deps): update dependency google-cloud-build to v3.7.1 (#203)
renovate-bot c712324
chore: update python-docs-samples link to main branch (#207)
gcf-owl-bot[bot] bb253f2
chore(samples): Add check for tests in directory (#214)
gcf-owl-bot[bot] 8a29734
chore(python): Noxfile recognizes that tests can live in a folder (#219)
gcf-owl-bot[bot] 23e5799
chore(deps): update all dependencies (#224)
renovate-bot d7c58a3
chore(deps): update dependency pytest to v7.0.1 (#229)
renovate-bot fbe596d
chore(deps): update dependency google-cloud-build to v3.8.0 (#230)
renovate-bot 7e16765
chore: Adding support for pytest-xdist and pytest-parallel (#240)
gcf-owl-bot[bot] 36b3a64
chore(deps): update dependency google-cloud-build to v3.8.1 (#243)
renovate-bot 22fd651
chore(deps): update dependency pytest to v7.1.0 (#246)
renovate-bot de17fa3
chore(deps): update all dependencies (#247)
renovate-bot 2b6dbe2
chore(python): use black==22.3.0 (#250)
gcf-owl-bot[bot] 87967fc
chore(deps): update dependency google-auth to v2.6.3 (#261)
renovate-bot 0d27920
chore(deps): update dependency google-auth to v2.6.4 (#265)
renovate-bot 692eddf
chore(deps): update dependency google-auth to v2.6.5 (#267)
renovate-bot d396ffb
chore(quickstart): clarify private pools instructions (#268)
1479493
chore(python): add nox session to sort python imports (#269)
gcf-owl-bot[bot] 5a6593e
chore(deps): update dependency google-auth to v2.6.6 (#272)
renovate-bot f394338
chore(deps): update dependency pytest to v7.1.2 (#273)
renovate-bot fbb8ef7
chore(deps): update dependency google-cloud-build to v3.8.2 (#278)
renovate-bot 8767483
fix: require python 3.7+ (#308)
gcf-owl-bot[bot] 02490d1
chore(deps): update all dependencies (#300)
renovate-bot 9361e88
chore(deps): update all dependencies (#314)
renovate-bot 088c1d4
chore(deps): update all dependencies (#317)
renovate-bot 8c6f1b5
chore(deps): update dependency google-cloud-build to v3.9.1 (#323)
renovate-bot 4ce6763
chore(python): Add example of using client_options for regional endpo…
joshuamo 8baad9f
chore(deps): update dependency google-auth to v2.11.0 (#325)
renovate-bot c9507fd
chore(deps): update dependency pytest to v7.1.3 (#335)
renovate-bot 98d7986
chore: detect samples tests in nested directories (#339)
gcf-owl-bot[bot] be38215
chore(deps): update dependency google-auth to v2.11.1 (#340)
renovate-bot 42e452f
chore(deps): update dependency google-auth to v2.12.0 (#343)
renovate-bot 28c128f
chore(deps): update dependency google-cloud-build to v3.9.2 (#345)
renovate-bot d41a48c
chore(deps): update dependency google-cloud-build to v3.9.3 (#348)
renovate-bot 335977b
chore(deps): update dependency google-auth to v2.13.0 (#349)
renovate-bot 7934f8a
chore(deps): update dependency pytest to v7.2.0 (#350)
renovate-bot 5af6eb3
chore(deps): update dependency google-auth to v2.14.0 (#354)
renovate-bot 2d33288
Merge remote-tracking branch 'migration/main' into python-cloudbuild-…
donmccasland bfdaf13
Adding 2.7 test
donmccasland 84b6a24
Removing 2.7 test
donmccasland 31a92c9
removing noxfile and adding noxfile_config.py
donmccasland af372c6
Merge branch 'main' into python-cloudbuild-migration
donmccasland e450172
Adding CODEOWNERS and blunderbuss
donmccasland 01c20f0
updating owners
donmccasland 67c7cd8
Update cloudbuild/snippets/quickstart.py
donmccasland 3cf3348
Update cloudbuild/snippets/quickstart_test.py
donmccasland c278ce9
Update cloudbuild/snippets/quickstart_test.py
donmccasland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/CONTRIBUTING.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# 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. | ||
|
||
# Default TEST_CONFIG_OVERRIDE for python repos. | ||
|
||
# You can copy this file into your directory, then it will be imported from | ||
# the noxfile.py. | ||
|
||
# The source of truth: | ||
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/noxfile_config.py | ||
|
||
TEST_CONFIG_OVERRIDE = { | ||
# You can opt out from the test for specific Python versions. | ||
# NOTE: We currently only run the test in Python 3.8. | ||
"ignored_versions": ["2.7"], | ||
# Old samples are opted out of enforcing Python type hints | ||
# All new samples should feature them | ||
"enforce_type_hints": True, | ||
# An envvar key for determining the project id to use. Change it | ||
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a | ||
# build specific Cloud project. You can also use your own string | ||
# to use your own Cloud project. | ||
"gcloud_project_env": "GOOGLE_CLOUD_PROJECT", | ||
# 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', | ||
# A dictionary you want to inject into your test. Don't put any | ||
# secrets here. These values will override predefined values. | ||
"envs": { | ||
}, | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# 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. | ||
|
||
|
||
# [START cloudbuild_quickstart] | ||
import google.auth | ||
from google.cloud.devtools import cloudbuild_v1 | ||
|
||
|
||
def quickstart() -> None: | ||
"""Create and execute a simple Google Cloud Build configuration, | ||
print the in-progress status and print the completed status.""" | ||
|
||
# Authorize the client with Google defaults | ||
credentials, project_id = google.auth.default() | ||
client = cloudbuild_v1.services.cloud_build.CloudBuildClient() | ||
|
||
# If you're using Private Pools or a non-global default pool, add a regional | ||
# `api_endpoint` to `CloudBuildClient()` | ||
# For example, '<YOUR_POOL_REGION>-cloudbuild.googleapis.com' | ||
# | ||
# from google.api_core import client_options | ||
# client_options = client_options.ClientOptions( | ||
# api_endpoint="us-central1-cloudbuild.googleapis.com" | ||
# ) | ||
# client = cloudbuild_v1.services.cloud_build.CloudBuildClient(client_options=client_options) | ||
|
||
build = cloudbuild_v1.Build() | ||
|
||
# The following build steps will output "hello world" | ||
# For more information on build configuration, see | ||
# https://cloud.google.com/build/docs/configuring-builds/create-basic-configuration | ||
build.steps = [{"name": "ubuntu", | ||
"entrypoint": "bash", | ||
"args": ["-c", "echo hello world"]}] | ||
|
||
operation = client.create_build(project_id=project_id, build=build) | ||
# Print the in-progress operation | ||
print("IN PROGRESS:") | ||
print(operation.metadata) | ||
|
||
result = operation.result() | ||
# Print the completed status | ||
print("RESULT:", result.status) | ||
# [END cloudbuild_quickstart] | ||
|
||
|
||
if __name__ == "__main__": | ||
quickstart() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 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 | ||
# | ||
# 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. | ||
|
||
|
||
import pytest | ||
|
||
import quickstart | ||
|
||
|
||
def test_quickstart(capsys: pytest.CaptureFixture) -> None: | ||
quickstart.quickstart() | ||
out, _ = capsys.readouterr() | ||
# Prints in-progress message | ||
assert "hello world" in out | ||
# Prints final status | ||
assert "Status.SUCCESS" in out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pytest==7.2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
google-cloud-build==3.9.3 | ||
google-auth==2.14.0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.