flipt-io / flipt

Enterprise-ready, GitOps enabled, CloudNative feature management solution

Home Page:https://flipt.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FLI-921] Constraints to match strings or arrays of strings containing a substring

epahl-atlassian opened this issue · comments

Problem

I would like to be able to match against context that is slightly irregular. For example with a constraint of CONTAINS ONE OF, I could say:
"env" CONTAINSONEOF ["dev", "stg"] and

  • match{"env": "dev-west"} or {"env": "platdev-west"}
  • but not {"env": "prod-west"}

CONTAINS for the single value case, and CONTAINS ONE OF to check against an array of values.

Possibly CONTAINS ANY OF might be better terminology.

Ideal Solution

Implement constraints as described in the problem.

Search

  • I searched for other open and closed issues before opening this

Additional Context

No response

FLI-921

@epahl-atlassian what if we supported regex? would this allow you to accomplish what you need?

Ie: (dev|stg) ?

@markphelps that could accomplish the same result (and may be a useful feature as well).

Considering the (flag) user flow, compared regex to a substring matched against an item or array of items, there is a higher complexity and risk of mistakes or burden of confirming a correct regex, so I would still prefer the contains (substring) operator.