feat(Dogfooding): Add OpenFeature SDK for server-side Flagsmith-on-Flagsmith#7008
feat(Dogfooding): Add OpenFeature SDK for server-side Flagsmith-on-Flagsmith#7008
Conversation
Migrate Flagsmith-on-Flagsmith feature evaluation from the native Flagsmith Python SDK to the vendor-neutral OpenFeature SDK with the Flagsmith provider, dogfooding our own OpenFeature integration.
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.
Once credits are available, reopen this pull request to trigger a review.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
| variants={"enabled": True}, | ||
| default_variant="enabled", |
There was a problem hiding this comment.
Yes, this is how to create an enabled by default in-memory flag for OF. No, there is no shorter way to do this.
| [[tool.mypy.overrides]] | ||
| module = ["openfeature_flagsmith.*"] | ||
| ignore_missing_imports = true |
There was a problem hiding this comment.
Opened Flagsmith/flagsmith-openfeature-provider-python#30 in the meantime.
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7008 +/- ##
==========================================
- Coverage 98.32% 98.32% -0.01%
==========================================
Files 1335 1335
Lines 49876 49835 -41
==========================================
- Hits 49039 48998 -41
Misses 837 837 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Migrate Flagsmith-on-Flagsmith feature evaluation from the native Flagsmith Python SDK to the vendor-neutral OpenFeature SDK with the Flagsmith provider.
What changed
openfeature-sdkandopenfeature-provider-flagsmith(from danjuv's fork until PR #28 merges — bumps provider constraint to support flagsmith SDK v5).integrations/flagsmith/client.py): Replacedget_client()withget_openfeature_client()using OpenFeature's provider registry with a named domain (flagsmith-api). Lazy initialisation viaProviderStatuscheck.flagsmith_identifier+flagsmith_on_flagsmith_api_traitswith a singleopenfeature_evaluation_contextproperty returning anEvaluationContext.client.get_identity_flags(...).is_feature_enabled("x")toclient.get_boolean_value("x", default_value=False, evaluation_context=...).conftest.py):enable_featuresnow uses OpenFeature'sInMemoryProviderinstead of mocking Flagsmith internals.get_openfeature_clientmocks to theenable_featuresfixture.openfeature_flagsmith.*toignore_missing_importsoverrides (package lackspy.typed).How did you test this code?
Made sure existing tests pass.