Validate namespaced parts or warn when part names contain slashes
Metadata
Current evaluation
Fixed by merged PR canonical/craft-parts#1701 (commit c0d12d9e), which rejects namespaced part names that create nested part-directory conflicts.
Resolution: closed resolved
Reason: PR #1701 was merged as commit c0d12d9e and added validation that raises an error when one part name is nested under another, implementing Option 2 while retaining general slash-based namespacing.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### What needs to get done
#### Option 1 - Warn today, error tomorrow
If a part name contains a slash, craft-parts should provide a warning:
```
Warning: part 'foo/bar' contains a '/', which may cause undesired behavior.
```
In a future major release, we can change the warning to an error.
#### Option 2 - Check for conflicts
If one part will be nested inside another, craft-parts should raise an error:
```
Error: part 'foo/bar' conflicts with 'foo'.
```
### Why it needs to get done
Craft-parts has no handling for '/' and allows for nested parts. Nested parts are undefined and will almost certainly cause a broken build:
```yaml
parts:
foo:
plugin: nil
foo/bar:
plugin: nil
```
```
├── parts
│ └── foo
│ ├── bar
│ │ ├── build
│ │ ├── install
│ │ ├── layer
│ │ ├── run
│ │ │ ├── build.sh
│ │ │ └── environment.sh
│ │ ├── src
│ │ └── state
│ │ ├── build
│ │ ├── prime
│ │ ├── pull
│ │ └── stage
│ ├── build
│ ├── install
│ ├── layer
│ ├── run
│ │ ├── build.sh
│ │ └── environment.sh
│ ├── src
│ └── state
│ ├── build
│ ├── prime
│ ├── pull
│ └── stage
```
Note that some craft apps namespace parts to indicate they belong to the application ([example](https://github.com/canonical/snapcraft/blob/945ab1505b603f298ff491392bf570d959229edb/snapcraft/extensions/gnome.py#L339)).
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR canonical/craft-parts#1701 (commit c0d12d9e), which rejects namespaced part names that create nested part-directory conflicts. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR canonical/craft-parts#1701 (commit c0d12d9e), which validates namespaced part names and prevents directory conflicts. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Accepted Option 2 to detect naming conflicts instead of banning slashes, as slash usage is required for application namespacing. Closed with plans to implement conflict validation to prevent broken builds from nested part directories. | |
| qwen/qwen3.8-27b |
Impact:
55
Quick Win:
30
Staleness:
10
Complexity:
45
Confidence:
80
Support Request:
0
|
keep open | craft-parts allows part names with slashes, creating nested part directories and broken builds. A maintainer recently confirmed Option 2 (conflict detection) is the compatible path since apps like snapcraft use namespaced part names by default. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
90
Complexity:
65
Confidence:
85
Support Request:
10
|
needs triage | Proposes warning or erroring on part names containing slashes to prevent broken builds from unintended nesting. Currently unlabelled and inactive since last year. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
85
Complexity:
30
Confidence:
75
Support Request:
10
|
needs triage | Request to validate or warn on part names containing slashes to prevent undefined nested part behavior and build failures. Currently unlabelled and inactive for over a year. |
Update history
| Date | Change |
|---|---|
| closed | |
| updated |
Related work
-
Likely Fixed By:
canonical/craft-parts#1701
(confidence 100%)
Merged PR adding namespaced-part conflict validation explicitly linked to issue #1016.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1701 feat: validate namespaced parts | craft-parts | merged | Merged in #1701 (commit c0d12d9e), rejecting namespaced parts nested under another part; fixes #1016 and is recorded in 2.37.0. |