Need better error handling in the parser
Metadata
Current evaluation
Fixed by merged PR canonical/snapcraft#581 ("Make most wiki fields required. Bugs/1593390"), which tightened snapcraft-parser wiki entry validation so bad entries error instead of silently defaulting.
Resolution: closed resolved
Reason: Maintainer ~elopio linked ubuntu-core/snapcraft PR #581 in the closing comment; that PR was merged and made most wiki entry fields mandatory (only origin-type left optional), addressing the request to stop using .get() and to surface parser errors. The bug was then closed against that work.
Evaluated by: mr-cal-bot
No scores available.
Issue body
1. Don't use .get() to access wiki entry data.
2. Raise exceptions to the top of the stack and log warnings.
[Impact]
* The parts origin will often change, and some changes might cause errors.
* Better error messages will make it easier to fix the problems in the source.
[Test Case]
* Add an invalid wiki entry.
* Run snapcraft-parser
* Make sure that an error is printed, but that it's not fatal and the rest of the entries are properly parsed.
[Regression Potential]
* snapcraft-parse is relatively new. Some other use cases could be affected, so extensive exploratory is required here.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR canonical/snapcraft#581 ("Make most wiki fields required. Bugs/1593390"), which tightened snapcraft-parser wiki entry validation so bad entries error instead of silently defaulting. | |
| stealth/space-bunny-alpha | — | closed resolved | Parser validation was improved by merged PR canonical/snapcraft#581, making most wiki fields required while leaving only origin-type optional. | |
| stealth/space-bunny-alpha | — | closed stale | Closed after about a decade without recorded follow-up; no resolving PR or commit was identified for the parser error-handling request. | |
| qwen/qwen3.6-35b-a3b | — | — | Improving error handling in the snapcraft-parser was closed without implementation. Proposed changes to replace .get() calls with explicit exception handling and logging were abandoned. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution or comments. The request to replace get calls with explicit exception handling and logging in the parser was abandoned due to inactivity. No implementation or merge occurred. | |
| qwen/qwen3.6-35b-a3b | — | — | Improved parser error handling was closed without implementation or linked pull requests. Zero comments and years of inactivity indicate the request was abandoned or superseded by newer parser versions. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without implementation, likely abandoned due to inactivity. No resolution or merge details were provided. The requested parser error handling improvements were not addressed. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
canonical/snapcraft#581
(confidence 97%)
Merged PR referenced directly in the issue's closing comment; title explicitly cites Bugs/1593390 and enforces required wiki fields so missing/invalid entries raise rather than silently default.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #613 parser - Don't allow duplicate wiki entries. | snapcraft | merged | Merged PR snapcraft#613 as commit 30e7f4207: the legacy parts parser now keeps the first wiki entry, emits a warning for duplicates and skips them. Fixes LP bug #1597057. | |
| #636 parser - Handle malformed wiki entries. | snapcraft | merged | Merged parser resilience fix for malformed wiki entries: documents are parsed independently, and integration tests use a fake server (#636, commit 0e3613ab4). |