Repository navigation
feat: Add overrideAffected to the flag metadata - #44
Closed
kinyoklion wants to merge 1 commit into
Closed
kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
2 of 3 tasks
kinyoklion
added a commit
that referenced
this pull request
Nov 16, 2026
**Requirements** - [x] I have added test coverage for new or changed functionality - [x] I have followed the repository's [pull request submission guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests) - [ ] I have validated my changes against all supported platform versions **Related issues** - OFP 1.1.0 spec change: launchdarkly/sdk-specs#284 - Supersedes the closed #44 (same branch) **Describe the solution you've provided** `ResolutionDetailsConverter` now sets `overrideAffected: true` in flag metadata when `EvaluationReason#override_affected` is true, and omits it otherwise (same as `inExperiment`, and as js-core's `translateResult.ts`). The `launchdarkly-server-sdk` dependency moves from `~> 8.19` to `~> 8.20`, the first release with `override_affected`. The README flag-metadata table and feature matrix list the new key. Tests cover override-affected true, false, unmarked reasons and an override-affected error evaluation. `bundle exec rspec` (78 examples, 0 failures) and `rubocop` pass locally on Ruby 3.4.7. **Describe alternatives you've considered** A `respond_to?(:override_affected)` guard that keeps the 8.19 floor (the approach in #44). Raising the floor is simpler, stays within the 8.x major and avoids a dead code path. **Additional context** None. <!-- devin-bot-banner-begin --> --- <picture><source srcset="https://app.devin.ai/api/presigned_proxy?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjpudWxsLCJidWNrZXRfbmFtZSI6ImRldmluYXR0YWNobWVudHMiLCJidWNrZXRfa2V5IjoiYXR0YWNobWVudHNfcHJpdmF0ZS9vcmdfaGVBMWRpc2owVHVLd2VVSy8wYTE0ODRlZC00ZjFkLTRiNzItODJmMi03Zjc3YTUzMzI5OWQiLCJpYXQiOjE3OTQ1MjM0NTgsIm9yZ19pZCI6Im9yZ19oZUExZGlzajBUdUt3ZVVLIiwiZmlsZW5hbWUiOiJib3QtYmFubmVyLnBuZyJ9.CWZivj413d8a1B1t-SIa74kOfmygffnKouWWdUwBw-Q"><img width="112" alt="" align="left"></picture> <h4><a href="https://app.devin.ai/bots/649040a7a000452fbe03eca40165f725">OpenFeature Maintainer</a> opened this PR for Ryan</h4> <p>Implemented in session <a href="https://app.devin.ai/sessions/13c6663b53f74a4aa59a17dda110533b">Add overrideAffected metadata to Ruby provider</a><br> <a href="https://app.devin.ai/review/launchdarkly/openfeature-ruby-server/pull/45">Review with Devin</a> · <a href="https://app.devin.ai/desktop/session/13c6663b53f74a4aa59a17dda110533b?variant=devin">Open in Devin Desktop</a></p> <br clear="left"> <!-- devin-bot-banner-end --> <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/launchdarkly/openfeature-ruby-server/pull/45" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a> <!-- devin-review-badge-end --> [SDK-3580](https://launchdarkly.atlassian.net/browse/SDK-3580) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Adds **OpenFeature flag metadata** support for LaunchDarkly **override** evaluations by surfacing `overrideAffected: true` when `EvaluationReason#override_affected` is set, and omitting the key otherwise (same pattern as `inExperiment`). > > **`ResolutionDetailsConverter`** gains the `overrideAffected` metadata key; the **`launchdarkly-server-sdk`** runtime floor moves from **~> 8.19** to **~> 8.20** so `override_affected` is always available. README feature matrix and flag-metadata table document the new key; specs cover positive, false, absent, and error-with-override cases. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 461bd56. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> [SDK-3580]: https://launchdarkly.atlassian.net/browse/SDK-3580?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Requirements
Related issues
OpenFeature provider behavior spec (OFP) 1.1.0 added
overrideAffectedto the flag metadata table (Requirement 3.3.2), applying when the wrapped SDK supports flag overrides (OVERRIDE 1.6.1). Found during the weekly OpenFeature provider audit.Describe the solution you've provided
Evaluations whose LaunchDarkly reason is marked override-affected now carry
overrideAffected: truein the flag metadata. The key is omitted otherwise, the same wayinExperimentis handled.No released LaunchDarkly Ruby SDK has flag overrides yet.
EvaluationReason#override_affectedexists on the SDK'sfeat/overridesbranch (ruby-server-sdk #450, marked experimental). Therespond_to?guard means the provider keeps working with 8.19.x, where the key is never present, and picks up the indicator once an SDK with overrides is installed. Thelaunchdarkly-server-sdkrequirement is unchanged. The README flag metadata table lists the new key and says it needs an SDK version that has overrides.Describe alternatives you've considered
Waiting for the Ruby SDK release with overrides, then requiring that version. That would tie this provider release to the SDK release, and the guard costs one method check.
Additional context
Testing:
bundle exec rspec(77 examples) andbundle exec rubocopon Ruby 3.4 against 8.19.1. Specs stuboverride_affectedon a reason to cover true, false and absent. I also ran the converter against thefeat/overridesSDK branch:EvaluationReason.fallthrough.with_override_affected(true)produced{"variationIndex" => 0, "overrideAffected" => true}.Link to Devin session: https://app.devin.ai/sessions/afef6eb710c1429f878ab14b829c297a
Open in Devin Desktop: https://app.devin.ai/desktop/session/afef6eb710c1429f878ab14b829c297a?variant=devin