Skip to content

[utils] remove multipass::Path #4184

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

[utils] remove multipass::Path #4184

wants to merge 1 commit into from

Conversation

levkropp
Copy link
Contributor

@levkropp levkropp commented Jun 26, 2025

This pull request refactors the multipass codebase by removing the custom Path type (an alias for QString) and using QString directly throughout the code. This streamlines the codebase and eliminates the unnecessary Path abstraction, which affects e.g. Intellisense when dealing with strings, especially in areas like conversions to/from std::string. By standardizing on QString, the code becomes more consistent and easier to maintain. Alternatives include QDir and fs::path which are both used in Multipass as well.

@levkropp levkropp force-pushed the no-path branch 5 times, most recently from f1456ae to b2d24ba Compare June 26, 2025 23:38
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

Attention: Patch coverage is 91.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 89.30%. Comparing base (fdbd5f6) to head (16908ce).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/utils.cpp 72.72% 3 Missing ⚠️
...ckends/libvirt/libvirt_virtual_machine_factory.cpp 66.66% 1 Missing ⚠️
src/xz_decoder/xz_image_decoder.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4184      +/-   ##
==========================================
- Coverage   89.31%   89.30%   -0.01%     
==========================================
  Files         259      259              
  Lines       15684    15683       -1     
==========================================
- Hits        14008    14006       -2     
- Misses       1676     1677       +1     

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

@xmkg
Copy link
Member

xmkg commented Jun 27, 2025

@levkropp my 2c's here; I think we should keep the multipass::Path alias until we replace it with a proper path type, i.e., (std::filesystem::path). Right now, we at least know that a variable is a Path by looking at the type, because the alias is named in such a way. If we go ahead and remove it, we would lose this info, and it would be harder to refactor this later on.

Hence, I'm against removing it, unless replaced with std::filesystem::path.

@levkropp
Copy link
Contributor Author

levkropp commented Jul 2, 2025

Right now, we at least know that a variable is a Path by looking at the type, because the alias is named in such a way. If we go ahead and remove it, we would lose this info

I disagree with this because every variable name that uses Path is suffixed with _path or _dir or in some cases even _dir_path

I'd be fine with keeping Path if we address the variable naming conventions (we know the variable is a Path by looking at the type), and remove the inconsistent suffixes

@xmkg
Copy link
Member

xmkg commented Jul 3, 2025

Right now, we at least know that a variable is a Path by looking at the type, because the alias is named in such a way. If we go ahead and remove it, we would lose this info

I disagree with this because every variable name that uses Path is suffixed with _path or _dir or in some cases even _dir_path

What I'm saying is it would be much easier to locate instances of multipass::Path than an arbitrary suffix. I'm not against removing the suffixes since they're mostly useful when the type itself is not descriptive enough. I'd prefer to see them gone first than the type alias.

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.

2 participants