-
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: add starts_with
and ends_with
json evaluators
#658
Conversation
Signed-off-by: Florian Bacher <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #658 +/- ##
==========================================
+ Coverage 72.98% 73.39% +0.40%
==========================================
Files 24 25 +1
Lines 2402 2439 +37
==========================================
+ Hits 1753 1790 +37
Misses 583 583
Partials 66 66
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Co-authored-by: Giovanni Liva <[email protected]> Signed-off-by: Florian Bacher <[email protected]>
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.
The functionality looks good, but it needs to be documented.
Co-authored-by: Kavindu Dodanduwa <[email protected]> Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
…t/custom-json-logic # Conflicts: # core/pkg/eval/string_comparison_evaluation.go
…ation readme Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
the documentation has now been added as well |
🤖 I have created a release *beep* *boop* --- <details><summary>flagd: 0.5.4</summary> ## [0.5.4](flagd/v0.5.3...flagd/v0.5.4) (2023-06-07) ### 🧹 Chore * update otel dependencies ([#649](#649)) ([2114e41](2114e41)) ### 🐛 Bug Fixes * **deps:** update module github.com/open-feature/flagd/core to v0.5.3 ([#634](#634)) ([1bc7e99](1bc7e99)) * **deps:** update module github.com/open-feature/go-sdk-contrib/providers/flagd to v0.1.12 ([#635](#635)) ([fe88061](fe88061)) * **deps:** update module github.com/open-feature/go-sdk-contrib/tests/flagd to v1.2.2 ([#651](#651)) ([9776973](9776973)) ### ✨ New Features * telemetry improvements ([#653](#653)) ([ea02cba](ea02cba)) ### 🔄 Refactoring * introduce additional linting rules + fix discrepancies ([#616](#616)) ([aef0b90](aef0b90)) </details> <details><summary>flagd-proxy: 0.2.4</summary> ## [0.2.4](flagd-proxy/v0.2.3...flagd-proxy/v0.2.4) (2023-06-07) ### 🐛 Bug Fixes * **deps:** update module github.com/open-feature/flagd/core to v0.5.3 ([#634](#634)) ([1bc7e99](1bc7e99)) ### 🧹 Chore * update otel dependencies ([#649](#649)) ([2114e41](2114e41)) ### ✨ New Features * telemetry improvements ([#653](#653)) ([ea02cba](ea02cba)) ### 🔄 Refactoring * introduce additional linting rules + fix discrepancies ([#616](#616)) ([aef0b90](aef0b90)) * introduce isyncstore interface ([#660](#660)) ([c0e2fa0](c0e2fa0)) </details> <details><summary>core: 0.5.4</summary> ## [0.5.4](core/v0.5.3...core/v0.5.4) (2023-06-07) ### ✨ New Features * add `sem_ver` jsonLogic evaluator ([#675](#675)) ([a8d8ab6](a8d8ab6)) * add `starts_with` and `ends_with` json evaluators ([#658](#658)) ([f932b8f](f932b8f)) * telemetry improvements ([#653](#653)) ([ea02cba](ea02cba)) ### 🐛 Bug Fixes * **deps:** update module github.com/bufbuild/connect-go to v1.8.0 ([#683](#683)) ([13bb13d](13bb13d)) * **deps:** update module github.com/bufbuild/connect-opentelemetry-go to v0.3.0 ([#669](#669)) ([e899435](e899435)) * **deps:** update module github.com/prometheus/client_golang to v1.15.1 ([#636](#636)) ([b22279d](b22279d)) * **deps:** update module github.com/stretchr/testify to v1.8.3 ([#662](#662)) ([2e06d58](2e06d58)) * **deps:** update module github.com/stretchr/testify to v1.8.4 ([#678](#678)) ([ca8c9d6](ca8c9d6)) * **deps:** update module golang.org/x/mod to v0.10.0 ([#682](#682)) ([16199ce](16199ce)) * **deps:** update module golang.org/x/net to v0.10.0 ([#644](#644)) ([ccd9d35](ccd9d35)) * **deps:** update module golang.org/x/sync to v0.2.0 ([#638](#638)) ([7f4a7db](7f4a7db)) * **deps:** update module google.golang.org/grpc to v1.55.0 ([#640](#640)) ([c0d7328](c0d7328)) * **deps:** update module sigs.k8s.io/controller-runtime to v0.15.0 ([#665](#665)) ([9490ed6](9490ed6)) * fix connect error code handling for disabled flags ([#670](#670)) ([86a8012](86a8012)) * remove disabled flags from bulk evaluation ([#672](#672)) ([d2ce988](d2ce988)) ### 🔄 Refactoring * introduce additional linting rules + fix discrepancies ([#616](#616)) ([aef0b90](aef0b90)) * introduce isyncstore interface ([#660](#660)) ([c0e2fa0](c0e2fa0)) ### 🧹 Chore * refactor json logic evaluator to pass custom operators as options ([#691](#691)) ([1c9bff9](1c9bff9)) * update otel dependencies ([#649](#649)) ([2114e41](2114e41)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR adds additional jsonLogic evaluators for
starts_with
andends_with
, which check if the given property starts/ends with the given value. Both evaluators return a boolean, indicating whether the condition has been met.The following example shows how these evaluators can be used in a flag targeting rule:
This rule will resolve to the
red
variant of theheaderColor
flag, if theemail
property within the evaluationContext starts withuser@faas
.