← Back to issue list

Format partition warnings and errors inside the error class

View original Github issue

Metadata

Project
craft-parts
Number
#670
Type
issue
State
open
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

Refactor task: partition warning/error classes should format indented messages internally instead of callers passing pre-indented strings. Unlabeled, no maintainer activity since 2024-05-17; code at HEAD still passes indented strings, so the work remains unaddressed.

Suggested action: needs triage

Reason: The issue has no labels, no assignee, and no maintainer response — the only comment is the autogenerated Jira-sync bot message (2024-05-17). I verified at HEAD that parts.py still builds pre-indented strings (e.g. ' misused partition ...' at parts.py:1189) and PartitionUsageError/PartitionUsageWarning in errors.py just join them, so the described refactor is still applicable but has never been triaged or prioritized.

Impact: 15 Quick Win: 9.0 Staleness: 72 Complexity: 40 Confidence: 85 Support Request: 0

Issue body

### What needs to get done Partition-related warnings are collated and presented as a nested list: ``` Possible misuse of partitions The following entries begin with a valid partition name but are not wrapped in parentheses. These entries will go into the default partition. parts.hello.organize misused partition 'default' in 'default/A1' misused partition 'kernel' in 'kernel/B' parts.hello.stage misused partition 'default' in 'default/' Wrap the partition name in parentheses, for example 'default/file' should be written as '(default)/file' ``` And the same for errors: ``` Invalid usage of partitions parts.hello.stage unknown partition 'bogus' in '(bogus)/C' no path specified after partition in '(kernel)' parts.hello.prime unknown partition 'extra/bogus' in '(extra/bogus)/C' no path specified after partition in '(kernel)/' Valid partitions: default, kernel, component/bar-baz Correct the invalid partition name(s) and try again. ``` Currently, the code that raises warnings and errors pass a list of indented strings to the error. Instead, the code should pass an unformatted data structure to the error. The error will handle the indenting. ### Why it needs to get done To reduce technical debt and improve code quality.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 15
Quick Win: 9.0
Staleness: 72
Complexity: 40
Confidence: 85
Support Request: 0
needs triage Refactor task: partition warning/error classes should format indented messages internally instead of callers passing pre-indented strings. Unlabeled, no maintainer activity since 2024-05-17; code at HEAD still passes indented strings, so the work remains unaddressed.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 15
Confidence: 80
Support Request: 0
needs triage Refactor partition warning and error formatting to pass unstructured data to the error class instead of pre-formatted strings. Currently unlabelled and inactive for over two years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 70
Support Request: 0
needs triage Refactor partition warnings and errors to pass unformatted data structures to the error class instead of pre-formatted strings. Currently untriaged and inactive for over two years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 30
Confidence: 70
Support Request: 5
needs triage Refactor partition warning and error handling to pass unformatted data structures instead of pre-indented strings, moving formatting into the error class. Reduces technical debt. Inactive for over a year; requires triage or reassignment.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1714 refactor: format partition errors inside error class craft-parts open Refactors partition error classes to receive unformatted data structures instead of pre-formatted strings. Fixes craft-parts#670. PR is 0 days old with pending CI checks and 2 unresolved review comments.
71%