A snapcraft.yaml with more than 1 after: stanza doesn't warn or error
Metadata
Current evaluation
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).
Resolution: closed resolved
Reason: The issue was resolved by enabling duplicate key warnings in the YAML parser, as noted by @~mr-cal and implemented in commit 2f80e5313.
Evaluated by: mr-cal-bot
No scores available.
Issue body
I (accidentally) created a snapcraft.yaml with 2 `after:` stanzas in the same part. Snapcraft did not warn or error that I had made this mistake. The `after:` stanza declared last was the one used.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | closed resolved | 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). | |
| stealth/space-bunny-alpha |
Impact:
45
Quick Win:
37
Complexity:
15
Confidence:
99
Actionability:
98
|
close resolved | Duplicate mapping keys, including two part-level after declarations, now produce a parsing error instead of silently retaining the last value. | |
| qwen/qwen3.6-35b-a3b |
Impact:
35
Quick Win:
15
Complexity:
30
Confidence:
55
Actionability:
60
|
needs triage | Snapcraft silently accepts duplicate `after:` stanzas in a part, using the last one. No validation or warning is emitted. Issue is open, unlabelled, and has no maintainer response. | |
| qwen/qwen3.8-27b |
Impact:
40
Quick Win:
32
Staleness:
85
Complexity:
20
Confidence:
80
Support Request:
10
|
close stale | Snapcraft silently accepted multiple after: stanzas in a part, using the last one. Fixed: duplicate-key detection in yaml_utils now raises an error for any repeated key, including after:. Issue is stale (8+ years, no activity) but the underlying problem is resolved in current code. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
15
Confidence:
80
Support Request:
10
|
close stale | Snapcraft silently accepts multiple after: stanzas in a part, using the last one without warning or error. Untriaged, inactive for over 8 years. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
10
Confidence:
85
Support Request:
5
|
needs triage | Snapcraft silently accepts duplicate after stanzas in a part, using the last one without warning or error. Open for over 8 years with no maintainer response or labels. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
100
Complexity:
15
Confidence:
80
Support Request:
10
|
close stale | Snapcraft silently accepts multiple after: stanzas in a single part, using the last one without warning or error. Issue is completely inactive for over 8 years with no maintainer response. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcraft#2f80e5313
(confidence 90%)
Commit 2f80e5313 enables duplicate key warnings, addressing the silent failure described in the issue.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1826753 Snapcraft should complain multiple `after` properties in a single part | snapcraft (launchpad) | closed | Snapcraft now rejects duplicate YAML mapping keys, producing an error for duplicate `after` properties instead of silently replacing the first value. | |
| #3517 yaml: detect and log warning on duplicate keys in snapcraft.yaml | snapcraft | closed | Superseded by PR #3518, merged as 5c2a9d2f8, adding warnings for duplicate keys in snapcraft.yaml. | |
| #3518 yaml: detect and log warning on duplicate keys in snapcraft.yaml (CRAFT-553) | snapcraft | merged | PR merged as 5c2a9d2f8 (commits 9b60bb1ef, 2f80e5313): snapcraft.yaml loading now detects duplicate YAML keys and logs a warning for each duplicate. Re-opened from #3517 for edge publishing. |