← Back to issue list

project_loader: raise error if part in after is undefined

View original Github issue

Metadata

Project
snapcraft
Number
#2386
Type
pull request
State
merged
Author
kyrofa
Labels
Created
Updated
Closed

Current evaluation

Merged a fix that raises an error when an undefined part is referenced in the after keyword, resolving LP: #1799596. Previously, snapcraft silently ignored such references, complicating migration from remote parts.

Suggested action:

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] 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)? - [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh tests/unit`? ----- The removal of remote parts in 06532fe0cea61462f371c6a87439771bfa6d67d6 also removed the sanity checking of parts contained within the `after` keyword. As a result, the snapcraft CLI simply ignores part names specified in `after` that aren't defined in the `snapcraft.yaml`. This isn't very helpful, and also makes the migration from remote parts incredibly difficult since they magically don't work instead of erroring nicely. This PR fixes [LP: #1799596](https://bugs.launchpad.net/snapcraft/+bug/1799596) by raising an error if a part specified in `after` isn't defined.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged a fix that raises an error when an undefined part is referenced in the after keyword, resolving LP: #1799596. Previously, snapcraft silently ignored such references, complicating migration from remote parts.
qwen3.6-35b-a3b-mtp-q6 Merged. Raises an error when a part referenced in the after keyword is undefined in snapcraft.yaml, restoring sanity checking lost during remote parts removal. Fixes LP: #1799596. Achieved 100% diff coverage.
qwen3.6-35b-a3b-mtp-q6 Merged. Raises an error when a part referenced in the after keyword is undefined in snapcraft.yaml, restoring sanity checks removed during remote parts deprecation. Fixes LP: #1799596.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1799596 No error if `after` specifies part that doesn't exist snapcraft (launchpad) closed Closed without a fix or comments, indicating the bug was abandoned. Snapcraft continues to silently accept invalid after references to non-existent parts.
71%