Skip to content

fix: Normalize nested multi-context attribute keys - #46

Open
kinyoklion wants to merge 4 commits into
mainfrom
devin/1794846200-ruby-multi-context-keys
Open

kinyoklion wants to merge 4 commits into
mainfrom
devin/1794846200-ruby-multi-context-keys

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 16, 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

Accepted OFP requirements 2.2–2.4.

Describe the solution you've provided

Normalize nested multi-context attribute names to strings, matching OpenFeature's top-level EvaluationContext. String-keyed nested keys now work, targeting_key takes precedence over key for symbol-keyed hashes too, and reserved attribute validation applies consistently. Keep invalid targeting keys as invalid contexts instead of silently dropping their kind. Frozen input hashes are not mutated. Nested kind attributes are ignored: the top-level attribute name remains the sub-context kind, and kind is not copied into custom attributes.

Describe alternatives you've considered

Reading symbol and string keys independently would still bypass reserved attribute validation for symbol-keyed hashes.

Additional context

The original converter and affected tests were written by Matthew M. Keeler; this fix is by Devin for Ryan. Independent of held lifecycle work in #36/#39. Updated with main a1ce7e1. Six regression cases cover nested kind values user, multi, and a non-string with symbol/string keys; all six fail against main's converter and pass with this fix. Local Ruby 3.4: 87 examples pass; RuboCop clean. CI passes on Linux Ruby 3.4, JRuby 10.0 and Windows Ruby 3.4; Devin Review found no issues.


OpenFeature Maintainer opened this PR for Ryan
Implemented in session Audit openfeature-ruby-server provider this week
Review with Devin · Open in Devin Desktop


SDK-3721

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@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 16, 2026 22:20
@kinyoklion
kinyoklion requested a review from a team as a code owner November 16, 2026 22:20
@cursor cursor Bot added the risk:low label Nov 16, 2026

@cursor cursor 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.

Risk: low.

Automated risk review (dry run): Low

This PR would be automatically approved.

Why: Nested multi-context key handling in lib/ldclient-openfeature/impl/context_converter.rb is a small, well-tested SDK bugfix (with matching spec/impl/context_converter_spec.rb coverage) and does not touch infra, auth, CI, or approval-policy files.

If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant