Skip to content

feat(Dogfooding): Add OpenFeature SDK for server-side Flagsmith-on-Flagsmith#7008

Merged
khvn26 merged 3 commits intomainfrom
feat/openfeature-sdk-migration
Apr 2, 2026
Merged

feat(Dogfooding): Add OpenFeature SDK for server-side Flagsmith-on-Flagsmith#7008
khvn26 merged 3 commits intomainfrom
feat/openfeature-sdk-migration

Conversation

@khvn26
Copy link
Copy Markdown
Member

@khvn26 khvn26 commented Mar 20, 2026

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Migrate Flagsmith-on-Flagsmith feature evaluation from the native Flagsmith Python SDK to the vendor-neutral OpenFeature SDK with the Flagsmith provider.

Added openfeature-sdk and openfeature-provider-flagsmith (>=0.1.6), now published on PyPI with flagsmith SDK v5 support.

Replaced get_client() with get_openfeature_client() in integrations/flagsmith/client.py, using OpenFeature's provider registry with a named domain (flagsmith-api) and lazy initialisation via ProviderStatus check.

Replaced flagsmith_identifier + flagsmith_on_flagsmith_api_traits on the Organisation model with a single openfeature_evaluation_context property returning an EvaluationContext.

Migrated all call-sites from client.get_identity_flags(...).is_feature_enabled("x") to client.get_boolean_value("x", default_value=False, evaluation_context=...), including leftover flags.is_feature_enabled() references in organisations/tasks.py and organisations/task_helpers.py.

enable_features test fixture now uses OpenFeature's InMemoryProvider instead of mocking Flagsmith internals. 22 org tasks tests migrated from manual get_openfeature_client mocks to the fixture.

Added openfeature_flagsmith.* and licensing.* to mypy ignore_missing_imports overrides (packages lack py.typed).

How did you test this code?

Made sure existing tests pass.

@khvn26 khvn26 requested a review from a team as a code owner March 20, 2026 18:59
@khvn26 khvn26 requested review from gagantrivedi and removed request for a team March 20, 2026 18:59
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

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.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Apr 2, 2026 11:04am
flagsmith-frontend-preview Ignored Ignored Preview Apr 2, 2026 11:04am
flagsmith-frontend-staging Ignored Ignored Preview Apr 2, 2026 11:04am

Request Review

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Mar 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 20, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7008 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7008 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api-test:pr-7008 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-7008 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7008 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7008 Finished ✅ Results

@khvn26 khvn26 changed the title feat(API): Add OpenFeature SDK for server-side Flagsmith-on-Flagsmith feat: Add OpenFeature SDK for server-side Flagsmith-on-Flagsmith Mar 20, 2026
@khvn26 khvn26 changed the title feat: Add OpenFeature SDK for server-side Flagsmith-on-Flagsmith feat(Dogfooding): Add OpenFeature SDK for server-side Flagsmith-on-Flagsmith Mar 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 20, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  43 seconds
commit  11c6b4b
info  🔄 Run: #15405 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  29.2 seconds
commit  11c6b4b
info  🔄 Run: #15405 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  46.1 seconds
commit  11c6b4b
info  🔄 Run: #15405 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 12 seconds
commit  11c6b4b
info  🔄 Run: #15405 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  26.1 seconds
commit  0d6327b
info  🔄 Run: #15590 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  47 seconds
commit  0d6327b
info  🔄 Run: #15590 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  53.3 seconds
commit  0d6327b
info  🔄 Run: #15590 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute
commit  0d6327b
info  🔄 Run: #15590 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  27.7 seconds
commit  f8770f0
info  🔄 Run: #15643 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  10.1 seconds
commit  f8770f0
info  🔄 Run: #15643 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  44.1 seconds
commit  f8770f0
info  🔄 Run: #15643 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  59.9 seconds
commit  f8770f0
info  🔄 Run: #15643 (attempt 1)

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.33%. Comparing base (cee0c91) to head (f8770f0).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7008      +/-   ##
==========================================
- Coverage   98.33%   98.33%   -0.01%     
==========================================
  Files        1335     1335              
  Lines       49943    49930      -13     
==========================================
- Hits        49113    49100      -13     
  Misses        830      830              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Zaimwa9

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@Zaimwa9 Zaimwa9 left a comment

Choose a reason for hiding this comment

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

Not much too say, I would approve if it wasn't for the dependency update and merge conflicts to come. Good addition overall

@khvn26 khvn26 force-pushed the feat/openfeature-sdk-migration branch from ddf8c99 to 0d6327b Compare March 31, 2026 09:46
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Mar 31, 2026
@khvn26 khvn26 requested a review from Zaimwa9 March 31, 2026 09:50
khvn26 added 3 commits April 2, 2026 12:02
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.
Custom kwargs bypassed get_provider_kwargs() entirely, meaning essential
properties like the API key were never set when kwargs were provided.
@khvn26 khvn26 force-pushed the feat/openfeature-sdk-migration branch from 0d6327b to f8770f0 Compare April 2, 2026 11:04
@khvn26 khvn26 requested a review from Zaimwa9 April 2, 2026 11:05
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Apr 2, 2026
@khvn26 khvn26 merged commit 3e3be2e into main Apr 2, 2026
36 checks passed
@khvn26 khvn26 deleted the feat/openfeature-sdk-migration branch April 2, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants