deps(go): bump github.com/open-feature/go-sdk from 1.14.1 to 1.16.0 (#112489)
* deps(go): bump github.com/open-feature/go-sdk from 1.14.1 to 1.16.0 Bumps [github.com/open-feature/go-sdk](https://github.com/open-feature/go-sdk) from 1.14.1 to 1.16.0. - [Release notes](https://github.com/open-feature/go-sdk/releases) - [Changelog](https://github.com/open-feature/go-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-feature/go-sdk/compare/v1.14.1...v1.16.0) --- updated-dependencies: - dependency-name: github.com/open-feature/go-sdk dependency-version: 1.16.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * make update-workspace Signed-off-by: Dave Henderson <dave.henderson@grafana.com> * fix(lint): SA1019: openfeature.GetApiInstance is deprecated, using NewDefaultClient Signed-off-by: Dave Henderson <dave.henderson@grafana.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Dave Henderson <dave.henderson@grafana.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
co-authored by
Dave Henderson
parent
9573cd3395
commit
05dff2f7cb
@@ -124,7 +124,7 @@ func testGoFFProvider(t *testing.T, failSigning bool) {
|
||||
|
||||
// Test that the flag evaluation can be attempted (though it will fail due to non-existent service)
|
||||
// The important thing is that the authentication middleware is properly integrated
|
||||
_, err := openfeature.GetApiInstance().GetClient().BooleanValueDetails(ctx, "test", false, openfeature.NewEvaluationContext("test", map[string]interface{}{"test": "test"}))
|
||||
_, err := openfeature.NewDefaultClient().BooleanValueDetails(ctx, "test", false, openfeature.NewEvaluationContext("test", map[string]interface{}{"test": "test"}))
|
||||
|
||||
// Error related to the token exchange should be returned if signing fails
|
||||
// otherwise, it should return a connection refused error since the goff URL is not set
|
||||
|
||||
@@ -4,10 +4,11 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/open-feature/go-sdk/openfeature"
|
||||
goffmodel "github.com/thomaspoignant/go-feature-flag/cmd/relayproxy/model"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
// StaticFlagEvaluator provides methods for evaluating static feature flags
|
||||
@@ -38,7 +39,7 @@ func CreateStaticEvaluator(cfg *setting.Cfg) (StaticFlagEvaluator, error) {
|
||||
return nil, fmt.Errorf("static provider is not of type inMemoryBulkProvider")
|
||||
}
|
||||
|
||||
c := openfeature.GetApiInstance().GetClient()
|
||||
c := openfeature.NewDefaultClient()
|
||||
|
||||
return &staticEvaluator{
|
||||
provider: p,
|
||||
|
||||
@@ -22,7 +22,7 @@ func Test_StaticProvider(t *testing.T) {
|
||||
t.Run("empty config loads standard flags", func(t *testing.T) {
|
||||
setup(t, []byte(``))
|
||||
// Check for one of the standard flags
|
||||
feat, err := openfeature.GetApiInstance().GetClient().BooleanValueDetails(ctx, stFeatName, !stFeatValue, evalCtx)
|
||||
feat, err := openfeature.NewDefaultClient().BooleanValueDetails(ctx, stFeatName, !stFeatValue, evalCtx)
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, stFeatValue == feat.Value)
|
||||
})
|
||||
@@ -33,14 +33,14 @@ func Test_StaticProvider(t *testing.T) {
|
||||
featureOne = true
|
||||
`)
|
||||
setup(t, conf)
|
||||
feat, err := openfeature.GetApiInstance().GetClient().BooleanValueDetails(ctx, "featureOne", false, evalCtx)
|
||||
feat, err := openfeature.NewDefaultClient().BooleanValueDetails(ctx, "featureOne", false, evalCtx)
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, feat.Value)
|
||||
})
|
||||
|
||||
t.Run("missing feature should return default evaluation value and an error", func(t *testing.T) {
|
||||
setup(t, []byte(``))
|
||||
missingFeature, err := openfeature.GetApiInstance().GetClient().BooleanValueDetails(ctx, "missingFeature", true, evalCtx)
|
||||
missingFeature, err := openfeature.NewDefaultClient().BooleanValueDetails(ctx, "missingFeature", true, evalCtx)
|
||||
assert.Error(t, err)
|
||||
assert.True(t, missingFeature.Value)
|
||||
assert.Equal(t, openfeature.ErrorCode("FLAG_NOT_FOUND"), missingFeature.ErrorCode)
|
||||
|
||||
@@ -188,7 +188,7 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, prefs *pref.Prefere
|
||||
treeRoot.RemoveSectionByID(navtree.NavIDCfg)
|
||||
}
|
||||
|
||||
enabled := openfeature.GetApiInstance().GetClient().Boolean(ctx, featuremgmt.FlagPinNavItems, true, openfeature.TransactionContext(ctx))
|
||||
enabled := openfeature.NewDefaultClient().Boolean(ctx, featuremgmt.FlagPinNavItems, true, openfeature.TransactionContext(ctx))
|
||||
if enabled && c.IsSignedIn {
|
||||
treeRoot.AddSection(&navtree.NavLink{
|
||||
Text: "Bookmarks",
|
||||
|
||||
Reference in New Issue
Block a user