Repository navigation
feat: Evaluate flags that depend on other flags - #150
Open
linear-code[bot] wants to merge 9 commits into
Open
linear-code[bot] wants to merge 9 commits into
linear-code[bot] wants to merge 9 commits into
Conversation
Segment conditions can now read other flags via `$.flags.<name>`, resolved lazily with a cycle guard, mirroring flagsmith-engine. Flag results also carry a `variant` key. Bumps engine-test-data to v3.11.0. Generated with [Linear](https://linear.app/flagsmith/agent-session/d9c8ddc7-fa40-4842-80da-7e01be1b4f77) Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Skip the lazy flags when there are no segments, and break the context/flags reference cycle so each evaluation is freed by reference counting rather than left to the cycle collector. Generated with [Linear](https://linear.app/flagsmith/agent-session/d9c8ddc7-fa40-4842-80da-7e01be1b4f77) Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
emyller
force-pushed
the
linear/sdk-6-enable-flag-dependency-in-the-php-server-side-sdk-3e8e
branch
from
October 27, 2026 02:23
1649a50 to
744057b
Compare
# Conflicts: # .gitmodules
Bumps engine-test-data to v3.12.1, which expects it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Environment flags can now follow the flags they depend on, as in the Flagsmith API. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merging this PR will improve performance by 38.35%
Performance Changes
Tip Curious why performance improved? Comment Comparing |
Conditions such as `$.identity.identifier` or `$.flags.<feature>.enabled` skip JSONPath evaluation. Other paths are still evaluated by softcreatr/jsonpath. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Environment flags no longer deep-clone the context and select its identity-free segments on every call. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The engine leaves the context it evaluates untouched. Identity override rules now map an empty list of sub-rules, which deep-cloning used to fill in. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Local evaluation ignores segments that depend on other flags (
$.flags.<feature>.enabled), unlike flagsmith-engine and the Flagsmith API.Closes SDK-6. Tested by engine-test-data v3.12.1 and sdk-spec v0.7.0.
Changes
$.flags.<feature>.enabled,.valueand.variant) are now evaluated, including chains of dependencies; circular dependencies serve the default with reasonERROR; code=CIRCULAR_DEPENDENCY.variantthey were evaluated to.STATICinstead ofDEFAULT.🤖 Generated with Claude Code