Skip to content

fix: key provider state by identity, default the NoOp reason, freeze client metadata - #355

Merged
josecolella merged 3 commits into
mainfrom
fix/community-spec-fixes
Oct 23, 2026
Merged

josecolella merged 3 commits into
mainfrom
fix/community-spec-fixes

Conversation

@josecolella

Copy link
Copy Markdown
Collaborator

Summary

Behavior changes worth noting

  • NoOp reason: a NoOp evaluation's reason is "DEFAULT" instead of "No-op".
  • ProviderInitializationError.new without error_code: defaults to GENERAL instead of PROVIDER_FATAL. Errors the SDK raises from a failing init still carry that init's own code.
  • Client metadata: mutating client.metadata raises FrozenError.

How to review

Merging

  • Squash merges here use an empty body. Add Co-authored-by: Cristian Marta <cristian@caffe-lento.com> to the squash message so his authorship survives.

🤖 Generated with Claude Code

…ider.object_id

Signed-off-by: Cristian Marta <cristian@caffe-lento.com>
Signed-off-by: Jose Colella <jose.colella@gusto.com>
…t error code with spec

Signed-off-by: Cristian Marta <cristian@caffe-lento.com>
Signed-off-by: Jose Colella <jose.colella@gusto.com>
Signed-off-by: Cristian Marta <cristian@caffe-lento.com>
Signed-off-by: Jose Colella <jose.colella@gusto.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e95b9973-42ec-4405-9dcf-466480c0ca6b
📥 Commits

Reviewing files that changed from the base of the PR and between 06a0263 and bf16f28.

📒 Files selected for processing: 8
  • lib/open_feature/sdk/client_metadata.rb
  • lib/open_feature/sdk/provider/no_op_provider.rb
  • lib/open_feature/sdk/provider_initialization_error.rb
  • lib/open_feature/sdk/provider_state_registry.rb
  • spec/open_feature/sdk/client_spec.rb
  • spec/open_feature/sdk/hooks/logging_hook_spec.rb
  • spec/open_feature/sdk/provider_initialization_error_spec.rb
  • spec/open_feature/sdk/provider_state_registry_spec.rb
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.67%. Comparing base (06a0263) to head (bf16f28).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #355   +/-   ##
=======================================
  Coverage   99.67%   99.67%           
=======================================
  Files          32       32           
  Lines         927      930    +3     
=======================================
+ Hits          924      927    +3     
  Misses          3        3           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@josecolella
josecolella marked this pull request as ready for review October 23, 2026 19:43
@josecolella
josecolella requested a review from a team as a code owner October 23, 2026 19:43
Copilot AI balanced review requested due to automatic review settings October 23, 2026 19:43
@josecolella
josecolella merged commit d15bd84 into main Oct 23, 2026
28 checks passed
@josecolella
josecolella deleted the fix/community-spec-fixes branch October 23, 2026 19:44

Copilot AI 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.

🟢 Approval recommended

These localized changes have no identified blocking issues; automated tests were not run in this environment.

No open issues 🎉

What changed in this PR

Combines three focused fixes that advance the Ruby SDK’s OpenFeature specification compliance under #300.

Changes:

  • Tracks provider state using object identity rather than object_id.
  • Changes the NoOp evaluation reason to DEFAULT and the default initialization error code to GENERAL.
  • Freezes client metadata and a defensive copy of its domain, with updated regression tests.
File Description
spec/​open_feature/​sdk/​provider_state_registry_spec.rb Removes unnecessary object_id stubs.
spec/​open_feature/​sdk/​provider_initialization_error_spec.rb Expects the GENERAL default error code.
spec/​open_feature/​sdk/​hooks/​logging_hook_spec.rb Verifies logging preserves an explicit error code.
spec/​open_feature/​sdk/​client_spec.rb Checks metadata and domain are frozen.
lib/​open_feature/​sdk/​provider/​no_op_provider.rb Uses the standard DEFAULT reason.
lib/​open_feature/​sdk/​provider_state_registry.rb Uses provider objects as identity-based keys.
lib/​open_feature/​sdk/​provider_initialization_error.rb Defaults to GENERAL and updates its documentation.
lib/​open_feature/​sdk/​client_metadata.rb Copies and freezes the domain, then freezes metadata.

Review effort: Balanced

This was referenced Oct 23, 2026
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.

3 participants