Uploaded image for project: 'OpenShift Dev Console'
  1. OpenShift Dev Console
  2. ODC-2184

Pipeline getPipelineRunData() Cleanup

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • UI

      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

      1. 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`
      2. Split `getPipelineRunData` into two use-case utilities:
        1. `getPipelineRunDataFromPipeline` - this will just take a Pipeline resource
        2. `getPipelineRunDataFromPreviousRun` - this will just take a PipelineRun resource
      3. 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
      4. 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:

            Unassigned Unassigned
            aballantyne Andrew Ballantyne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: