Snapcraft should complain multiple `after` properties in a single part
Metadata
Current evaluation
Snapcraft now rejects duplicate YAML mapping keys, producing an error for duplicate `after` properties instead of silently replacing the first value.
Resolution: closed resolved
Reason: Resolved by PR #3669 (commit a40a34314) which makes Snapcraft raise an error for duplicate YAML keys, as noted by @mr-cal in the closing comment.
Evaluated by: mr-cal-bot
No scores available.
Issue body
I stuck on debugging the missing patch files in the following part definition
```yaml
parts:
picard:
after:
- patching
source: https://github.com/metabrainz/picard.git
source-depth: 100
source-tag: release-2.1.3
plugin: x-python
override-build: |
git apply --verbose "${SNAPCRAFT_STAGE}"/patching/localedir.patch
snapcraftctl build
after: [desktop-qt5]
# Code patching to fix another part, when it cannot be solved by other means
patching:
source: patching
plugin: dump
organize:
'*': patching/
prime:
- -*
```
Which I (veeeery) later recognize that it is the `after: [desktop-qt5]` line that cause the problem, and has the effect of Snapcraft no longer consider the `patching` part os the `picard` part's dependency.
I suggest that Snapcraft bails out prematurely if multiple `after` properties are defined in a single part.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | closed resolved | Snapcraft now rejects duplicate YAML mapping keys, producing an error for duplicate `after` properties instead of silently replacing the first value. | |
| stealth/space-bunny-alpha |
Impact:
45
Quick Win:
34
Complexity:
10
Confidence:
99
Actionability:
85
|
close resolved | Snapcraft now rejects duplicate YAML mapping keys, so a second `after` entry can no longer silently replace the first; the issue is resolved. | |
| stealth/space-bunny-alpha |
Impact:
35
Quick Win:
28
Complexity:
15
Confidence:
99
Actionability:
95
|
close resolved | Duplicate YAML keys silently replaced the first `after` list, hiding a build dependency. This was fixed: merged PR #3669 added duplicate-key parsing errors for parts. | |
| qwen/qwen3.8-27b |
Impact:
15
Quick Win:
12
Staleness:
95
Complexity:
20
Confidence:
55
Support Request:
30
|
close stale | Request for snapcraft to error on duplicate 'after' YAML keys in a part definition. 7+ years old, zero comments, no labels, no maintainer interaction. References snapcraftctl and old part format that no longer exist in modern snapcraft. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
15
Confidence:
85
Support Request:
10
|
close stale | Feature request for Snapcraft to error out when multiple after properties are defined in a single part. The issue is 7+ years old, unlabelled, and has received zero maintainer engagement or comments. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
10
Confidence:
85
Support Request:
5
|
close stale | Feature request for Snapcraft to error on duplicate after properties in part definitions. Unlabeled and inactive for over 7 years with zero maintainer interaction. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
15
Confidence:
85
Support Request:
10
|
needs triage | Feature request to add validation and error out when a Snapcraft part definition contains multiple after properties, which currently silently overwrite each other. Untriaged and inactive for over 7 years. |
Update history
| Date | Change |
|---|---|
| closed | |
| created |
Related work
-
Likely Fixed By:
#3669
(confidence 95%)
PR #3669 added duplicate key detection in YAML parsing, which now catches duplicate `after` properties with a clear error message.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1770221 A snapcraft.yaml with more than 1 after: stanza doesn't warn or error | snapcraft (launchpad) | closed | Duplicate `after:` stanzas in `snapcraft.yaml` now trigger a warning instead of silently using the last value. Resolved by enabling duplicate key warnings (commit 2f80e5313). |