fix: guard against an unset LAUNCHDARKLY_SDK_KEY - #15
Draft
devin-ai-integration[bot] wants to merge 1 commit into
Draft
fix: guard against an unset LAUNCHDARKLY_SDK_KEY#15devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
Author
|
@cursor review |
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.
Summary
SDK audit of this example against the latest gems. No dependency changes were required; one real bug in
main.rbis fixed.main.rbnever hit its own "please set the env var" branch:ENV['LAUNCHDARKLY_SDK_KEY']isnil(not'') when unset, so the example crashed with a rawArgumentError: sdk_key must not be nilstack trace from the SDK instead of the intended message.feature_flag_keyalways has a default, so it can only be a string — its check is simplified to.empty?.Gemfile.lockis committed (launchdarkly-server-sdk8.15.0,launchdarkly-openfeature-server-sdk0.2.0 under~> 0.2,openfeature-sdk0.6.5,listen3.10.0 under~> 3.3).-wwarnings all originate inside third-party gems.Implementation details
Validated in a
ruby:3.4container (matching CI'sruby-version: 3.4) with the latest gems installed from the uncommitted resolution:Before the fix, the second invocation ended in
ldclient.rb:74:in 'LaunchDarkly::LDClient#initialize': sdk_key must not be nil (ArgumentError).RUBYOPT=-wwarnings are all upstream and not fixable here:http-cookiecircular require,openfeature-sdkcircular require /flag_metadatamethod redefinition, and unused-variable warnings insidelaunchdarkly-server-sdk.Ruby ≥ 3.4 is genuinely required (both
launchdarkly-openfeature-server-sdk0.2.0 andopenfeature-sdk0.6.5 declarerequired_ruby_version >= 3.4); documenting that in the README is already covered by the open PR #14, so it is not duplicated here.fix:rather thanchore:because the change touches shipped example code.Link to Devin session: https://app.devin.ai/sessions/2d84367c077e4bc287c95457e9cd7422