-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 TektonListener to accept events and trigger pipeline/task runs #783
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: iancoffey If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
A few high level comments, thanks for sending this out!
cmd/pipelinelistener/README.md
Outdated
spec: | ||
serviceAccountName: tekton-pipelines-controller | ||
listener-image: github.com/tektoncd/pipeline/cmd/pipelinelistener | ||
event-type: com.github.checksuite |
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.
Is there a way to take data out of the event payload and thread that through into the pipeline via creation of a new resource, or similar?
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.
Here's a strawperson I put together on how binding eventdata into a resource might work: https://gist.github.com/dlorenc/bdd3dc952cd9b9cb10b837224b031214
Any thoughts?
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.
I find this very interesting! Admittedly though, I am still processing how the example EventBinding
type fits into the puzzle, inre: this PR.
Would that kind be used to spawn a listener behind the scenes based on the binding type? Or am I way off :)
I would love to chat about this more, feel free to ping on tekton slack as well.
cmd/pipelinelistener/README.md
Outdated
role: test-build-pipeline-listener | ||
spec: | ||
serviceAccountName: tekton-pipelines-controller | ||
listener-image: github.com/tektoncd/pipeline/cmd/pipelinelistener |
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.
What about storing info like the image used in a configmap or a flag somewhere?
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.
That sounds like a better plan, Ill make that change.
/ok-to-test |
|
@khrm hello, some answers inline:
It creates a statefulset for every listener. Since it creates a listener for any run spec provided - there could also be multiple Listeners for one repo. Thinking of use cases - there may be different events that need to be handled, or you may build different parts of your monorepo based on specific events. I think the implementation allows for almost any combo of repo/branch/pipeline but to be fair I have only tested 1:1:1.
Yes, its possible. My goal for next Tuesdays Tekton WG meet is to understand where this should be added to the experimental repo or if this can land right here once feedback is addressed.
Cool! Thanks. There are many updates coming via the proposal document that will likely change much of this but that part of the spec will likely stay and grow. |
@iancoffey can we close this PR now that we've got https://github.com/tektoncd/experimental/tree/master/tekton-listener ? :D |
yes and ty! |
Changes
Proposal: https://docs.google.com/document/d/1tfG6dkARP2xko-5trDV3D62DJZiXQBZgLtLH7GyUopM/edit#
This is a mostly-functioning WIP of the proposal linked above. It adds a new type, PipelineListener and CRD which allow for a workflow to accept events and trigger pipeline runs end-to-end from any source. This implementation is meant to allow the project to accept any event type, with initial support for CloudEvents, and the ability to add event handling as needed for other types/sources.
Related
This concept started off in the build project, there is some good background there as well.
knative/build#577
knative/build#591
TODO
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide
for more details.
Release Notes