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 · 3 comments
Open
1 task done
Labels
enhancement Created by Linear-GitHub Sync

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
@markphelps markphelps removed the linear label Jan 18, 2025
@aliktb
Copy link

aliktb commented Mar 23, 2025

I have a similar requirement for a CONTAINS constraint operator. I have a list of groups associated with a user that I have access to in my frontend. I'd like to pass that in the context and check for specific groups in our constraints. A regex operator could work for that use case.

I've been trying to think of other ways but not sure if there are any supported ways currently? Initially our list was a JSON array which seems to be an unsupported data type but toString() converts that into a comma-separated String list. That solved that problem but now the roadblock is searching for specific text within the String

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
Projects
Status: No status
Development

No branches or pull requests

3 participants