From a5c6eaee73e4008a51d71c925b4fd410b27578c8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 2 Aug 2026 04:38:33 +0900 Subject: fix(symfony-finder): make Glob::to_regex regex-crate compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Glob::toRegex emits PCRE-only constructs — the (?=[^\.]) look-ahead for the strict-leading-dot rule, the possessive [^/]++ in /**/ segments, and, via BaseExcludeFilter, the (?=$|/) dir-boundary look-ahead — which the regex crate cannot compile, so `archive` and every ArchivableFilesFinder path panicked. Rewrite the port to tokenize the glob (mirroring the PHP loop's dispatch) and resolve every no-dot constraint by recursive union expansion. The dir boundary must take part in that expansion (a trailing `*` matching zero characters drops the constraint onto the boundary itself), so BaseExcludeFilter now uses the new Glob::to_regex_dir_boundary instead of string surgery. Equivalence was verified against PHP 8.5.8 (vendored Glob.php + preg_match) over 66,176 glob x flag x subject combinations with zero divergence. Un-ignores the five archiver tests blocked on this and updates GitExcludeFilterTest's expected pattern text, an explicitly authorized exception to the no-test-modification rule. Co-Authored-By: Claude Fable 5 --- crates/shirabe/tests/all_functional_test.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'crates/shirabe/tests/all_functional_test.rs') diff --git a/crates/shirabe/tests/all_functional_test.rs b/crates/shirabe/tests/all_functional_test.rs index 2bd81e11..72e1cbec 100644 --- a/crates/shirabe/tests/all_functional_test.rs +++ b/crates/shirabe/tests/all_functional_test.rs @@ -259,16 +259,11 @@ fn test_integration_create_project_command() { #[test] #[serial] -#[ignore = "the former blocker (scheme-less packages.json read via RemoteFilesystem::\ - get_remote_contents) is fixed and the EXPECT-REGEX assertion itself now passes, but \ - only incidentally: the run needs live network (real git clone from github.com) and \ - still panics with exit 101 (Composer exits 0) during CreateProjectCommand's keep-vcs \ - cleanup, whose Symfony Finder name patterns go through Glob::to_regex, which \ - faithfully emits PCRE lookaheads ((?=[^\\.])) the regex crate cannot compile; the \ - fixture just never asserts the exit code. Making Glob::to_regex regex-crate-compatible \ - would change the pattern text git_exclude_filter_test::test_pattern_escape asserts \ - verbatim, so both that rewrite and un-ignoring this green-but-crashing test need a \ - user decision"] +#[ignore = "needs live network (real git clone from github.com). The two former in-process \ + blockers are fixed: the scheme-less packages.json read via RemoteFilesystem::\ + get_remote_contents, and the exit-101 panic during CreateProjectCommand's keep-vcs \ + cleanup, whose Symfony Finder name patterns go through Glob::to_regex (now \ + regex-crate-compatible); a full green run is unverified because it requires network"] fn test_integration_create_project_shows_full_hash_for_dev_packages() { run_integration("create-project-shows-full-hash-for-dev-packages.test"); } -- cgit v1.3.1