Repository navigation
feat(Flag Dependency): Evaluate flags that depend on other flags in local evaluation - #67
Conversation
…ocal evaluation Port flagsmith-engine's context evaluator, including flag dependency, and run identity flags through it. Bump engine-test-data to v3.12.1 and run all of its test cases. Generated with [Linear](https://linear.app/flagsmith/agent-session/51c26f09-5fe3-44a8-8e3d-be2cf9ac50ff) 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
|
Split the evaluator into a prepare step for the environment, with segment conditions compiled, and a per identity evaluation step. The prepared environment is kept per process for the environment last evaluated, and segments are evaluated without flags when only segments are asked for. Generated with [Linear](https://linear.app/flagsmith/agent-session/51c26f09-5fe3-44a8-8e3d-be2cf9ac50ff) Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
f06f112 to
c58b7b3
Compare
# Conflicts: # .gitmodules
…r flags Environment flags apply the overrides of segments that need no identity, i.e. conditions only on `$.environment` and `$.flags`, as the Flagsmith API does. `hide_disabled_flags` now hides flags by their evaluated state. Identity evaluation is faster: flags not overridden are evaluated once per environment, variant splits are sorted once per environment, and identity overrides no longer go through a segment of their own. 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 ×2.3
Performance Changes
Tip Curious why performance improved? Comment Comparing |
|
@coderabbitai review |
Action not completed
|
Zaimwa9
left a comment
There was a problem hiding this comment.
Minors but still requesting a change to have the key schema on par with other SDKs.
Ready to approve right after
Empty strings were cast to nil when parsing environment documents and API responses, so flags served nil instead of "" and IS_SET conditions on flag values diverged from other SDKs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Results now carry build-time contracts matching the SDK evaluation result schema, instead of string-keyed maps that typespecs cannot describe. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Concerns addressed while on opposite timezone. Thanks!
🤖 I have created a release *beep* *boop* --- ## [2.4.0](v2.3.1...v2.4.0) (2026-11-04) ### Features * **CI:** Set up CodSpeed ([#68](#68)) ([edb95fb](edb95fb)) * **Flag Dependency:** Evaluate flags that depend on other flags in local evaluation ([#67](#67)) ([260c966](260c966)) ### Bug Fixes * Send identity trait values as plain JSON values ([#60](#60)) ([f259ff8](f259ff8)) ### CI * Label Renovate's SDK spec bump PRs ([#62](#62)) ([77b5e9a](77b5e9a)) * Run the Flagsmith SDK behavioural spec ([#61](#61)) ([45b5617](45b5617)) * setup Renovate for engine-test-data tracking ([#56](#56)) ([60090c0](60090c0)) ### Other * Remove amannn/action-semantic-pull-request workflow ([#53](#53)) ([19414f3](19414f3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Local evaluation ignores conditions on other flags, so a flag that depends on another flag is served as if it didn't.
Contributes to SDK-9. Tested by engine-test-data v3.12.1.
Changes
$.flags.<feature>.enabled), including chains of dependencies. Segments caught in a cycle don't match.$.identity.*and$.environment.*now work.🤖 Generated with Claude Code
Closes #57