mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-04 17:18:35 +02:00
* fix(labels): always enable resource labels (MUL-5563) Co-authored-by: multica-agent <github@multica.ai> * docs(labels): clarify resource label rollback safety (MUL-5563) Co-authored-by: multica-agent <github@multica.ai> * docs(labels): correct compat client range (MUL-5563) Co-authored-by: multica-agent <github@multica.ai> --------- Co-authored-by: Eve <eve@multica-ai.local> Co-authored-by: multica-agent <github@multica.ai>
34 lines
878 B
Go
34 lines
878 B
Go
package handler
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/multica-ai/multica/server/internal/featureflags"
|
|
"github.com/multica-ai/multica/server/pkg/featureflag"
|
|
)
|
|
|
|
func withComposioMCPAppsFlag(t *testing.T, h *Handler, enabled bool) {
|
|
withFeatureFlag(t, h, featureflags.ComposioMCPApps, enabled)
|
|
}
|
|
|
|
func withFeatureFlag(t *testing.T, h *Handler, key string, enabled bool) {
|
|
t.Helper()
|
|
provider := featureflag.NewStaticProvider()
|
|
provider.Set(key, featureflag.Rule{Default: enabled})
|
|
flags := featureflag.NewService(provider)
|
|
|
|
origHandlerFlags := h.FeatureFlags
|
|
h.FeatureFlags = flags
|
|
var origTaskFlags *featureflag.Service
|
|
if h.TaskService != nil {
|
|
origTaskFlags = h.TaskService.FeatureFlags
|
|
h.TaskService.FeatureFlags = flags
|
|
}
|
|
t.Cleanup(func() {
|
|
h.FeatureFlags = origHandlerFlags
|
|
if h.TaskService != nil {
|
|
h.TaskService.FeatureFlags = origTaskFlags
|
|
}
|
|
})
|
|
}
|