-
Notifications
You must be signed in to change notification settings - Fork 64
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!: allow custom seed when using targetingKey override for fractional op #1266
feat!: allow custom seed when using targetingKey override for fractional op #1266
Conversation
✅ Deploy Preview for polite-licorice-3db33c canceled.
|
9f687dc
to
57ef518
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1266 +/- ##
==========================================
+ Coverage 73.69% 77.51% +3.82%
==========================================
Files 32 20 -12
Lines 3140 1610 -1530
==========================================
- Hits 2314 1248 -1066
+ Misses 717 281 -436
+ Partials 109 81 -28 ☔ View full report in Codecov by Sentry. |
@colebaileygit could you please update the documentation [1]. We should document the ability to customize the distribution key (ex:- using cat or any other valid string operation). And include not on this change. |
5207994
to
272cc45
Compare
Added 👍 |
272cc45
to
e43144e
Compare
24ed5a7
to
f81cfcf
Compare
Signed-off-by: Cole Bailey <[email protected]>
Signed-off-by: Cole Bailey <[email protected]>
Signed-off-by: Cole Bailey <[email protected]>
Signed-off-by: Cole Bailey <[email protected]>
Co-authored-by: Michael Beemer <[email protected]> Signed-off-by: Cole Bailey <[email protected]>
f81cfcf
to
38bdd26
Compare
once open-feature/flagd-schemas#136 is merged, we must update the submodule to the latest release of the schema. |
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR <!-- add the description of the PR here --> - updates fractional schema to accept complex rules as first argument to override targeting so that we can support using `cat` and other rules to provide custom seeds to randomisation ### Related Issues <!-- add here the GitHub issue that this PR resolves if applicable --> open-feature/flagd#1264 resolves open-feature/flagd#1265 ### Notes <!-- any additional notes for this PR --> ### Follow-up Tasks <!-- anything that is related to this PR but not done here should be noted under this section --> <!-- if there is a need for a new issue, please link it here --> ### How to test <!-- if applicable, add testing instructions under this section --> see open-feature/flagd#1266 --------- Signed-off-by: Cole Bailey <[email protected]> Signed-off-by: Kavindu Dodanduwa <[email protected]> Co-authored-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
@colebaileygit I have updated this PR with the latest submodules as well as Go dependencies. All checks are green. Planning to merge this tomorrow :) |
Great solution and effort @colebaileygit . Thanks for your diligence. @Kavindu-Dodan @beeme1mr I guess we need to update the in-process impls ASAP? |
Yeah, for Go SDK, it's a matter of using the latest flagd core with the next release. Otherwise, we already have PRs for Java [1] & Python [2]. I think JS needs to be taken care of. [1] - open-feature/java-sdk-contrib#737 |
🤖 I have created a release *beep* *boop* --- <details><summary>flagd: 0.10.0</summary> ## [0.10.0](flagd/v0.9.2...flagd/v0.10.0) (2024-04-10) ### ⚠ BREAKING CHANGES * allow custom seed when using targetingKey override for fractional op ([#1266](#1266)) * This is a breaking change only to the extent that it changes the assignment of evaluated flag values. Previously, flagd's `fractional` op would internally concatenate any specified bucketing property with the `flag-key`. This improved apparent "randomness" by reducing the chances that users were assigned a bucket of the same ordinality across multiple flags. However, sometimes it's desireable to have such predictibility, so now **flagd will use the bucketing value as is**. If you are specifying a bucketing value in a `fractional` rule, and want to maintain the previous assignments, you can do this concatenation manually: `{ "var": "user.name" }` => `{"cat": [{ "var": "$flagd.flagKey" }, { "var": "user.name" }]}`. This will result in the same assignment as before. Please note, that if you do not specify a bucketing key at all (the shorthand version of the `fractional` op), flagd still uses a concatentation of the `flag-key` and `targetingKey` as before; this behavior has not changed. ### 🐛 Bug Fixes * **deps:** update module github.com/open-feature/flagd/core to v0.8.2 ([#1255](#1255)) ([9005089](9005089)) ### ✨ New Features * allow custom seed when using targetingKey override for fractional op ([#1266](#1266)) ([f62bc72](f62bc72)) ### 🧹 Chore * refactor evaluation core ([#1259](#1259)) ([0e6604c](0e6604c)) * update go deps ([#1279](#1279)) ([219789f](219789f)) </details> <details><summary>flagd-proxy: 0.6.0</summary> ## [0.6.0](flagd-proxy/v0.5.2...flagd-proxy/v0.6.0) (2024-04-10) ### ⚠ BREAKING CHANGES * allow custom seed when using targetingKey override for fractional op ([#1266](#1266)) * This is a breaking change only to the extent that it changes the assignment of evaluated flag values. Previously, flagd's `fractional` op would internally concatenate any specified bucketing property with the `flag-key`. This improved apparent "randomness" by reducing the chances that users were assigned a bucket of the same ordinality across multiple flags. However, sometimes it's desireable to have such predictibility, so now **flagd will use the bucketing value as is**. If you are specifying a bucketing value in a `fractional` rule, and want to maintain the previous assignments, you can do this concatenation manually: `{ "var": "user.name" }` => `{"cat": [{ "var": "$flagd.flagKey" }, { "var": "user.name" }]}`. This will result in the same assignment as before. Please note, that if you do not specify a bucketing key at all (the shorthand version of the `fractional` op), flagd still uses a concatentation of the `flag-key` and `targetingKey` as before; this behavior has not changed. ### 🐛 Bug Fixes * **deps:** update module github.com/open-feature/flagd/core to v0.8.2 ([#1255](#1255)) ([9005089](9005089)) ### ✨ New Features * allow custom seed when using targetingKey override for fractional op ([#1266](#1266)) ([f62bc72](f62bc72)) ### 🧹 Chore * update go deps ([#1279](#1279)) ([219789f](219789f)) </details> <details><summary>core: 0.9.0</summary> ## [0.9.0](core/v0.8.2...core/v0.9.0) (2024-04-10) ### ⚠ BREAKING CHANGES * allow custom seed when using targetingKey override for fractional op ([#1266](#1266)) * This is a breaking change only to the extent that it changes the assignment of evaluated flag values. Previously, flagd's `fractional` op would internally concatenate any specified bucketing property with the `flag-key`. This improved apparent "randomness" by reducing the chances that users were assigned a bucket of the same ordinality across multiple flags. However, sometimes it's desireable to have such predictibility, so now **flagd will use the bucketing value as is**. If you are specifying a bucketing value in a `fractional` rule, and want to maintain the previous assignments, you can do this concatenation manually: `{ "var": "user.name" }` => `{"cat": [{ "var": "$flagd.flagKey" }, { "var": "user.name" }]}`. This will result in the same assignment as before. Please note, that if you do not specify a bucketing key at all (the shorthand version of the `fractional` op), flagd still uses a concatentation of the `flag-key` and `targetingKey` as before; this behavior has not changed. ### ✨ New Features * allow custom seed when using targetingKey override for fractional op ([#1266](#1266)) ([f62bc72](f62bc72)) ### 🧹 Chore * refactor evaluation core ([#1259](#1259)) ([0e6604c](0e6604c)) * update go deps ([#1279](#1279)) ([219789f](219789f)) * wire evaluation ctx to store methods ([#1273](#1273)) ([0075932](0075932)) </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 <[email protected]> Signed-off-by: Todd Baert <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Todd Baert <[email protected]>
Update publicly served schema (flagd.dev) Specifically this supports [enhancements](#1266) from @colebaileygit Signed-off-by: Todd Baert <[email protected]>
This PR
cat
and other operations so that custom targeting can be properly seededRelated Issues
#1264
Notes
Follow-up Tasks
How to test