pipeline
pipeline copied to clipboard
Rely on knative/pkg to update TaskRuns
This changes the TaskRun reconciler to never call Update itself; instead, Knative controller infrastructure will be responsible for Updating TaskRuns if it has determined they've changed.
This also changes changeset detection to happen once at init-time, since it doesn't change for the lifetime of the controller.
finishReconcileUpdateEmitEvents is now only responsible for emitting events. This could be simplified even further in a later change.
Proof of concept for https://github.com/tektoncd/pipeline/issues/5146
/kind cleanup
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
- [x] Has Docs included if any changes are user facing
- [x] Has Tests included if any functionality added or changed
- [x] Follows the commit message standard
- [x] Meets the Tekton contributor standards (including functionality, content, code)
- [x] Has a kind label. You can add one by adding a comment on this PR that contains
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep - [x] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
- [x] Release notes contains the string "action required" if the change requires additional action from users switching to the new release
Release Notes
NONE
PR friction log:
- the kind label wasn't set when I created the PR with
/kind cleanup, causing CI ❌ - manually adding the label didn't cause the label check to run, so still ❌
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: To complete the pull request process, please ask for approval from imjasonh after the PR has been reviewed.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/test all (Just realized it was skipping CI.. 🙃 )
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/reconciler/taskrun/taskrun.go | 80.3% | 80.0% | -0.3 |
/test all (Just realized it was skipping CI.. 🙃 )
Yeah, it's got some work to do to pass even the unit tests. I might try this as a smaller change, rather than also refactoring Cloud Events emitting as part of this change.
Stay tuned!
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/reconciler/taskrun/taskrun.go | 80.3% | 80.7% | 0.3 |
It seems something somewhere was depending on this to persist the task labels or something; this fails on the only test that checks that the task label is persisted on the taskrun.
taskrun_test.go:1983: Labels were not added to task run
taskrun_test.go:1986: Did not get expected label (-want, +got): string(
- "test-task",
+ "",
)
Anyway, I'll keep plugging away later.
/test check-pr-has-kind-label
@afrittoli: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:
/test pull-tekton-pipeline-alpha-integration-tests/test pull-tekton-pipeline-build-tests/test pull-tekton-pipeline-integration-tests/test tekton-pipeline-unit-tests
The following commands are available to trigger optional jobs:
/test pull-tekton-pipeline-go-coverage
Use /test all to run all jobs.
In response to this:
/test check-pr-has-kind-label
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
PR friction log:
- the kind label wasn't set when I created the PR with
/kind cleanup, causing CI ❌- manually adding the label didn't cause the label check to run, so still ❌
Thank you for tracking these. They should be fixed now.
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/reconciler/taskrun/taskrun.go | 80.6% | 80.3% | -0.3 |
/retest
@imjasonh what's the status ? 🙃 (it's red right now because of the rebase required I guess ?)
Aside from needing to rebase, I need to figure out why label propagation is broken by this.
I think we're relying on there being two updates of the object in etcd during the initial reconcile, so that cloudevent receivers can see the TaskRun has started, then also see it become Pending (I think). The model knative/pkg expects is that each time through ReconcileKind is zero-or-one etcd update, which conflicts with our usage. I think their model is simpler to understand than ours, and I'd like to get to it, without breaking cloudevents consumers.
...Then I got distracted with other stuff and haven't made it back to work on this. I'll rebase at least so it's not so red, but any help untangling this or better understanding of how this works would be helpful.
Aside from needing to rebase, I need to figure out why label propagation is broken by this.
I think we're relying on there being two updates of the object in etcd during the initial reconcile, so that cloudevent receivers can see the TaskRun has started, then also see it become Pending (I think). The model knative/pkg expects is that each time through
ReconcileKindis zero-or-one etcd update, which conflicts with our usage. I think their model is simpler to understand than ours, and I'd like to get to it, without breaking cloudevents consumers.
The started event and running events are sent during the same reconcile cycle, because I didn't want to rely on two reconcile cycles for that. Not sure why labels would not work... I wonder if it's something about how tests are designed?
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/reconciler/taskrun/taskrun.go | 80.4% | 79.8% | -0.6 |
@imjasonh: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| pull-tekton-pipeline-unit-tests | 3d79456d95c823f0d6d4250c3674a4dddda6bc51 | link | true | /test tekton-pipeline-unit-tests |
| pull-tekton-pipeline-integration-tests | 3d79456d95c823f0d6d4250c3674a4dddda6bc51 | link | true | /test pull-tekton-pipeline-integration-tests |
| pull-tekton-pipeline-alpha-integration-tests | 3d79456d95c823f0d6d4250c3674a4dddda6bc51 | link | true | /test pull-tekton-pipeline-alpha-integration-tests |
Full PR test history. Your PR dashboard.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.
@imjasonh: PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Let me try to tackle this for TaskRun and PipelineRun 🤔