← Back to issue list

Allow hyphens in partition names

View original Github issue

Metadata

Project
craft-parts
Number
#789
Type
issue
State
closed
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Hyphens enabled in partition names and namespace/partition overlap conflicts validated. Landed via merged PR canonical/craft-parts#800 (commit 184d5142); conflict detection lives in _detect_conflicts().

Resolution: closed resolved

Reason: Both requested changes shipped in merged PR #800, commit 184d5142 ('feat: allow hyphens in partition names'). The current VALID_PARTITION_REGEX allows hyphens, and _validate_partitions_conflicts()/_detect_conflicts() now translate '+', '-' and '/' to '_' to flag collisions such as foo/bar vs foo-bar sharing CRAFT_FOO_BAR_STAGE.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### What needs to get done 1. Update validators to allow hyphens 2. Update [`_validate_namespace_conflicts()`](https://github.com/canonical/craft-parts/blob/9fe38d11637f037b37fe76aa5ecc013a9bc39695/craft_parts/utils/partition_utils.py#L124) to check that partitions and namespaced partitions won't overlap For example, `foo/bar` and `foo-bar` should be flagged as conflicts because they will both use the same environment variables `CRAFT_FOO_BAR_STAGE` and `CRAFT_FOO_BAR_PRIME`. ### Why it needs to get done To allow partitions to contain hyphens

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Hyphens enabled in partition names and namespace/partition overlap conflicts validated. Landed via merged PR canonical/craft-parts#800 (commit 184d5142); conflict detection lives in _detect_conflicts().
stealth/space-bunny-alpha — closed resolved Hyphens in partition names were enabled by merged PR canonical/craft-parts#800 (commit 184d5142).
qwen/qwen3.6-35b-a3b — — Closed without resolution. The request to allow hyphens in partition names and update conflict validation was logged as internal ticket CRAFT-3172 and appears abandoned. No code changes or pull requests were merged.
qwen/qwen3.6-35b-a3b — — Closed without implementation. The request to allow hyphens in partition names was synced to Jira ticket CRAFT-3172. No pull requests were merged or code changes applied, indicating the feature was deferred.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The request to allow hyphens in partition names and update conflict validators was not implemented. An automated bot synced it to Jira, but no pull requests were merged. The issue appears abandoned.
qwen3.6-35b-a3b-mtp-q6 — — Closed without implementation. The request to allow hyphens in partition names and update namespace conflict validation was deferred, with tracking moved to internal Jira ticket CRAFT-3172. No code changes were merged.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-parts#800 (confidence 99%)

    Merged PR titled 'feat: allow hyphens in partition names', commit 184d5142; directly implements both bullet points of #789.

  • Related To: canonical/craft-parts#790 (confidence 92%)

    Predecessor work (commit b2128938) relaxing the same validators to allow numbers; #789 was the follow-up for hyphens.

  • Related To: canonical/craft-parts#801 (confidence 88%)

    Follow-up fix (commit ceaf4cda, 'fix: partitions break when using special characters') repairing CRAFT-3031 lifecycle failures arising from the hyphen/number support added in #800.

  • Related To: canonical/craft-parts#1002 (confidence 72%)

    Later extension in the same validator, commit c2e41898 'feat: allow slashes in partition names', building on the same conflict-detection logic.

Related issues

Issue Project State Summary Similarity
#800 feat: allow hyphens in partition names craft-parts merged Merged PR #800 as commit 184d5142, adding support for hyphens in partition names for CRAFT-3031.
82%
#790 feat: allow numbers in partition names and namespaces craft-parts merged Merged PR #790 (commit b2128938) relaxes partition/namespace name validation to allow numbers; unblocked LP#2069783 (CRAFT-3043). Follow-up for hyphens filed as #789, fixed later by #800.
72%
#801 fix: partitions break when using special characters craft-parts merged Merged PR #801 fixed CRAFT-3031 lifecycle failures for partition names containing numbers and hyphens; merged as commit ceaf4cda.
72%
#999 Allow slashes in partition names craft-parts closed Implemented in PR #1002 (commit c2e41898): partition names now allow slashes, with updated conflict validation and path identification.
71%
#600 feat(partitions): handle namespaced partitions in utils craft-parts merged Merged into main in commit f387afa5 (PR #600), adding namespaced-partition handling to four partition utilities and resolving craft-parts#596.
70%
#599 feat(partitions): validate namespaced partitions craft-parts merged Merged PR #599 as commit 06a5f999, adding namespaced partition validation during LifecycleManager initialization and fixing #595 (CRAFT-2032).
70%