Skip to content

Conversation

@avivtur
Copy link
Collaborator

@avivtur avivtur commented Sep 28, 2025

📝 Links

https://issues.redhat.com/browse/MTV-3177

📝 Description

This PR fixes:

  • Filtering nads from namespaces that are not the plan target namespace.
  • Add mapping button is can be clicked even though there's no more mapping to do, button get disabled after we click on add mapping and nothing happens.
  • when adding mappings to plan on mappings tab and clicking cancel the UI looks like it was added and needs a refresh to see the actual state.

🎥 Demo

Before:

mapping-tab-bugs.mp4

After:

mapping-tab-bugs-fixed.mp4

📝 CC://

@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2025

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

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.75%. Comparing base (13484d0) to head (62929c0).
⚠️ Report is 828 commits behind head on main.

Files with missing lines Patch % Lines
...s/Mappings/utils/getLabeledAndAvailableMappings.ts 0.00% 5 Missing ⚠️
.../PlanMappingsActionsBar/PlanMappingsActionsBar.tsx 0.00% 2 Missing ⚠️
...etails/tabs/Mappings/utils/planMappingsHandlers.ts 0.00% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #1853       +/-   ##
==========================================
- Coverage   36.81%   6.75%   -30.07%     
==========================================
  Files         158    1009      +851     
  Lines        2548   19358    +16810     
  Branches      599    4006     +3407     
==========================================
+ Hits          938    1307      +369     
- Misses       1428   18044    +16616     
+ Partials      182       7      -175     

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

Copy link
Collaborator

@sgratch sgratch left a comment

Choose a reason for hiding this comment

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

The fixes for disabling the "add" and refreshing for "cancel" actions - LGTM except a small comment question.

For the original bug fix of avoid filtering based on target ns - not sure it's a bug. please see comments below for details.

name: `${network.namespace}/${network.name}`,
};
}
networkMap[network.uid] = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think that this fix is correct since target networks should be filtered by target projects. Let's wait for backend approval for this:
https://issues.redhat.com/browse/MTV-3177?focusedId=28157294&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-28157294

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see your point, I think it's very weird that the backend allows to set something that wouldn't work and doesn't throw an error about it, than our bug is that we allow to see nad from any namespace on the NetworkMap details page

Copy link
Collaborator

Choose a reason for hiding this comment

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

@avivtur

I see your point, I think it's very weird that the backend allows to set something that wouldn't work and doesn't throw an error about it,

Doesn't it throw an error? Maybe when trying to migrate VMs with invalid mappings that will result of a VM without a valid NIC then it will fail? Need to test it and see what happens.

than our bug is that we allow to see nad from any namespace on the NetworkMap details page

For NetworkMap CR, there is no option to set target project value. So it's not a bug since no filtering can be applied. The filtering should be applied once you select an existing NetworkMap for a specific plan IIUC...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looking into CNV docs, it does specify that the NAD should live in the same namespace as the VM/pod, so I'll revert this change as it's not a bug and keep only the other minor fixes.
And +1 on no sure filter on NM CR as it might or might not have a plan owner

@avivtur avivtur force-pushed the missing-nads-from-target-mappings branch 3 times, most recently from 8426c96 to 8049af6 Compare October 5, 2025 10:50
variant={ButtonVariant.secondary}
onClick={reset}
onClick={() => {
reset();
Copy link
Collaborator

Choose a reason for hiding this comment

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

@avivtur Can you please just fix the prototype for reset param since I'm pretty sure that it will be fixed again as part of eslint fixes...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@avivtur avivtur force-pushed the missing-nads-from-target-mappings branch from 8049af6 to 62929c0 Compare October 5, 2025 12:41
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 5, 2025

@sgratch sgratch added this pull request to the merge queue Oct 5, 2025
Merged via the queue into kubev2v:main with commit 58ab9b4 Oct 5, 2025
10 checks passed
Pedro-S-Abreu pushed a commit to Pedro-S-Abreu/forklift-console-plugin that referenced this pull request Oct 6, 2025
Pedro-S-Abreu pushed a commit to Pedro-S-Abreu/forklift-console-plugin that referenced this pull request Oct 16, 2025
Pedro-S-Abreu pushed a commit to Pedro-S-Abreu/forklift-console-plugin that referenced this pull request Nov 3, 2025
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.

3 participants