Giter VIP home page Giter VIP logo

Comments (9)

andreyvital avatar andreyvital commented on May 19, 2024 3

@markphelps actually that's what needs to happen. It's just to avoid multiple HTTP roundtrips for each flag you know?

from flipt.

andreyvital avatar andreyvital commented on May 19, 2024 1

Hmm...good question, the way I see it is that in the 1st case, who's consuming the API would have to guarantee that the context is appropriate to validate against all constraints in all the flags requested.

Case N2 we'd repeat the context which might increase the request payload... what about allowing both scenarios? one network-friendly and another more "flexible"?

{
  "requestId": "1234",
  "entityId": "127.0.0.1",
  "globalContext": {
    "country": "UK",
    "property": "value"
  },
  "evaluations": [{
    "flagKey": "foo",
  }, {
    "flagKey": "bar",
    "context": {
      "country": "US"
    }
  }]
}

So the developer would consider globalContext for common things across all the flags whereas individual flags' context would be merged with globalContext, but notice, the override priority would come from the individual flag. So:

evaluate "foo" with { country: UK, property: value }
evaluate "bar" with { country: US, property: value }

from flipt.

markphelps avatar markphelps commented on May 19, 2024 1

@sagikazarmark yeah it was closed due to inactivity. I'll reopen it if its a feature you'd like to see added.

Question about evaluateAll, in what order would it evaluate all the flags? By createdAt? Or would this be configurable per request

from flipt.

markphelps avatar markphelps commented on May 19, 2024

Great idea. How would you expect the request body to look?

Something like this, where you evaluate multiple flags but with the same entity_id and context?:

{
"request_id": "string",
"flag_keys": ["string", "string"],
"entity_id": "string",
"context": {
  "property1": "string",
  "property2": "string"
  }
}

Or, would you want to have different context/entity_ids for each flag, something like this:

{
"request_id": "string",
"evaluations": [
  {
    "flag_key": "string",
    "entity_id": "string",
    "context": {
    "property1": "string",
    "property2": "string"
    }
  },
  {
    "flag_key": "string",
    "entity_id": "string",
    "context": {
    "property1": "string",
    "property2": "string"
    }
  },
  ]
}

from flipt.

stale avatar stale commented on May 19, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from flipt.

stale avatar stale commented on May 19, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from flipt.

sagikazarmark avatar sagikazarmark commented on May 19, 2024

Is this actually done or just got closed due to inactivity?

I would also be interested in an evaluateAll request, since a batch can grow pretty large. That would help integrate flipt into existing solutions.

from flipt.

sagikazarmark avatar sagikazarmark commented on May 19, 2024

Hm, I'm not really interested in the order, I just need a list of the flags evaluated for a certain user.

from flipt.

markphelps avatar markphelps commented on May 19, 2024

Good point, I guess the order wouldnt matter if the response returned match=true/false for each flag, not just the first one that matches.

from flipt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.