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

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

Open
1 task done
epahl-atlassian opened this issue Mar 21, 2024 · 2 comments
Open
1 task done
Labels
enhancement Created by Linear-GitHub Sync linear

Comments

@epahl-atlassian
Copy link

epahl-atlassian commented Mar 21, 2024

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 epahl-atlassian added the enhancement Created by Linear-GitHub Sync label Mar 21, 2024
@epahl-atlassian epahl-atlassian changed the title Implemen CONTAINS ONE OF and CONTAINS as constraints Constraints to match strings or arrays of strings containing a substringImplemen ONE OFCONTAINS ONE OF and CONTAINS as constraints Mar 21, 2024
@epahl-atlassian epahl-atlassian changed the title Constraints to match strings or arrays of strings containing a substringImplemen ONE OFCONTAINS ONE OF and CONTAINS as constraints Constraints to match strings or arrays of strings containing a substring Mar 21, 2024
@markphelps
Copy link
Collaborator

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

Ie: (dev|stg) ?

@epahl-atlassian
Copy link
Author

@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.

@markphelps markphelps changed the title Constraints to match strings or arrays of strings containing a substring [FLI-921] Constraints to match strings or arrays of strings containing a substring Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Created by Linear-GitHub Sync linear
Projects
Status: No status
Development

No branches or pull requests

2 participants