Commit 9b0ee43
authored
feat: add sync stream type and context (#183)
This PR updates the sync schema. It:
- deprecates the
[GetMetadata](https://buf.build/open-feature/flagd/docs/main:flagd.sync.v1#flagd.sync.v1.FlagSyncService.GetMetadata)
rpc and its messages
- includes a new, **_optional_** `sync_context` field which conveys the
same data as the now-deprecated GetMetadata rpc
- `optional` makes 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
GetMetadata
- ~includes a new, **_required_** `type` field, exactly equivalent to the~
`type` field in the
[EventStream](https://buf.build/open-feature/flagd/docs/main:flagd.evaluation.v1#flagd.evaluation.v1.EventStreamResponse)
- this field must contain `provider_ready` on the first stream payload,
and `configuration_change` in subsequent payloads
- this 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 implementations
Relates to: open-feature/flagd#1584
Relates to: open-feature/flagd#1585
In general, I'm wondering what people think of the name `sync_context`
for the new field carrying the static context from flagd. My argument
for `sync_context` is simple, in that it carries the auxiliary context
from server and it's delivered via the sync stream. `static_context`
might 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).
`GetMetadata` was 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.
---------
Signed-off-by: Todd Baert <[email protected]>1 parent e840a03 commit 9b0ee43
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
65 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
77 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
78 | 86 | | |
0 commit comments