Repository navigation
feat(Flag Dependency): Evaluate flags that depend on other flags in local evaluation - #267
Open
linear-code[bot] wants to merge 2 commits into
Open
linear-code[bot] wants to merge 2 commits into
linear-code[bot] wants to merge 2 commits into
Conversation
…ocal evaluation Identity flags in local evaluation are resolved lazily against a context trimmed to the requested feature, which hides the flags a segment condition such as `$.flags.<feature>.enabled` depends on. Features overridden by such segments are now resolved against the full context. Contributes to https://linear.app/flagsmith/issue/SDK-2/enable-flag-dependency-in-all-server-side-sdks Generated with [Linear](https://linear.app/flagsmith/agent-session/c423fe72-0914-42ca-8401-f6992464b081) Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
… lazy flags Generated with [Linear](https://linear.app/flagsmith/agent-session/c423fe72-0914-42ca-8401-f6992464b081) Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.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 ignored Flag Dependency for identity flags. The SDK already uses flagsmith-flag-engine 11.1.1, which supports segment conditions on other flags (
$.flags.<feature>.enabled). However,get_identity_flagsresolves each flag lazily against a context that contains only the requested feature, so the engine never sees the flags that feature depends on. For example, a feature that should turn on when its prerequisite is enabled kept its default. In the shared engine test data, 11 of the 19 flag-dependency cases failed through this path.Changes
ERROR; code=CIRCULAR_DEPENDENCY, as in the engine.tests/engine_tests/engine-test-data.Flag-dependent features are detected once per environment-document refresh. Reading one triggers a single full evaluation, at the same cost as
all_flags(), and its results are cached for the rest of thatFlagsobject. All 220 engine-test-data cases pass through the lazyget_flagpath.Merging this produces a minor release (6.4.0) through release-please, which needs a maintainer to merge the release PR.
Contributes to https://linear.app/flagsmith/issue/SDK-2/enable-flag-dependency-in-all-server-side-sdks
Review effort: 2/5