From cc7c1aa1573237bfdf88724be25ac96415b032d7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 4 Jun 2026 07:51:35 +0100 Subject: [PATCH] Bug 42764: Fix false positives caused by mixed filetypes in CI failure store The ci-results repo stores all failures from a single test run as one flat JSON array, regardless of whether they came from the pl, tt, or js filetype pass. On the next incremental run, get_files_to_test('pl') reads that entire list -- including any .tt failures -- and calls remove_exceptions with the 'pl' context. Since .tt files only appear in the tt exception list, they survive the filter and get codespell'd in the pl pass where nothing is configured to exclude them. The fix filters stored failures by filetype before applying exceptions, so each pass only re-checks failures that belong to its own type. Test plan: 1. Apply all patches 2. Add a file to the tt codespell exceptions in Koha::Devel::Files that contains a word codespell would flag 3. Introduce a deliberate failure in another file so the ci-results repo records the excepted .tt file as a previous failure 4. On the next incremental run, confirm the excepted .tt file is not re-tested in the pl or js pass 5. prove xt/author/codespell.t => Tests pass; no false positives from cross-filetype re-checks Signed-off-by: Martin Renvoize --- Koha/Devel/CI/IncrementalRuns.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Devel/CI/IncrementalRuns.pm b/Koha/Devel/CI/IncrementalRuns.pm index f7e02638f9..9b9df67c0c 100644 --- a/Koha/Devel/CI/IncrementalRuns.pm +++ b/Koha/Devel/CI/IncrementalRuns.pm @@ -140,6 +140,7 @@ sub get_files_to_test { @koha_commit_history; if ($last_build_commit) { @files = @{ from_json( read_file("$self->{git_repo_dir}/$self->{test_dir}/$last_build_commit") ) }; + @files = grep { $dev_files->get_filetype($_) eq $filetype } @files; @files = $dev_files->remove_exceptions( \@files, $filetype ); push @files, $dev_files->ls_files( $filetype, "$last_build_commit HEAD" ); } else {