Conversation
e0ca5dd to
f3f1ce7
Compare
f3f1ce7 to
8e19bf3
Compare
Implement local evaluation of feature flag dependencies by adding support for flag properties with type="flag" and dependency_chain arrays.
Added two new examples demonstrating complex multivariate flag dependency chains that were ported from the Python SDK: 1. Pineapple chain: pineapple@example.com -> blue -> breaking-bad 2. Mango chain: mango@example.com -> red -> the-wire These examples showcase the multivariate flag dependencies feature that was recently implemented and demonstrate local evaluation of complex dependency chains without requiring HTTP requests. Changes: - Added examples to both main section (case 4) and "run all" section (case 6) - Used proper Ruby syntax with named parameters for client methods - Added success/failure validation with expected vs actual value reporting
8e19bf3 to
267f998
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements local evaluation of feature flag dependencies in the PostHog Ruby SDK by adding support for flag properties with type="flag" and dependency_chain arrays. The feature enables evaluating flags that depend on other flags without requiring remote API calls.
- Adds comprehensive flag dependency evaluation logic with circular dependency detection
- Implements
matches_dependency_valuemethod for comparing expected vs actual flag values - Adds extensive test coverage for various dependency scenarios including complex multivariate chains
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/posthog/feature_flags.rb | Core implementation of flag dependency evaluation with new helper methods |
| spec/posthog/flags_spec.rb | Comprehensive test suite for flag dependencies including edge cases |
| spec/posthog/feature_flag_spec.rb | Removes old test that was replaced by new dependency implementation |
| example.rb | Updates example script with flag dependency demonstrations and env var name changes |
| .env.example | Updates environment variable name for consistency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
And remove the TODO comment.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
andyzzhao
approved these changes
Aug 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement local evaluation of feature flag dependencies by adding support for flag properties with type="flag" and
dependency_chainarrays.