Skip to content

feat: Add Config#with_wrapper_information - #421

Merged
kinyoklion merged 2 commits into
mainfrom
devin/config-with-wrapper-information
Aug 20, 2026
Merged

feat: Add Config#with_wrapper_information#421
kinyoklion merged 2 commits into
mainfrom
devin/config-with-wrapper-information

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Aug 19, 2026

Copy link
Copy Markdown
Member

Adds Config#with_wrapper_information so wrapper libraries can derive a configuration that identifies themselves without reconstructing the application's configuration.

  • Returns a copy of the configuration with wrapper_name and wrapper_version replaced; the original is unchanged.
  • Mirrors the equivalent capability in the .NET (Configuration.Builder(config)) and Java (LDConfig.Builder.fromConfig) SDKs.
  • Needed by the Ruby OpenFeature provider, which currently has no supported way to report itself as the wrapper when the application supplies its own Config.
Implementation details

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

The Ruby OpenFeature provider accepts a LaunchDarkly::Config from the application and needs to add wrapper identification to it. Config exposes wrapper_name/wrapper_version as readers only, so today a wrapper would have to either mutate instance variables or rebuild the configuration option by option, which silently drops any options it does not know about.

Describe the solution you've provided

with_wrapper_information(wrapper_name, wrapper_version = nil) uses dup plus protected writers for the two wrapper fields, so all other configuration — including options added in the future — carries over unchanged.

Describe alternatives you've considered

Reconstructing a Config from the public readers — rejected because it must be updated whenever a configuration option is added and would drop unknown options. Public writers for the wrapper fields — rejected because Config is otherwise immutable after construction.

Testing

bundle exec rspec on Ruby 3.4: 1027 examples, 0 failures. bundle exec rubocop on the changed files: no offenses. The protected attr_writer form was also verified on Ruby 3.1, the minimum supported version.

@cursor review

Link to Devin session: https://app.devin.ai/sessions/0c452d209ec54b068ba120b4c92b8f6c
Requested by: @kinyoklion


Note

Overview
Lets wrapper libraries (e.g. the OpenFeature provider) stamp wrapper_name / wrapper_version onto an application-supplied Config without reconstructing it option-by-option.

with_wrapper_information dups the config and uses protected writers so the original stays unchanged. Other settings carry over; nested objects (store, logger, etc.) are shared. Specs cover copy, immutability of the original, and a nil default version.

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

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@kinyoklion kinyoklion self-assigned this Aug 19, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 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

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@kinyoklion
kinyoklion merged commit 2de2b75 into main Aug 20, 2026
10 checks passed
@kinyoklion
kinyoklion deleted the devin/config-with-wrapper-information branch August 20, 2026 17:30
kinyoklion pushed a commit that referenced this pull request Aug 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[8.15.0](8.14.0...8.15.0)
(2026-08-20)


### Features

* Add Config#with_wrapper_information
([#421](#421))
([2de2b75](2de2b75))
* Add environment ID support for hooks
([#414](#414))
([257e0af](257e0af))


### Bug Fixes

* Escape attribute names reported in redactedAttributes
([#415](#415))
([447296f](447296f))
* Send the FDv2 polling selector as the "basis" query parameter
([#418](#418))
([1084931](1084931))
* Stop per-context private attributes from accumulating between contexts
([#416](#416))
([2fd26ea](2fd26ea))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> Release Please bump from **8.14.0** to **8.15.0**. Updates
`LaunchDarkly::VERSION`, the release-please manifest, provenance example
version, and changelog.
> 
> The 8.15.0 notes cover `Config#with_wrapper_information`, environment
ID support for hooks, redacted attribute escaping, FDv2 polling `basis`
query param, and a fix so per-context private attributes do not
accumulate.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c2fb4f4. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
kinyoklion added a commit to launchdarkly/openfeature-ruby-server that referenced this pull request Aug 21, 2026
Reports the provider as the wrapper so LaunchDarkly can attribute usage
to the OpenFeature Ruby provider rather than the base Ruby SDK.

- The provider derives its client configuration with
`Config#with_wrapper_information("open-feature-ruby-server", VERSION)`,
leaving the application's configuration untouched.
- Requires `launchdarkly-server-sdk ~> 8.15`, the release that adds
`Config#with_wrapper_information` (launchdarkly/ruby-server-sdk#421).
That version is now published, so dependency resolution succeeds.

<details>
<summary>Implementation details</summary>

**Requirements**

- [x] I have added test coverage for new or changed functionality
- [x] I have followed the repository's pull request submission
guidelines
- [x] I have validated my changes against all supported platform
versions

**Related issues**

Part of an audit of the LaunchDarkly OpenFeature providers against the
current OpenFeature specification. The Java and .NET providers already
identify themselves via wrapper info; the Ruby provider did not, so
usage of this provider was indistinguishable from direct use of the Ruby
server SDK.

**Describe the solution you've provided**

`Config` exposes `wrapper_name`/`wrapper_version` as readers only, so
the base SDK gained a supported way to derive a configuration with
different wrapper information. The provider calls it when constructing
its client.

**Describe alternatives you've considered**

Setting the configuration's instance variables from the provider —
rejected, as the provider must not depend on SDK internals. Rebuilding
the configuration from its public readers — rejected because it would
silently drop configuration options the provider does not know about.

**Testing**

`bundle exec rake` (RSpec + RuboCop) on Ruby 3.4: 55 examples, 0
failures; 12 files inspected, no offenses. CI now resolves against the
published 8.15.0 gem.

</details>


Link to Devin session:
https://app.devin.ai/sessions/0c452d209ec54b068ba120b4c92b8f6c
Requested by: @kinyoklion

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> The OpenFeature Ruby provider now identifies itself to LaunchDarkly as
wrapper `open-feature-ruby-server` with the gem `VERSION`, so usage is
attributed to this provider instead of the base Ruby SDK.
> 
> On client construction it derives config via
`Config#with_wrapper_information` and leaves the caller’s `Config`
unchanged. Runtime dependency is bumped to `launchdarkly-server-sdk ~>
8.15` for that API. A spec asserts wrapper name/version are passed
through.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
ffac4cf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants