-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Cleanup] Refactor importing VM method #11037
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #11037 +/- ## ========================================= Coverage 16.60% 16.60% - Complexity 13925 13934 +9 ========================================= Files 5730 5730 Lines 508224 508252 +28 Branches 61789 61783 -6 ========================================= + Hits 84388 84417 +29 + Misses 414401 414399 -2 - Partials 9435 9436 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
DaanHoogland
commented
Jun 17, 2025
@nvazquez , this looks like a good improvement. I wonder if a bigger win can be made (as well).
baseImportInstance calls two methods based on the cmd Object and both of those get a lot of parameters. In turn they both call importVirtualMachineInternal which gets 21 parameters. I imagine most of those come from the cmd object or are directly consequential to the contents of it. If we just keep passing the cmd object, if need be on the basis of an interface, I think we can make that part more legible and in the process more optimal on runtime. What do you think?
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
Description
This PR refactors the long method for importing VMs.
Fixes #11033
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?