← Back to issue list

sources: copy mutable ignore pattern for source handlers (CRAFT-494)

View original Github issue

Metadata

Project
craft-parts
Number
#120
Type
pull request
State
merged
Author
cmatsuoka
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #120 (CRAFT-494, cmatsuoka) fixed shared mutable ignore patterns: merge commit 880735ee, implementation commit 280e1592, approved by 2 reviewers with no unresolved comments.

Resolution: closed resolved

Reason: The PR was merged into main as commit 880735ee (implementation 280e1592). craft_parts/sources/base.py now stores `self._ignore_patterns = ignore_patterns.copy()`, so per-source appends in craft_parts/sources/local_source.py (e.g. parts/stage/prime/overlay dir names) no longer mutate the caller's shared list from lifecycle_manager.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Source handlers may modify the list of ignore patterns, so make a new copy for each source handler instance. Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com> - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #120 (CRAFT-494, cmatsuoka) fixed shared mutable ignore patterns: merge commit 880735ee, implementation commit 280e1592, approved by 2 reviewers with no unresolved comments.
stealth/space-bunny-alpha — closed resolved Merged via #120 (merge 880735ee, implementation 280e1592), giving each source handler an independent copy of the mutable ignore-pattern list.
stealth/space-bunny-alpha — closed resolved Merged in canonical/craft-parts#120, making each source handler use its own copy of mutable ignore patterns to prevent shared-list mutations.
qwen/qwen3.6-35b-a3b — — Merged to resolve CRAFT-494. Source handlers now instantiate independent copies of mutable ignore patterns, preventing unintended shared state modification. Approved by two reviewers and passed CI checks.
qwen3.6-35b-a3b-mtp-q6 — — Merged a fix that creates a copy of mutable ignore patterns for each source handler instance, preventing unintended modifications. Resolves CRAFT-494.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-parts#362 (confidence 40%)

    Later work 'sources: fix ignore patterns in local sources' touches the same ignore-pattern append logic that motivated copying the list.

Related issues

Issue Project State Summary Similarity
#96 many: fix source ignore patterns (CRAFT-375) craft-parts merged Merged #96 via commit 9fd6ee7c (merge ab69ef78), fixing local-source filtering to exclude generated outputs, support app-defined ignore patterns, and honor custom work directories.
72%
#363 sources: fix ignore patterns in local sources craft-parts merged Merged PR #363, preventing local-source processing from accumulating repeated ignore patterns; the fix landed as 722d8f57 and was later backported by #373.
71%
#362 sources: fix ignore patterns in local sources craft-parts merged Merged as 722d8f57; local sources no longer accumulate repeated ignore patterns. Backported to 1.18 by #373 (ec0ab362).
70%