← Back to issue list

Merge similar error types

View original Github issue

Metadata

Project
craft-parts
Number
#1331
Type
issue
State
open
Author
bepri
Labels
Status: Triaged
Created
Updated
Closed
—

Current evaluation

Maintainer refactoring task (bepri, CRAFT-4798) to merge the near-duplicate InvalidSourceOption/InvalidSourceOptions source errors into one type; both classes and their separate raise paths still exist in craft_parts/sources/errors.py and sources/base.py.

Suggested action: keep open

Reason: The duplication is confirmed still present: InvalidSourceOption (errors.py:48) and InvalidSourceOptions (errors.py:67) are byte-for-byte equivalent apart from the `option`/`options` argument, and base.py:129-136 raises one or the other purely based on len(invalid_options) > 1. No commit in history touching errors.py after 4efd5bd0 merges them, so nothing has fixed it. The issue is maintainer-authored, labelled Status: Triaged, and linked to CRAFT-4798, so it should stay open despite 374 days of inactivity. Only uncertainty: the exact target signature (a single `options: list[str]` vs. keeping a plural alias) needs a small design decision, and since these error classes are part of craft-parts' public error surface, downstream craft apps could theoretically catch them.

Evaluated by: mr-cal-bot

Impact: 15 Quick Win: 10 Complexity: 22 Confidence: 82 Actionability: 82

Issue body

### What needs to get done `InvalidSourceOption` and `InvalidSourceOptions` should be merged into a singular error type. ### Why it needs to get done Spawned from the following TODO comment: https://github.com/canonical/craft-parts/blob/a20b49d1b27ecd00ab74eb786d0f2403184adc97/craft_parts/sources/errors.py#L67

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 15
Quick Win: 10
Complexity: 22
Confidence: 82
Actionability: 82
keep open Maintainer refactoring task (bepri, CRAFT-4798) to merge the near-duplicate InvalidSourceOption/InvalidSourceOptions source errors into one type; both classes and their separate raise paths still exist in craft_parts/sources/errors.py and sources/base.py.
qwen/qwen3.6-35b-a3b
Impact: 20
Quick Win: 13
Complexity: 20
Confidence: 85
Actionability: 80
keep open Merge InvalidSourceOption and InvalidSourceOptions into a single error type, as requested by a TODO comment in craft_parts/sources/errors.py:67.
qwen/qwen3.8-27b
Impact: 15
Quick Win: 9
Staleness: 65
Complexity: 40
Confidence: 85
Support Request: 0
keep open Cleanup task to merge near-duplicate error types InvalidSourceOption and InvalidSourceOptions in craft_parts/sources/errors.py. Labeled Status: Triaged; both types still exist and are raised in sources/base.py, so the work remains unaddressed.
qwen/qwen3.6-35b-a3b
Staleness: 80
Complexity: 15
Confidence: 90
Support Request: 0
keep open Refactor to merge `InvalidSourceOption` and `InvalidSourceOptions` error types per a code TODO. Labeled triaged but inactive for ~10 months with no maintainer follow-up.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 10
Confidence: 85
Support Request: 0
close stale Request to merge InvalidSourceOption and InvalidSourceOptions error types. Triaged by a maintainer but inactive for over 9 months with no implementation or discussion.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.