snapcraft init doesn't fail if there is a .snapcraft.yaml file
Metadata
Current evaluation
Fixed by merged snapcraft#669 (commit 2cd727259): snapcraft init now detects an existing .snapcraft.yaml and fails instead of creating snapcraft.yaml.
Resolution: closed resolved
Reason: PR canonical/snapcraft#669 was merged as commit 2cd727259, adding the missing-file detection and unit test coverage.
Evaluated by: mr-cal-bot
No scores available.
Issue body
$ touch .snapcraft.yaml
$ snapcraft init
Created snapcraft.yaml.
Edit the file to your liking or run `snapcraft` to get started
Instead of creating the snapcraft.yaml, it should fail with:
.snapcraft.yaml already exists!
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged snapcraft#669 (commit 2cd727259): snapcraft init now detects an existing .snapcraft.yaml and fails instead of creating snapcraft.yaml. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR canonical/snapcraft#669 (commit 2cd727259): snapcraft init now detects an existing .snapcraft.yaml instead of creating another config. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by snapcore/snapcraft#669 (commit 2cd727259): snapcraft init now rejects an existing .snapcraft.yaml instead of creating snapcraft.yaml. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in PR #669 (commit 2cd727259): snapcraft init now detects an existing .snapcraft.yaml before generating snapcraft.yaml. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution or linked pull request. The bug where snapcraft init fails to detect existing .snapcraft.yaml files remains unfixed. Likely abandoned due to prolonged inactivity. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The snapcraft init command remains unchanged and still creates snapcraft.yaml when .snapcraft.yaml exists, indicating the bug was abandoned or superseded by newer project changes. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed. The issue requested snapcraft init to fail when .snapcraft.yaml already exists. No resolution or merge details were provided. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. The snapcraft init command should detect an existing .snapcraft.yaml file and exit with an error instead of creating snapcraft.yaml. No fix or pull request was submitted. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
canonical/snapcraft#669
(confidence 100%)
The linked merged PR implemented detection for existing .snapcraft.yaml files.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #669 Add detection for an existing `.snapcraft.yaml` file before running `snapcraft init` | snapcraft | merged | Merged PR #669 (commit 2cd727259) makes snapcraft init detect an existing .snapcraft.yaml, preventing creation of a duplicate snapcraft.yaml; a unit test was added. | |
| #5664 fix: snapcraft init crash when snapcraft.yaml exists but is empty | snapcraft | merged | Merged #5664 as commit f78e6e5d1, preventing snapcraft init from crashing when snapcraft.yaml is empty or invalid and adding unit coverage. | |
| #1660880 snapcraft init doesn't finish the yaml with an empty line | snapcraft (launchpad) | closed | Resolved by merged PR snapcraft#1275 (commit 34f45ef2d), which added a trailing newline to snapcraft.yaml files generated by snapcraft init. | |
| #1871109 snapcraft should check file creation permissions and warn/error out instead of generating a non-functional snap | snapcraft (launchpad) | closed | Snapcraft now validates the snap skeleton and fails before producing an unusable artifact; merged in canonical/snapcraft#3743 (7c927032d). | |
| #1898922 snapcraftctl fails, but exit status is zero | snapcraft (launchpad) | closed | Fixed by merged PR #3317 (commit 9c622ecda), which makes snapcraft propagate snapcraftctl build failures instead of returning a false success status. | |
| #1567041 snapcraft init creates icon entry | snapcraft (launchpad) | closed | Fixed by merged ubuntu-core/snapcraft#433 (commit af86cddce): snapcraft init no longer generates an icon entry. | |
| #1575581 "snapcraft init" doesn't generate a valid template | snapcraft (launchpad) | closed | Fixed by PR ubuntu-core/snapcraft#528 and released in Snapcraft 2.10 for Xenial; verification confirmed `snapcraft init` followed by `snapcraft` produced a valid snap. | |
| #1599098 [parser] Don't explode if snapcraft.yaml is missing | snapcraft (launchpad) | closed | Fixed by merged PR #985 (commit 632022ccd), which replaced the missing snapcraft.yaml traceback with a clearer parser error. | |
| #1541987 snapcraft snap <directory> fails due to looking for package.yaml | snapcraft (launchpad) | closed | Bug fixed in merged PR ubuntu-core/snapcraft#297 (commit 53236ee): `snapcraft snap <directory>` now looks for snap.yaml instead of the obsolete package.yaml. | |
| #5167 Snapcraft raises an internal error if there is a file called `snap` | snapcraft | closed | Fixed by merged PR #5512 (commit 02e267fb9): get_snap_project now catches NotADirectoryError and raises ProjectDirectoryTypeError instead of crashing when a file named 'snap' exists in the project directory. |