featurevisor-openfeature 3.0.0 → 3.1.0
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/README.md +12 -16
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b95462003a714b5ba431826e55cfbdacaa79353bd3a2ef94b0362783563ff9e
|
|
4
|
+
data.tar.gz: 1f369ffa08695ab9eeef87253ef78f8f0891712d597c831d689543d9e16b8f9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dadb82981756de2034d404cff611a78971e89f42cf5a1e50d43af13686d46bb2384a4fab9feb6b08a9fd8e6ca9f38d00e4a78839b36fba97844bdb23e56a592b
|
|
7
|
+
data.tar.gz: 562954bcdf0b0173c947c87f0f6c47aa4ada512f2c0213f8c536e049b8f43086d93c8fb306f923f1830977a9659598b69ef9dd290f5190d5fa63ed5e26b2ba11
|
data/README.md
CHANGED
|
@@ -454,7 +454,7 @@ load_datafile(f, "checkout")
|
|
|
454
454
|
|
|
455
455
|
### Updating datafile
|
|
456
456
|
|
|
457
|
-
You can set the datafile as many times as you want in your application, which will result in emitting a [`datafile_set`](#
|
|
457
|
+
You can set the datafile as many times as you want in your application, which will result in emitting a [`datafile_set`](#datafile-set) event that you can listen and react to accordingly.
|
|
458
458
|
|
|
459
459
|
The triggers for setting the datafile again can be:
|
|
460
460
|
|
|
@@ -520,7 +520,7 @@ f = Featurevisor.create_featurevisor(
|
|
|
520
520
|
|
|
521
521
|
Every diagnostic has `:level`, `:code`, `:message`, and an object-shaped `:details` hash. Optional `:module`, `:moduleName`, and `:originalError` fields describe provenance. Evaluation metadata belongs in `:details`.
|
|
522
522
|
|
|
523
|
-
Diagnostic handlers are isolated from SDK
|
|
523
|
+
Diagnostic handlers are isolated from SDK behaviour. An exception in a handler does not stop other handlers or evaluations.
|
|
524
524
|
|
|
525
525
|
|
|
526
526
|
## Events
|
|
@@ -635,10 +635,12 @@ And optionally these properties depending on whether you are evaluating a featur
|
|
|
635
635
|
|
|
636
636
|
## Modules
|
|
637
637
|
|
|
638
|
-
Modules allow you to intercept the evaluation process and customize SDK
|
|
638
|
+
Modules allow you to intercept the evaluation process and customize SDK behaviour.
|
|
639
639
|
|
|
640
640
|
For feature evaluations, all `before` callbacks run in registration order, followed by all `before_evaluation` callbacks. After evaluation and caller defaults, all `after_evaluation` callbacks run, followed by all `after` callbacks. Global variable evaluations use only `before_evaluation` and `after_evaluation`. Required feature checks run through the complete module pipeline, and transformed defaults are preserved.
|
|
641
641
|
|
|
642
|
+
`before` and `after` remain available as deprecated feature-only compatibility callbacks. Use `before_evaluation` and `after_evaluation` for new modules so the same callbacks can handle feature and global variable evaluations.
|
|
643
|
+
|
|
642
644
|
### Defining a module
|
|
643
645
|
|
|
644
646
|
A module is a simple hash with a unique recommended `name` and optional lifecycle functions:
|
|
@@ -663,8 +665,8 @@ my_custom_module = {
|
|
|
663
665
|
})
|
|
664
666
|
},
|
|
665
667
|
|
|
666
|
-
# before evaluation
|
|
667
|
-
|
|
668
|
+
# before feature or global variable evaluation
|
|
669
|
+
before_evaluation: ->(options) {
|
|
668
670
|
# update context before evaluation
|
|
669
671
|
options[:context] = options[:context].merge({
|
|
670
672
|
someAdditionalAttribute: 'value'
|
|
@@ -672,21 +674,15 @@ my_custom_module = {
|
|
|
672
674
|
options
|
|
673
675
|
},
|
|
674
676
|
|
|
675
|
-
#
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
# after evaluation
|
|
679
|
-
after: ->(evaluation, options) {
|
|
677
|
+
# after feature or global variable evaluation
|
|
678
|
+
after_evaluation: ->(evaluation, options) {
|
|
680
679
|
reason = evaluation[:reason]
|
|
681
680
|
if reason == 'error'
|
|
682
681
|
# log error
|
|
683
|
-
return
|
|
684
682
|
end
|
|
683
|
+
evaluation
|
|
685
684
|
},
|
|
686
685
|
|
|
687
|
-
# unified callback for feature and global variable evaluations
|
|
688
|
-
after_evaluation: ->(evaluation, options) { evaluation },
|
|
689
|
-
|
|
690
686
|
# configure bucket key
|
|
691
687
|
bucket_key: ->(options) {
|
|
692
688
|
# return custom bucket key
|
|
@@ -822,7 +818,7 @@ $ bundle exec featurevisor test \
|
|
|
822
818
|
|
|
823
819
|
The Ruby test runner builds base datafiles and Target datafiles in memory via `npx featurevisor build --json`. When an assertion contains `target`, it is evaluated against the matching Target datafile.
|
|
824
820
|
|
|
825
|
-
All three commands accept repeatable `--target=<target>` options. `test` builds only the selected Target datafiles and runs untargeted assertions plus assertions for those targets. `benchmark` and `assess-distribution` run independently against every selected Target datafile. Without `--target`, existing project-wide
|
|
821
|
+
All three commands accept repeatable `--target=<target>` options. `test` builds only the selected Target datafiles and runs untargeted assertions plus assertions for those targets. `benchmark` and `assess-distribution` run independently against every selected Target datafile. Without `--target`, existing project-wide behaviour is preserved. Project definitions, test specs, Target discovery, and datafile generation continue to come from the Node.js CLI.
|
|
826
822
|
|
|
827
823
|
### Test against local monorepo's example-1
|
|
828
824
|
|
|
@@ -950,7 +946,7 @@ The build produces `featurevisor-VERSION.gem` and `featurevisor-openfeature-VERS
|
|
|
950
946
|
- Run `bundle install`
|
|
951
947
|
- Push commit to `main` branch
|
|
952
948
|
- Wait for CI to complete
|
|
953
|
-
- Tag the release with the same version number, for example `v3.
|
|
949
|
+
- Tag the release with the same version number, for example `v3.1.0`
|
|
954
950
|
- The workflow verifies that the tag matches the shared version
|
|
955
951
|
- The workflow publishes `featurevisor` first, followed by `featurevisor-openfeature`
|
|
956
952
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: featurevisor-openfeature
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fahad Heylaal
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 3.
|
|
18
|
+
version: 3.1.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 3.
|
|
25
|
+
version: 3.1.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: openfeature-sdk
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|