OpenFeature: Add context attributes to frontend settings (#112105)

* Update targeting key to namespace

* Pass eval ctx attributes to frontend

* Add context config to the frontend

* Fix OF namespace not defined in e2e tests

* Set default namespace and targeting key

* remove e2e server config now that namespace is default

---------

Co-authored-by: joshhunt <josh.hunt@grafana.com>
This commit is contained in:
Tania
2025-10-10 13:43:24 +02:00
committed by GitHub
co-authored by joshhunt
parent fa9d6be255
commit 21e26aefdb
10 changed files with 35 additions and 12 deletions
+7 -4
View File
@@ -11,12 +11,13 @@ func Test_CtxAttrs(t *testing.T) {
testCases := []struct {
name string
conf string
expected map[string]any
expected map[string]string
}{
{
name: "empty config - only default attributes should be present",
expected: map[string]any{
expected: map[string]string{
"grafana_version": "",
"namespace": "default",
},
},
{
@@ -26,11 +27,12 @@ func Test_CtxAttrs(t *testing.T) {
foo = bar
baz = qux
quux = corge`,
expected: map[string]any{
expected: map[string]string{
"foo": "bar",
"baz": "qux",
"quux": "corge",
"grafana_version": "",
"namespace": "default",
},
},
{
@@ -39,9 +41,10 @@ quux = corge`,
[feature_toggles.openfeature.context]
grafana_version = 10.0.0
foo = bar`,
expected: map[string]any{
expected: map[string]string{
"grafana_version": "10.0.0",
"foo": "bar",
"namespace": "default",
},
},
}