-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow manual triggers without source configuration #16188
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
base: main
Are you sure you want to change the base?
Allow manual triggers without source configuration #16188
Conversation
Remove at_least_one_of validation from source-related fields in google_cloudbuild_trigger to allow manual triggers without any source configuration (trigger_template, github, pubsub_config, etc.). This enables creating triggers with only an inline build block, which can be invoked manually via the Cloud Build API. Fixes hashicorp/terraform-provider-google#16295
|
Hello! I am a robot. Tests will require approval from a repository maintainer to run. Googlers: For automatic test runs see go/terraform-auto-test-runs. @BBBmau, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 33 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
BBBmau
left a comment
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.
After reviewing the original issue. (as well as coming across this comment) it would be best to include approval_config as part of the at_least_one_of in order to require it be explicit when wanting to create a manual trigger.



Description
This PR removes the
AtLeastOneOfvalidation from source configuration fields ingoogle_cloudbuild_trigger, allowing manual triggers to be created without any source configuration (such astrigger_template,github,pubsub_config,webhook_config, orsource_to_build).Background
The GCP Console and
gcloud builds triggers create manualcommand support creating triggers without source configuration, but Terraform's validation was blocking this use case. These manual triggers can only be invoked via the Cloud Build API or GCP Console.Changes
at_least_one_ofvalidation from source-related fields inTrigger.yamlAtLeastOneOffrom state migration schema incloud_build_trigger.go.tmplTestAccCloudBuildTrigger_manualTriggerNoSourceRelated Issues
Fixes hashicorp/terraform-provider-google#16295
References