Nr. 3 - [TEP-0056]: Implement Pipelines-in-Pipelines reconciliation.#8879
Conversation
|
The following is the coverage report on the affected files.
|
|
/kind feature |
86cc7e7 to
05e788a
Compare
|
@twoGiants this now can be rebased 👼🏼 |
05e788a to
e2c0619
Compare
5ac5277 to
18ab6a7
Compare
[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 <[email protected]> Signed-off-by: Vincent Demeester <[email protected]>
18ab6a7 to
7b864b3
Compare
|
|
There is really something fishy with the example tests and feature-flags |
|
Prior to this, they may affect the other tests (mainly examples one). Signed-off-by: Vincent Demeester <[email protected]>
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 thePipelineRunreconciler, equal to theTaskRun/CustomRunimplementations.An event handler for child
PipelineRunsis registered in controller entrypoint. This will trigger the reconciliation loop when childPipelineRunschange their state.Extend
resolvePipelineStatewith getter for childPipelineRunsusing lister and extendrunNextSchedulableTaskwith a condition check for aPipelineTaskwhich is aPipelineand implement the creation of a newPipelineRunfrom the resolved pipeline state and pipeline facts.Setting the
ChildReferenceswas 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
testingpackage in thefactory.gofile.The unit tests validates:
PipelineSpecfields in the pipeline tasks of the parent pipeline.Similar checks are performed in
TestReconcileforTaskRunand inTestReconcile_V1Beta1CustomTaskforCustomTasks.The e2e tests validate:
Similar checks are performed in
TestPipelineRun|TestPipelineRunStatusSpec|...forTaskRunand inTestCustomTaskforCustomTask.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