"snapcraft init" doesn't generate a valid template
Metadata
Current evaluation
Fixed by updating the snapcraft init template to include the required parts section and a documentation comment. The fix was verified, closed, and validated with a regression test ensuring the generated template builds successfully.
Suggested action: —
No scores available.
Issue body
Using snapcraft 2.8.4 in xenial
Getting a source and doing "snapcraft init", editing the snapcraft.yaml to file the info required and doig "snapcraft build" leads to an error "'parts' is a required property" ... if that's required the default template should include it or at least a comment saying "you need to add a parts section, see documentation on ..."
[Impact]
* It's hard for a user to get started.
* The init template will contain more info, and will be snapcraft-able.
[Test Case]
* Run snapcraft init
* Run snapcraft
* Verify that you get a valid snap.
[Regression Potential]
* The only risk would be that the error message is worse than before. We added a test to check that there is no error message anymore.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Fixed by updating the snapcraft init template to include the required parts section and a documentation comment. The fix was verified, closed, and validated with a regression test ensuring the generated template builds successfully. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by updating the snapcraft init template to include the required parts section, ensuring generated snaps build successfully. Verified and closed. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1604504 'snapcraft init' examples are not style compliant | snapcraft (launchpad) | closed | Resolved via PR #673, which updated snapcraft init boilerplate indentation to 2 spaces and added missing minimum properties. | |
| #528 Improve the template for snapcraft init | snapcraft | merged | Merged updates to the snapcraft init template, adding placeholder metadata and a default part to simplify initial setup. Approved following maintainer review and positive contributor feedback. | |
| #1620843 Updated boilerplate for 'snapcraft init' | snapcraft (launchpad) | closed | Closed without implementation. The proposed snapcraft init boilerplate was likely superseded by a later template update. No further action was taken. | |
| #2393 lifecycle: make snapcraft init template use > not | | snapcraft | merged | Merged changes to update the snapcraft init template, replacing the YAML literal style with the folded style for the description field. Approved and integrated to correct formatting per bug report lp:1801973. |