Skip to content
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

Add support for manual builds, git source for webhook/pubsub triggered builds and filter field #5738

Merged
merged 6 commits into from
Mar 4, 2022

Conversation

abhinavrau
Copy link
Contributor

@abhinavrau abhinavrau commented Feb 23, 2022

Fixes hashicorp/terraform-provider-google#10779
Fixes hashicorp/terraform-provider-google#10434
Fixes hashicorp/terraform-provider-google#10387
Fixes hashicorp/terraform-provider-google#9755
Fixes hashicorp/terraform-provider-google#8374
Fixes hashicorp/terraform-provider-google#9189
Fixes hashicorp/terraform-provider-google#9883

Add support for REST fields sourceToBuild and gitFileSource which adds support for manual builds as well as adds support for webhook and pubsub triggered builds with source code.
Also added support for filter field that is used with webhook and pubsub triggered builds.
Also added examples for webhook, pubsub (with filter) and manual build.

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

cloudbuild: Add support for manual builds, git source for webhook/pubsub triggered builds and filter field

@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@slevenick, please review this PR or find an appropriate assignee.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 698 insertions(+), 16 deletions(-))
Terraform Beta: Diff ( 3 files changed, 698 insertions(+), 16 deletions(-))
TF Validator: Diff ( 3 files changed, 126 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 12 files changed, 410 insertions(+))

@slevenick
Copy link
Contributor

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 698 insertions(+), 16 deletions(-))
Terraform Beta: Diff ( 3 files changed, 698 insertions(+), 16 deletions(-))
TF Validator: Diff ( 3 files changed, 126 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 12 files changed, 410 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic|TestAccApigeeEnvironmentIamBindingGenerated|TestAccApigeeEnvironmentIamMemberGenerated|TestAccApigeeEnvironmentIamPolicyGenerated|TestAccCloudBuildTrigger_cloudbuildTriggerPubsubConfigExample|TestAccCloudBuildTrigger_cloudbuildTriggerWebhookConfigExample|TestAccCloudBuildTrigger_cloudbuildTriggerManualExample|TestAccCloudbuildWorkerPool_basic|TestAccContainerCluster_withAuthenticatorGroupsConfig|TestAccEventarcTrigger_BasicHandWritten You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=261062

@slevenick slevenick requested a review from megan07 February 24, 2022 20:18
Copy link
Contributor

@megan07 megan07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that description change, I think everything else looks good! Thank you!

mmv1/products/cloudbuild/api.yaml Outdated Show resolved Hide resolved
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 696 insertions(+), 16 deletions(-))
Terraform Beta: Diff ( 3 files changed, 696 insertions(+), 16 deletions(-))
TF Validator: Diff ( 3 files changed, 126 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 12 files changed, 410 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceSqlDatabaseInstance_basic|TestAccBigqueryReservationAssignment_BasicHandWritten|TestAccCGCSnippet_sqlSqlserverInstanceAuthorizedNetworkExample|TestAccCloudBuildTrigger_cloudbuildTriggerBuildExample|TestAccCloudBuildTrigger_cloudbuildTriggerFilenameExample|TestAccCloudBuildTrigger_cloudbuildTriggerServiceAccountExample|TestAccCloudBuildTrigger_basic|TestAccCloudBuildTrigger_available_secrets_config|TestAccCloudBuildTrigger_disable|TestAccCloudBuildTrigger_fullStep|TestAccContainerCluster_withAuthenticatorGroupsConfig|TestAccEventarcTrigger_BasicHandWritten|TestAccServiceNetworkingPeeredDNSDomain_basic You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=264754

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccContainerCluster_withAuthenticatorGroupsConfig Please fix these to complete your PR

Copy link
Contributor

@megan07 megan07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks so much!

@wyardley
Copy link
Contributor

Does this support the manual approval parameter for builds as well? I had assumed so, but it looks like this is relating to manually triggering builds, not manually approving builds?

@slevenick
Copy link
Contributor

What do you mean by manually approving builds? Is there a particular field/method in the REST API you are looking to use?

@abhinavrau
Copy link
Contributor Author

abhinavrau commented Mar 14, 2022 via email

@wyardley
Copy link
Contributor

@slevenick @abhinavrau yeah, was looking for hashicorp/terraform-provider-google#9880 tho after I read the magic modules PR, realized this was the fix for something different.

lcaggio pushed a commit to lcaggio/magic-modules that referenced this pull request Mar 16, 2022
…d builds and filter field (GoogleCloudPlatform#5738)

* add filter support for cloudbuild

* Add support for sourceToBuild and gitFileSource. Add examples for pubsub_config, webhook_config trigger and manual mode

* Add support for sourceToBuild and gitFileSource. Add examples for pubsub_config, webhook_config trigger and manual mode

* Fix description for field uri in sourceToBuild to be required
lcaggio pushed a commit to lcaggio/magic-modules that referenced this pull request Mar 17, 2022
…d builds and filter field (GoogleCloudPlatform#5738)

* add filter support for cloudbuild

* Add support for sourceToBuild and gitFileSource. Add examples for pubsub_config, webhook_config trigger and manual mode

* Add support for sourceToBuild and gitFileSource. Add examples for pubsub_config, webhook_config trigger and manual mode

* Fix description for field uri in sourceToBuild to be required
@abhinavrau
Copy link
Contributor Author

abhinavrau commented Mar 19, 2022

@slevenick @wyardley I have submitted a PR #5837 for hashicorp/terraform-provider-google#9880. Let me know how it works out.

betsy-lichtenberg pushed a commit to betsy-lichtenberg/magic-modules that referenced this pull request Apr 25, 2022
…d builds and filter field (GoogleCloudPlatform#5738)

* add filter support for cloudbuild

* Add support for sourceToBuild and gitFileSource. Add examples for pubsub_config, webhook_config trigger and manual mode

* Add support for sourceToBuild and gitFileSource. Add examples for pubsub_config, webhook_config trigger and manual mode

* Fix description for field uri in sourceToBuild to be required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment