feat: Add reason, variant to flagsmith eval output - #74
Draft
khvn26 wants to merge 1 commit into
Draft
Conversation
`eval` has only ever said what an SDK resolves, never why. A flag that is on because of a segment override, an identity override or a percentage split all looked identical, so answering "why is this on for that user" meant leaving the terminal for the dashboard. flagsmith-go-client#221 puts `Reason` and `Variant` on `Flag`, populated from the engine in local evaluation and from the `reason` and `variant` fields of `/flags` and `/identities` remotely. This surfaces both. Both are `omitempty` rather than always present. The EvaluationResult schema marks them required, but an SDK API that predates them reports neither, and no variant applies to a standard feature or to an evaluation with no identity to bucket. An empty string would read as a reason of its own, so absence is the honest answer — the same treatment `segments` already gets, and what keeps `--json` a subset rather than a fiction. The table grows a column only where there is something to put in it, so an API reporting neither renders exactly as it does today. `--js` is deliberately untouched: a frontend SDK hydrates from enabled and value, and anything else is state it would carry without ever reading. go.mod pins a pseudo-version until #221 is merged and released. beep boop
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
flagsmith evalflagsmith eval output
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.
Closes #73.
reasonandvariantin--json, the table and the detail view, fromFlag.Reason/Flag.Variantomitempty: an SDK API reporting neither renders exactly as it does todayDrafted until flagsmith-go-client#221 is released.
Note the core API sends
variantonly, onPOST /identities/—reasoncomes from Edge.