Closed mturley closed 2 years ago
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
/retest
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: ibolton336, mturley
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Implements https://issues.redhat.com/projects/MTRHO/issues/MTRHO-11
Replacement for https://github.com/konveyor/crane-ui-plugin/pull/76 to re-target main from my fork. Thanks so much for your work on this @seanforyou23, I'll get it over the finish line now š
This PR adds a new page to the console called "Application Imports" (for now; all of this terminology is temporary). This page provides:
Under the hood, this PR introduces a new concept called "Pipeline groups" which does not necessarily need to be exposed to the user. A "pipeline group", or a single "application import", is made up of all of the Pipelines and PipelineRuns that were generated by one usage of the import wizard. A group will always have one cutover pipeline (the primary resource), and may have 0 or 1 stage pipelines, and at least 1 PipelineRun for each pipeline. The following annotations are attached to every Pipeline and PipelineRun generated by the wizard, to facilitate this:
crane-ui-plugin.konveyor.io/action
, with value either'stage'
or'cutover'
crane-ui-plugin.konveyor.io/group
, with a string value provided by the user as a name for this group of pipelines. The same string is also used as a prefix for the names of all Pipelines and PipelineRuns in the group.The
useWatchCranePipelineGroups
hook atsrc/api/queries/pipelines.ts
assembles these groups from socket-watched arrays of all Pipelines and PipelineRuns in the namespace. Each of them is returned as aCranePipelineGroup
object which have conveniently indexed properties, and this is the single object passed around all the components of this page.You can also see here that the
CranePipeline
andCranePipelineRun
types have been added. These are just supersets of thePipelineKind
andPipelineRunKind
types with our new action and group annotations on them for typechecking and autocomplete purposes.The page requires a project/namespace to be selected before reaching it (eventually we will be able to streamline this like the Add page and Pipelines pages do in the developer console, but that requires new features in the plugin SDK. See https://github.com/openshift/console/pull/11823). If you reach the page without a selected project it will direct you to the Projects page.
If you reach the page before reaching the wizard, an EmptyState screen will direct you to the wizard. There is also a "start a new import" button in the corner to more easily reach the wizard later.
This PR duplicates a small amount of code from the Console Pipelines UI, the
pipelineRunStatus
function in thesrc/reused/pipelines-plugin/src/utils/pipeline-filter-reducer.ts
file (source copied from https://github.com/openshift/console/blob/master/frontend/packages/pipelines-plugin/src/utils/pipeline-filter-reducer.ts). This allows us to determine the status of a PipelineRun to show in our UI, and like the pipeline visualization and types we have also duplicated insrc/reused/*
we should be sure to keep it up to date and eventually see if we can remove it and consume this code directly from the console some other way.This PR does not include some additional enhancements including updating secrets and small polish items like confirmation dialogs. I'll open issues for those shortly.
Screens
Empty state when the wizard has not been used yet
No tabs present when there is only one pipeline group (stage and cutover buttons are visible because this one is a stateful migration with PVCs selected)
Tabs shown when there are more than one group (no stage button visible because this one is a stateless migration with no PVCs)
History after running some Stage / Cutover PipelineRuns (failing in my test case, but status will match status shown on PipelineRuns page)