Skip to content

Conversation

avitova
Copy link
Collaborator

@avitova avitova commented Sep 4, 2025

We allow adding more root mountpoints via import feature, which should not be possible. This fix allows users to remove extra root partition, but keeps it in the wizard so that users know about it.

@avitova
Copy link
Collaborator Author

avitova commented Sep 4, 2025

Better safe than sorry. 🎉 The bug is here:

Screencast.From.2025-09-04.16-00-54.mp4

Copy link

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.53%. Comparing base (92ef8ee) to head (2503f5d).
⚠️ Report is 1 commits behind head on main.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3614      +/-   ##
==========================================
- Coverage   82.58%   82.53%   -0.06%     
==========================================
  Files         204      204              
  Lines       24674    24694      +20     
  Branches     2550     2559       +9     
==========================================
+ Hits        20378    20382       +4     
- Misses       4269     4285      +16     
  Partials       27       27              
Files with missing lines Coverage Δ
...rd/steps/FileSystem/components/FileSystemTable.tsx 74.76% <100.00%> (+0.67%) ⬆️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92ef8ee...2503f5d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avitova avitova force-pushed the edge-case-import branch 2 times, most recently from fb08d6a to 958abb6 Compare September 4, 2025 15:21
@avitova
Copy link
Collaborator Author

avitova commented Sep 4, 2025

/retest

@avitova avitova requested a review from a team as a code owner September 5, 2025 07:50
kingsleyzissou
kingsleyzissou previously approved these changes Sep 5, 2025
Copy link
Collaborator

@kingsleyzissou kingsleyzissou left a comment

Choose a reason for hiding this comment

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

Nice!

@avitova
Copy link
Collaborator Author

avitova commented Sep 5, 2025

/retest

@ksiekl
Copy link
Collaborator

ksiekl commented Sep 5, 2025

Great! I just wonder why in your bug video there wasn't an exclamation mark next to the FS configuration step in nav bar 🤔 Was is just a slow load? Maybe that's worth investigating if our validation is not set correctly for that step, but that's a different PR kinda thing. Nice work!

ksiekl
ksiekl previously approved these changes Sep 5, 2025
@avitova
Copy link
Collaborator Author

avitova commented Sep 5, 2025

Yeah, the validation happens for some reason only on click of the next button. 😄

@mgold1234
Copy link
Collaborator

@avitova very nice, is it possible to add unit test to check this change?

@avitova avitova dismissed stale reviews from ksiekl and kingsleyzissou via 6cb2b2e September 8, 2025 10:33
@avitova avitova force-pushed the edge-case-import branch 3 times, most recently from 8974b71 to 3387288 Compare September 8, 2025 10:37
@avitova
Copy link
Collaborator Author

avitova commented Sep 8, 2025

Good point, @mgold1234 . However, I decided to do Playwright tests, as they are more easy to write and read. What do you think about this way of importing blueprints that we define in a file, @tkoscieln ?
I found some more unexpected behaviour in our error handling thanks to the Playwright test. Let's get #3623 in first. Thanks!

We allow adding more root mountpoints via import feature, which should not be possible. This fix allows users to remove extra root partition, but keeps it in the wizard so that users know about it.
Copy link
Collaborator

@tkoscieln tkoscieln left a comment

Choose a reason for hiding this comment

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

@avitova this way of importing blueprints LGTM. Added some additional comments.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would maybe create a subdirectory fixtures/data to separate these files from the fixture functions. But this is a nitpick.

const frame = await ibFrame(page);

await test.step('Import BP', async (step) => {
step.skip(!isHosted(), 'Importing is not available in the plugin');
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should propably skip the entire test if the importing is not avaiable in Cockpit plugin at all. You can use test.skip for that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is also what is failing the cockpit tests in Schutzbot. It expects the wizard to be open from the Import helper function, but it is not.

@@ -143,3 +146,17 @@ export const importBlueprint = async (
await page.getByRole('button', { name: 'Review and Finish' }).click();
}
};

export const importDynamicFixture = async (
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should propably change the name of this helper function to something else since it just creates a file 🤔 Also please add docstring 🥺

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just realized this test is not running in the CI at all. Since I've introduced the Boot tests, the playwright action for the other tests that should run on PRs need to have the directory specified for the playwright command here. So since you placed the test in a new directory, it needs to be added there. I should propably document this, my bad 😬

await registerLater(frame);
});

await test.step('Select the Locale step', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you divide this one big step into several smaller steps that encapsulate every wizard step that is being checked?

This commits adds a constant with blueprint in order for us to test
different cases of errors that might ocurr out of a blueprint.
@avitova
Copy link
Collaborator Author

avitova commented Sep 8, 2025

Thank you, Tomas! I tried to address your comments.

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