Skip to content

feat(engine): implement Regex in FlowExpr and migrate FeatureFilter#2122

Merged
asrcpq merged 10 commits into
mainfrom
refactor/engine/migrate-feature-filter
Jun 2, 2026
Merged

feat(engine): implement Regex in FlowExpr and migrate FeatureFilter#2122
asrcpq merged 10 commits into
mainfrom
refactor/engine/migrate-feature-filter

Conversation

@asrcpq
Copy link
Copy Markdown
Contributor

@asrcpq asrcpq commented Jun 1, 2026

Overview

Continuing #2030, #2087, #2109, migrating FeatureFilter and update FlowExpr implementation.

Changes

Notes

Currently condition expression accepts both code and string types which is a known problem. Schema generation for the new code fields are not determined. The fix will be implemented in another PR.

@github-actions github-actions Bot added the engine label Jun 1, 2026
@asrcpq asrcpq marked this pull request as ready for review June 1, 2026 08:18
Copilot AI review requested due to automatic review settings June 1, 2026 08:18
@asrcpq asrcpq requested review from n4to4 and shunski as code owners June 1, 2026 08:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the ongoing FlowExpr migration by refactoring FeatureFilter condition expressions from a plain string (Expr) into a structured { type, value } Code object, and extends the FlowExpr runtime with several usability features needed by migrated workflows.

Changes:

  • Update FeatureFilter condition schema from Expr (string) to Code (type + value) and migrate test workflow fixtures accordingly.
  • Extend FlowExpr runtime with Regex(...) support and raw-string literals (r"...") for easier regex authoring.
  • Add list/array .get(...) and centralize index resolution logic to simplify safe indexing and reduce duplicated bounds logic.

Reviewed changes

Copilot reviewed 96 out of 97 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
engine/schema/actions.json Introduces Code/CodeType schema and switches Condition.expr to reference Code.
engine/schema/actions_en.json Language-specific schema mirror for Code/CodeType + Condition.expr update.
engine/schema/actions_ja.json Language-specific schema mirror for Code/CodeType + Condition.expr update.
engine/schema/actions_zh.json Language-specific schema mirror for Code/CodeType + Condition.expr update.
engine/schema/actions_fr.json Language-specific schema mirror for Code/CodeType + Condition.expr update.
engine/schema/actions_es.json Language-specific schema mirror for Code/CodeType + Condition.expr update.
engine/schema/i18n/actions/en.json Adds i18n placeholders for the new Code definition fields.
engine/schema/i18n/actions/ja.json Adds i18n placeholders for the new Code definition fields.
engine/schema/i18n/actions/zh.json Adds i18n placeholders for the new Code definition fields.
engine/schema/i18n/actions/fr.json Adds i18n placeholders for the new Code definition fields.
engine/schema/i18n/actions/es.json Adds i18n placeholders for the new Code definition fields.
engine/runtime/action-processor/src/feature/filter.rs Refactors FeatureFilter to compile/evaluate Code and route by eval_bool().
engine/runtime/types/src/expr.rs Adds CompiledCode::eval_bool() and adjusts string evaluation to use str_cast.
engine/runtime/runtime/src/builder_dag.rs Adds/maintains dynamic output-port extraction for FeatureFilter from with.conditions[].outputPort.
engine/runtime/expr/src/lib.rs Adjusts public re-exports (adds bool_cast/str_cast) and removes eval_string helper.
engine/runtime/expr/src/core/lexer.rs Adds r"..." raw string literal tokenization.
engine/runtime/expr/src/core/eval.rs Refactors array index assignment bounds logic to use shared index resolution.
engine/runtime/expr/src/core/builtins/array.rs Adds array/list .get(...) and resolve_index(...) helper.
engine/runtime/expr/src/core/builtins/regex.rs Adds Regex builtin object with find/find_all-style methods and tests.
engine/runtime/tests/fixture/workflow/feature/filter.yaml Migrates FeatureFilter test fixture to {type: flowExpr, value: ...}.
engine/runtime/tests/fixture/workflow/geometry/neighbor_finder/proximity_search_with_geojson.yaml Migrates FeatureFilter test fixture to {type: flowExpr, value: ...}.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread engine/schema/actions.json
Comment thread engine/runtime/expr/src/core/builtins/regex.rs
Comment thread engine/runtime/expr/src/core/builtins/regex.rs Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 7.86%. Comparing base (070257c) to head (b2e46e8).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2122   +/-   ##
=====================================
  Coverage   7.86%   7.86%           
=====================================
  Files        224     224           
  Lines      37600   37600           
=====================================
  Hits        2956    2956           
  Misses     34391   34391           
  Partials     253     253           
Flag Coverage Δ
api 7.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 96 out of 97 changed files in this pull request and generated 1 comment.

Comment thread engine/runtime/action-processor/src/feature/filter.rs
@asrcpq asrcpq force-pushed the refactor/engine/migrate-feature-filter branch from 2f403d0 to b2e46e8 Compare June 2, 2026 00:48
@asrcpq asrcpq force-pushed the refactor/engine/migrate-feature-filter branch from b2e46e8 to a0a9d97 Compare June 2, 2026 00:49
@asrcpq asrcpq changed the title refactor(engine): migrate FeatureFilter to FlowExpr feat(engine): implement Regex module in FlowExpr and migrate FeatureFilter Jun 2, 2026
@asrcpq asrcpq changed the title feat(engine): implement Regex module in FlowExpr and migrate FeatureFilter feat(engine): implement Regex in FlowExpr and migrate FeatureFilter Jun 2, 2026
Copy link
Copy Markdown
Contributor

@n4to4 n4to4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@asrcpq asrcpq merged commit f062a1e into main Jun 2, 2026
25 checks passed
@asrcpq asrcpq deleted the refactor/engine/migrate-feature-filter branch June 2, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants