Repository navigation
fix(planner): match task input patterns as path globs - #174
Conversation
A bare or mid-segment ** (GitHub's **.js example) now matches at any depth, ( ) $ ^ | are literal so app/(marketing)/** and routes/$slug.tsx match themselves, and a pattern that cannot compile triggers its task instead of throwing out of plan(). Fixes DiffCI#173 Signed-off-by: FredApps <[email protected]>
|
CI note: the one failure, |
Align regexFrom with the research matcher fix for DiffCI#178 (PR DiffCI#179): + is literal, ? is one character within a segment, [...] and [!...] are character classes, and a backslash escapes the next character. c++/** now matches c++/ only instead of failing to compile. Refs DiffCI#173, DiffCI#178 Signed-off-by: FredApps <[email protected]>
|
Cross-reference: #178 / #179 (Yandere-san) fix the same glob converter in |
Read an invalid class like [z-a] the way the planner's matcher in DiffCI#174 does: it cannot rule a change out, so the task runs instead of being skipped. Signed-off-by: FredApps <[email protected]>
FredApps
left a comment
There was a problem hiding this comment.
Cross-review (Yandere-san). Head 98225f7.
Checked: regexFrom in planner.ts is the same reading as the research matcher in #179 (** mid-pattern, ?, classes, escapes, literal + ( ) $, invalid patterns count as a match so plan() does not throw). The new tests fail on main (including c++/** throwing and [z-a] crashing plan()) and pass here. All tests/planner/*.test.ts pass locally (102).
Overlap: #179 fixes the copy in src/research/baseline/matcher.ts; this PR fixes the planner copy. They agree. #182 only passes plain-glob workflow path filters into inputPatterns, which land here; **.js is correct only with this fix. No conflict.
Required hosted checks are green. DiffCI change impact is still in progress, which is the usual fork skip (neutral on the other PRs). The earlier windows-latest flake in rust-adapter.test.ts cleanup is #227 / #235, not this change.
No code changes from me. Nothing open on this PR.
…acters stay literal (#179) * fix(research): compile globs character by character so regex metacharacters stay literal regexFrom escaped only backslash and dot, so ( ) | ^ $ reached the RegExp as operators, + threw, ? was a quantifier, and a ** not next to a slash could not cross directories. Fixes #178 Signed-off-by: FredApps <[email protected]> * fix(research): read a character class RegExp rejects as literal text A reversed range such as [z-a] compiled to an invalid RegExp, so matchesAny still threw for some patterns. Fall back to a literal [ when the class does not compile, and cover it with example tests. Signed-off-by: FredApps <[email protected]> * fix(research): count a pattern RegExp rejects as matching Read an invalid class like [z-a] the way the planner's matcher in #174 does: it cannot rule a change out, so the task runs instead of being skipped. Signed-off-by: FredApps <[email protected]> --------- Signed-off-by: FredApps <[email protected]>
Fixes #173
Changed behavior
regexFrominsrc/planner/planner.ts, whichDefaultCIPlanneruses to match a task'sinputPatternsagainst changed files, now compiles each glob character by character. It reads globs the same way as the research matcher fix for #178 (#179), so the two matchers agree:**/matches any number of leading directories, and a trailing/**matches anything below.**, such as**.js,src/**.tsor a bare**, matches across directories, as GitHub path filters do.*and?stay within one segment.[...]and[!...]are character classes.\escapes the next character.( ) $ ^ | +. Soapp/(marketing)/**,app/routes/$slug.tsxandc++/**match themselves.[z-a], counts as matching, so its task isRUNinstead ofplan()throwing. Failures go toward running more.Validation
tests/planner/input-patterns.test.tsis new and added torelease-files.json. Its**, metacharacter and invalid-pattern cases fail onmain; the output is in Planner: task input patterns mis-match **.js, (group) and $route paths, and an invalid pattern crashes plan() #173. Further tests cover the+,?, class and escape behavior, and pin the existing globstar forms the registry uses.npm run typecheck,npm test(1172 pass, 0 fail),npm run build,npm run audit:boundary.Related
src/research/baseline/matcher.ts; this PR covers the planner copy.on:path filters through toinputPatterns, but only plain globs ([A-Za-z0-9_.@/*{},-]). Those reach this matcher, and**.jsmatches correctly only with this fix.Unsupported cases
!negation ininputPatternsis still not modelled. A negated pattern never matches, so it can only cause more runs.wildcardToRegexintask-registry.tshas the escaping gap, but it is unreachable through theTaskRegistryinterface, as noted in Planner: task input patterns mis-match **.js, (group) and $route paths, and an invalid pattern crashes plan() #173.