-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Nr. 3 - [TEP-0056]: Implement Pipelines-in-Pipelines reconciliation. #8879
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?
Nr. 3 - [TEP-0056]: Implement Pipelines-in-Pipelines reconciliation. #8879
Conversation
[TEP-0056]: Third PR of Pipelines-in-Pipelines feature implementation. Child `PipelineRuns` (PinP) are created by the `PipelineRun` reconciler, equal to the `TaskRun/CustomRun` implementations. An event handler for child `PipelineRuns` is registered in controller entrypoint. This will trigger the reconciliation loop when child `PipelineRuns` change their state. Extend `resolvePipelineState` with getter for child `PipelineRuns` using lister and extend `runNextSchedulableTask` with a condition check for a `PipelineTask` which is a `Pipeline` and implement the creation of a new `PipelineRun` from the resolved pipeline state and pipeline facts. Setting the `ChildReferences` was extended for child `PipelineRuns`. Rename label/annotation factory. The unit/e2e test framework was refactored and extended to prepare for future tests. The test setup is a parent pipeline with one or more embedded child/grandchild pipelines using the `PipelineSpec` (alpha) field. It follows the given-when-then test flow arrangement. The pipeline manifests yaml definitions use variables for every field which is validated. Multiple helper functions were created equal to reconciliation unit tests for TaskRuns/CustomRuns. Test data factory functions were put in the `testing` package in the `factory.go` file. The unit tests validates: - the status and condition of the parent PipelineRuns which should trigger the creation of the child PipelineRuns, - the actual created child/grandchild PipelineRuns if they have the correct metadata i.e. name, owner reference, etc. and the embedded pipelines from the `PipelineSpec` fields in the pipeline tasks of the parent pipeline. Similar checks are performed in `TestReconcile` for `TaskRun` and in `TestReconcile_V1Beta1CustomTask` for `CustomTasks`. The e2e tests validate: - parent PipelineRun creation, - child PipelineRun creation, - successful finish of all resources, - correct label and annotation propagation, - amount of events published. Similar checks are performed in `TestPipelineRun|TestPipelineRunStatusSpec|...` for `TaskRun` and in `TestCustomTask` for `CustomTask`. Issues tektoncd#8760, tektoncd#7166. Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found 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 the affected files.
|
Important
Pull request number 3.
The numbering
Nr. 3 - [TEP-0056]
means the PRs must be merged in order. They build on each other.Changes
[TEP-0056]: Third PR of Pipelines-in-Pipelines feature implementation.
Child
PipelineRuns
(PinP) are created by thePipelineRun
reconciler, equal to theTaskRun/CustomRun
implementations.An event handler for child
PipelineRuns
is registered in controller entrypoint. This will trigger the reconciliation loop when childPipelineRuns
change their state.Extend
resolvePipelineState
with getter for childPipelineRuns
using lister and extendrunNextSchedulableTask
with a condition check for aPipelineTask
which is aPipeline
and implement the creation of a newPipelineRun
from the resolved pipeline state and pipeline facts.Setting the
ChildReferences
was extended for childPipelineRuns
.Rename label/annotation factory.
The unit/e2e test framework was refactored and extended to prepare for future tests. The test setup is a parent pipeline with one or more embedded child/grandchild pipelines using the
PipelineSpec
(alpha) field. It follows the given-when-then test flow arrangement.The pipeline manifests yaml definitions use variables for every field which is validated. Multiple helper functions were created equal to reconciliation unit tests for TaskRuns/CustomRuns.
Test data factory functions were put in the
testing
package in thefactory.go
file.The unit tests validates:
PipelineSpec
fields in the pipeline tasks of the parent pipeline.Similar checks are performed in
TestReconcile
forTaskRun
and inTestReconcile_V1Beta1CustomTask
forCustomTasks
.The e2e tests validate:
Similar checks are performed in
TestPipelineRun|TestPipelineRunStatusSpec|...
forTaskRun
and inTestCustomTask
forCustomTask
.Issues #8760, #7166.
Release notes will be added with the last PR which will make this feature functional for users.
/kind feature
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes