Skip to content

chore: default LAUNCHDARKLY_FLAG_KEY to sample-feature - #13

Merged
jsonbailey merged 1 commit into
mainfrom
devin/1785747880-default-flag-key
Aug 3, 2026
Merged

chore: default LAUNCHDARKLY_FLAG_KEY to sample-feature#13
jsonbailey merged 1 commit into
mainfrom
devin/1785747880-default-flag-key

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The README states that a boolean flag of sample-feature is assumed when LAUNCHDARKLY_FLAG_KEY is unset, but main.rb read the variable without a default, so running the example without it printed *** The feature flag evaluates to false. (empty key, always the default value). This matches the behavior of the sibling examples (hello-ruby, hello-openfeature-node-server).

-feature_flag_key = ENV['LAUNCHDARKLY_FLAG_KEY']
+feature_flag_key = ENV['LAUNCHDARKLY_FLAG_KEY'] || 'sample-feature'

Dependency check (weekly SDK-freshness pass)

No dependency changes needed:

  • launchdarkly-openfeature-server-sdk '~> 0.2' — latest is 0.2.0; already satisfied.
  • launchdarkly-server-sdk (unconstrained) — resolves to latest 8.14.0.
  • No committed Gemfile.lock, so bundle install already picks up the latest compatible gems.
  • No deprecated SDK/tooling API usage observed (-W:deprecated run produced no warnings).

How to test

docker run --rm -v "$PWD":/app -w /app -e LAUNCHDARKLY_SDK_KEY=<key> ruby:3.4 \
  bash -c "bundle install && bundle exec ruby main.rb"
# *** The sample-feature feature flag evaluates to false.

Verified against a real SDK key both with and without LAUNCHDARKLY_FLAG_KEY set.

Risks

None; console-only example, one-line change.

Link to Devin session: https://app.devin.ai/sessions/99fa63dd93664185808e8b7ba127af91
Requested by: @jsonbailey


Note

Low Risk
Console-only sample app; single-line env default with no security or data impact.

Overview
Aligns runtime behavior with the README by defaulting LAUNCHDARKLY_FLAG_KEY to sample-feature when the env var is missing.

Previously the script read the variable with no fallback, so an unset key produced an empty flag name in the output and always evaluated the default boolean. With the default, running only with LAUNCHDARKLY_SDK_KEY evaluates the documented sample-feature flag.

Reviewed by Cursor Bugbot for commit db65f31. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot added the devin-pr PR created by Devin label Aug 3, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@cursor review

@kinyoklion
kinyoklion marked this pull request as ready for review August 3, 2026 16:01
@kinyoklion
kinyoklion requested a review from a team as a code owner August 3, 2026 16:01
@jsonbailey
jsonbailey merged commit dff8c73 into main Aug 3, 2026
5 checks passed
@jsonbailey
jsonbailey deleted the devin/1785747880-default-flag-key branch August 3, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devin-pr PR created by Devin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants