fix: adapt to craft-application v6 breaking changes
Metadata
Current evaluation
Closed unmerged and superseded by imagecraft#261, which merged as fa39f80 to upgrade to craft-application 6 and require summary and description.
Resolution: closed superseded
Reason: Maintainer comment lengau explicitly marked #244 as superseded by #261. The replacement PR merged as commit fa39f80.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Craft-application v6 changed defaults for `mandatory_adoptable_fields` and `project_variables` from `["version"]` to `["version", "summary", "description"]`, and Pydantic v2 now includes input values in validation error messages.
This PR adapts imagecraft to work with these changes by using the new defaults and updating tests accordingly.
## Changes
- **application.py**: Use craft-application v6 defaults for `mandatory_adoptable_fields` and `project_variables` (includes `version`, `summary`, and `description`)
- **test_project.py**: Update validation error assertions to match Pydantic v2 format with `input:` suffix
- **test_application.py**: Add `summary` and `description` fields to test YAML files to satisfy v6 requirements
- **test_lifecycle.py**: Update project_vars expectations to include `summary` and `description`
- **test_pack.py**: Use real `ProjectInfo` object instead of `MagicMock` for more reliable testing and to prevent apt backend initialization during tests
## Craft-application v6 Mandatory Fields
Yes, craft-application v6 effectively made `summary` and `description` mandatory through the `mandatory_adoptable_fields` mechanism. These fields must now be either:
- Defined in the project YAML, or
- Adopted via `adopt-info`
A follow-up issue should be created to discuss whether imagecraft should override these defaults to only require `version`.
---
- [x] I've followed the [contribution guidelines](https://github.com/canonical/imagecraft/blob/main/CONTRIBUTING.md).
- [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [x] I've successfully run `make lint && make test`.
- [ ] I've added or updated any relevant documentation.
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for you](https://github.com/canonical/imagecraft/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed superseded | Closed unmerged and superseded by imagecraft#261, which merged as fa39f80 to upgrade to craft-application 6 and require summary and description. | |
| stealth/space-bunny-alpha | — | closed superseded | Closed unmerged and superseded by #261, which merged as fa39f80 to upgrade to craft-application 6 and make summary and description mandatory. | |
| qwen/qwen3.6-35b-a3b | — | — | Superseded by PR #261. The pull request adapting imagecraft to craft-application v6 breaking changes was closed without merging due to code quality concerns. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Superseded by PR #261. The changes attempted to adapt the codebase to craft-application v6 mandatory fields and Pydantic v2 validation updates. The pull request was closed after the maintainer noted it contained hallucinations and recommended the updated version instead. |
Update history
No update history recorded yet.
Related work
-
Superseded By:
imagecraft#261
(confidence 100%)
Merged replacement PR that updated imagecraft for craft-application 6 and its new mandatory fields.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #241 Update to craft-application v6 | imagecraft | closed | Fixed by merged PR canonical/imagecraft#261 (fa39f80), upgrading to craft-application v6 and adapting to its required summary and description fields. | |
| #261 build!(deps): update to craft-application 6 | imagecraft | merged | Merged as commit fa39f80: bumped imagecraft to craft-application 6, requiring `summary` and `description` fields. Spread failure noted as pre-existing. | |
| #240 build(deps): update dependency craft-application to v6 (main) - autoclosed | imagecraft | closed | Renovate PR to bump craft-application ~=5.9 to ~=6.1 was autoclosed after `uv lock` failed to resolve; migration continued in #244 and landed via merged PR #261 (commit fa39f80). | |
| #6038 build(deps): bump craft-application to 6.2.0 | snapcraft | merged | Merged into main as fb8526fea, upgrading craft-application to 6.2.0 and bringing in the fix for canonical/craft-application#942. | |
| #5895 build(deps): update dependency craft-application to v6 (main) - autoclosed | snapcraft | closed | Renovate's craft-application 6.0 update was autoclosed unmerged; the upgrade was later completed by merged PR canonical/snapcraft#6038 (fb8526fea) using v6.2.0. | |
| #4659 fix: update to craft-application latest | snapcraft | merged | Merged PR #4659 updated Snapcraft for the latest craft-application breaking changes, consolidating work from #4616, #4643, and #4651. | |
| #2371 build(deps): update dependency craft-application to v5 (main) - autoclosed | charmcraft | closed | Renovate PR #2371 (craft-application ~=4.8 -> ~=5.5) was closed unmerged and autoclosed; maintainer @upils noted it was superseded by the hand-written #2360, merged in commit 5e0dd360. | |
| #1072 build(deps): update craft-application and craft-parts | rockcraft | closed | Closed unmerged and superseded by canonical/rockcraft#1073, which merged the same craft-application 6.1.0 and craft-parts 2.28.0 update in commit d5f711b2. | |
| #5749 build(deps): update dependency craft-application to >=5.9.0,<5.10.0 (main) | snapcraft | closed | Renovate's craft-application 5.9.0 bump was closed unmerged (bot ignore notice 2025-09-03); replacement #5758 (5.9.1) also closed. The upgrade instead landed later as craft-application 6.2.0 in #6038 (fb8526fea). | |
| #1182 build(deps): update craft-application to 6.3.1 | rockcraft | merged | Merged PR #1182 updated craft-application to 6.3.1, resolving the pending Pro-related issues. |