Repository navigation
feat: add OpenFeature Python server provider - #1
Conversation
|
Warning Review limit reached
Next review available in: 53 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis change adds a packaged FeatBit OpenFeature provider with context and resolution converters, typed flag evaluation, lifecycle and status handling, tracking, packaging automation, documentation, and unit plus offline integration tests. ChangesFeatBit OpenFeature provider
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant OpenFeatureClient
participant FeatBitProvider
participant EvaluationContextConverter
participant FBClient
participant OpenFeatureEvents
OpenFeatureClient->>FeatBitProvider: resolve typed flag
FeatBitProvider->>EvaluationContextConverter: convert evaluation context
EvaluationContextConverter-->>FeatBitProvider: FeatBit user
FeatBitProvider->>FBClient: variation_detail
FBClient-->>FeatBitProvider: EvalDetail and variation
FeatBitProvider-->>OpenFeatureClient: FlagResolutionDetails
FBClient->>FeatBitProvider: status or flag-change notification
FeatBitProvider->>OpenFeatureEvents: emit provider event
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Line 20: Update the actions/checkout@v4 step to set persist-credentials to
false, ensuring the workflow does not retain the GitHub token in local Git
configuration; leave the remaining checkout behavior unchanged.
- Around line 28-29: The CI dependency installation should not use the moving
`refs/pull/14/head` override. Update the `fb-python-sdk` install command in the
workflow to honor the `pyproject.toml` constraint `>=1.1.8,<2`, or replace it
with an immutable full commit pin and document the temporary override.
In `@featbit_openfeature/provider.py`:
- Around line 74-86: Register the status listeners in initialize
unconditionally, including when wait_for_OKState times out or state is OFF.
Ensure _register_listeners() executes before propagating ProviderFatalError or
ProviderNotReadyError, while preserving the existing error classification and
successful initialization behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a9e9f0cf-2f49-4ce4-b487-a53d642e563c
📒 Files selected for processing (17)
.flake8.github/workflows/ci.yml.gitignoreMANIFEST.inREADME.mdfeatbit_openfeature/__init__.pyfeatbit_openfeature/impl/__init__.pyfeatbit_openfeature/impl/context_converter.pyfeatbit_openfeature/impl/details_converter.pyfeatbit_openfeature/provider.pyfeatbit_openfeature/py.typedpyproject.tomltests/fixtures/bootstrap.jsontests/impl/test_context_converter.pytests/impl/test_details_converter.pytests/test_offline_integration.pytests/test_provider.py
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)
14-14: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winPin release actions to immutable commits.
The workflow uses mutable action references. A changed action could alter the build artifact or the publish step. The publish job has
id-token: write, so this could affect PyPI Trusted Publishing. Pin each action to a full commit SHA and keep the upstream version in a comment for maintainable updates.Also applies to: 17-17, 26-26, 42-42, 47-47
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release.yml at line 14, Update every action reference in the release workflow, including checkout and the actions at the other indicated steps, to use a full immutable commit SHA instead of a mutable tag. Add a comment alongside each SHA identifying its upstream version so future updates remain maintainable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@featbit_openfeature/provider.py`:
- Around line 115-120: Update the provider lifecycle synchronization around
shutdown(), _register_listeners(), and status emission: set a shutdown state
while holding _lifecycle_lock, then make listener registration and status
emission no-ops once shutdown has begun. Ensure shutdown snapshots and removes
only valid pre-shutdown listeners, preventing initialize() from adding callbacks
after the snapshot.
---
Nitpick comments:
In @.github/workflows/release.yml:
- Line 14: Update every action reference in the release workflow, including
checkout and the actions at the other indicated steps, to use a full immutable
commit SHA instead of a mutable tag. Add a comment alongside each SHA
identifying its upstream version so future updates remain maintainable.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 76903af5-2f19-4dfe-be67-9268e6215ba5
📒 Files selected for processing (8)
.github/workflows/ci.yml.github/workflows/release.ymlREADME.mdfeatbit_openfeature/provider.pypyproject.tomltests/test_offline_integration.pytests/test_packaging_metadata.pytests/test_provider.py
💤 Files with no reviewable changes (1)
- tests/test_offline_integration.py
🚧 Files skipped from review as they are similar to previous changes (2)
- .github/workflows/ci.yml
- pyproject.toml
Summary
Add the standalone FeatBit OpenFeature Python server provider as a thin wrapper around the existing FeatBit Python Server SDK.
FeatureProviderand all typed resolution methodsStatus mapping
OK→ OpenFeatureREADYINTERRUPTED→ OpenFeatureSTALEOFF→ OpenFeatureFATALNOT_READYDependencies
fb-python-sdk>=1.1.8,<2openfeature-sdk>=0.10,<1The required variation-ID and thread-safe status-listener capabilities are proposed in featbit/featbit-python-sdk#14.
Validation
53 passedv2, variantvariation-v2, and provider statusREADYSummary by CodeRabbit
New Features
Documentation
Packaging
Quality