docs: fix result values in custom operation examples#1989
Conversation
The example "Result" blocks in the sem_ver and starts_with/ends_with docs showed values that did not match their own variant. The variants map defines red as #FF0000 and green as #00FF00, but the red results showed #00FF00 and the green results showed #0000FF, which is not what flagd actually returns. Correct each result value to match its variant so users copy-running the examples see the real output: - variant "red" -> value "#FF0000" - variant "green" -> value "#00FF00" Verified against flagd's ResolveString output for both examples. Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
✅ Deploy Preview for polite-licorice-3db33c ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR corrects example output values in two documentation files. In semver-operation.md, the red and green variant ChangesCustom operations documentation fixes
Estimated code review effort: 1 (Trivial) | ~2 minutes Related PRs: None identified. Suggested labels: documentation Suggested reviewers: None identified. 🐰 A poem for the occasionA rabbit checked the docs one day, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
|



with targeting
if(<operation>) then "red" else "green". So a result with"variant":"red"must carry"value":"#FF0000"and"variant":"green"mustcarry
"value":"#00FF00". The docs instead showed:{"value":"#00FF00", ... ,"variant":"red"}(should be#FF0000){"value":"#0000FF", ... ,"variant":"green"}(should be#00FF00)which flagd never actually returns, so anyone copy-running the examples sees a
mismatch. This corrects the six affected
valuefields (2 insemver-operation.md, 4 instring-comparison-operation.md) to match eachvariant. Only the hex value changes;
reason(TARGETING_MATCH, correct onboth branches) and
variantare left as-is.Verification
Built flagd and re-ran the exact commands from the docs against
ResolveString:>=1.0.0:1.0.1->{"value":"#FF0000",...,"variant":"red"};0.1.0->{"value":"#00FF00",...,"variant":"green"}user@faas:user@faas.com-> red/#FF0000;foo@bar.com-> green/#00FF00faas.com:user@faas.com-> red/#FF0000;foo@bar.com-> green/#00FF00All six live outputs now match the corrected docs.
fractional-operation.mdalready agreed with its variants map, so it is left untouched.
Docs-only change;
make markdownlintrules pass on both files.