Skip to content

feat: snap prepare-image plugins#320

Merged
lengau merged 30 commits intomainfrom
work/classic-snap-prepare-image-plugin
Apr 24, 2026
Merged

feat: snap prepare-image plugins#320
lengau merged 30 commits intomainfrom
work/classic-snap-prepare-image-plugin

Conversation

@smethnani
Copy link
Copy Markdown
Contributor

@smethnani smethnani commented Apr 20, 2026

Adds snap prepare-image plugins for core and classic images

(IMAGECRAFT-109)


  • I've followed the contribution guidelines.
  • I've signed the CLA.
  • I've successfully run make lint && make test.
  • I've added or updated any relevant documentation.

@smethnani smethnani marked this pull request as ready for review April 20, 2026 14:07
@smethnani smethnani requested review from a team and lengau April 20, 2026 14:07
@lengau lengau requested a review from Copilot April 20, 2026 19:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds new craft-parts plugins to run snap prepare-image for Ubuntu Core (uc-prepare) and Ubuntu Classic (snap-preseed), plus coverage in unit and spread tests and a new system-seed volume role.

Changes:

  • Introduce UcPreparePlugin and SnapPreseedPlugin implementations and register them in the plugin setup.
  • Add unit tests for both plugins’ command generation plus new spread tasks/configs to exercise them end-to-end.
  • Extend Volume.Role with system-seed and update the related validation expectation in tests.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
imagecraft/plugins/uc_prepare_plugin.py New Ubuntu Core snap prepare-image plugin implementation (with preseed-related options).
imagecraft/plugins/snap_preseed_plugin.py New Ubuntu Classic snap prepare-image --classic plugin implementation.
imagecraft/plugins/_setup.py Registers the new plugins so Imagecraft can use them by name.
imagecraft/models/volume.py Adds system-seed to supported partition roles.
tests/unit/models/test_volume.py Updates expected validation message to include system-seed.
tests/unit/plugins/test_uc_prepare_plugin.py Unit tests for uc-prepare properties validation and command assembly.
tests/unit/plugins/test_snap_preseed_plugin.py Unit tests for snap-preseed properties validation and command assembly.
tests/spread/plugins/uc-prepare/* Spread task + fixtures to validate uc-prepare plugin output.
tests/spread/plugins/snap-preseed/* Spread task + fixtures to validate snap-preseed plugin output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/unit/plugins/test_uc_prepare_plugin.py Outdated
Comment thread imagecraft/plugins/uc_prepare_plugin.py
Comment thread imagecraft/plugins/uc_prepare_plugin.py
Comment thread imagecraft/plugins/uc_prepare_plugin.py
Comment thread imagecraft/plugins/uc_prepare_plugin.py Outdated
Comment thread imagecraft/plugins/snap_preseed_plugin.py Outdated
@steinbro steinbro requested a review from mr-cal April 21, 2026 13:57
Copy link
Copy Markdown
Contributor

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

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

All non-blocking feedback. Looks good!

Comment thread imagecraft/plugins/uc_prepare_plugin.py Outdated
Comment thread imagecraft/plugins/uc_prepare_plugin.py Outdated
Comment thread tests/spread/plugins/snap-preseed/task.yaml Outdated
Comment thread imagecraft/plugins/snap_preseed_plugin.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread imagecraft/plugins/uc_prepare_plugin.py
Comment thread imagecraft/plugins/snap_preseed_plugin.py Outdated
Comment thread imagecraft/plugins/snap_preseed_plugin.py Outdated
Comment thread imagecraft/plugins/uc_prepare_plugin.py Outdated
Comment thread tests/unit/plugins/test_uc_prepare_plugin.py
Comment thread tests/unit/plugins/test_snap_preseed_plugin.py
Comment thread imagecraft/models/volume.py
Comment thread imagecraft/plugins/snap_preseed_plugin.py
Comment thread imagecraft/plugins/snap_preseed_plugin.py
Comment thread imagecraft/plugins/snap_preseed_plugin.py
Comment thread imagecraft/plugins/uc_prepare_plugin.py
Comment thread tests/spread/plugins/snap-preseed/task.yaml
Copy link
Copy Markdown

Copilot AI commented Apr 21, 2026

@lengau I've opened a new pull request, #323, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown

Copilot AI commented Apr 21, 2026

@lengau I've opened a new pull request, #324, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown

Copilot AI commented Apr 21, 2026

@lengau I've opened a new pull request, #325, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 16 commits April 22, 2026 12:13
* Initial plan

* Extract _resolve_snap to shared helper in imagecraft/plugins/_utils.py

Agent-Logs-Url: https://github.com/canonical/imagecraft/sessions/4615f0f5-ebf0-4d3b-86ea-03f5a729dd29

Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
…tion plugin options (#323)

* Initial plan

* Add tests for snap-preseed-channel and snap-preseed-validation options

Agent-Logs-Url: https://github.com/canonical/imagecraft/sessions/34e3782d-fe61-42fb-8630-aac0f0238e49

Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@lengau lengau left a comment

Choose a reason for hiding this comment

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

Thanks Shams! This was a very big one with SO MANY little edge cases.

@lengau lengau merged commit 97670aa into main Apr 24, 2026
18 checks passed
@lengau lengau deleted the work/classic-snap-prepare-image-plugin branch April 24, 2026 14:04
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.

5 participants