-
Notifications
You must be signed in to change notification settings - Fork 11
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
"Application Imports" management page - initial implementation #88
Conversation
Skipping CI for Draft Pull Request. |
30d23db
to
49556c6
Compare
89fd7fd
to
1ad0097
Compare
…ails/history under tabs
ec92ce4
to
d34d80d
Compare
4bf296d
to
630526d
Compare
672e57a
to
b1fd5d8
Compare
/retest |
708f600
to
5761ce1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Great work Mike!
[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
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Implements https://issues.redhat.com/projects/MTRHO/issues/MTRHO-11
Replacement for #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 openshift/console#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)