-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Added pubsubConfig and webhookConfig support to the cloud build resource. #4931
Added pubsubConfig and webhookConfig support to the cloud build resource. #4931
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
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. @c2thorn, please review this PR or find an appropriate assignee. |
@googlebot I signed it! |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@googlebot I fixed it. |
@iamsumit, sorry about this, but could you rebase off of the latest master commit? We changed our CI and unfortunately it means our tests won't run without doing so. |
0bb3535
to
4f26d7f
Compare
@c2thorn I have rebased it. Thank you. |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 3 files changed, 532 insertions(+), 5 deletions(-)) |
@c2thorn Is there anything I have to do for the failing test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid, just requesting a few schema changes. Thanks for adding the update tests in there as well!
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 3 files changed, 529 insertions(+), 5 deletions(-)) |
@c2thorn A gentle reminder to review this PR. Please do let me know if there is anything I am missing? |
/gcbrun |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 3 files changed, 529 insertions(+), 5 deletions(-)) |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccBigQueryDataTable_jsonEquivalency|TestAccCloudBuildTrigger_pubsub_config|TestAccCloudBuildTrigger_webhook_config|TestAccComputeInstance_updateRunning_desiredStatusNotSet_notAllowStoppingForUpdate|TestAccComputeInstance_updateRunning_desiredStatusRunning_notAllowStoppingForUpdate|TestAccContainerNodePool_withGPU|TestAccPrivatecaCaPool_privatecaCapoolUpdate|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityBasicExample|TestAccPrivatecaCertificate_privatecaCertificateConfigExample|TestAccPrivatecaCertificate_privatecaCertificateNoAuthorityExample You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=195858 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relevant tests have passed
Tests failed during RECORDING mode: TestAccPrivatecaCaPool_privatecaCapoolUpdate|TestAccPrivatecaCertificate_privatecaCertificateNoAuthorityExample|TestAccContainerNodePool_withGPU Please fix these to complete your PR |
@c2thorn So, I checked that the 3.75 includes the changes but when I used that on my local, it doesn't work. Did we miss anything? |
@iamsumit the release was cut before this change. https://github.com/hashicorp/terraform-provider-google/commits/release-3.75.0 shows the commits in 3.75, I believe your link shows the differences between This should be released next week on Monday |
@c2thorn Aah. My bad. Thank you for confirming. |
I've updated to version v3.77.0, but it appears that this feature is still missing some functionality. I do not see a way to specify the repo/branch info. These fields are required when creating a pubsub trigger from the GCP console. Did I miss something in the docs, or is feature not complete yet? |
There is no parameter in Google API documentation to specify this information. I know it is required in the UI, but it seems like a bug, and there is no need to specify those in the terraform or over the rest API. |
@iamsumit It seems that |
I would suggest submitting a new Github issue outlining the problem here so it can get assigned and tracked. |
I have the same issue using webhookConfig being unable to specify a source repo |
Did anyone already create an issue for the missing repo information? If yes, please link the issue here. FYI @iamsumit The fact that the repo could not / had not to be passed via REST API was most likely a bug in the Google API. We reported a related bug to them within our support subscription, and that has been fixed about four weeks ago (previously, it was not even possible to create a Pub/Sub trigger with a repository reference using either REST API or But, if you refer to their gcloud docs (https://cloud.google.com/sdk/gcloud/reference/alpha/builds/triggers/create/pubsub), you will see that there is a So, this feature here seems indeed completely unusable ATM (also because of the missing If no one responds regarding a created bug issue, I will create one next week. |
@albrechtflo-hg I was aware of the fact that this was not part of the API. We actually talked to Google folks about the missing rest API as you said the rest API was not documented earlier. They added it after our discussion only. Our primary need was to use the webhook trigger only so I didn't pursue it further. It's not just about the issue of missing repo key in the API but also I noticed that the configuration form was not showing the pub/sub button checked and the the rest API doesn't need the repo. I did told them but didn't raise any issue in the google issue tracker. I wonder why the repo is required in pub/sub trigger. It should be optional just like it is in the webhook trigger. |
@iamsumit But if you do not specify a repo, what shall the Cloud Build build? |
@albrechtflo-hg The requirement is quite complicated. Let's say the code is on GitHub's private repository and cloud build needs to access it, it requires authorisation using manual actions. What if we don't want automate the process? So, the idea is to give cloud build an access token to access the private repository and then do its thing. I hope this make sense. |
I had meant to create an issue but didn't get around to it before I went on vacation, and then I forgot about it. Please go ahead since it sounds like you have more details about the issue than I currently have/remember. |
To be honest, no, it does not make sense to me - I do not understand that use case. How should the build know what to do with the GitHub repository? And why should there be manual steps involved in a Pub/Sub based trigger? (There is a manual trigger for this, isn't it?) I now have created a bug issue for this: hashicorp/terraform-provider-google#9936 Perhaps you could add some .tf examples there for this use case. In any case, discussions should be continued there. |
…rce. (GoogleCloudPlatform#4931) Co-authored-by: Sumit Madan <[email protected]>
I guess this currently only allows you to trigger cloudbuilds defined inline without any associated repository? It seems like at the very least you could allow |
Google have API documentation to create a pub/sub and webhook trigger in the cloud build resource, but, the terraform google provider doesn't. I have updated the terraform resource to add that support.
Fixes hashicorp/terraform-provider-google#8692, hashicorp/terraform-provider-google#9189
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)