← Back to issue list

fix: reject overlay scripts in parts organizing to overlay

View original Github issue

Metadata

Project
craft-parts
Number
#1747
Type
pull request
State
open
Author
randyli
Labels
—
Created
Updated
Closed
—

Current evaluation

Adds validation rejecting overlay lifecycle scripts when output organizes to (overlay), with guidance, 17 regression cases, and changelog/docs; open with no failing CI but one unresolved review comment.

Suggested action: needs review

Reason: The change directly addresses triaged issue #1735, and the reported fast suite completed with 5274 passes while no CI checks are failing. It still needs maintainer review because one review comment remains unresolved, no reviewer has responded, and the slow/integration suite was not run.

Evaluated by: mr-cal-bot

Impact: 46 Quick Win: 18 Complexity: 42 Confidence: 88 Actionability: 68

Issue body

Parts that organize build output into `(overlay)` currently accept `overlay-script` and `override-overlay`, allowing conflicting lifecycle configuration. Reject either script during part validation and explain how to generate files in `$CRAFT_PART_INSTALL` during `override-build`, or move overlay modifications to a separate dependent part. The validation uses the existing `organizes_to_overlay` predicate and treats empty scripts as defined, while allowing `None`. Preserve model-level Pydantic errors when converting them to `PartSpecificationError`; otherwise the new actionable message is discarded because these errors have no field location. Fixes #1735. ## Validation - `make test-fast`: 5274 passed, 4 skipped, 1 xfailed; 589 slow tests deselected. - 17 new regression cases cover both script keys, empty scripts, overlay destinations, null scripts, valid non-overlay configurations, and preservation of model-level error messages. - Actual CLI invocation rejects invalid configuration before execution and displays the resolution guidance. - Repository Ruff lint/format and codespell passed; `uv lock --check` and `git diff --check` passed. - Standalone `ty check --python .venv craft_parts tests` completed without errors, with one unrelated unused-ignore warning. The aggregate `make lint` command stopped because the snap-installed type checker could not resolve system APT modules. - Sphinx HTML build with warnings treated as errors and repository RST lint passed. - Vale spelling/inclusive-language checks on the changed documentation report exactly the same 89 findings as the base revision, with no new findings. - Full slow/integration suite was not run. ## Checklist - [x] Have you followed the guidelines for contributing? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `make lint && make test`? - [x] Have you added an entry to the changelog (`docs/reference/changelog.rst`)? The Canonical CLA check passed on this PR.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 46
Quick Win: 18
Complexity: 42
Confidence: 88
Actionability: 68
needs review Adds validation rejecting overlay lifecycle scripts when output organizes to (overlay), with guidance, 17 regression cases, and changelog/docs; open with no failing CI but one unresolved review comment.
stealth/space-bunny-alpha
Impact: 45
Quick Win: 17
Complexity: 30
Confidence: 78
Actionability: 55
needs review Rejects overlay-script/override-overlay on parts organizing to (overlay) via new part validation; adds 17 tests, changelog, docs. Fixes #1735. Open, no reviews, 1 unresolved comment, CI passing.
stealth/space-bunny-alpha
Impact: 55
Quick Win: 22
Complexity: 30
Confidence: 72
Actionability: 58
needs review Adds part-spec validation rejecting overlay-script/override-overlay on parts organizing to (overlay), with actionable guidance, 17 regression tests, changelog and docs. Fixes #1735. Open, no reviews yet, one unresolved comment.
stealth/space-bunny-alpha
Impact: 42
Quick Win: 19
Complexity: 32
Confidence: 62
Actionability: 65
needs review Rejects overlay-script/override-overlay on parts organizing to (overlay) via new part validation with actionable guidance; adds 17 regression tests, changelog and docs. Fixes #1735. Open, no reviews yet, one unresolved comment.

Update history

Date Change
updated
updated
created

Related work

  • Related To: craft-parts#1735 (confidence 100%)

    The PR explicitly states that it fixes this issue, which requests rejection of overlay lifecycle scripts on parts organizing output to (overlay).

Related issues

Issue Project State Summary Similarity
#1735 Parts that organize to the overlay should not accept `overlay-script` or `override-overlay` craft-parts open craft-parts accepts overlay-script/override-overlay on parts whose organize targets (overlay), silently doing the wrong thing. Triaged by lengau, assigned to randyli, and targeted by open PR #1747 adding PartSpec validation plus tests/docs.
73%