Skip to content

Conversation

@jonathannorris
Copy link
Member

Summary

Enhances the OpenFeature Provider to support userId field mapping and corrects the priority order to match other DevCycle SDKs.

Changes

  • Priority Order: Updated to targetingKeyuser_iduserId (was previously backwards)
  • New Field Support: Added support for userId field mapping from OpenFeature evaluation context
  • Validation: Added robust validation for user ID fields (required, must be string, non-empty)
  • Error Handling: Improved error messages to include specific field names for better debugging
  • Custom Data: All user ID fields (targetingKey, user_id, userId) are now excluded from custom data

Validation Added

  • Throws ArgumentError if no user ID field is provided
  • Throws ArgumentError if user ID field is not a string (with field name)
  • Throws ArgumentError if user ID field is empty

Tests

  • ✅ 45 comprehensive tests covering all scenarios
  • ✅ Priority order validation
  • ✅ Field validation edge cases
  • ✅ Custom data exclusion behavior
  • ✅ Backward compatibility

This change aligns the Ruby SDK with other DevCycle OpenFeature providers and ensures consistent behavior across all platforms.


Open Background Agent:
Web · Cursor

[Slack Thread](https://taplytics.slack.com/archives/C02DU5GTB6U/p1752872862815949%3Fthread_ts=1752872862.815949

cursoragent and others added 7 commits July 21, 2025 20:46
Co-authored-by: jonathan <jonathan@taplytics.com>
Co-authored-by: jonathan <jonathan@taplytics.com>
Co-authored-by: jonathan <jonathan@taplytics.com>
Co-authored-by: jonathan <jonathan@taplytics.com>
Co-authored-by: jonathan <jonathan@taplytics.com>
Co-authored-by: jonathan <jonathan@taplytics.com>
@jonathannorris jonathannorris requested a review from a team as a code owner July 22, 2025 16:27
@jonathannorris jonathannorris changed the title Fix: Update OpenFeature Provider user ID mapping priority and add userId support fix: Update OpenFeature Provider user ID mapping priority and add userId support Jul 22, 2025
@jonathannorris jonathannorris merged commit e6c269a into main Jul 22, 2025
8 of 9 checks passed
@jonathannorris jonathannorris deleted the cursor/standardize-openfeature-user-id-mapping-fde1 branch July 22, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants