feat(lifecycle): conditionally enable partitions
Metadata
Current evaluation
Merged after approval and CI checks. Conditionally enables partitions for components on core24 or newer bases, generates partitions from definitions, and adds environment variables. Resolves #4463 and #4465.
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] Have you successfully run `make lint`?
- [x] Have you successfully run `pytest tests/unit`?
-----
- Conditionally enable partitions if components are defined and base is `devel`, `core24`, or newer
- Create partitions from components
- Create envvars for partitions (e.g. `SNAPCRAFT_COMPONENT_<name>_STAGE`)
TODO:
- [x] improve spread test to the partitions are created and `stage`, `prime`, and `organize` keywords work as-expected
Replaces #4487
Fixes #4463
Fixes #4465
(CRAFT-2307)
(CRAFT-2311)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged after approval and CI checks. Conditionally enables partitions for components on core24 or newer bases, generates partitions from definitions, and adds environment variables. Resolves #4463 and #4465. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged after fixing spread test failures. Conditionally enables partitions for components on devel and core24+ bases, generates partitions from components, adds partition environment variables, and adds core22 component support. Resolves #4463 and #4465. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Conditionally enables partitions for components on core24+ bases, creates partitions from components, and adds partition environment variables. Adds core22 support and updates the ComponentProject model. Fixes #4463 and #4465. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1699 feat: partitions always enabled | craft-parts | open | Consolidates enabled/disabled partition code paths into a unified approach where no partitions defaults to a single partition. CI passing, awaiting review. | |
| #599 feat(partitions): validate namespaced partitions | craft-parts | merged | Validates namespaced partitions during LifecycleManager initialization, resolving issue #595. Merged after approval by two reviewers, adding 248 lines and removing 22 across five files. | |
| #4487 [DRAFT] feat: enable partitions | snapcraft | closed | Superseded by PR #4493. The proposal to enable partitions unconditionally was revised per reviewer feedback to only activate when components are declared. The PR was closed without merging. | |
| #489 partitions: add feature and validation | craft-parts | merged | Merged. Implements the partitions feature and validation for LifecycleManager, adding a new parameter, input validation, error handling, and integration tests. Approved by two reviewers and passed CI checks. |