[parser] Don't explode if snapcraft.yaml is missing
Metadata
Current evaluation
Resolved by adding a missing file check to prevent parser crashes. The fix was merged and the issue closed.
Suggested action: —
No scores available.
Issue body
Slightly related to bug 1591207, there's this:
daniel@daydream:/tmp/test$ ~/dev/snappy/snapcraft/bin/snapcraft-parser -d -i https://wiki.ubuntu.com/snapcraft/parts?action=raw
Processing part 'qt5conf'
Von https://github.com/dplanella/qt5conf
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Processing part 'qt4conf'
Von https://github.com/kyrofa/qt4conf
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Processing part 'gtkconf'
Von https://github.com/dplanella/gtkconf
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Processing part 'curl'
Von https://github.com/sergiusens/curl
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Processing part 'mqtt-paho'
Von https://github.com/sergiusens/mqtt-paho
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Processing part 'ffmpeg'
Von https://github.com/Winael/ffmpegconf
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Traceback (most recent call last):
File "/home/daniel/dev/snappy/snapcraft/bin/snapcraft-parser", line 29, in <module>
snapcraft.internal.parser.main()
File "/home/daniel/dev/snappy/snapcraft/snapcraft/internal/parser.py", line 77, in main
return run(args)
File "/home/daniel/dev/snappy/snapcraft/snapcraft/internal/parser.py", line 248, in run
master_parts_list = _process_index(output)
File "/home/daniel/dev/snappy/snapcraft/snapcraft/internal/parser.py", line 222, in _process_index
parts_list, after_parts = _process_entry(data)
File "/home/daniel/dev/snappy/snapcraft/snapcraft/internal/parser.py", line 184, in _process_entry
origin_data = _get_origin_data(origin_dir)
File "/home/daniel/dev/snappy/snapcraft/snapcraft/internal/parser.py", line 99, in _get_origin_data
with open(os.path.join(origin_dir, 'snapcraft.yaml'), "r") as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ffmpeg/snapcraft.yaml'
daniel@daydream:/tmp/test$
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Resolved by adding a missing file check to prevent parser crashes. The fix was merged and the issue closed. | |
| qwen/qwen3.6-35b-a3b | — | — | The parser crashed with a FileNotFoundError when snapcraft.yaml was missing. The issue was closed without comments or activity, indicating it was abandoned without a formal fix or resolution. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed to gracefully handle missing snapcraft.yaml files, preventing the parser from crashing with a FileNotFoundError. The issue was closed after the fix was merged. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #618 parser - Support .snapcraft.yaml files. | snapcraft | merged | Merged. Adds parser support for .snapcraft.yaml alongside snapcraft.yaml, enforcing that exactly one file exists and erroring otherwise. Successfully integrated into the codebase. | |
| #1605541 snapcraft-parser doesn't work | snapcraft (launchpad) | closed | Closed as a regression without resolution. snapcraft-parser 2.13 failed to parse multi-document YAML streams, causing a parser error. The issue was abandoned with no fix or follow-up. | |
| #1597484 The parser needs to support hidden .snapcraft.yaml files | snapcraft (launchpad) | closed | Closed without resolution. Support for hidden .snapcraft.yaml files was abandoned due to inactivity. No fix or implementation details were recorded. |