Skip to content

feat(sdk): Add flag dependencies to the evaluation context - #8396

Draft
khvn26 wants to merge 1 commit into
mainfrom
feat/dependent-flags-evaluation-context
Draft

feat(sdk): Add flag dependencies to the evaluation context#8396
khvn26 wants to merge 1 commit into
mainfrom
feat/dependent-flags-evaluation-context

Conversation

@khvn26

@khvn26 khvn26 commented Aug 27, 2026

Copy link
Copy Markdown
Member

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #8394.

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Aug 27, 2026 3:57pm
flagsmith-frontend-preview Ignored Ignored Preview Aug 27, 2026 3:57pm
flagsmith-frontend-staging Ignored Ignored Preview Aug 27, 2026 3:57pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the feature New feature or request label Aug 27, 2026
@khvn26
khvn26 force-pushed the feat/dependent-flags-evaluation-context branch from 3411d79 to 37c4926 Compare August 27, 2026 15:54
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Aug 27, 2026
@khvn26
khvn26 force-pushed the feat/dependent-flags-evaluation-context branch from 37c4926 to 6b6685d Compare August 27, 2026 15:55
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Aug 27, 2026
Adds the schema surface needed to evaluate flags that depend on other
flags, as an equivalent to LaunchDarkly's flag prerequisites.

`EvaluationContext.flags` is a map of already-evaluated flag results
keyed by feature name, so that segment conditions can reference
`$.flags.<name>.enabled`, `.value` and `.variant`. Entries reference
`FlagResult` in evaluation-result.json directly, so the context and the
result cannot drift, and it is `readOnly` as the engine populates it.

No behaviour change; this lands the schema so the engines can generate
their context types from it.
@khvn26
khvn26 force-pushed the feat/dependent-flags-evaluation-context branch from 6b6685d to 87b91cb Compare August 27, 2026 15:57
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Aug 27, 2026
khvn26 added a commit to Flagsmith/engine-test-data that referenced this pull request Aug 27, 2026
REVERT BEFORE MERGE.

`EvaluationContext.flags` only exists on the schema branch of
Flagsmith/flagsmith#8396, so validating the new test cases against
`refs/heads/main` silently proves nothing: the key is simply unknown to
the schema, and `EvaluationContext` doesn't set `additionalProperties`
to false, so anything at all passes.

Points `schema.json` at the context schema on that branch, and the new
test cases at `schema.json` on this one, so that validation is
meaningful while both are in review. With this, `check-jsonschema`
rejects e.g. a non-boolean `$.context.flags.<name>.enabled`, which it
accepted before.

Once #8396 is merged, both refs should go back to `main` (and the test
cases to a tag, in line with the rest of the corpus).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants