-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: proxy sdk #165
feat: proxy sdk #165
Conversation
… DTOs for variants
…ning metrics for isEnabled
b849bf9
to
02f17e1
Compare
02f17e1
to
4aa5f7b
Compare
9d174e6
to
6ba87ef
Compare
b7ef7c3
to
043cc66
Compare
dda1d8d
to
7e3281d
Compare
…tor, remove a few props from proxy builder that aren't needed
4ee680c
to
3cc80c2
Compare
…ings from the public api that shouldn't have been exposed
…make unleash builder work for proxy sdk and collapse a few interfaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most of my comments are details, I'm more than happy to review again after you go over them
Co-authored-by: Gastón Fournier <gastonfournier@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good, just leaving some comments.
Co-authored-by: Dominik Chrástecký <dominik@chrastecky.cz>
Co-authored-by: Dominik Chrástecký <dominik@chrastecky.cz>
Co-authored-by: Dominik Chrástecký <dominik@chrastecky.cz>
Co-authored-by: Dominik Chrástecký <dominik@chrastecky.cz>
…ater piece of work
Everything looks good to me now, let me know if you're done with all the changes and I'll be happy to merge. |
Yes! I'm all happy, shall we merge and release this? |
This adds implementation of
Unleash
that talks to the proxy endpoints on Edge. This implements the same external interface as the existingDefaultUnleash
but the implementation details of a Proxy SDK are very different behind the scenes, which makes for some significant design decisions. The responses returned from the proxy endpoints do not return enough data for the existing SDK to reuse so I've split this out at the repository layer. I don't believe this is a major problem, the construction of the objects is handled by the existingUnleashBuilder
, consumers that want to manually construct instances will need to know what they're doing.DefaultUnleash
DefaultProxyUnleash
classDefaultProxyUnleash
class reuses the existing builder, context, caching layers, configuration, and metrics handlers. It does not reuse the existingUnleashRepository
orFeature
classes. This is intentional for a few reasons: behind the scenes retrieving the relevant feature toggle for the Proxy SDK requires the actual context object to make the decision on how to resolve the feature (the resolution itself is handled by Edge/Proxy). So the method signature looks like this:ProxyFeature
is a very stripped down version of whats contained in the existingFeature
class, but more to the point, the fields mean vastly different things. While it's probably possible to force theDefaultProxyFeature
andDefaultFeature
classes to share an interface, I don't believe this is correct, since doing so will signal to consumers that they're interchangeable, when they very much are not.weight
orstickiness
I've created a new interface and class calledResolvedVariant
/DefaultResolvedVariant
which is now returned from the high level public interfaces, containing only the relevant fields. The existing code now uses the existingVariant
/DefaultVariant
for internal calculations but no longer exposes it through the high level interfaces. This is a breaking change, albeit a small one