Unleash / unleash-client-go

Unleash client SDK for Go
https://docs.getunleash.io
Apache License 2.0
138 stars 55 forks source link

Add app & environment variant override support #178

Closed mrizk closed 1 month ago

mrizk commented 1 month ago

Describe the feature request

At the moment, the SDK doesn't support setting a variant override for appName / environment despite this being supported by Unleash. Only userId, sessionId, and remoteAddress are supported.

https://github.com/Unleash/unleash-client-go/blob/10a33385c5b131f72c4a179c6efadfeb55e13089/api/variant.go#L55

Screenshot 2024-08-27 at 14 35 12

This is a trivial feature to support, I could open a PR but wasn't sure what the contribution guidelines are on this project.

Background

No response

Solution suggestions

Add cases for appName & environment to Override.getIdentifier() and return their values from the context.

ivarconr commented 1 month ago

This is a trivial feature to support, I could open a PR but wasn't sure what the contribution guidelines are on this project.

Great, please feel free to open a PR.

mrizk commented 1 month ago

@ivarconr done

sighphyre commented 1 month ago

Thanks for patching this @mrizk, it's definitely a missing feature in the SDK but from a perspective of the wider Unleash ecosystem, not having that is a bug so I've done a patch release for this

Appreciate the contribution!