← Back to issue list

nodejs plugin: fail gracefully when a package.json is missing

View original Github issue

Metadata

Project
snapcraft
Number
#2424
Type
pull request
State
merged
Author
sergiusens
Labels
Created
Updated
Closed

Current evaluation

Merged into master. The nodejs plugin now fails gracefully when package.json is missing, resolving LP #1807971 and SNAPCRAFT-9X. The change adds 40 lines and removes 8 across two files, achieving 100% diff coverage.

Suggested action:

No scores available.

Issue body

LP: #1807971 Fixes SNAPCRAFT-9X Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [ ] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged into master. The nodejs plugin now fails gracefully when package.json is missing, resolving LP #1807971 and SNAPCRAFT-9X. The change adds 40 lines and removes 8 across two files, achieving 100% diff coverage.
qwen3.6-35b-a3b-mtp-q6 Merged into master. The nodejs plugin now fails gracefully when a package.json is missing, resolving LP #1807971. Changes passed static and unit tests, received maintainer approval, and achieved 100% diff coverage before integration.
qwen3.6-35b-a3b-mtp-q6 Merged into master. The nodejs plugin now handles missing package.json files gracefully, resolving LP #1807971 and SNAPCRAFT-9X. Approved by a maintainer, the change achieved 100% diff coverage and fixed the crash behavior.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1023 nodejs plugin: fix the plugin’s dependency installation snapcraft merged Merged into master, this one-line change fixes the nodejs plugin dependency installation, resolving LP #1652542. The commit integrates cleanly with no impact on overall code coverage.
75%
#1819804 nodejs plugin: build fails if there are missing peer dependencies. snapcraft (launchpad) open Snapcraft nodejs plugin build fails when npm ls --json exits non-zero on missing peer deps; the CalledProcessError fallback is dead code since run_output wraps it in SnapcraftPluginCommandError. Open 7.5 years, unlabelled, no maintainer activity.
73%
#1838474 nodejs plugin assumes a version key in the package.json snapcraft (launchpad) open Nodejs plugin crashed with KeyError when package.json lacked a version key, with no fallback to snapcraft.yaml version. Reported 2019, zero comments, no maintainer response. The nodejs plugin has since been removed and replaced by the npm plugin, so the referenced code no longer exists.
70%