Skip to content

fix: setting OpenFeature Provider sdkPlatform, update tests, mark getOpenFeatureProvider() as deprecated - #1113

Merged
jonathannorris merged 4 commits into
mainfrom
fix-of-provider-sdk-platform
Jul 16, 2025
Merged

fix: setting OpenFeature Provider sdkPlatform, update tests, mark getOpenFeatureProvider() as deprecated#1113
jonathannorris merged 4 commits into
mainfrom
fix-of-provider-sdk-platform

Conversation

@jonathannorris

@jonathannorris jonathannorris commented Jul 16, 2025

Copy link
Copy Markdown
Member

Fix OpenFeature Provider SDK Platform and Test Issues

Problem

  • SDK platform not properly identified for OpenFeature integration
  • Deprecated getOpenFeatureProvider() method lacked clear guidance
  • OpenFeature provider tests failing due to improper client instantiation and mock bleeding

Changes

  • Platform: Set sdkPlatform to 'nodejs-of' for proper tracking
  • Deprecation: Added warnings to getOpenFeatureProvider() methods with migration docs
  • Tests: Fixed client type instantiation and added proper mock cleanup with afterEach

Migration

// Before (deprecated)
const client = new DevCycleClient(sdkKey, options)
const provider = await client.getOpenFeatureProvider()

// After
const provider = new DevCycleProvider(sdkKey, options)
// For cloud: new DevCycleProvider(sdkKey, { ...options, enableCloudBucketing: true })

@vercel

vercel Bot commented Jul 16, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
js-sdks-web-elements ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2025 8:24pm
js-sdks-with-provider ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2025 8:24pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
js-sdks-next-js-page-router ⬜️ Ignored (Inspect) Jul 16, 2025 8:24pm

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.

Pull Request Overview

This PR fixes OpenFeature provider integration by properly setting the SDK platform identifier, addressing test instability, and deprecating legacy provider access methods. The changes improve tracking capabilities and guide users toward the recommended DevCycleProvider pattern.

  • Set sdkPlatform to 'nodejs-of' for proper OpenFeature integration tracking
  • Added deprecation warnings to getOpenFeatureProvider() methods with migration documentation
  • Fixed test suite by switching to direct DevCycleProvider instantiation and adding proper cleanup

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
sdk/nodejs/src/open-feature/DevCycleProvider.ts Sets sdkPlatform to 'nodejs-of' when initializing from SDK key
sdk/nodejs/src/index.ts Adds deprecation warning to getOpenFeatureProvider() method
sdk/nodejs/src/client.ts Adds deprecation warning to getOpenFeatureProvider() method
sdk/nodejs/__tests__/open-feature-provider/DevCycleProvider.test.ts Updates tests to use DevCycleProvider directly and adds proper mock cleanup

Comment thread sdk/nodejs/__tests__/open-feature-provider/DevCycleProvider.test.ts
@jonathannorris
jonathannorris merged commit f3c723d into main Jul 16, 2025
14 checks passed
@jonathannorris
jonathannorris deleted the fix-of-provider-sdk-platform branch July 16, 2025 20:29
phaym pushed a commit that referenced this pull request Jul 16, 2025
jonathannorris added a commit that referenced this pull request May 26, 2026
- uuid ^8.3.2 -> ^11.1.1 in package.json and sdk/js/package.json (runtime, alerts #1113/#1114)
- uuid resolution ^11.1.1 added to root and all e2e sub-project package.json files (alerts #1105-#1109)
- qs resolutions added for exact-pinned 6.13.0 and 6.14.0 -> ^6.15.2 in root (alerts #1110-#1112)
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