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

Looks like that the segment constraints are not respecting the match all rules #140

Closed
ajdevries opened this issue Sep 30, 2019 · 4 comments · Fixed by #146
Closed

Looks like that the segment constraints are not respecting the match all rules #140

ajdevries opened this issue Sep 30, 2019 · 4 comments · Fixed by #146
Assignees
Labels

Comments

@ajdevries
Copy link

Describe the bug
When creating a segment with two constraints:

  • boolean constraint == true
  • and a string == 'somevalue'

The segment is matched when evaluating a flag with the boolean value only.

Version Info
Run flipt --version and paste the output here.

Version: 0.8.0
Commit: 0a47977b560085983cd95eb5f31141039df8ecd2
Build Date: 2019-09-30T08:43:15Z
Go Version: go1.13

To Reproduce

  1. Create a flag with one variant
  2. Create a segment
    2a. Create a constraint isAdmin, boolean and == TRUE
    2b. Create a constraint customer, string and equals acme
  3. Evaluate the created flag with the following contexts:
{
    "flagKey": "flag",
    "entityId": "ca93e3ad-8327-4da6-909c-f5f7b2c9a4f5",
    "context": {
        "isAdmin": "true"
    }
}

Expecting no match

{
    "flagKey": "flag",
    "entityId": "ca93e3ad-8327-4da6-909c-f5f7b2c9a4f5",
    "context": {
        "isAdmin": "true",
        "customer": "acme"
    }
}

Expecting a match

{
    "flagKey": "flag",
    "entityId": "ca93e3ad-8327-4da6-909c-f5f7b2c9a4f5",
    "context": {
        "isAdmin": "true",
        "customer": "apple"
    }
}

Expecting no match

Additional context

  • Running the latest docker container
  • Database used Postgres
@markphelps
Copy link
Collaborator

Thanks for reporting this @ajdevries. I'll look into this tonight and hopefully be able to provide a fix for this in the same release that delivers #138

@ajdevries
Copy link
Author

Hi @markphelps, thanks for your quick response. There is no hurry, take your time.

@Domino987
Copy link

Hi @markphelps ,
is there a way to change the 'match all' to 'match one of several' for the segments constraints?

@markphelps
Copy link
Collaborator

@Domino987 would you mind opening up a Feature Request issue to explain your use case?

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 a pull request may close this issue.

3 participants