-
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
Cloud Event pipeline resource #1091
Conversation
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from three pull requests: - tektoncd#1090 - tektoncd#1091 - tektoncd#1092 It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
32af6d1
to
45329e0
Compare
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
45329e0
to
f92f210
Compare
The following is the coverage report on pkg/.
|
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.
Thanks for breaking this up, it is much easier to review! (Apologies for the parts where the context is missing and so I'm asking about it - however I think being able to understand it in the context of just this code via comments will be useful anyway!) ❤️
f92f210
to
43648e4
Compare
The following is the coverage report on pkg/.
|
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.
Left a couple thoughts but generally I think it's looking good! A couple typos maybe to fix but otherwise I would /lgtm!
Will approve anyway:
/approve
// GetUploadContainerSpec returns nothing as the cloud event is sent by the controller once the POD execution is completed | ||
func (s *CloudEventResource) GetUploadContainerSpec() ([]corev1.Container, error) { | ||
return nil, nil | ||
} |
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.
The fact that we have no upload or download container spec here I think is interesting and I think hints that maybe a PipelineResource
isn't the way we want to go with this in the long run - but I think this is fine for now!
Maybe in the future we can either:
- Make it so that emitting events during / before / after Pipeline execution is something the controller always does when provided with a sink
- Make it so we have a "finally" clause that allows a PipelineResource like this to be invoked and actually have the context of whether the PipelineRun succeeded or not
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.
Yeah, I wanted to do this using a container scheduled to be executed as the last one in the Pod, but it didn't work out, so we might switch this in future to be something like you proposed.
I like both the ideas you proposed, I think what I need to do is to put together a design for a more general concept of notifications
One thing that I wanted to highlight is that the way this will be used in #837 is for TaskRun notifications, as opposed to PipelineRun.
Both TaskRun and PipelineRun end notifications can be useful, but I focused on TaskRun first because it fits well with the use cases I included in the design.
In the demo that I presented at the OSS I have a pipeline that builds a docker image, runs unit testing and runs a code lint, the three in parallel. All three tasks send a notifications once they're done, and the notification triggers different TaskRuns depending on the source (identified via a label on the TaskRun). This makes it possible to publish test results on GitHub using the PullRequestPipelineResource as soon as the corresponding task is complete, with no need to wait for the other Tasks - i.e. I don't necessarily want to wait for the image build to be complete before I can see the unit test results.
43648e4
to
bb020ac
Compare
The following is the coverage report on pkg/.
|
One minor comment otherwise looks good to me |
We can fix that comment after merge. /lgtm |
/retest |
2 similar comments
/retest |
/retest |
Oh, the resource interface changed, I need to update this :P |
bb020ac
to
de64a44
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli, bobcatfish 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 |
The following is the coverage report on pkg/.
|
Looks like just the generated code changed, is that right @afrittoli ? |
de64a44
to
403fbc8
Compare
The following is the coverage report on pkg/.
|
403fbc8
to
f4d8028
Compare
The following is the coverage report on pkg/.
|
/test pull-tekton-pipeline-build-tests |
Define a new type of PipelineResource for cloud events. This resource can be used as an output only. The resource is only defined here, it's not functional yet. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
f4d8028
to
281b799
Compare
The following is the coverage report on pkg/.
|
/lgtm |
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from four pull requests: - tektoncd#1090 - tektoncd#1091 - tektoncd#1092 - TBD TBD: address review comments TBD: test for interaction with the image digest export It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from four pull requests: - tektoncd#1090 - tektoncd#1091 - tektoncd#1092 TBD: Test for interaction with the image digest export It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from four pull requests: - tektoncd#1090 - tektoncd#1091 - tektoncd#1092 TBD: Test for interaction with the image digest export It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from four pull requests: - tektoncd#1090 - tektoncd#1091 - tektoncd#1092 TBD: Test for interaction with the image digest export It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from four pull requests: - tektoncd#1090 - tektoncd#1091 - tektoncd#1092 It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from four pull requests: - tektoncd#1090 - tektoncd#1091 - tektoncd#1092 It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from four pull requests: - tektoncd#1090 - tektoncd#1091 - tektoncd#1092 It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from four pull requests: - tektoncd#1090 - tektoncd#1091 - tektoncd#1092 It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from four pull requests: - tektoncd#1090 - tektoncd#1091 - tektoncd#1092 It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
Implements in the TaskRun controller the logic to provide the cloud event pipeline resource. This commits puts together the API, cloud event helper and resource definition from four pull requests: - #1090 - #1091 - #1092 It adds unit tests for the new code and one E2E YAML test. The YAML test runs a simple http server that can receive the cloudevent for test purposes. The list of cloud events to be sent is added to the TaskRun status and processed by the TaskRun controller once the pod associated to the TaskRun completes its execution. The `isDone` definition of the TaskRun is not altered, the reconciler checks for events to be sent once the TaskRun.isDone is true. Retries are not implemented yet in the sense that every scheduled event will be attempted exactly once, but it may be that those attempts happen across different invocations of Reconcile. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
Changes
Define a new type of PipelineResource for cloud events.
This resource can be used as an output only. The resource is only
defined here, it's not functional yet.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
There's not much to be unit tested in this PR. This is tested by a PR on top that actually implements the logic behind the cloud event pipeline resource.
See the contribution guide for more details.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task and TaskRun to build and release this image