featureflip-openfeature 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +6 -0
- data/lib/featureflip/open_feature/provider.rb +22 -2
- data/lib/featureflip/open_feature/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f200fca2c00afb3109431bc224e6f49fac272f43fdbfde00b9a33e52d1f4c83f
|
|
4
|
+
data.tar.gz: c7e7e399ae3945b3444137f33d93ae44a8e903f92bd9962404bd2ad6a7ec7b4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0fd9682f0998b58d6b107626f1634c155d72a128cd9dc865b33f1ad92723697e2ce572ea89e509870777ee0b4ea10e0ec4bd0b10b7dbc5fd12e7b928d4404f3f
|
|
7
|
+
data.tar.gz: 78bcd49889185f9715703d096af2f510eeb6221d48f2644670efe29c92a75a0b323bd3fa96ddd292588a6d7a74aceb7b3e94e36428c41968b8ba062e2d8fefa8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1 — 2026-10-26
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Requires the `featureflip` gem 2.13 or later, so the evaluation events behind every flag the provider resolves carry the evaluation reason (`rule-match`, `fallthrough`, `flag-disabled`, `prerequisite-failed`, `error` or `flag-not-found`) and the matched rule id. Featureflip's flag Analytics tab uses them to show which part of the targeting served the traffic. (#4268)
|
|
8
|
+
|
|
9
|
+
## 0.2.0 — 2026-10-20
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Requests made through the provider now identify it: `User-Agent: featureflip-ruby/<version> featureflip-openfeature-ruby/<version>`, so Featureflip can count OpenFeature usage apart from direct SDK use. This applies when the provider builds its own client from `sdk_key:`; it works on a copy of your `Featureflip::Config`, so the config you passed is unchanged. A `client:` you pass in was built before the provider saw it, so its requests are unchanged, and a `wrapper_name:` already set on your config is kept. (#4154)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Requires `featureflip` `~> 2.11`, the release that added `wrapper_name:`.
|
|
18
|
+
|
|
3
19
|
## 0.1.0 — 2026-10-10
|
|
4
20
|
|
|
5
21
|
### Added
|
data/README.md
CHANGED
|
@@ -59,6 +59,12 @@ fork leaves each worker with dead polling and streaming threads, so it serves
|
|
|
59
59
|
the boot snapshot and never emits `PROVIDER_CONFIGURATION_CHANGED`. If you pass
|
|
60
60
|
your own `client:`, call `client.restart` in that hook instead.
|
|
61
61
|
|
|
62
|
+
The SDK keeps one client core per SDK key in each process. So if your app also
|
|
63
|
+
builds a client for the same key before the fork, say with
|
|
64
|
+
`Featureflip.configure` in a Rails initializer, the provider registered after
|
|
65
|
+
the fork picks up that inherited core, dead threads and all. Call
|
|
66
|
+
`Featureflip.restart` in the same hook to bring it back to life.
|
|
67
|
+
|
|
62
68
|
Full documentation: https://featureflip.io/docs/integrations/openfeature/#ruby
|
|
63
69
|
|
|
64
70
|
## License
|
|
@@ -60,7 +60,7 @@ module Featureflip
|
|
|
60
60
|
generation = @state_mutex.synchronize { @shut_down ? nil : @generation }
|
|
61
61
|
return nil if generation.nil?
|
|
62
62
|
|
|
63
|
-
@client ||= Featureflip::Client.get(@sdk_key, config:
|
|
63
|
+
@client ||= Featureflip::Client.get(@sdk_key, config: identified_config)
|
|
64
64
|
# Subscribed after the client is ready, so the initial load is never a
|
|
65
65
|
# "change" (OpenFeature signals it with PROVIDER_READY). Guarded because
|
|
66
66
|
# OpenFeature may initialize a provider more than once. The listener can
|
|
@@ -118,7 +118,8 @@ module Featureflip
|
|
|
118
118
|
resolve(:object, flag_key, default_value, evaluation_context)
|
|
119
119
|
end
|
|
120
120
|
|
|
121
|
-
# Called by openfeature-sdk 0.6.1
|
|
121
|
+
# Called by openfeature-sdk 0.6.1+, the release that added the tracking API.
|
|
122
|
+
# Earlier versions never call it.
|
|
122
123
|
def track(tracking_event_name, evaluation_context: nil, tracking_event_details: nil)
|
|
123
124
|
client = @client
|
|
124
125
|
return if client.nil?
|
|
@@ -133,6 +134,25 @@ module Featureflip
|
|
|
133
134
|
|
|
134
135
|
private
|
|
135
136
|
|
|
137
|
+
WRAPPER_NAME = "featureflip-openfeature-ruby"
|
|
138
|
+
|
|
139
|
+
# The caller's config (or a default one) naming this provider as the SDK's
|
|
140
|
+
# wrapper, so requests read "featureflip-ruby/<v> featureflip-openfeature-ruby/<v>"
|
|
141
|
+
# (#4154). A copy, so a config the caller reuses for direct SDK clients is not
|
|
142
|
+
# relabelled, with the SDK's memoized user agent cleared so the copy does not
|
|
143
|
+
# inherit the caller's. A wrapper the caller already set is kept: the SDK
|
|
144
|
+
# carries one, and theirs is the more specific. Only the sdk_key: form gets
|
|
145
|
+
# here; a borrowed client was built before the provider saw it.
|
|
146
|
+
def identified_config
|
|
147
|
+
return @config if @config&.wrapper_name
|
|
148
|
+
|
|
149
|
+
copy = @config ? @config.dup : Featureflip::Config.new
|
|
150
|
+
copy.remove_instance_variable(:@user_agent) if copy.instance_variable_defined?(:@user_agent)
|
|
151
|
+
copy.wrapper_name = WRAPPER_NAME
|
|
152
|
+
copy.wrapper_version = VERSION
|
|
153
|
+
copy
|
|
154
|
+
end
|
|
155
|
+
|
|
136
156
|
# Reads UNTYPED via variation_detail and applies the type guard here. The
|
|
137
157
|
# SDK's typed accessors report a wrong-typed value as reason "Error", the
|
|
138
158
|
# same reason a real failure carries, so TYPE_MISMATCH could not be told
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: featureflip-openfeature
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Featureflip
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: featureflip
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '2.
|
|
19
|
+
version: '2.13'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '2.
|
|
26
|
+
version: '2.13'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: openfeature-sdk
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|