Skip to content

feat: Every SDK includes reason in responses for identity and environment flags - #114

Merged
khvn26 merged 3 commits into
mainfrom
openhands/sdk-spec-v0.10.0
Nov 20, 2026
Merged

khvn26 merged 3 commits into
mainfrom
openhands/sdk-spec-v0.10.0

Conversation

@flagsmithsmith

@flagsmithsmith flagsmithsmith Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Contributes to Flagsmith/sdk-spec#27
Closes #93

Flagsmith returns a reason for every flag from /flags/ and /identities/,
and Flag already parses and stores it. Pass it through the spec steps so
SDK spec v0.10.0 can check it, cover reasons for environment and identity
flags in client tests, and document the field.

Contributes to Flagsmith/sdk-spec#27

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@flagsmithsmith

Copy link
Copy Markdown
Contributor Author

Pushed 5645f9a, which makes the SDK spec v0.10.0 checks pass.

Why CI was red. v0.10.0 checks each flag's reason in the core scenarios (STATIC, TARGETING_MATCH; segment=premium_users, DEFAULT). Three scenarios failed because the spec steps returned reason: None:

  • Environment flags are returned as configured in Flagsmith
  • Identity flags reflect segment overrides matched by traits
  • Identity flags fall back to the environment's when no segment matches

What changed.

  • sdk-spec/steps.dart: asSpecFlags now returns flag.reason, as the spec README asks of steps that get flags. The SDK already parses reason from /flags/ and /identities/ responses into Flag.reason (lib/src/core/model/flag.dart) and keeps it through storage, so no library change was needed. The step passes the server's value through. Nothing is hardcoded.
  • test/fg/flagsmith_reasons_test.dart: new client tests. They check that getFeatureFlags returns reasons for environment and identity flags, that reasons survive the cache (reload: false, cachedFlags), that a changed reason replaces the stored one on refresh, and that reasons are null when the server omits them.
  • README.md: a short section documenting reason.

Verified locally. flutter analyze reports no issues and flutter test passes (231 tests). The spec v0.10.0 runner with TAGS='core events' against its pinned Flagsmith passed 19 scenarios, with 8 deselected.

@flagsmithsmith
flagsmithsmith Bot marked this pull request as ready for review November 20, 2026 19:28
@flagsmithsmith
flagsmithsmith Bot requested a review from a team as a code owner November 20, 2026 19:28
@flagsmithsmith
flagsmithsmith Bot requested review from talissoncosta and removed request for a team November 20, 2026 19:28
Comment thread test/fg/flagsmith_reasons_test.dart Resolved
Comment thread README.md Resolved
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Nov 20, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Adds the existing nullable flag reason to the sdk-spec output, documents it in the README, pins the spec workflow to v0.10.0, and adds tests covering environment, identity, cache, and null cases. The change is bounded, additive, and well-tested.

Turn on auto-fix | Re-trigger cubic

The SDK spec checks flag reasons end to end, and SDKs are documented on
the docs site.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@khvn26
khvn26 merged commit 6fe215e into main Nov 20, 2026
6 checks passed
@khvn26
khvn26 deleted the openhands/sdk-spec-v0.10.0 branch November 20, 2026 19:33

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Adds the existing nullable reason field to sdk-spec flag output and bumps the sdk-spec workflow from v0.9.0 to v0.10.0 in sync. Both changes are spec/tooling-only and additive, with no production behavior or public API impact.

Turn on auto-fix | Re-trigger cubic

khvn26 pushed a commit that referenced this pull request Nov 23, 2026
🤖 I have created a release *beep* *boop*
---


##
[6.4.0](v6.3.0...v6.4.0)
(2026-11-20)


### Features

* Every SDK includes `reason` in responses for identity and environment
flags
([#114](#114))
([6fe215e](6fe215e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk-spec Bumps of the Flagsmith SDK behavioural spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Surface engine reasons in SDK response objects

1 participant