Skip to content

Resolves: MTV-4481 | Add appliance management UI input for OVA providers#2229

Merged
avivtur merged 1 commit intokubev2v:mainfrom
avivtur:expose-checkbox-for-ova-upload
Feb 4, 2026
Merged

Resolves: MTV-4481 | Add appliance management UI input for OVA providers#2229
avivtur merged 1 commit intokubev2v:mainfrom
avivtur:expose-checkbox-for-ova-upload

Conversation

@avivtur
Copy link
Member

@avivtur avivtur commented Feb 3, 2026

📝 Links

References: https://issues.redhat.com/browse/MTV-4481

📝 Description

Add UI input for the applianceManagement setting on OVA providers, which controls whether users can upload OVA files directly to the provider.

Changes:

  • Add checkbox field in the create provider form when OVA type is selected
  • Add details item with edit capability in the OVA provider details page
  • Add shared constants for label and description text
  • Add selector for reading applianceManagement from provider spec
  • Add E2E test verification for the appliance management setting

When enabled, the "Upload local OVA files" section becomes visible on the provider details page.

🎥 Demo

Screenshot (1) Screenshot (2) Screenshot (3) Screenshot (4)

📝 CC://

@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 25.00000% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 14.58%. Comparing base (13484d0) to head (780e66c).
⚠️ Report is 965 commits behind head on main.

Files with missing lines Patch % Lines
.../DetailsSection/ApplianceManagementDetailsItem.tsx 0.00% 20 Missing ⚠️
...ponents/DetailsSection/EditApplianceManagement.tsx 0.00% 17 Missing ⚠️
...ents/DetailsSection/onUpdateApplianceManagement.ts 0.00% 14 Missing ⚠️
...roviders/create/utils/buildOvaProviderResources.ts 25.00% 3 Missing ⚠️
...ls/components/DetailsSection/OVADetailsSection.tsx 0.00% 3 Missing ⚠️
src/components/OvaFileUploader/OvaFileUploader.tsx 0.00% 2 Missing ⚠️
.../create/fields/ova/OvaApplianceManagementField.tsx 84.61% 2 Missing ⚠️
src/utils/crds/common/selectors.ts 50.00% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2229       +/-   ##
===========================================
- Coverage   36.81%   14.58%   -22.23%     
===========================================
  Files         158     1127      +969     
  Lines        2548    20175    +17627     
  Branches      599     3767     +3168     
===========================================
+ Hits          938     2943     +2005     
- Misses       1428    17222    +15794     
+ Partials      182       10      -172     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@avivtur avivtur force-pushed the expose-checkbox-for-ova-upload branch 2 times, most recently from e3233c8 to 4305cce Compare February 3, 2026 13:59
@Pedro-S-Abreu
Copy link
Collaborator

LGTM

@jpuzz0
Copy link
Contributor

jpuzz0 commented Feb 3, 2026

Why is it that in the create provider form there is no ability to upload local OVA files but in the details after creation there is?

@jpuzz0
Copy link
Contributor

jpuzz0 commented Feb 3, 2026

There isn't supposed to be a minus sign next to the helper text. Our other helper text does not have this and I don't believe its meant for this use-case regardless.
image

@jpuzz0
Copy link
Contributor

jpuzz0 commented Feb 3, 2026

image

Is there meant to be more than 1 field contained in this section called "Upload local OVA files"? Seems redundant to have that title then another just below it called "Upload local OVA file". Should we just have 1 or the other?

@jpuzz0
Copy link
Contributor

jpuzz0 commented Feb 3, 2026

image

I think the bottom section of this tooltip text with the arrows would be more readable if we make sure it doesn't wrap.

@jpuzz0
Copy link
Contributor

jpuzz0 commented Feb 3, 2026

Also, why not contain the OVA local file upload within the edit more for appliance management to keep the details page more simple?

{t('Enabled')}
</Label>
) : (
<Label isCompact status="info">
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure it makes sense to have "info" status for something labeled as "Disabled". Do we do this elsewhere? Otherwise I would suggest a default status.

const obj = await k8sPatch({
data: [
{
op: currentValue ? REPLACE : ADD,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not exactly sure why the Modal utils possess REPLACE/ADD/REMOVE operations for k8sPatch operations (something we might want to consider moving to a place for this just pertaining to k8s operations), but either way, it looks like REMOVE is an option, and wouldn't that make more sense to use when appliance management is "disabled" vs REPLACE?

Copy link
Member Author

Choose a reason for hiding this comment

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

It cluters a bit the code, I made the changes what do you think?

provider: V1beta1Provider,
enabled: boolean,
): Promise<V1beta1Provider> => {
const currentValue = getApplianceManagement(provider);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: since this is used to determine replace vs add, I wonder if its a better read to convert to value returned to a boolean and call it something like isAppManagementEnabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added this selector because it makes sense, but in this specific case I want to see if I have any value in there (including false value) so I would know the patch operation should replace or delete

@avivtur avivtur force-pushed the expose-checkbox-for-ova-upload branch 2 times, most recently from e2dbc99 to 7840390 Compare February 3, 2026 18:11
@avivtur
Copy link
Member Author

avivtur commented Feb 3, 2026

Why is it that in the create provider form there is no ability to upload local OVA files but in the details after creation there is?

the service to upload the OVA files is created only after the provider creation, not during.

Also, why not contain the OVA local file upload within the edit more for appliance management to keep the details page more simple?

Not sure if we should hide this upload if I remember they wanted it exposed in a way a user would not miss it, but I do think that's just temporary just to make them aware of it, so we can ask Margot about this

const [enabled, setEnabled] = useState(isApplianceManagementEnabled(provider));

const onSubmit = async (): Promise<void> => {
await onUpdateApplianceManagement(provider, enabled);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: no point of awaiting here. can just return onUpdateApplianceManagement(provider, enabled);

const currentValue = getApplianceManagement(provider);
const getOpAndValue = () => {
if (currentValue === enabled.toString()) return undefined;
if (isEmpty(currentValue) && enabled) return { op: ADD, value: TRUE_VALUE };
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't currentValue just a string? Do we need to use isEmpty on strings? I thought it was mainly for objects and arrays.

Copy link
Member Author

Choose a reason for hiding this comment

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

it can be also used with strings, any reason not to?
this function is meant to replace the one in loadsh: https://lodash.com/docs/#isEmpty (we wanted to avoid adding the entire package for just some bits of the package)

const getOpAndValue = () => {
if (currentValue === enabled.toString()) return undefined;
if (isEmpty(currentValue) && enabled) return { op: ADD, value: TRUE_VALUE };
if (!isEmpty(currentValue) && enabled) return { op: REPLACE, value: TRUE_VALUE };
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I personally think this is less readable with all if statements being single lines with their return statements

Copy link
Member Author

Choose a reason for hiding this comment

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

thought so, will revert

Copy link
Contributor

@jpuzz0 jpuzz0 left a comment

Choose a reason for hiding this comment

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

Few minor comments, but otherwise LGTM

Add checkbox field to enable appliance management when creating OVA
providers and in the provider details page. This setting controls
whether users can upload OVA files directly to the provider.

Changes:
- Add checkbox in create provider form for OVA type
- Add details item with edit capability in OVA provider details page
- Add E2E test verification for appliance management setting

Resolves: MTV-4481
Signed-off-by: Aviv Turgeman <[email protected]>
@avivtur avivtur force-pushed the expose-checkbox-for-ova-upload branch from 7840390 to 780e66c Compare February 4, 2026 06:36
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

@avivtur avivtur added this pull request to the merge queue Feb 4, 2026
Merged via the queue into kubev2v:main with commit 9619084 Feb 4, 2026
10 checks passed
@avivtur avivtur deleted the expose-checkbox-for-ova-upload branch February 4, 2026 08:03
@avivtur
Copy link
Member Author

avivtur commented Feb 4, 2026

/backport release-2.11

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

🔄 Backport Status

Starting backport of PR #2229 to release-2.11
🚀 Live mode - Changes will be applied

View workflow run

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

Backport Completed Successfully

PR #2229 has been successfully backported to release-2.11.

A new pull request should have been created with the backported changes.

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.

4 participants