-
Story
-
Resolution: Unresolved
-
Undefined
-
None
-
None
Description
`getPipelineRunData` has grown over the various releases it has existed and is doing too much for a single method. Since 4.3 it has suffered from a multiple personality and was possible to support either a Pipeline and/or PipelineRun. This is too much for a utility, especially for the single goal of building a PipelineRun.
Acceptance Criteria
- Move the utilities out of `modals/common/utils.ts` – it's much bigger than what the modals do now; arguably should be in `pipelines-plugin/src/utils/common.ts`
- Split `getPipelineRunData` into two use-case utilities:
- `getPipelineRunDataFromPipeline` - this will just take a Pipeline resource
- `getPipelineRunDataFromPreviousRun` - this will just take a PipelineRun resource
- Wrap the above methods in any additional configurations to manage use-cases
- Such as `generateName` use-cases (from getPipelineRunFromForm), dropping the `metadata.name` for `metadata.generateName`
- Dealing with certain annotation or label situations
- Note the other use-cases around kebab "...AndStay" and "...AndRedirect" for use-cases where piecemeal functionality can occur
- Fix `pipeline-actions.tsx` kebab actions - `rerunPipeline` (and variations of stay/redirect), they take a PipelineRunKind (confusing name to parameters)
- For sanity sake, `reRunPipelineRun` should probably be renamed to `reRunLastRun` as it has a singular and special use-case
Additional Information
Current function layout: