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

feat(HMS-3332): Migrate to PF5 #365

Merged
merged 1 commit into from
Jan 9, 2024
Merged

Conversation

amirfefer
Copy link
Member

This PR migrate to PF5 following the official migration guide and @patternfly/pf-codemods
PF5 supports react 18+, so this PR also update react and react-dom
This PR NOT refactored the Wizard and Select components. These have some heavy breaking changes, and will be refactored in a follow up PR. For now, we use the deprecated components from @patternfly/react-core/deprecated'

@akhil-jha, This might break tests, because some selectors are changed or removed, unit testing is broken a bit, needs a small align.

@amirfefer
Copy link
Member Author

amirfefer commented Dec 28, 2023

This PR also seems to fix the wizard's modal resizing:

Screen.Recording.2023-12-28.at.19.27.53.mov

@akhil-jha
Copy link
Member

Will you be pushing anymore commits or shall I start testing it? :)

@amirfefer amirfefer force-pushed the pf5-migration branch 2 times, most recently from 2544a9d to c058841 Compare January 2, 2024 18:10
@amirfefer
Copy link
Member Author

@akhil-jha, done - unit tests are 🟢

@akhil-jha
Copy link
Member

Great! I'll start working on it then :)

ezr-ondrej
ezr-ondrej previously approved these changes Jan 4, 2024
Copy link
Member

@ezr-ondrej ezr-ondrej left a comment

Choose a reason for hiding this comment

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

Code LGTM and I've tested most of the happy paths and empty state for no source and everything works as expected 🎉

Will wait for @akhil-jha to ack this, which might take a while (we need the ephem cluster working first)

@akhil-jha
Copy link
Member

/retest

@ezr-ondrej
Copy link
Member

/retest

maaybe now? xD

@akhil-jha
Copy link
Member

/retest

maaybe now? xD

I am seeing this in the pipeline. Maybe because of this the IQE test isn't starting?

03:04:03 Test Suites: 1 failed, 11 passed, 12 total
03:04:03 Tests:       1 failed, 53 passed, 54 total
03:04:03 Snapshots:   0 total
03:04:03 Time:        48.277 s
03:04:03 Ran all test suites.
03:04:03 ERROR: "test" exited with 1.

@lzap
Copy link
Member

lzap commented Jan 5, 2024

Can you elaborate? I don’t understand.

@ezr-ondrej
Copy link
Member

Ah right, I did not even look properly there and missed this!
@amirfefer we are running the unit tests in the pr check as well and it seems to be failing there for some reason and when unit tests fail there, it does not run the pr_check (I'm guessing to safe resources).

This test fails: FAIL src/Components/ProvisioningWizard/ProvisioningWizard.test.js

In the past it was sometimes because of Jenkins being slower then GH actions, so just bumping the limits might help.
If not, we might need to bump adjust the nodejs version we're using in the pipeline, might that have an effect?

@@ -36,17 +36,17 @@ describe('ProvisioningWizard', () => {

render(<ProvisioningWizard hasAccess image={{ ...awsImage, sourceIDs: ['1'] }} />);
// wait for the sources to load
await screen.findByText('Select account', undefined, { timeout: 10000 });
await screen.findByText('Select account', undefined, { timeout: 15000 });
Copy link
Member

Choose a reason for hiding this comment

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

This is the place where the pr_check fails. Let me bump this bit more :)

@ezr-ondrej
Copy link
Member

/retest

2 similar comments
@Victoremepunto
Copy link

/retest

@ezr-ondrej
Copy link
Member

/retest

<EmptyState variant="lg">
<EmptyStateHeader
headingLevel="h4"
title={polledReservation?.success ? 'System(s) launched successfully' : 'Launching system(s)'}
Copy link
Member

Choose a reason for hiding this comment

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

I think it should be titleText. https://www.patternfly.org/components/empty-state#emptystateheader
Because I am getting the following....
Screenshot 2024-01-07 at 11 37 51 PM

Copy link
Member

Choose a reason for hiding this comment

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

oh, good catch! :)

<Title size="lg" headingLevel="h4">
Loading available Sources
</Title>
<EmptyStateHeader headingLevel="h4" title="Loading available Sources" icon={<EmptyStateIcon icon={Spinner} />} />
Copy link
Member Author

Choose a reason for hiding this comment

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

same as here

@@ -36,13 +36,9 @@ describe('ProvisioningWizard', () => {

render(<ProvisioningWizard hasAccess image={{ ...awsImage, sourceIDs: ['1'] }} />);
// wait for the sources to load
await screen.findByText('Select account', undefined, { timeout: 10000 });
Copy link
Member Author

@amirfefer amirfefer Jan 8, 2024

Choose a reason for hiding this comment

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

this is redundant check, it just make the test be slower, if the Source 1 exists, we don't need the Select account placeholder.

@akhil-jha
Copy link
Member

/retest

akhil-jha
akhil-jha previously approved these changes Jan 9, 2024
Copy link
Member

@akhil-jha akhil-jha left a comment

Choose a reason for hiding this comment

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

commit message check is still failing.

Also, @amirfefer can you restore the pr_check.sh change?
I will be creating a new PR for the CICD_URL change.

@akhil-jha akhil-jha enabled auto-merge (squash) January 9, 2024 09:16
@akhil-jha akhil-jha merged commit 295c472 into RHEnVision:main Jan 9, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants