Skip to content
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

Upgrade odh dashboard to PF5 #1901

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

jenny-s51
Copy link
Contributor

Closes #1694

Description

WIP, do not merge

How Has This Been Tested?

Test Impact

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Commits have been squashed into descriptive, self-contained units of work (e.g. 'WIP' and 'Implements feedback' style messages have been removed)
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit tests & storybook for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change (find relevant UX in the SMEs section).

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@jenny-s51 jenny-s51 added the do-not-merge/work-in-progress This PR is in WIP state label Oct 3, 2023
@openshift-merge-robot openshift-merge-robot added the needs-rebase PR needs to be rebased label Oct 3, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase PR needs to be rebased label Oct 3, 2023
@andrewballantyne
Copy link
Member

Great work! Thanks so much for diving in on this @jenny-s51. This will be a fun one to review haha...

/hold

Also let us not merge this into main until we do some testing on the impact side of things. We have a lot of feature branches and this will be interesting to see of what it does to the code, not to mention the timing of a release. Once you get it out of WIP I don't want it to accidentally get approved, so throwing a hold on it as well 🙂

@openshift-ci openshift-ci bot added the do-not-merge/hold This PR is hold for some reason label Oct 3, 2023
Copy link
Contributor

@dpanshug dpanshug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jenny-s51, There is an issue related to code linting and formatting. To address this, could you please run the following commands:

npm run format
npm run lint:goal

Additionally, it appears that certain components such as Select, Dropdown, and ApplicationLauncher are still imported from PF4. These components have a new implementation and cannot be updated using codemod (source). Are we planning to upgrade these components in this particular issue, or does it require a separate one?

frontend/src/pages/BYONImages/UpdateImageModal.tsx Outdated Show resolved Hide resolved
frontend/src/__tests__/integration/hooks/TestHook.tsx Outdated Show resolved Hide resolved
@dpanshug
Copy link
Contributor

dpanshug commented Oct 4, 2023

Also there is a peer dependency issue with @openshift/dynamic-plugin-sdk-extensions, pls check here

@openshift-merge-robot openshift-merge-robot added the needs-rebase PR needs to be rebased label Oct 4, 2023
Copy link
Contributor Author

@jenny-s51 jenny-s51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dpanshug thanks so much for taking a look at this and for your helpful PR comments. I've addressed a few of them and am still working on resolving some remaining build and UI issues.

As far as updating the deprecated components, that would definitely be the next step, and it would make the most sense to track that work in a follow up issue. Updating the deprecated components may require quite a bit of refactoring, which would be better suited to a review process that is independent of this (already very large) PR. 🙂

@jenny-s51 jenny-s51 force-pushed the pf5_upgrade branch 2 times, most recently from 62bba0e to a9d5b03 Compare October 6, 2023 15:52
@openshift-merge-robot openshift-merge-robot removed the needs-rebase PR needs to be rebased label Oct 6, 2023
@dpanshug
Copy link
Contributor

dpanshug commented Oct 9, 2023

CSS also need to be updated with Patternfly 5, there is a separate codemode for it https://www.patternfly.org/get-started/upgrade#utilize-our-class-name-updater-codemod

Copy link
Member

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self note, we need to log a tech debt to get rid of all the /deprecated imports.

I'll test the UI now, this is just the code review.

backend/src/types.ts Outdated Show resolved Hide resolved
frontend/.cache_16xe4ex Outdated Show resolved Hide resolved
Comment on lines 190 to 194
{
<>
<BrandImage src={odhApp.spec.img} alt={odhApp.spec.displayName} />
</>
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not just be <BrandImage ... />? You're creating a variable block, wrapping a fragment, then rendering a single item 🤔

frontend/src/components/OdhDocCard.tsx Outdated Show resolved Hide resolved
frontend/src/components/OdhExploreCard.tsx Outdated Show resolved Hide resolved
@@ -108,7 +108,7 @@ const MetricsChart: React.FC<MetricsChartProps> = ({ title, color, metrics, unit
</>
) : (
<>
<EmptyStateIcon variant="container" component={Spinner} />
<EmptyStateIcon icon={Spinner} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't Empty state get a header/footer? Was this missed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - nice catch @andrewballantyne looks like the codemods didn't pick up this instance

Comment on lines 9 to 15
onChange: (
e:
| React.MouseEvent<Element, MouseEvent>
| React.ChangeEvent<Element>
| React.FormEvent<HTMLInputElement>,
selection: string,
) => void;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems unnecessary 🤔 Both users only care about selection.

frontend/src/redux/types.ts Outdated Show resolved Hide resolved
Copy link
Member

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some UI issues from my testing....

Each are inline to allow for comments... except for this one:


I'm not sure how this one broke... internal CSS for PF & our overrides due to bad tab formats... is my guess, since you didn't modify the file in question (frontend/src/concepts/pipelines/content/pipelinesDetails/pipeline/PipelineDetails.tsx)

The sidebar in the tab breaks scroll area for the topology. We lose the bottom left icons (if you scroll the sidebar all the way to the bottom, they reappear).

Before:
Screenshot 2023-10-10 at 3 12 05 PM

After:
Screenshot 2023-10-10 at 3 11 54 PM

onUpdateVariable({ name: variable.name, type: variable.type, value: newValue })
}
/>
</InputGroupItem>
{variable.type === 'password' ? (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
Screenshot 2023-10-10 at 3 03 21 PM

After:
Screenshot 2023-10-10 at 3 03 30 PM

Copy link
Contributor Author

@jenny-s51 jenny-s51 Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unable to reproduce both the topology issue (above) and this environment variables issue in my local instance of the shared cluster. Would be great if the team could help investigate these issues cc @andrewballantyne

{!disableK8sName && (
<FormHelperText>
<HelperText>
<HelperTextItem icon={<ExclamationCircleIcon />} variant={'error'}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
Screenshot 2023-10-10 at 3 04 58 PM

After:
Screenshot 2023-10-10 at 3 04 53 PM

variant={token.error ? 'error' : 'default'}
>
{token.error ??
'Enter the service account name for which the token will be generated'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
Screenshot 2023-10-10 at 3 07 08 PM

After:
Screenshot 2023-10-10 at 3 07 13 PM

>
{validated === 'error'
? 'The path must not point to a root folder.'
: 'Enter a path to a model or folder. This path cannot point to a root folder.'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
Screenshot 2023-10-10 at 3 08 39 PM

After:
Screenshot 2023-10-10 at 3 08 34 PM

}}
/>
</InputGroupItem>
<InputGroupText>GiB</InputGroupText>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in frontend/src/pages/clusterSettings/CullerSettings.tsx -- same issue, I caught them both in the same screenshot and I'm too lazy to retake or to break up the screenshots 🙂

Before:
Screenshot 2023-10-10 at 3 14 11 PM

After:
Screenshot 2023-10-10 at 3 14 16 PM

Copy link
Member

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replies to your latest code push

actions: (
<>
<FavoriteButton isFavorite={favorite} onClick={() => updateFavorite(!favorite)} />
</>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a missed point of my previous review... mind removing the fragment here too?

{...(!dashboardConfig.spec.dashboardConfig.disableISVBadges && {
actions: {
actions: (
<>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fragments are not needed when dealing with 1 child... they help when you have two or more siblings and you don't have a comment parent (usually only needed when passing as a "single prop" or "returning as a single value").

@@ -11,7 +11,6 @@ export enum Actions {
FORCE_COMPONENTS_UPDATE = 'FORCE_COMPONENTS_UPDATE',
}

export type AppNotificationStatus = 'success' | 'danger' | 'warning' | 'info' | 'default';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm... maybe just undo all of this... not sure what you were changing 🤔 I think these values are fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1901 (comment)

Ah I think you're addressing PF errors, and you modified this to fit those. These are our notification values. These are used in frontend/src/app/AppNotificationDrawer.tsx

Where are the variants:

variant?: 'custom' | 'success' | 'danger' | 'warning' | 'info';

Can we just make this a TS reference of that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to reference the PF AlertVariant enum let me know if this is what you had in mind @andrewballantyne

@dpanshug
Copy link
Contributor

dpanshug commented Oct 11, 2023

need to log a tech debt to get rid of all the /deprecated imports.

@andrewballantyne I already logged a feature issue #1931

Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-10-11 at 1 24 04 PM Screenshot 2023-10-11 at 1 24 08 PM The hover (see image 1) and selected (see image 2) card styles seem broken. Looks like PF changed the props interface for `CardHeader`, we might want to look into that to make sure the style works and keeps the functionality at the same time.

@jenny-s51
Copy link
Contributor Author

jenny-s51 commented Oct 11, 2023

The hover (see image 1) and selected (see image 2) card styles seem broken. Looks like PF changed the props interface for CardHeader, we might want to look into that to make sure the style works and keeps the functionality at the same time.

Thank you @DaoDaoNoCode nice catch!

I've updated OdhExploreCard to use the new PF5 recommendation for the "clickable and selectable" pattern, which can now be seen in the "Enable" view.

Still investigating why this update does not apply to the "Jupyter" card ... do you have any ideas how we can fix this?

@DaoDaoNoCode
Copy link
Member

@jenny-s51 Yes, it might related to the props in CardHeader component, you may need to use selectableActions instead of actions there, however, I am not sure how it could be compatible with the current implementation, you might need some test to see if anything is broken.

changes to card component, revert openshift-dynamic-sdk bump

fix dependency conflicts, remove comments, lint

upgrade hardcocded class references to v5 classnames

run codemods after rebase

run linting commands

fix lint errors in CI workflow

comment out references to PluginLoader

format sdkInitialize

update pluginstore initialization

update classnames and change Title to EmptyStateHeader

remove cache files

update to latest release versions

format

remove unused title import

add EmptyStateActions import

PR feedback from Andrew

PR feedback from Andrew and Juntao

apply patch

format

remove eslint no console

remove unused imports

fix missing link in Jupyter card
@andrewballantyne andrewballantyne changed the base branch from main to f/pf5-upgrade October 17, 2023 18:58
@andrewballantyne andrewballantyne changed the title [WIP] Upgrade odh dashboard to PF5 Upgrade odh dashboard to PF5 Oct 17, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Oct 17, 2023
@andrewballantyne
Copy link
Member

/unhold
/retest

Reworking this branch to merge into a feature branch for a brief time. This won't go to incubation yet, we will look to get this safely into main, hopefully this sprint -- might be next sprint.

There is still a few little items to tie up in the style department from our custom styles.

Thanks again for the hard work here @jenny-s51 🎉

@openshift-ci openshift-ci bot removed the do-not-merge/hold This PR is hold for some reason label Oct 17, 2023
@openshift-ci openshift-ci bot added the lgtm label Oct 17, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot merged commit 33c36b7 into opendatahub-io:f/pf5-upgrade Oct 17, 2023
6 checks passed
@jenny-s51 jenny-s51 mentioned this pull request Oct 20, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Upgrade to Patternfly v5
6 participants