diff --git a/providers/openfeature-go-feature-flag-provider/README.md b/providers/openfeature-go-feature-flag-provider/README.md index e1ed9f2..4edc0fd 100644 --- a/providers/openfeature-go-feature-flag-provider/README.md +++ b/providers/openfeature-go-feature-flag-provider/README.md @@ -13,7 +13,7 @@ This repository contains the official Ruby OpenFeature provider for accessing your feature flags with [GO Feature Flag](https://gofeatureflag.org). -In conjuction with the [OpenFeature SDK](https://openfeature.dev/docs/reference/concepts/provider) you will be able +In conjunction with the [OpenFeature SDK](https://openfeature.dev/docs/reference/concepts/provider) you will be able to evaluate your feature flags in your Ruby applications. For documentation related to flags management in GO Feature Flag, @@ -53,11 +53,6 @@ The `OpenFeature::GoFeatureFlag::Provider` needs some options to be created and The only required option to create a `GoFeatureFlagProvider` is the URL _(`endpoint`)_ to your GO Feature Flag relay-proxy instance. ```ruby -import GOFeatureFlag -import OpenFeature - -# ... - options = OpenFeature::GoFeatureFlag::Options.new(endpoint: "http://localhost:1031") provider = OpenFeature::GoFeatureFlag::Provider.new(options: options) @@ -123,7 +118,7 @@ client.fetch_object_value(flag_key: 'my-flag', default_value: {"default" => true | ❌ | Caching | Mechanism is in place to refresh the cache in case of configuration change | | ❌ | Event Streaming | Not supported by the SDK | | ❌ | Logging | Not supported by the SDK | -| ✅ | Flag Metadata | Not supported by the SDK | +| ✅ | Flag Metadata | You can retrieve your flag metadata directly in the evaluation details. | **Implemented**: ✅ | In-progress: ⚠️ | Not implemented yet: ❌ diff --git a/providers/openfeature-go-feature-flag-provider/lib/openfeature/go-feature-flag/go_feature_flag_provider.rb b/providers/openfeature-go-feature-flag-provider/lib/openfeature/go-feature-flag/go_feature_flag_provider.rb index 972cb94..3ac64fc 100644 --- a/providers/openfeature-go-feature-flag-provider/lib/openfeature/go-feature-flag/go_feature_flag_provider.rb +++ b/providers/openfeature-go-feature-flag-provider/lib/openfeature/go-feature-flag/go_feature_flag_provider.rb @@ -32,7 +32,7 @@ def fetch_object_value(flag_key:, default_value:, evaluation_context: nil) private def evaluate(flag_key:, default_value:, allowed_classes:, evaluation_context: nil) - evaluation_context = OpenFeature::SDK::EvaluationContext.new unless evaluation_context.is_a?(OpenFeature::SDK::EvaluationContext) + evaluation_context = OpenFeature::SDK::EvaluationContext.new if evaluation_context.nil? validate_parameters(flag_key, evaluation_context) # do a http call to the go feature flag server diff --git a/providers/openfeature-go-feature-flag-provider/lib/openfeature/go-feature-flag/goff_api.rb b/providers/openfeature-go-feature-flag-provider/lib/openfeature/go-feature-flag/goff_api.rb index 3862c9b..bd640c3 100644 --- a/providers/openfeature-go-feature-flag-provider/lib/openfeature/go-feature-flag/goff_api.rb +++ b/providers/openfeature-go-feature-flag-provider/lib/openfeature/go-feature-flag/goff_api.rb @@ -25,7 +25,7 @@ def evaluate_ofrep_api(flag_key:, evaluation_context:) end end - evaluation_context = OpenFeature::SDK::EvaluationContext.new unless evaluation_context.is_a?(OpenFeature::SDK::EvaluationContext) + evaluation_context = OpenFeature::SDK::EvaluationContext.new if evaluation_context.nil? # Format the URL to call the Go Feature Flag OFREP API base_uri = URI.parse(@options.endpoint) new_path = File.join(base_uri.path, "/ofrep/v1/evaluate/flags/#{flag_key}")