Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration: regex tests which write matches to @extra #69

Closed
rowanseymour opened this issue Jul 27, 2017 · 2 comments
Closed

Migration: regex tests which write matches to @extra #69

rowanseymour opened this issue Jul 27, 2017 · 2 comments
Milestone

Comments

@rowanseymour
Copy link
Member

rowanseymour commented Jul 27, 2017

In old world, RegexTest has access to the run and adds the matches to @extra on the run. In the new world, tests are expressions which know nothing of runs.

Either:

  • we introduce a mechanism for tests to return a dict that can be automatically added to @extra by the router
  • we introduce an action for users to explicitly add things to extra, and allow them to add the result of an expression which returns the matching groups. We could then migrate rulesets with regex tests to nodes that include this action before the switch router
  • we introduce an expression to the old world which allows users to regex parse input and see if we can change existing flows to using this in expression type rulesets instead of relying on @extra

I think I'm leaning toward the latter option because implicitly changing @extra isn't something I particularly want to support in the new world.

@rowanseymour rowanseymour changed the title Migration of regex tests which write matches to @extra Migration: regex tests which write matches to @extra Jul 27, 2017
@rowanseymour rowanseymour added this to the MVP milestone Mar 23, 2018
@rowanseymour
Copy link
Member Author

We've now added support for getting match groups from the has_pattern test and regex_group expression function... but still no clear way to automatically migrate usage of @extra.1 etc in legacy flows.

@rowanseymour
Copy link
Member Author

We now make regex group matches accessible via .extra on the result, and migrate @extra.1 in legacy flows to @legacy_extra.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant