Skip to content

[vm-image-vault] Normalize image path before replace#4813

Merged
xmkg merged 5 commits into
mainfrom
bugfix/normalize-path-before-clone-rename
Apr 14, 2026
Merged

[vm-image-vault] Normalize image path before replace#4813
xmkg merged 5 commits into
mainfrom
bugfix/normalize-path-before-clone-rename

Conversation

@xmkg
Copy link
Copy Markdown
Member

@xmkg xmkg commented Apr 10, 2026

The replace_all call assumes the path is single forward slashes, where Windows makes no such guarantees. Call generic_string() to grab a POSIX-like normalized path so it's always forward slashes.

MULTI-2563

The replace_all call assumes the path is single forward slashes where
Windows makes no such guarantees. Call generic_string() to grab a posix
like normalized path so it's always forward slashes.

Signed-off-by: Mustafa Kemal Gilor <mustafa.gilor@canonical.com>
@xmkg xmkg requested a review from jimporter April 10, 2026 23:23
@xmkg xmkg changed the title [vm-image-vault] Normalize image path before repl [vm-image-vault] Normalize image path before replace Apr 11, 2026
xmkg added 2 commits April 13, 2026 13:01
Signed-off-by: Mustafa Kemal Gilor <mustafa.gilor@canonical.com>
Signed-off-by: Mustafa Kemal Gilor <mustafa.gilor@canonical.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.54%. Comparing base (13a02c9) to head (8f0b3c1).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4813      +/-   ##
==========================================
+ Coverage   87.54%   87.54%   +0.01%     
==========================================
  Files         258      258              
  Lines       14155    14157       +2     
==========================================
+ Hits        12391    12393       +2     
  Misses       1764     1764              

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

Update the instance_image_records map after verifying all invariants.
Also add a test with invalid instance dir.

Signed-off-by: Mustafa Kemal Gilor <mustafa.gilor@canonical.com>
Copy link
Copy Markdown
Contributor

@jimporter jimporter left a comment

Choose a reason for hiding this comment

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

Good catch! The difference between .string() and .generic_string() is definitely something to be careful about with the standard path type. One comment below; I don't feel super strongly about it, but using boost::replace_all_copy seems like it lets us simplify this code a bit.

Comment thread src/daemon/default_vm_image_vault.cpp Outdated
Signed-off-by: Mustafa Kemal Gilor <mustafa.gilor@canonical.com>
Copy link
Copy Markdown
Contributor

@jimporter jimporter left a comment

Choose a reason for hiding this comment

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

LGTM!

@xmkg xmkg added this pull request to the merge queue Apr 14, 2026
Merged via the queue into main with commit c717aca Apr 14, 2026
27 checks passed
@xmkg xmkg deleted the bugfix/normalize-path-before-clone-rename branch April 14, 2026 18:13
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