https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41274

--- Comment #1 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 189716
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189716&action=edit
Bug 41274: Koha::Devel::Files - Fix exception filtering in incremental mode

This patch fixes two bugs in the file exception filtering logic that
caused generated files (like Koha/Schema/Result/*) to not be excluded
properly when running in incremental/CI mode.

Bug #1: Incorrect array assignment
Lines 173 and 204 were assigning an arrayref as a single element
instead of dereferencing it:
  my @exception_files = $exceptions->{...};  # Wrong: creates array with 1
element (arrayref)
  my @exception_files = @{ $exceptions->{...} };  # Correct: dereferences to
array

Bug #2: Pattern matching not supported
array_minus() only performs exact string matches, so patterns like
"Koha/Schema/Result" would not match "Koha/Schema/Result/Aqbasket.pm".

The fix:
- Properly dereferences exception patterns array
- Replaces array_minus with grep + regex pattern matching
- Uses /^\Q$_\E/ to match file paths starting with exception patterns
- Removes now-unused Array::Utils dependency

This ensures consistent behavior between:
- Non-incremental mode: Uses git ls-files with :(exclude) patterns
- Incremental mode: Now uses equivalent pattern matching

Test plan:
1. Run tests locally (non-incremental): prove xt/perltidy.t
2. Verify Schema files are excluded
3. Run in CI (incremental mode) with Schema file changes
4. Verify Schema files are now correctly excluded (previously failing)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to