feat: add `needs_project` property
Metadata
Current evaluation
Merged. Adds a needs_project property and refactors LifecycleCommands classes to enable snapcraft's custom Pack command with minimal duplication. Approved by two reviewers and passed CI checks.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the guidelines for contributing?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `tox`?
-----
Two things:
1. Refactors the LifecycleCommands classes in a slightly more organized way without changing any existing commands. This is required for snapcraft to define its own `Pack` command with minimal duplicated code (https://github.com/canonical/snapcraft/pull/4794)
2. Add a `needs_project` property, which can determine if a project needs to be loaded based on the provided arguments.
Fixes https://github.com/canonical/snapcraft/issues/4769
(CRAFT-2861)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Adds a needs_project property and refactors LifecycleCommands classes to enable snapcraft's custom Pack command with minimal duplication. Approved by two reviewers and passed CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged to add a needs_project property and refactor LifecycleCommands classes. This enables snapcraft to define a custom Pack command with minimal duplication, resolving canonical/snapcraft#4769. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5616 feat(snapcraft_legacy): pack command runs the lifecycle | snapcraft | merged | Merged squashed PR that aligns the core20 snapcraft pack command with core22 and core24 by running the lifecycle. Approved by three reviewers with all CI checks passing. Resolves #5425. |