fix(project): handle devel bases in is_effective_base_eol() - #1153
Open
lengau wants to merge 3 commits into
Open
fix(project): handle devel bases in is_effective_base_eol()#1153lengau wants to merge 3 commits into
lengau wants to merge 3 commits into
Conversation
is_effective_base_eol() did not handle a devel series or a base unrecognized by distro-support, causing an unhandled UnknownVersionError crash (e.g. build-base: devel with --ignore=unmaintained). Give it the same treatment as check_base_is_supported()/base_eol_soon_date(): treat devel as never EOL, and assume unknown bases are supported. Fixes #1152 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a crash in ProjectService.is_effective_base_eol() when the project’s effective base is devel or otherwise unrecognized by distro-support, aligning the behavior with the existing base-support helper methods.
Changes:
- Treat
effective_basewithseries == "devel"as never EOL (returnsFalse). - Catch
UnknownDistributionError/UnknownVersionErrorfromdistro-supportand assume the base is supported (not EOL). - Add a new parametrized unit test for
is_effective_base_eol()covering supported, EOL,develbuild-base, and unknown distribution cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
craft_application/services/project.py |
Adds devel handling and exception fallback to prevent UnknownVersionError/UnknownDistributionError crashes in is_effective_base_eol(). |
tests/unit/services/test_project.py |
Introduces a new unit test for is_effective_base_eol() across several base/build-base scenarios. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Simplify is_effective_base_eol() to special-case a devel series the same way check_base_is_supported() does, rather than broadly catching UnknownDistributionError/UnknownVersionError for any unrecognized base. This more precisely fixes the crash on build-base: devel without silently treating other unrecognized bases as non-EOL. Also add a spread test that packs a project with build-base: devel and --ignore=unmaintained, and update/split the unit tests to cover the devel special-case versus genuinely unknown bases (which now correctly propagate the underlying distro-support error). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds the newly-available Ubuntu 26.04 LTS multipass image as a spread test system, matching the existing openstack backend coverage. Verified locally by running the pack-devel-build-base regression test on multipass:ubuntu-26.04-64. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lengau
marked this pull request as ready for review
August 10, 2026 21:56
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
tests/spread/witchcraft/pack-devel-build-base/task.yaml:8
- This says the regression test covers any base unknown to
distro-support, but the implementation only special-casesseries == "devel", andtest_is_effective_base_eol_unknown_base_raisesexplicitly verifies that other unknown distributions/versions still raise. Narrow this explanation to thedevelcase so the test documentation matches the behavior.
# ProjectService.is_effective_base_eol() did not handle a build-base of "devel"
# (or any base unrecognized by distro-support), crashing with an unhandled
# UnknownVersionError. This is only exercised when the --ignore=unmaintained
lengau
added a commit
to canonical/imagecraft
that referenced
this pull request
Aug 10, 2026
is_effective_base_eol() crashes with UnknownVersionError when build-base: devel is used with --ignore=unmaintained, since it lacks the same devel/unknown-base handling as its sibling methods check_base_is_supported()/base_eol_soon_date(). This broke tests/spread/pack/non-sequential-partitions and tests/spread/pack/sector-write on all systems. Point craft-application at the canonical/craft-application#1153 fix branch until it's merged and released, then switch back to a released craft-application~=7.1. Fixes canonical/craft-application#1152 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1152
ProjectService.is_effective_base_eol()did not handle abuild-base/baseofdevel(or any base unrecognized bydistro-support) the same way its sibling methods do, causing an unhandledUnknownVersionErrorcrash.This gives
is_effective_base_eol()the same treatment ascheck_base_is_supported()andbase_eol_soon_date():develseries as never EOL.(UnknownDistributionError, UnknownVersionError)and assume the base is supported whendistro-supportdoesn't recognize it.Testing
Added
test_is_effective_base_eolcovering supported, EOL,develbuild-base, and unrecognized-base cases. Fulltests/unit/services/test_project.pysuite passes (2199 passed, 54 skipped).