← Back to issue list

inconsistency in organize to overlay

View original Github issue

Metadata

Project
craft-parts
Number
#1590
Type
issue
State
closed
Author
cmatsuoka
Labels
Status: Triaged
Created
Updated
Closed

Current evaluation

Maintainer-filed report of inconsistent overlay organize (MERGE vs NEST) was fixed by PR #1602, merged as commit 139cbce6, making glob keys always nest and explicit keys merge.

Resolution: closed resolved

Reason: Maintainer cmatsuoka closed the issue citing commit 139cbce6 from PR #1602 ('fix(organize): make organize to overlay behavior consistent'), which rewrote organize_files() with _check_overlay_equivalence() so overlay destinations behave like other glob-key destinations and revert the a1178308 regression introduced by #1541.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description When organizing a directory to a directory, craft-parts exhibits two different behaviors: MERGE and NEST, depending on the presence of glob keys. If the source is a glob key and destination is the `(overlay)` pseudo-partition the behavior is different from all other glob key cases, as shown in the table below: | Key type | Destination type | Behavior | |------------------|-------------------|----------| | Explicit (no *) | Any | MERGE | | Glob (*) | Partition root | NEST | | Glob (*) | Overlay partition | MERGE | | Glob (*) | Regular path | NEST | The inconsistency is at lines 199-202 of organize.py: if dst_path in install_dir_map.values(): real_dst_path = dst_path / src_path.name else: real_dst_path = dst_path The "else" branch handles the overlay partition case and sets real_dst_path to dst_path directly, causing a MERGE instead of a NEST. To make the overlay partition consistent with other destinations, the fix would be to also nest the source directory name for the overlay partition: if dst_path in install_dir_map.values(): real_dst_path = dst_path / src_path.name elif dst_partition_pair.partition == OVERLAY_PARTITION: real_dst_path = dst_path / src_path.name else: real_dst_path = dst_path This ensures that a glob key always nests, regardless of whether the destination is a partition root, overlay partition, or regular path. The only case that should MERGE is when the key is explicit (no *), since the user is explicitly naming the source directory and specifying where its contents should go. [organize_behavior.txt](https://github.com/user-attachments/files/28116512/organize_behavior.txt) ### To Reproduce Create a part that organizes from a glob key to a directory under `(overlay)/`. ### part yaml ```shell ``` ### Relevant log output ```shell N/A ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Maintainer-filed report of inconsistent overlay organize (MERGE vs NEST) was fixed by PR #1602, merged as commit 139cbce6, making glob keys always nest and explicit keys merge.
stealth/space-bunny-alpha — closed resolved Fixed overlay organize behavior in merged PR #1602 (commit 139cbce6): glob keys now nest while explicit keys merge.
qwen/qwen3.6-35b-a3b — — Inconsistent directory organization to overlay partitions was fixed in commit 139cbce6 via PR #1602. The change normalizes overlay handling in organize_files() to ensure consistent nesting for glob keys across all destinations.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 40
Confidence: 90
Support Request: 0
keep open Bug report regarding inconsistent behavior when organizing directories to overlay partitions in craft-parts. Issue is triaged and assigned to a maintainer.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 15
Confidence: 95
Support Request: 0
keep open Inconsistency in craft-parts organize behavior when glob keys target the overlay partition, causing MERGE instead of expected NEST. Triaged, awaiting fix implementation.

Update history

Date Change
closed

Related work

  • Likely Fixed By: canonical/craft-parts#1602 (confidence 97%)

    Merged as 139cbce6; cited by the maintainer as the resolution.

  • Caused By: canonical/craft-parts#1541 (confidence 80%)

    Commit a1178308 (overlay idempotency fix) introduced the special-case overlay MERGE branch that #1602 reversed.

  • Related To: canonical/craft-parts#1586 (confidence 60%)

    Merged as 0797420f; related overlay organize conflict-handling change in the same area of organize.py.

Related issues

Issue Project State Summary Similarity
#1596 fix(organize): nest overlay directory globs craft-parts closed Overlay directory-glob fix was superseded by merged PR #1602 (commit 139cbce6), which restored consistent nesting for glob keys while explicit keys merge.
80%
#1602 fix(organize): make organize to overlay behavior consistent craft-parts merged Merged as 139cbce6, fixing a regression from #1541: glob-key overlay organization now nests files, while explicit keys continue to merge them.
78%