-
Notifications
You must be signed in to change notification settings - Fork 4
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
List properties used to evaluate single/all flags #18
Comments
Hey @oxddr just to be sure that I am understanding correctly, what do you call properties? |
That's correct - property = field in the evaluation context. I've updated the top-level description. |
If I understand correctly, you would like a way to know which fields of the evaluation context each flag is using?
This is an interesting use case, I don't know if any vendors are doing this. |
@oxddr do you expect some validation in the provider based on that? Just trying to understand what would be the scope of this feature if we decide to implement it. |
Hey @oxddr, could you please elaborate on how this would work? How would this information be returned to the service so that it could be used to avoid expensive async calls? How would changes to the flag definition (e.g. a new property is added to a rule) be communicated to the provider? Vendors would have access to this information in the ruleset, but I haven't seen many expose it. I've thought about using this information for reporting purposes in the past. It's an interesting use case that we'll have to consider the end-to-end ramifications. |
This looks like a key metadata endpoint. To that effect, I would propose an extension specification that extends the configuration response with a ---
keys:
my-flag-a:
dependencies:
# List of Json Pointers (RFC 6901) this flag depends on
# If between a change in your context, the value of one of these pointers is not equal to its previous value, then the key is invalid
# Equality would be described the same as JSONPatch "test" operation ( https://datatracker.ietf.org/doc/html/rfc6902#section-4.6 ) or JSON Schema instance equality ( https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-01#name-instance-equality )
- /email
- /language
schema: # As a bonus, you could verify the flag has the type you expect
type: boolean
I.love.dotted.flag.names:
dependencies: [] # Flags could just be set without dependency by the service
schema:
type: string
and/slashed/ones:
# a missing dependencies key could mean it depends on everything. Or maybe it's not obvious and we should rather remove it
schema:
type: integer
format: int32
"and also spaces because the spec do not forbid them":
description: |
Keys could have descriptions attached for documentation. That's out of the scope of your request but I'd like that :)
dependencies:
- / # You could depend on just everything by pointing to the root
schema: # As a bonus, you could verify the flag has the type you expect
type: boolean Some notes on my format proposal:
|
My main question with such endpoint will be, what will we do in the providers with it? |
|
I like all of those ideas but I am not sure this should be part of OFREP, it may be another API definition than this one. |
Something like this would be extremely useful and powerful. It could also potentially be used in integrations like the Vercel toolbar. However, I think that it's out of scope for the initial implementation of OFREP and that we'll need to define a strategy for supporting optional "extension". In the meantime, @grimly, would you be willing to put together a prototype? That would help showcase the value and implementation effort and perhaps highlight where this could fit into the rest of OFREP. |
I know, that's why I call it an extension. Also it's one of the first thing you can read on this repo :
Please understand I was trying to find a solution to @oxddr 's issue and I hope my proposal is a good fit.
I have no time for it. It would not serve my current concerns. But here are my thoughts Server sideThe effort required on server side depends only on the vendor's offer. DependenciesTo fill in the dependencies, you must identify the fields your evaluator may access. SchemaTo fill in the schema, you can :
There is no one-size fits all here DocumentationThis is just like Swagger UI (hard if you want to show all details of a schema) Consumer sideContext re-evaluation (dependencies)This is really easy on consumer side. Code generatorsThere are code generators based on JSON Schema here and there so depending on the language's ecosystem, the task could be either a breeze or a pain in the a** |
Is this something that we can achieve by utilizing already defined For example, {
"value": true,
"key": "my-flag",
"reason": "STATIC",
"variant": "string",
"metadata": {
"evaluationDecisionBasedOnCtx": [
"email",
"country",
....
],
}
} Footnotes |
I apologize for not responding yet to questions and comments. I am going to get back to you in few days. |
I apologize for not responding earlier - I am currently on the longer leave. Kamil from my team is going to take over discussion from our end. |
Add API method that returns properties (property = field in the evaluation context) used to evaluate single/all flags. The OFREP client then can only calculate and send properties, which are used by given flags.
Some properties are expensive to calculate (e.g. they require separate, expensive RPC) and we'd like to avoid calculating them if possible. With the protocol in the current shape, it's not possible.
The text was updated successfully, but these errors were encountered: