← Back to issue list

BuilddBaseAlias enum lookup raises bare ValueError — should raise a typed error

View original Github issue

Metadata

Project
craft-providers
Number
#969
Type
issue
State
open
Author
tonyandrewmeyer
Labels
Created
Updated
Closed

Current evaluation

Untriaged issue requesting BuilddBaseAlias enum lookup raise a typed CraftError instead of bare ValueError for better downstream error handling.

Suggested action: needs triage

Reason: The issue has no labels, no maintainer comments, and no assignee after 94 days — it has not yet been triaged. The report is well-structured with a clear proposed fix (catch ValueError at checks.py:109/115 and re-raise as a typed error), and it blocks canonical/craft-application#1086, so it warrants maintainer review rather than automatic closure.

Impact: 50 Quick Win: 37.5 Staleness: 65 Complexity: 25 Confidence: 70 Support Request: 10

Issue body

`BuilddBaseAlias(...)` at `craft_providers/bases/checks.py:109` and `:115` raises a bare `ValueError("'X.YY' is not a valid BuilddBaseAlias")` when the host or guest reports an Ubuntu `VERSION_ID` that isn't in the enum. Downstream consumers (e.g. craft-application's runtime-error handler) cannot distinguish this from any other `ValueError` without string-matching the message, which is brittle. Proposed fix: at the lookup site, catch the enum's `ValueError` and re-raise as a typed `CraftError` (or subclass) with a clear user-facing message — e.g. "Unsupported Ubuntu version for build base: <X.YY>". Context: craft-application carries a string-match guard for this in canonical/craft-application#1082; we want to remove it once this is fixed. Blocks: canonical/craft-application#1086

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 37.5
Staleness: 65
Complexity: 25
Confidence: 70
Support Request: 10
needs triage Untriaged issue requesting BuilddBaseAlias enum lookup raise a typed CraftError instead of bare ValueError for better downstream error handling.
qwen/qwen3.6-35b-a3b
Staleness: 55
Complexity: 20
Confidence: 85
Support Request: 0
needs triage Unlabelled issue requesting that BuilddBaseAlias enum lookup raises a typed CraftError instead of a bare ValueError. Currently unacknowledged by maintainers with no comments or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 60
Complexity: 20
Confidence: 90
Support Request: 0
needs triage BuilddBaseAlias enum lookup raises a bare ValueError instead of a typed error, breaking downstream error handling. Contributor proposes re-raising as CraftError. Issue is unlabelled and awaiting maintainer assessment.
qwen3.6-35b-a3b-mtp-q6
Staleness: 40
Complexity: 10
Confidence: 90
Support Request: 0
needs triage BuilddBaseAlias enum lookup raises a bare ValueError instead of a typed error. Proposed fix is to catch and re-raise as CraftError. Currently untriaged with no maintainer response.

Update history

No update history recorded yet.

Related work

  • Blocked By: canonical/craft-application#1086 (confidence 90%)

    Issue body explicitly states this blocks craft-application#1086, which removes a string-match guard that exists because of this bare ValueError.

  • Related To: canonical/craft-application#1082 (confidence 85%)

    PR in craft-application that handles base-alias lookup failures with structured errors; the issue body references this as context for the string-match guard.

Related issues

Issue Project State Summary Similarity
#979 ValueError: '26.10' is not a valid BuilddBaseAlias on `ensure_guest_compatible()` craft-providers closed Closed and triaged for internal tracking via Jira ticket CRAFT-5227. No explicit resolution or fix was documented in the provided context.
71%