open-feature / flagd

A feature flag daemon with a Unix philosophy
https://openfeature.dev
Apache License 2.0
453 stars 55 forks source link

fix: fixes store merge when selector is used #1322

Closed Kavindu-Dodan closed 1 month ago

Kavindu-Dodan commented 1 month ago

This PR

This change address https://github.com/open-feature/open-feature-operator/issues/664.

Background

We allow using multiple flag source CRDs when using flagd-proxy with OFO. Internally, this converts to flagd using gRPC syncs with scopes, where scopes specify the CRD names that need to source flags from.

Bug

We had two bugs, first gRPC resyncs never contained scope. This is why we observed unable to build sync from URI for target message. Secondly, we triggered resyncs only considering source equility. This is not valid with flagd-proxy as we always go through the proxy for any CRD.

Fix

Fix here adds scope to gRPC resyncs and considers both source and selector equality when triggering a resync

How to validate the fix

Use this image with OFO sidecar image override

helm upgrade --install openfeature openfeature/open-feature-operator --set sidecarConfiguration.image.tag=1,sidecarConfiguration.image.repository=kavindudodanduwa/flagd

netlify[bot] commented 1 month ago

Deploy Preview for polite-licorice-3db33c canceled.

Name Link
Latest commit 32abe8cd5de3a87155e2e5d88b2a8a5466269d9d
Latest deploy log https://app.netlify.com/sites/polite-licorice-3db33c/deploys/6660df611aca5700087c594a
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.74%. Comparing base (1c530ab) to head (32abe8c). Report is 66 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1322 +/- ## ========================================== + Coverage 73.69% 78.74% +5.05% ========================================== Files 32 36 +4 Lines 3140 2828 -312 ========================================== - Hits 2314 2227 -87 + Misses 717 466 -251 - Partials 109 135 +26 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.