← Back to issue list

Utility function to format partition names

View original Github issue

Metadata

Project
craft-parts
Number
#610
Type
issue
State
open
Author
lengau
Labels
—
Created
Updated
Closed
—

Current evaluation

Consolidate duplicated partition name formatting logic in executor/environment.py and utils/partition_utils.py into a shared utility function.

Suggested action: keep open

Reason: The duplication is confirmed: `executor/environment.py:_translate_partition_env()` and `utils/partition_utils.py:_detect_conflicts()` both independently implement the same `+`/`-`/`/` to `_` translation with uppercasing. A volunteer (gcomneno) prepared a behavior-preserving refactor but stepped back, leaving the issue available. The fix is straightforward — extract the shared formatting logic into a utility function in `partition_utils` and use it from both callers.

Evaluated by: mr-cal-bot

Impact: 30 Quick Win: 22 Complexity: 10 Confidence: 85 Actionability: 80

Issue body

### What needs to get done Basically this as a utility function: https://github.com/snapcore/snapcraft/pull/4493/files#diff-81bf1b8cfa88289a0432d3e12f4b4c1c104d4463a49dbc0e6c431d4e444a35cdR541-R544 ### Why it needs to get done We've got this code in multiple places and more will probably come. If this changes we'd have to change it in downstream apps. cc @mr-cal

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 22
Complexity: 10
Confidence: 85
Actionability: 80
keep open Consolidate duplicated partition name formatting logic in executor/environment.py and utils/partition_utils.py into a shared utility function.
stealth/space-bunny-alpha
Impact: 28
Quick Win: 19
Complexity: 22
Confidence: 88
Actionability: 85
keep open Refactor request: centralize partition-name-to-env-var formatting (uppercase, +/-// to _) currently duplicated in environment.py and partition_utils; still unfixed. Contributor gcomneno proposed partition_utils.format_partition_name_for_env() awaiting maintainer review.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 20
Complexity: 20
Confidence: 85
Actionability: 85
keep open Refactor to centralize partition name formatting logic currently duplicated in executor.environment and partition_utils._detect_conflicts. A contributor has a concrete plan and prepared changes locally.
qwen/qwen3.8-27b
Impact: 30
Quick Win: 22
Staleness: 10
Complexity: 25
Confidence: 90
Support Request: 0
keep open Refactor request to extract partition-name-to-env-var translation (uppercase, +/-/ to _) into a shared utility, currently duplicated in executor/environment.py and utils/partition_utils.py. Contributor volunteered 17 days ago with a concrete plan; duplication confirmed to still exist.
qwen/qwen3.6-35b-a3b
Staleness: 20
Complexity: 15
Confidence: 90
Support Request: 0
keep open Request to extract partition name formatting logic into a shared utility to reduce code duplication. A contributor recently volunteered to implement a behavior-preserving refactor, making it an active, actionable task.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 20
Confidence: 80
Support Request: 10
close stale Proposes extracting a partition name formatting utility function to reduce code duplication across the codebase and downstream apps. Currently inactive with no maintainer follow-up or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 92
Complexity: 15
Confidence: 85
Support Request: 0
needs triage Request to extract a partition name formatting utility function to reduce code duplication. Unlabelled, inactive for over a year, awaiting maintainer assessment.

Update history

Date Change
updated
updated
updated

Related issues

No related issues found above the similarity threshold.