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

on-prem: cockpit create image wizard (HMS-5301) #2735

Merged
merged 15 commits into from
Jan 27, 2025

Conversation

kingsleyzissou
Copy link
Collaborator

@kingsleyzissou kingsleyzissou commented Jan 10, 2025

This PR adds some changes for us to open the create image wizard for on-prem:

  • switch to hash router
  • implement a few more store methods
  • add some more plumbing

/jira-epic COMPOSER-2411

JIRA: HMS-5301

@schutzbot schutzbot changed the title on-prem: cockpit create image wizard on-prem: cockpit create image wizard (HMS-5301) Jan 10, 2025
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 51.01010% with 97 lines in your changes missing coverage. Please review.

Project coverage is 84.51%. Comparing base (6a29f7f) to head (12606ed).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
src/store/cockpitApi.ts 19.35% 50 Missing ⚠️
...Components/CreateImageWizard/CreateImageWizard.tsx 38.88% 11 Missing ⚠️
...ponents/CreateImageWizard/utilities/getHostInfo.ts 27.27% 8 Missing ⚠️
src/store/backendApi.ts 65.00% 7 Missing ⚠️
src/test/mocks/os-release/index.ts 12.50% 7 Missing ⚠️
src/AppCockpit.tsx 0.00% 3 Missing ⚠️
src/Utilities/useGetEnvironment.ts 66.66% 3 Missing ⚠️
...CreateImageWizard/steps/ImageOutput/ArchSelect.tsx 75.00% 2 Missing ⚠️
...ateImageWizard/steps/ImageOutput/ReleaseSelect.tsx 85.71% 2 Missing ⚠️
src/Utilities/path.ts 33.33% 2 Missing ⚠️
... and 2 more

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2735      +/-   ##
==========================================
- Coverage   84.81%   84.51%   -0.31%     
==========================================
  Files         187      189       +2     
  Lines       21388    21530     +142     
  Branches     2120     2137      +17     
==========================================
+ Hits        18141    18196      +55     
- Misses       3225     3312      +87     
  Partials       22       22              
Files with missing lines Coverage Δ
src/Components/Blueprints/BlueprintDiffModal.tsx 88.46% <100.00%> (ø)
src/Components/Blueprints/BuildImagesButton.tsx 71.64% <ø> (ø)
...c/Components/CreateImageWizard/EditImageWizard.tsx 100.00% <100.00%> (ø)
...mageWizard/steps/ImageOutput/TargetEnvironment.tsx 91.98% <100.00%> (ø)
...Components/CreateImageWizard/steps/Oscap/Oscap.tsx 92.80% <ø> (ø)
...Components/CreateImageWizard/steps/Oscap/index.tsx 98.21% <100.00%> (-0.07%) ⬇️
...ents/CreateImageWizard/steps/Packages/Packages.tsx 79.63% <ø> (ø)
...ponents/CreateImageWizard/steps/Packages/index.tsx 100.00% <100.00%> (ø)
...nts/CreateImageWizard/steps/Registration/index.tsx 100.00% <100.00%> (ø)
...teImageWizard/steps/Review/ReviewStepTextLists.tsx 94.73% <100.00%> (+<0.01%) ⬆️
... and 17 more

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 6a29f7f...12606ed. Read the comment docs.

@kingsleyzissou kingsleyzissou marked this pull request as ready for review January 10, 2025 16:27
@kingsleyzissou
Copy link
Collaborator Author

This depends on #2704

@kingsleyzissou kingsleyzissou force-pushed the cockpit_wizard branch 2 times, most recently from d5adf33 to 1c6e08c Compare January 13, 2025 09:39
@kingsleyzissou kingsleyzissou marked this pull request as draft January 13, 2025 09:40
@kingsleyzissou
Copy link
Collaborator Author

Marking as draft as this also depends on #2739

@kingsleyzissou kingsleyzissou force-pushed the cockpit_wizard branch 3 times, most recently from afa0ced to ba3bf8a Compare January 20, 2025 12:13
@kingsleyzissou kingsleyzissou marked this pull request as ready for review January 20, 2025 12:14
@kingsleyzissou kingsleyzissou force-pushed the cockpit_wizard branch 5 times, most recently from cb3d3e8 to 9b58183 Compare January 23, 2025 15:17
@kingsleyzissou
Copy link
Collaborator Author

kingsleyzissou commented Jan 23, 2025

Screen.Recording.2025-01-23.at.16.08.09.mov

This doesn't include:

  • package selection
  • still need to limit the arch dropdown
  • creating the blueprint

Copy link
Member

@croissanne croissanne left a comment

Choose a reason for hiding this comment

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

LGTM, some small comments, but I'd leave out the logos/icons for now, I'm not sure if we can just do that :/

src/store/cockpitApi.ts Outdated Show resolved Hide resolved
src/store/cockpitApi.ts Show resolved Hide resolved
The browser router doesn't seem to work inside cockpit, switching
to the hashrouter resolves this.
Switch the useFlag usage to the stub function defined in the
`useGetEnvironment` utility
We need to check for the on-prem use case
@kingsleyzissou kingsleyzissou force-pushed the cockpit_wizard branch 2 times, most recently from 7b39b18 to 5135443 Compare January 27, 2025 14:40
@croissanne
Copy link
Member

/retest

@regexowl
Copy link
Collaborator

Just a heads up - failure of the two bonfire konflux actions is expected and should be safe to ignore.

croissanne
croissanne previously approved these changes Jan 27, 2025
Copy link
Member

@croissanne croissanne left a comment

Choose a reason for hiding this comment

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

lgtm, some repos are still there though

src/store/cockpitApi.ts Outdated Show resolved Hide resolved
@kingsleyzissou
Copy link
Collaborator Author

lgtm, some repos are still there though

smh. Sorry. Just going to fix that up quickly

kingsleyzissou and others added 12 commits January 27, 2025 15:19
We were making a call to a dead endpoint to get the architectures.
Instead, create a custom query function to return the list of architectures
and image types.
Create a get blueprint endpoint for the on-prem store.
Create the boilerplate function for getting the Oscap profiles. We will
need to make a call to the `oscap` binary to get this information. So
we will leave it empty for now.
Create a helper hook for RTK prefetch queries. This wrapper function
is needed since the imagebuilderApi and cockpitApi aren't at parity
yet.
Currently, the wizard still needs some of the other stores. If we
omit them, the wizard fails to launch
For a start, we will disable custom repositories and the OpenSCAP steps
for the on-prem version of the frontend.
Add a stub function for the `os-release` package from cockpit.
Initialize the create image wizard with the host's distribution for the
on-premise frontend.
Initialize the create image wizard with the host arch for the
on-prem frontend.
The list of imports was growing really long and getting a bit
unmanageable. This commit tidies the imports up by importing all
the queries into two variables.
@croissanne croissanne enabled auto-merge (rebase) January 27, 2025 15:32
@croissanne croissanne merged commit f2c5dcc into osbuild:main Jan 27, 2025
17 of 19 checks passed
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.

4 participants