-
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
google_cloudbuild_trigger Pub/Sub and Webhook configs need repo/branch info #9936
Comments
Looking at the REST API documentation, it seems that all of the pubsub fields available on the API are also available on pubsub_config. I think you might be looking for the If repo_source doesn't do what you need, please give some more details about which parts of the REST API are not supported. |
Well, the So, the current workaround is that you have to specify a complete Build Template within the resource when using Pub/Sub triggers. I am sorry, but this is not the same what the REST API and the The whole trigger resource looks very confusing to me. Serveral places to define same things etc. I think it needs a complete overhaul. Perhaps you should less refer to the REST API documentation, and more to the |
@albrechtflo-hg Unfortunately, we are not able to provide a custom experience on top of the API the way that gcloud does. Deviating from the REST API tends to cause more maintenance headaches for us in the long run than it's worth. If there is a way to accomplish your goal with the REST API without specifying a whole build template, that is definitely something we should support, and it might be considered a bug. However, if it's complicated in the REST API, then that's how it will be in the Terraform provider as well. |
@melinath It is really not that complicated:
I'd be very happy to see that done with the provider. |
Thanks for that sample API request! That clarifies things a lot. It looks like you're asking for two new fields: gitFileSource and sourceToBuild. That makes this an enhancement request rather than a bug, since it's new fields rather than fixing an issue with existing fields. There's already an enhancement request open for these fields if you'd like to vote for it: #9883 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.The relatively new feature for creating Pub/Sub based Cloud Build triggers (see #8692 and GoogleCloudPlatform/magic-modules#4931) does not support specifying a source repository and a branch.
While this may be seen as missing feature, please note that the Google docs of the associated
gcloud
command clearly state that both repo and branch must be specified for a Pub/Sub trigger.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
A working Pub/Sub based Cloud Build trigger is being created.
Actual Behavior
The resulting Cloud Build trigger is useless and does nothing when messages on the Pub/Sub topic arrive (well, because it does not know what to do). Please note that the resulting trigger also has no RUN option in the Google Cloud console, while manually created triggers do.
To be precise, the trigger does trigger a Cloud Build when a Pub/Sub message arrives, but immediately fails with this very nice error message (seen in the Google Cloud Console):
That's all, no more information.
Steps to Reproduce
terraform apply
Important Factoids
To me, it seems quite strange that creating such a trigger is allowed at all by the Google REST API. My thought was that this is a bug in the Google API, related to a bug I reported to Google a few months ago, which has been fixed in the meantime: https://issuetracker.google.com/issues/191394513
But in the discussion of the PR, the contributor pointed out that there may be use cases for such triggers (I must admit that I do not fully understand their argument). Personally, I'd stick with the Google docs stating that both repo and branch are required fields.
The text was updated successfully, but these errors were encountered: