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

Support of Pub/Sub by CloudBuildTrigger #447

Closed
evgenybenchsci opened this issue Apr 9, 2021 · 16 comments
Closed

Support of Pub/Sub by CloudBuildTrigger #447

evgenybenchsci opened this issue Apr 9, 2021 · 16 comments
Labels
enhancement New feature or request

Comments

@evgenybenchsci
Copy link

It is possible to configure Pub/Sub topic as build trigger using the console, however, CloudBuildTrigger lacking this functionality.

There is a scenario, where we have to use Pub/Sub message to trigger the build. The whole infrastructure uses ConfigConnector, so it is painful to create this specific trigger manually. Is it possible to extend CloudBuildTrigger to match functionality provided by the managed resources?

@evgenybenchsci evgenybenchsci added the enhancement New feature or request label Apr 9, 2021
@maqiuyujoyce
Copy link
Collaborator

Hi @evgenybenchsci , thank you for your request. Once the pubsub trigger is supported in the Terraform resource (issue #8692), then we will be able to support it in Config Connector. We will post updates when we have new information.

@tonybenchsci
Copy link

@maqiuyujoyce Is it always going to be Terraform resource lags GCP API, and KCC resource lags Terraform resource? One would think that KCC being google internal would be ahead of Terraform. Just curious how the behind the scenes of resource support roll out works :)

@xiaobaitusi
Copy link
Contributor

Hi @tonybenchsci, KCC has been in a process of migrating off Terraform to another actuation engine, so for new resource added in KCC, we will not expect the intermediate lag from Terraform.

@mikelnrd
Copy link

mikelnrd commented May 29, 2021

@xiaobaitusi

Hi @tonybenchsci, KCC has been in a process of migrating off Terraform to another actuation engine, so for new resource added in KCC, we will not expect the intermediate lag from Terraform.

Is this migration documented anywhere? I'd be interested to read more about the new actuation engine. Thanks.

Edit: Is this the new actuation engine? https://github.com/GoogleCloudPlatform/declarative-resource-client-library

@xiaobaitusi
Copy link
Contributor

Is this the new actuation engine? https://github.com/GoogleCloudPlatform/declarative-resource-client-library

Yes, this is the new actuation engine used by KCC.

@tonybenchsci
Copy link

Any idea when pubsub triggered cloudbuildtriggers will be supported? (regardless if terraform or DCL)

@tonybenchsci
Copy link

tonybenchsci commented Aug 9, 2021

@maqiuyujoyce @xiaobaitusi We have installed KCC v1.58.0, which supports spec.pubsubConfig. However it doesn't support spec.filter which is almost always used with pubsub-based triggers. Is that planned?

error validating data: ValidationError(CloudBuildTrigger.spec): unknown field "filter" in com.google.cloud.cnrm.cloudbuild.v1beta1.CloudBuildTrigger.spec; if you choose to ignore these errors, turn validation off with --validate=false

@jcanseco
Copy link
Member

Hi @tonybenchsci, thanks for raising this up. This one's likely just an oversight. Filed the appropriate issue against TF at hashicorp/terraform-provider-google#9755.

@tonybenchsci
Copy link

tonybenchsci commented Aug 10, 2021

Thanks @jcanseco ! Another issue: the schema only allows one of spec.github OR spec.pubsubConfig. However, GCP expects both to be set (the github repo and branch are required to check out the code to do stuff), so it's currently unusable.

@jcanseco
Copy link
Member

No problem @tonybenchsci!

Re: new issue: This one is interesting since I can see that it should be possible to create a pubsub-based trigger that builds a GitHub repo using the UI (correct me if I'm wrong).

However, if I try to create a CloudBuildTrigger with both fields specified, we get the following error which seems to be coming from the API (judging by the googleapi string):

Update call failed: error applying desired state: summary: Error creating Trigger: googleapi: Error 400: cannot set more than one trigger config, detail:

Let me check with the Cloud Build team internally to see what's going on here.

@jcanseco
Copy link
Member

Hi @tonybenchsci, apologies; took a while to get a response internally.

It turns out that the github field from the API is only used if you want to have the trigger be triggered by GitHub events such as pull requests (i.e. the "trigger's type") and have the trigger build a GitHub repo (i.e. the "trigger's source").

If you want to create a trigger that is triggered by PubSub messages and which builds GitHub repos (or CSR repos for that matter), you have to use the pubsubConfig and sourceToBuild fields.

This is also true for triggers that are triggered by webhook requests: you have to specify sourceToBuild to actually specify the repo to build.

We currently don't support sourceToBuild, though it turns out that there is already an existing Terraform request for the field, so I went ahead and let them know of your need for the field as well.

@tty47
Copy link

tty47 commented Nov 29, 2021

Hello!

Any news about that issue or any workaround to configure? :S

@jcanseco
Copy link
Member

Hi @jrmanes. We don't have an update for you yet, unfortunately. Once Terraform implements the field, we can bring it over to KCC. We'll update this thread accordingly once we add support.

@bharathkkb
Copy link
Member

@jcanseco any updates on this?

@jcanseco
Copy link
Member

Hi @bharathkkb, none yet unfortunately as it seems Terraform hasn't picked up the request yet (their team is quite overloaded right now as I understand).

@jcanseco
Copy link
Member

jcanseco commented Apr 4, 2022

Hello folks, it seems we now support sourceToBuild in KCC 1.79.0. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants