Skip to content

fix(query-engine): keep list inputs from nesting SQL past max_parser_depth - #2021

Merged
Makisuo merged 1 commit into
mainfrom
fix/ci-actor-stats-parse-depth
Oct 31, 2026
Merged

Makisuo merged 1 commit into
mainfrom
fix/ci-actor-stats-parse-depth

fix(query-engine): keep list inputs from nesting SQL past max_parser_…

56e9da6
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Oct 31, 2026 in 1m 27s

Confidence 10/10 · No issues found

🟢 Confidence 10/10 · safe to merge. Flattening is provably semantics-preserving here, and a property test, the SQL baseline and a 500-repository e2e pin it.
no findings · tests covered · risk medium

Replaces the per-item .and()/.or() chains in four query-engine builders — CI actor stats, log body search, attribute-filter OR groups and funnel steps — with one flat CH.and/CH.or call, so parser nesting no longer grows with the list. The SQL is unchanged apart from parentheses.

  • ciActorStatsQuery ORs default branches with one flat CH.or
  • Log body search ANDs every token through one CH.and
  • buildAttrFilterCondition OR groups and funnel steps flatten their OR
  • New property test bounds nesting for 7 list-taking builders; e2e covers 500 repos
What was checked
  • CH.or() returns undefined with no conditions, so ciActorStatsQuery's 1 = 0 fallback for an empty repository list still applies (effect-orm src/ch/expr.ts:803)
  • Tenant evidence unchanged: variadic or carries none and and still carries it through, as the .or()/.and() methods did (src/ch/expr.ts:789)
  • catalog.sql baseline diff is parenthesis flattening only: each changed clause is identical with (/) stripped

56e9da6 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.