Repository navigation
fix: Log invalid context kinds at error level - #49
Open
kinyoklion wants to merge 2 commits into
Open
kinyoklion wants to merge 2 commits into
kinyoklion wants to merge 2 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…-invalid-kind-diagnostic
There was a problem hiding this comment.
Risk: low.
Automated risk review (dry run): Low
This PR would be automatically approved.
Why: This is a one-line log-level change in lib/ldclient-openfeature/impl/context_converter.rb (warn to error for non-string kinds) plus a matching assertion in spec/impl/context_converter_spec.rb.
Sent by Cursor Approval Agent: Dry-Run PR Approver
This branch has not been deployed
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
Accepted OFP requirement 2.1.4.1.
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.
Implemented in session Audit openfeature-ruby-server provider this week
Review with Devin · Open in Devin Desktop
SDK-3721
Note
Overview
When an OpenFeature
EvaluationContextsupplies a non-stringkind, the converter still discards it and defaults touser, 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
ERRORand the same message text.Reviewed by Cursor Bugbot for commit f347acf. Bugbot is set up for automated code reviews on this repo. Configure here.