Skip to content

feat: add overrideAffected to flag metadata - #45

Merged
kinyoklion merged 2 commits into
mainfrom
devin/1794241273-ruby-override-affected
Nov 16, 2026
Merged

kinyoklion merged 2 commits into
mainfrom
devin/1794241273-ruby-override-affected

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

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.


OpenFeature Maintainer opened this PR for Ryan

Implemented in session Add overrideAffected metadata to Ruby provider
Review with Devin · Open in Devin Desktop



Devin Review

SDK-3580


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.

Reviewed by Cursor Bugbot for commit 461bd56. Bugbot is set up for automated code reviews on this repo. Configure here.

devin-ai-integration Bot and others added 2 commits November 9, 2026 16:22
Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@kinyoklion
kinyoklion marked this pull request as ready for review November 12, 2026 23:20
@kinyoklion
kinyoklion requested a review from a team as a code owner November 12, 2026 23:20
@kinyoklion
kinyoklion merged commit 8ae500c into main Nov 16, 2026
15 checks passed
@kinyoklion
kinyoklion deleted the devin/1794241273-ruby-override-affected branch November 16, 2026 22:14
kinyoklion pushed a commit that referenced this pull request Nov 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.0](0.3.1...0.4.0)
(2026-11-17)


### Features

* add overrideAffected to flag metadata
([#45](#45))
([8ae500c](8ae500c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
kinyoklion added a commit that referenced this pull request Nov 30, 2026
**Requirements**

- [x] I have added test coverage for new or changed functionality
- [x] I have followed the repository's pull request submission
guidelines
- [x] I have validated my changes against all supported platform
versions

**Related issues**

[Accepted OFP requirement
2.1.4.1](https://github.com/launchdarkly/sdk-specs/blob/main/specs/OFP-openfeature-provider-behavior/README.md#requirement-2141).

**Describe the solution you've provided**

Log an error, rather than a warning, when ignoring a non-string context
kind. The existing user-kind fallback is unchanged. Extend the existing
invalid-kind test to check the diagnostic.

**Describe alternatives you've considered**

Keeping a warning hides this required OFP diagnostic from applications
with an ERROR log level.

**Additional context**

The original converter and invalid-kind test were written by Matthew M.
Keeler; this fix is by Devin for Ryan. Updated cleanly with main after
#45 merged (8ae500c). Local Ruby 3.4: 78 examples pass; RuboCop clean.
CI passes on Linux Ruby 3.4, JRuby 10.0 and Windows Ruby 3.4; Devin
Review found no issues. Left as a draft per Ryan's account setting.

<!-- devin-bot-banner-begin -->
---

<p><picture><source
srcset="https://app.devin.ai/api/presigned_proxy?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjpudWxsLCJidWNrZXRfbmFtZSI6ImRldmluYXR0YWNobWVudHMiLCJidWNrZXRfa2V5IjoiYXR0YWNobWVudHNfcHJpdmF0ZS9vcmdfaGVBMWRpc2owVHVLd2VVSy9mMjlkYjhmNC0wMzFkLTRiZTktYjZhMi03ZDI3MTBmMmFiNWUiLCJpYXQiOjE3OTQ4NDYzMjksIm9yZ19pZCI6Im9yZ19oZUExZGlzajBUdUt3ZVVLIiwiZmlsZW5hbWUiOiJib3QtYmFubmVyLnBuZyJ9.7jfYTN71OcNs24NVj6QpiqlVcrPZpfvFOd37gdt-EiU"><img
height="63" alt="" align="left"></picture><strong><a
href="https://app.devin.ai/bots/649040a7a000452fbe03eca40165f725">OpenFeature
Maintainer</a> opened this PR for Ryan</strong><br>
Implemented in session <a
href="https://app.devin.ai/sessions/daa39d583b2c4e35af666a1de29c81b9">Audit
openfeature-ruby-server provider this week</a><br>
<a
href="https://app.devin.ai/review/launchdarkly/openfeature-ruby-server/pull/49">Review&nbsp;with&nbsp;Devin</a>
· <a
href="https://app.devin.ai/desktop/session/daa39d583b2c4e35af666a1de29c81b9?variant=devin">Open&nbsp;in&nbsp;Devin&nbsp;Desktop</a></p>
<br clear="left">
<!-- devin-bot-banner-end -->

[SDK-3721](https://launchdarkly.atlassian.net/browse/SDK-3721)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> When an OpenFeature `EvaluationContext` supplies a non-string `kind`,
the converter still discards it and defaults to `user`, but the
diagnostic is now emitted at **error** instead of **warn** so it meets
OpenFeature provider requirement 2.1.4.1 and shows up for apps that only
surface ERROR-level logs.
> 
> The existing invalid-kind spec is extended to assert the logger output
includes `ERROR` and the same message text.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f347acf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

[SDK-3721]:
https://launchdarkly.atlassian.net/browse/SDK-3721?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
kinyoklion added a commit that referenced this pull request Nov 30, 2026
**Requirements**

- [x] I have added test coverage for new or changed functionality
- [x] I have followed the repository's pull request submission
guidelines
- [x] I have validated my changes against all supported platform
versions

**Related issues**

[Accepted OFP requirements
2.4.4–2.4.5.1](https://github.com/launchdarkly/sdk-specs/blob/main/specs/OFP-openfeature-provider-behavior/README.md#24-attributes).

**Describe the solution you've provided**

Reject the whole privateAttributes reserved attribute with an error if
any list entry is not a string, rather than silently retaining a valid
subset. Valid/empty lists retain their existing behavior.

**Describe alternatives you've considered**

Filtering individual entries conflicts with OFP 2.4.5, which requires
leaving the corresponding context property unset for an invalid type.

**Additional context**

A malformed list such as ["email", true] now sets no private attributes;
applications must supply a valid all-string list to mark attributes
private. The original validation/tests were written by Matthew M.
Keeler; this fix is by Devin for Ryan. Updated cleanly with main after
#45 merged (8ae500c). Local Ruby 3.4: 79 examples pass; RuboCop clean.
CI passes on Linux Ruby 3.4, JRuby 10.0 and Windows Ruby 3.4; Devin
Review found no issues. Left as a draft per Ryan's account setting.

<!-- devin-bot-banner-begin -->
---

<p><picture><source
srcset="https://app.devin.ai/api/presigned_proxy?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjpudWxsLCJidWNrZXRfbmFtZSI6ImRldmluYXR0YWNobWVudHMiLCJidWNrZXRfa2V5IjoiYXR0YWNobWVudHNfcHJpdmF0ZS9vcmdfaGVBMWRpc2owVHVLd2VVSy8xYjYyYWMwMi1hN2ZjLTQ1YjktOGFjYi0yYTg0ZWZlMjQzNDAiLCJpYXQiOjE3OTQ4NDYzMTMsIm9yZ19pZCI6Im9yZ19oZUExZGlzajBUdUt3ZVVLIiwiZmlsZW5hbWUiOiJib3QtYmFubmVyLnBuZyJ9.TJtaidsyzDzHyKn8eOuF3oZR6SPFYb0mWTjD1-YL_Kg"><img
height="63" alt="" align="left"></picture><strong><a
href="https://app.devin.ai/bots/649040a7a000452fbe03eca40165f725">OpenFeature
Maintainer</a> opened this PR for Ryan</strong><br>
Implemented in session <a
href="https://app.devin.ai/sessions/daa39d583b2c4e35af666a1de29c81b9">Audit
openfeature-ruby-server provider this week</a><br>
<a
href="https://app.devin.ai/review/launchdarkly/openfeature-ruby-server/pull/48">Review&nbsp;with&nbsp;Devin</a>
· <a
href="https://app.devin.ai/desktop/session/daa39d583b2c4e35af666a1de29c81b9?variant=devin">Open&nbsp;in&nbsp;Devin&nbsp;Desktop</a></p>
<br clear="left">
<!-- devin-bot-banner-end -->

[SDK-3721](https://launchdarkly.atlassian.net/browse/SDK-3721)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> **`privateAttributes` validation is now all-or-nothing** in
`EvaluationContextConverter`: if any list element is not a string, the
converter logs an error and **does not** set `_meta.privateAttributes`
on the LD context (previously valid strings in a mixed list were still
applied).
> 
> Behavior for all-string arrays and empty arrays is unchanged. A spec
asserts that `["email", true]` yields an empty `private_attributes` and
the existing error message, aligning with OFP behavior that invalid
reserved attributes should be left unset rather than partially honored.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
18d0bf1. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

[SDK-3721]:
https://launchdarkly.atlassian.net/browse/SDK-3721?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
kinyoklion added a commit that referenced this pull request Nov 30, 2026
**Requirements**

- [x] I have added test coverage for new or changed functionality
- [x] I have followed the repository's pull request submission
guidelines
- [x] I have validated my changes against all supported platform
versions

**Related issues**

[Accepted OFP requirements
2.5.1–2.5.2.1](https://github.com/launchdarkly/sdk-specs/blob/main/specs/OFP-openfeature-provider-behavior/README.md#25-value-conversion).

**Describe the solution you've provided**

Convert Time and DateTime attributes to UTC ISO-8601 strings, preserving
fractional seconds, and Date attributes to midnight UTC. Recursively
convert arrays/structures, preserve JSON scalars, and replace
unsupported values with null while logging an error. Applies to custom
attributes in single/multi-contexts without mutating input values.

**Describe alternatives you've considered**

JSON serialization leaves native date/object instances in the evaluation
context, so local targeting does not see the string/null values required
by OFP.

**Additional context**

The affected converter and original tests were written by Matthew M.
Keeler; this fix is by Devin for Ryan. Independent of #45 and held
lifecycle work. Updated cleanly with main after #45 merged (8ae500c).
Local Ruby 3.4: 82 examples pass; RuboCop clean. CI passes on Linux Ruby
3.4, JRuby 10.0 and Windows Ruby 3.4; Devin Review found no issues. Left
as a draft per Ryan's account setting.

<!-- devin-bot-banner-begin -->
---

<p><picture><source
srcset="https://app.devin.ai/api/presigned_proxy?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjpudWxsLCJidWNrZXRfbmFtZSI6ImRldmluYXR0YWNobWVudHMiLCJidWNrZXRfa2V5IjoiYXR0YWNobWVudHNfcHJpdmF0ZS9vcmdfaGVBMWRpc2owVHVLd2VVSy8xMzdmNzg0Mi1kZTk0LTQzZTUtOGJlMy0zMmVkNmVhMDdhZWMiLCJpYXQiOjE3OTQ4NDYyNTEsIm9yZ19pZCI6Im9yZ19oZUExZGlzajBUdUt3ZVVLIiwiZmlsZW5hbWUiOiJib3QtYmFubmVyLnBuZyJ9.C8niQqrw0zlKRscfmysnngx5v40pD-vpAPAeykD2TAw"><img
height="63" alt="" align="left"></picture><strong><a
href="https://app.devin.ai/bots/649040a7a000452fbe03eca40165f725">OpenFeature
Maintainer</a> opened this PR for Ryan</strong><br>
Implemented in session <a
href="https://app.devin.ai/sessions/daa39d583b2c4e35af666a1de29c81b9">Audit
openfeature-ruby-server provider this week</a><br>
<a
href="https://app.devin.ai/review/launchdarkly/openfeature-ruby-server/pull/47">Review&nbsp;with&nbsp;Devin</a>
· <a
href="https://app.devin.ai/desktop/session/daa39d583b2c4e35af666a1de29c81b9?variant=devin">Open&nbsp;in&nbsp;Devin&nbsp;Desktop</a></p>
<br clear="left">
<!-- devin-bot-banner-end -->

[SDK-3721](https://launchdarkly.atlassian.net/browse/SDK-3721)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> **OpenFeature evaluation contexts are now normalized** before they
become `LDContext`, so custom attributes match OpenFeature provider
behavior (OFP 2.5.x) instead of being passed through as Ruby objects.
> 
> `EvaluationContextConverter` routes non-reserved attributes through a
new **`convert_value`** helper: JSON scalars stay as-is; **`Time` /
`DateTime`** become UTC ISO-8601 strings (with fractional seconds when
present); **`Date`** becomes midnight UTC; **arrays and hashes** are
converted recursively. Unsupported types are **`nil`** with an error
log. Input hashes/arrays are not mutated. Conversion applies in single-
and multi-kind contexts.
> 
> Specs cover timezone conversion without mutating frozen inputs, nested
structures, unsupported types, fractional seconds, and multi-context
attributes.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
8a8592e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

[SDK-3721]:
https://launchdarkly.atlassian.net/browse/SDK-3721?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants