Multi-entry dict not processed correctly
Metadata
Current evaluation
Fixed by merged PR #74 (commit 7f75f79), correcting multi-entry dictionary handling after grammar statements.
Resolution: closed resolved
Reason: PR #74 was merged with commit 7f75f79, fixing removal of grammar statements encountered while processing later multi-entry dictionaries.
Evaluated by: mr-cal-bot
No scores available.
Issue body
When followed by dictionary with more than one entry in a list, a grammar statement is removed by mistake.
The following configuration illustrate the issue:
```
foo:
- on amd64 to riscv64:
- bar1: baz1
- on amd64 to arm64:
- bar2: baz2
- bar3: baz3
bar4: baz4
```
When building for `riscv64`, the first statement (the `on amd64 to riscv64` section) is finalized when dealing with the second one. Then the second one (the `on amd64 to arm64` section) is excluded (not matching the target arch). So this is producing the expected primitives.
When building for `arm64`, the first statement is finalized (and later ignored) when dealing with the second one. But the second one is removed by mistake in `_parse_section_dictionary()` when looping over entries in the last dictionary (specifically when handling `bar4: baz4`). So the only resulting primitive will be the last element of the list.
See https://github.com/canonical/craft-grammar/commit/67816503fd77f033d27276720c14d621cd537009 showing a broken test.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #74 (commit 7f75f79), correcting multi-entry dictionary handling after grammar statements. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #74 (commit 7f75f79), correcting multi-entry dictionary handling after grammar statements. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed incorrect removal of grammar statements followed by multi-entry dictionaries; PR #74 merged as commit 7f75f79. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned in the repository and tracked internally via Jira ticket CRAFT-4267. No fix or pull request was merged. The multi-entry dictionary parsing bug remains unresolved. | |
| qwen/qwen3.6-35b-a3b | — | — | A bug report detailing incorrect parsing of multi-entry dictionaries was closed without a fix or resolution. An internal Jira ticket was created, but no code changes or merge details are documented. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed and tracked as Jira ticket CRAFT-4267. No fix or merge was provided. The parsing bug remains unresolved. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-grammar#74
(confidence 100%)
Merged fix specifically titled “handle multi-entry dictionary after grammar statement.”
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #74 fix: handle multi-entry dictionary after grammar statement | craft-grammar | merged | Merged PR #74 fixed #73 in commit 7f75f79 by correctly handling multi-entry dictionaries after grammar statements. |