Skip to content
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: support relative weighting for fractional evaluation #1313

Merged

Conversation

bacherfl
Copy link
Contributor

Closes #1282

This PR adds support for using relative weights instead of percentages that need to add up to 100.
The behavior for existing flag configs does not change with this PR, so those will continue to work as they did previously

Copy link

netlify bot commented May 21, 2024

Deploy Preview for polite-licorice-3db33c ready!

Name Link
🔨 Latest commit 2c5d23a
🔍 Latest deploy log https://app.netlify.com/sites/polite-licorice-3db33c/deploys/667d974d0bba1c0008b202c9
😎 Deploy Preview https://deploy-preview-1313--polite-licorice-3db33c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.64%. Comparing base (1c530ab) to head (23d179d).
Report is 83 commits behind head on main.

Current head 23d179d differs from pull request most recent head 2c5d23a

Please upload reports for the commit 2c5d23a to get more accurate results.

Files Patch % Lines
core/pkg/evaluator/fractional.go 92.30% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1313      +/-   ##
==========================================
+ Coverage   73.69%   78.64%   +4.95%     
==========================================
  Files          32       36       +4     
  Lines        3140     2810     -330     
==========================================
- Hits         2314     2210     -104     
+ Misses        717      465     -252     
- Partials      109      135      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bacherfl bacherfl changed the title Feat/1282/fractional evaluation weights feat: support relative weighting for fractional evaluation May 21, 2024
@bacherfl bacherfl marked this pull request as ready for review May 21, 2024 11:06
@bacherfl bacherfl requested a review from a team as a code owner May 21, 2024 11:06
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 21, 2024
Copy link
Member

@thisthat thisthat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 I left a question for @toddbaert to clarify an open requirement :)

@toddbaert
Copy link
Member

Nice @bacherfl this is great! I will review thoroughly next week. I think we can merge this, but I don't want to add schema support for it until we have something like #1312 so that we can track the implementation of this across different providers and avoid confusion as to why some flagd and some providers support it and others do not.

I don't think it will be that much work to support #1312. I will follow up next week.

@toddbaert toddbaert self-requested a review May 27, 2024 14:49
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me, but I'm going to block it for just a while to see about the feasibility of this, which would help us to release this in a consistent way across multiple implementations.

Consider this approved but temporarily blocked for merge.

@toddbaert
Copy link
Member

@bacherfl @Kavindu-Dodan @thisthat see:

open-feature/flagd-schemas#163
#1321

With these, we will serve fully versioned schemas for flagd, which we can use to denote features and fixes such as the one in this PR.

@toddbaert toddbaert force-pushed the feat/1282/fractional-evaluation-weights branch from 23d179d to 2c5d23a Compare June 27, 2024 16:46
@toddbaert
Copy link
Member

@bacherfl @Kavindu-Dodan @thisthat see:

open-feature/flagd-schemas#163 #1321

With these, we will serve fully versioned schemas for flagd, which we can use to denote features and fixes such as the one in this PR.

I'm not doing this afterall. I think it's more maintenance than it's worth, and @aepfli took the time to implement this in most other impls, so I think we can just move forward with this now. I will do the release(s) over the next couple days.

Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much @bacherfl

@toddbaert toddbaert merged commit f82c094 into open-feature:main Jun 27, 2024
13 checks passed
@github-actions github-actions bot mentioned this pull request Jun 27, 2024
toddbaert pushed a commit that referenced this pull request Jun 27, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>flagd: 0.11.0</summary>

##
[0.11.0](flagd/v0.10.3...flagd/v0.11.0)
(2024-06-27)


### ⚠ BREAKING CHANGES

* support emitting errors from the bulk evaluator
([#1338](#1338))

### 🐛 Bug Fixes

* **deps:** update module
buf.build/gen/go/open-feature/flagd/connectrpc/go to
v1.16.2-20240215170432-1e611e2999cc.1
([#1293](#1293))
([2694e7f](2694e7f))
* **deps:** update module buf.build/gen/go/open-feature/flagd/grpc/go to
v1.4.0-20240215170432-1e611e2999cc.1
([#1333](#1333))
([494062f](494062f))
* **deps:** update module
buf.build/gen/go/open-feature/flagd/protocolbuffers/go to
v1.34.2-20240215170432-1e611e2999cc.2
([#1330](#1330))
([32291ad](32291ad))
* **deps:** update module github.com/open-feature/flagd/core to v0.9.3
([#1296](#1296))
([1f7b8bd](1f7b8bd))
* **deps:** update module github.com/rs/cors to v1.11.0
([#1299](#1299))
([5f77541](5f77541))
* **deps:** update module github.com/spf13/cobra to v1.8.1
([#1332](#1332))
([c62bcb0](c62bcb0))
* **deps:** update module github.com/spf13/viper to v1.19.0
([#1334](#1334))
([1097b99](1097b99))
* **deps:** update module golang.org/x/net to v0.26.0
([#1337](#1337))
([83bdbb5](83bdbb5))
* **deps:** update opentelemetry-go monorepo
([#1314](#1314))
([e9f1a7a](e9f1a7a))
* readable error messages
([#1325](#1325))
([7ff33ef](7ff33ef))


### ✨ New Features

* support `FLAGD_DEBUG` / `--debug` / `-x`
([#1326](#1326))
([298bd36](298bd36))
* support emitting errors from the bulk evaluator
([#1338](#1338))
([b9c099c](b9c099c))
</details>

<details><summary>flagd-proxy: 0.6.3</summary>

##
[0.6.3](flagd-proxy/v0.6.2...flagd-proxy/v0.6.3)
(2024-06-27)


### 🐛 Bug Fixes

* **deps:** update module buf.build/gen/go/open-feature/flagd/grpc/go to
v1.4.0-20240215170432-1e611e2999cc.1
([#1333](#1333))
([494062f](494062f))
* **deps:** update module
buf.build/gen/go/open-feature/flagd/protocolbuffers/go to
v1.34.2-20240215170432-1e611e2999cc.2
([#1330](#1330))
([32291ad](32291ad))
* **deps:** update module github.com/open-feature/flagd/core to v0.9.3
([#1296](#1296))
([1f7b8bd](1f7b8bd))
* **deps:** update module github.com/spf13/cobra to v1.8.1
([#1332](#1332))
([c62bcb0](c62bcb0))
* **deps:** update module github.com/spf13/viper to v1.19.0
([#1334](#1334))
([1097b99](1097b99))
* **deps:** update module golang.org/x/net to v0.26.0
([#1337](#1337))
([83bdbb5](83bdbb5))
* **deps:** update opentelemetry-go monorepo
([#1314](#1314))
([e9f1a7a](e9f1a7a))
</details>

<details><summary>core: 0.10.0</summary>

##
[0.10.0](core/v0.9.3...core/v0.10.0)
(2024-06-27)


### ⚠ BREAKING CHANGES

* support emitting errors from the bulk evaluator
([#1338](#1338))

### 🐛 Bug Fixes

* **deps:** update module buf.build/gen/go/open-feature/flagd/grpc/go to
v1.4.0-20240215170432-1e611e2999cc.1
([#1333](#1333))
([494062f](494062f))
* **deps:** update module
buf.build/gen/go/open-feature/flagd/protocolbuffers/go to
v1.34.2-20240215170432-1e611e2999cc.2
([#1330](#1330))
([32291ad](32291ad))
* **deps:** update module connectrpc.com/connect to v1.16.2
([#1289](#1289))
([8bacb7c](8bacb7c))
* **deps:** update module
github.com/open-feature/open-feature-operator/apis to v0.2.43
([#1331](#1331))
([fecd769](fecd769))
* **deps:** update module golang.org/x/crypto to v0.24.0
([#1335](#1335))
([2a31a17](2a31a17))
* **deps:** update module golang.org/x/mod to v0.18.0
([#1336](#1336))
([5fa83f7](5fa83f7))
* **deps:** update opentelemetry-go monorepo
([#1314](#1314))
([e9f1a7a](e9f1a7a))
* readable error messages
([#1325](#1325))
([7ff33ef](7ff33ef))


### ✨ New Features

* add mandatory flags property in bulk response
([#1339](#1339))
([b20266e](b20266e))
* support emitting errors from the bulk evaluator
([#1338](#1338))
([b9c099c](b9c099c))
* support relative weighting for fractional evaluation
([#1313](#1313))
([f82c094](f82c094))
</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]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Change fractional custom op from percentage-based to relative weighting.
4 participants