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

[Feature Request] Add "flag type" and possibly metadata to Flag model #314

Closed
rclayton-the-terrible opened this issue Jan 13, 2020 · 3 comments

Comments

@rclayton-the-terrible
Copy link

I was curious if there would be interest in this feature request. If so, I would commit to taking it on (however, I'm not a competent Go developer).

Basically, in our system the UI/Services that consume flags don't necessarily know all the flag id's ahead of time, so sending a list of flag keys (or IDs) to the batch evaluation route requires us to pull all flags first to form the eval request. We've optimized this by caching keys/ids, but it would be great if we could some how request a subset of the flags be automatically included in a batch eval. Perhaps this could be done by filtering a key-value list of metadata on each flag?

Also, we manage the life cycle of our flags based on the flag type, following the categorization denoted by the Thoughtworks piece (https://martinfowler.com/articles/feature-toggles.html). It would be great if there was an arbitrary flag type that could be added to the model (perhaps that should also be metadata?). Right now, we have implemented a hierarchical key structure that allows us to infer the type, but the approach is kind of clunky, and prone to error when users manually manipulate flags in the UI.

BTW - Love the framework; thank you for all the hard work.

@rclayton-the-terrible rclayton-the-terrible changed the title [Feature Request] Add "flag type" and possibly metadata around flags [Feature Request] Add "flag type" and possibly metadata to Flag model Jan 13, 2020
@zhouzhuojie
Copy link
Collaborator

Hey @rclayton-the-terrible

I really like the idea, basically tag/group a few flags together, and pass it as one of the parameters to https://checkr.github.io/flagr/api_docs/#operation/postEvaluationBatch

E.g.

{
  "entities": [
    {
      "entityID": "1234",
      "entityType": "foobar",
      "entityContext": {}
    }
  ],
  "flagTags": [
    "tag1",
    "tag2"
  ]
}

And then we index the tag in memory for flags lookup in the cache and convert that to flag IDs.
For the CRUD api, add a tag field to flags.

PRs are always welcome! If I have time, I can also work on it later.

@rclayton-the-terrible
Copy link
Author

@zhouzhuojie didn't think about just using an array of tags, but I really like the idea. That would avoid adding too much complexity and meet all my needs. I will try to implement it myself and post a PR. Thank you!

@github-actions
Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants