Skip to content

qvm-template-upgrade: add CLI skeleton and orchestration flow#213

Open
nihalxkumar wants to merge 1 commit into
QubesOS:mainfrom
nihalxkumar:qvm-template-upgrade
Open

qvm-template-upgrade: add CLI skeleton and orchestration flow#213
nihalxkumar wants to merge 1 commit into
QubesOS:mainfrom
nihalxkumar:qvm-template-upgrade

Conversation

@nihalxkumar

Copy link
Copy Markdown

This is a PR for the GSoC 2026 project: Automate Template Version Upgrade
introducing the qvm-template-upgrade dom0 command-line utility, which provides the orchestration layer for in-place template version upgrades.

TLDR of what this PR does at the moment:

  • Validates that the target is a TemplateVM.
  • Clones the source template (e.g., fedora-41 -> fedora-42).
  • [Stubbed] Invokes the VM-side package manager agent via qube_connection.py.
  • On success: Updates qvm-features (sets template-name, clears stale RPM data).
  • On failure: Removes the broken clone (unless --keep-on-failure is passed), leaving the original template untouched.

related to QubesOS/qubes-issues#8605.

@ben-grande ben-grande left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yay, started. As I've done a review now, I will receive a notification every time you commit. Let me know when you need another look or have doubts by mentioning me.

Comment thread vmupdate/tests/test_template_upgrade.py
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
@codecov-commenter

codecov-commenter commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.29%. Comparing base (6786ad4) to head (6c3d431).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #213      +/-   ##
==========================================
+ Coverage   71.72%   77.29%   +5.56%     
==========================================
  Files          12       14       +2     
  Lines        1337     1665     +328     
==========================================
+ Hits          959     1287     +328     
  Misses        378      378              

☔ View full report in Codecov by Harness.
📢 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.

@nihalxkumar nihalxkumar marked this pull request as ready for review June 2, 2026 05:29
@ben-grande

Copy link
Copy Markdown
Contributor

PipelineRetryFailed

@nihalxkumar

Copy link
Copy Markdown
Author

It's showing a successful run

image image

@ben-grande

Copy link
Copy Markdown
Contributor

Some tests are not enabled on this repo, such as mypy, black and pylint. See this as an example: https://github.com/QubesOS/qubes-core-admin/blob/main/.gitlab-ci.yml. Can you create a separate PR to enable those checks?

@nihalxkumar

Copy link
Copy Markdown
Author

Sure, will do

Comment thread vmupdate/template_upgrade.py
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
Comment thread vmupdate/template_upgrade.py Outdated
@nihalxkumar

Copy link
Copy Markdown
Author

We can squash here if it's looks fine. Will also have to rebase as this is 24 commits behind.

@ben-grande

Copy link
Copy Markdown
Contributor

Looks fine to squash.

Add qvm-template-upgrade as an initial safe upgrade workflow for
TemplateVMs and StandaloneVMs. The command validates the source qube,
derives the next distro-version clone name, clones the source, updates
template metadata, and cleans up failed clones unless explicitly asked
to keep them.

The version-upgrade agent hook remains a stub for now, so the command
can land the orchestration, rollback behavior, and tests without
pretending to perform in-VM distro upgrades yet.

Fixes: QubesOS/qubes-issues#8605
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