feat: add sync stream context, deprecate GetMetadata#183
Conversation
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
|
Just a side note here - More details in the |
Yes; I meant that it's logically required for implementations (as in, our provider will not work properly if no data is sent in that field, if this proposal is merged). |
|
Wouldn't it be valid for that field to contain empty data? If yes (empty data is fine), shouldn't we make it completely optional and treat missing as empty? |
Not logically in providers. Currently, our RPC mode uses the |
We could always emit both as a default case in our providers, actually. Which would be non-breaking for servers that don't implement it and similar to the current behavior. cc @aepfli on this one to verify my thinking. |
|
I would like to understand a bit better the semantic of the
I think (2) would make sense. To me, if metadata is OK to be empty, then it should be also OK to omit it entirely. WDYT? |
2 is the proposal, going forward. Eventually the To sum it up, my proposal is:
I'd prefer not to immediately ignore a failure to successfully call How does that sound? Additionally, do you have any concerns about the |
|
I think the plan for Re: Lastly, I would like to add that we probably should figure out a better process for breaking API/proto changes (e.g. have concrete defintions for "a few provider version", etc). WDYT? |
|
the tradeoff is a simple one, either we manage state in each language sdk, or we manage state in flagd. We are firing events, and for the first connect it is an ready event, each configuration change after that is a configuration change event. If we do reach STALE or ERROR state we again start with a ready event, and afterwards with a configuration change event. Implementing the same logic over and over again, just adds to the technical debt and complexity, where as if flagd controls this approach, we do not need to think about this state, we can just react to the proper events. Another option would be to add this behavior as general behavior to the openfeature sdks, to handle the state for all providers, so none of the provider sdks need to tackle this topic. but i think it is easier to normalize this behavior for rpc and sync - and normalize the implementations regarding this topic. |
We actually have some pretty rigorous policies for breaking changes, but they mostly apply to 1.0+ artifacts (which flagd and it's providers are not yet). Once flagd is 1.0, this sort of thing will be more rigorous. Personally, I'd like to be 1.0 this summer, but when you 1.0 is a tough question due to "unknown unknowns".
You are exactly right. The tradeoff is simple - more state in client vs more state in server, basically, as @aepfli says:
I'm open to going either direction. We just need to decide. As of now, I think there's a very limited number of server implementations (flagd, our internal Dynatrace implementation, and yours @cupofcat) so all the stakeholders are probably in this thread. |
|
Do we have a roadmap for 1.0? |
No but we could add a parent issue here if we agree it's a medium-term goal. |
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
|
I spoke with @aepfli and we are OK with dropping the changes around I've updated the PR to only include the |
🤖 I have created a release *beep* *boop* --- <details><summary>protobuf: 0.6.4</summary> ## [0.6.4](protobuf-v0.6.3...protobuf-v0.6.4) (2025-04-10) ### ✨ New Features * add sync stream type and context ([#183](#183)) ([9b0ee43](9b0ee43)) ### 📚 Documentation * fix url for flags.json ([#182](#182)) ([e840a03](e840a03)) </details> <details><summary>json/json-schema: 0.2.11</summary> ## [0.2.11](json/json-schema-v0.2.10...json/json-schema-v0.2.11) (2025-04-10) ### 📚 Documentation * clarify that bucketing keys are strings ([#185](#185)) ([c707f56](c707f56)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
This PR updates the sync schema. It:
sync_contextfield which conveys the same data as the now-deprecated GetMetadata rpcoptionalmakes it easy for providers to absorb this change in a non-breaking way, since it generates code which allows us to check if the the field is explicitly set or not, and if not, fall back to the old GetMetadataincludes a new, requiredtypefield, exactly equivalent to thetypefield in the EventStreamthis field must containprovider_readyon the first stream payload, andconfiguration_changein subsequent payloadsthis field is required, meaning this is a breaking change for servers (they will need to be updated to check this field)this allows providers to commonize more logic between sync/event stream implementations, and remove some state maintenance associated with sync stream implementationsRelates to: open-feature/flagd#1584
Relates to: open-feature/flagd#1585
In general, I'm wondering what people think of the name
sync_contextfor the new field carrying the static context from flagd. My argument forsync_contextis simple, in that it carries the auxiliary context from server and it's delivered via the sync stream.static_contextmight also work, but it might not be "static" in some implementations and could change in a new stream payload (though it won't in flagd).GetMetadatawas poorly named, and I'm hoping this is clearer.@cupofcat I believe you have your own server implementation, so I'm interested in your thoughts on both these changes.