diff --git a/go.mod b/go.mod index 67791ff1..6e2636bd 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/gin-gonic/gin v1.9.1 github.com/google/uuid v1.3.0 github.com/splitio/gincache v1.0.1 - github.com/splitio/go-split-commons/v5 v5.1.1 - github.com/splitio/go-toolkit/v5 v5.3.2 + github.com/splitio/go-split-commons/v5 v5.1.2-0.20240108145819-63cfece95155 + github.com/splitio/go-toolkit/v5 v5.3.3-0.20240108144147-a36a17c46788 github.com/stretchr/testify v1.8.4 go.etcd.io/bbolt v1.3.6 golang.org/x/exp v0.0.0-20231006140011-7918f672742d diff --git a/go.sum b/go.sum index e87bab4d..d6b4e045 100644 --- a/go.sum +++ b/go.sum @@ -90,14 +90,10 @@ github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUA github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/splitio/gincache v1.0.1 h1:dLYdANY/BqH4KcUMCe/LluLyV5WtuE/LEdQWRE06IXU= github.com/splitio/gincache v1.0.1/go.mod h1:CcgJDSM9Af75kyBH0724v55URVwMBuSj5x1eCWIOECY= -github.com/splitio/go-split-commons/v5 v5.1.0 h1:mki1235gjXwuxcXdv/bKVduX1Lv09uXJogds+BspqSM= -github.com/splitio/go-split-commons/v5 v5.1.0/go.mod h1:9vAZrlhKvhensyRC11hyVFdgLIBrkX9D5vdYc9qB13w= -github.com/splitio/go-split-commons/v5 v5.1.1-0.20231215145627-50f20bea9ccd h1:SyJzAn3pLbMFafPEzOliYcA4RojNiFk+Sdn0H5cKSVQ= -github.com/splitio/go-split-commons/v5 v5.1.1-0.20231215145627-50f20bea9ccd/go.mod h1:9vAZrlhKvhensyRC11hyVFdgLIBrkX9D5vdYc9qB13w= -github.com/splitio/go-split-commons/v5 v5.1.1 h1:lLOqNQMdZA5Z7FBBh4YODWdE2QFgxSPMptX9ty14x4c= -github.com/splitio/go-split-commons/v5 v5.1.1/go.mod h1:9vAZrlhKvhensyRC11hyVFdgLIBrkX9D5vdYc9qB13w= -github.com/splitio/go-toolkit/v5 v5.3.2 h1:Yy9YBcHRmK5WVZjeA/klLGEdF38xpsL1ejnC3ro8a2M= -github.com/splitio/go-toolkit/v5 v5.3.2/go.mod h1:xYhUvV1gga9/1029Wbp5pjnR6Cy8nvBpjw99wAbsMko= +github.com/splitio/go-split-commons/v5 v5.1.2-0.20240108145819-63cfece95155 h1:SecApJYs4oumtZMIBwnE2DFyImlwiuswXIdZDaW42uE= +github.com/splitio/go-split-commons/v5 v5.1.2-0.20240108145819-63cfece95155/go.mod h1:sdXeIX4UdBf+EPdVAdBC+f2RuFUh/44bqHlTLy3rH/I= +github.com/splitio/go-toolkit/v5 v5.3.3-0.20240108144147-a36a17c46788 h1:URrg0BcgUzFE4pAacFlrWiTrmEdH4SY03XXLLWVtqLc= +github.com/splitio/go-toolkit/v5 v5.3.3-0.20240108144147-a36a17c46788/go.mod h1:xYhUvV1gga9/1029Wbp5pjnR6Cy8nvBpjw99wAbsMko= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= diff --git a/splitio/admin/controllers/helpers.go b/splitio/admin/controllers/helpers.go index d698b5e1..3a519d4f 100644 --- a/splitio/admin/controllers/helpers.go +++ b/splitio/admin/controllers/helpers.go @@ -34,6 +34,7 @@ func bundleSplitInfo(splitStorage storage.SplitStorageConsumer) []dashboard.Spli Killed: split.Killed, DefaultTreatment: split.DefaultTreatment, Treatments: treatmentsS, + FlagSets: split.Sets, LastModified: time.Unix(0, split.ChangeNumber*int64(time.Millisecond)).UTC().Format(time.UnixDate), ChangeNumber: split.ChangeNumber, }) diff --git a/splitio/admin/views/dashboard/datainspector.go b/splitio/admin/views/dashboard/datainspector.go index ef17c505..7886e3b9 100644 --- a/splitio/admin/views/dashboard/datainspector.go +++ b/splitio/admin/views/dashboard/datainspector.go @@ -61,11 +61,11 @@ const dataInspector = ` + + + + @@ -79,6 +79,7 @@ const dataInspector = ` Status Killed Treatments + Flag Sets Last Modified diff --git a/splitio/admin/views/dashboard/js.go b/splitio/admin/views/dashboard/js.go index 7d3ff2c3..8deb3f5c 100644 --- a/splitio/admin/views/dashboard/js.go +++ b/splitio/admin/views/dashboard/js.go @@ -241,6 +241,7 @@ const mainScript = ` (!featureFlag.active ? 'ARCHIVED' : 'ACTIVE') + (featureFlag.killed ? 'true' : 'false') + ' ' + formatTreatments(featureFlag) + '' + + ' ' + featureFlag.flagSets + '' + ' ' + featureFlag.cn + '' + '\n'); }; diff --git a/splitio/admin/views/dashboard/main.go b/splitio/admin/views/dashboard/main.go index 76567cb1..d84279d9 100644 --- a/splitio/admin/views/dashboard/main.go +++ b/splitio/admin/views/dashboard/main.go @@ -113,6 +113,7 @@ type SplitSummary struct { Killed bool `json:"killed"` DefaultTreatment string `json:"defaultTreatment"` Treatments []string `json:"treatments"` + FlagSets []string `json:"flagSets"` LastModified string `json:"cn"` ChangeNumber int64 `json:"changeNumber"` } diff --git a/splitio/proxy/caching/workers_test.go b/splitio/proxy/caching/workers_test.go index e90ca744..a979c9d9 100644 --- a/splitio/proxy/caching/workers_test.go +++ b/splitio/proxy/caching/workers_test.go @@ -289,6 +289,9 @@ func (*splitStorageMock) FetchMany(splitNames []string) map[string]*dtos.SplitDT func (*splitStorageMock) GetNamesByFlagSets(sets []string) map[string][]string { panic("unimplemented") } +func (*splitStorageMock) GetAllFlagSetNames() []string { + panic("unimplemented") +} func (*splitStorageMock) KillLocally(splitName string, defaultTreatment string, changeNumber int64) { panic("unimplemented") } @@ -346,28 +349,28 @@ func (*segmentStorageMock) SegmentContainsKey(segmentName string, key string) (b func (*segmentStorageMock) SegmentKeysCount() int64 { panic("unimplemented") } /* -type segmentUpdaterMock struct { - SynchronizeSegmentCall func(name string, till *int64) (*segment.UpdateResult, error) - SynchronizeSegmentsCall func() (map[string]segment.UpdateResult, error) - SegmentNamesCall func() []interface{} - IsSegmentCachedCall func(segmentName string) bool -} + type segmentUpdaterMock struct { + SynchronizeSegmentCall func(name string, till *int64) (*segment.UpdateResult, error) + SynchronizeSegmentsCall func() (map[string]segment.UpdateResult, error) + SegmentNamesCall func() []interface{} + IsSegmentCachedCall func(segmentName string) bool + } -func (s *segmentUpdaterMock) SynchronizeSegment(name string, till *int64) (*segment.UpdateResult, error) { - return s.SynchronizeSegmentCall(name, till) -} + func (s *segmentUpdaterMock) SynchronizeSegment(name string, till *int64) (*segment.UpdateResult, error) { + return s.SynchronizeSegmentCall(name, till) + } -func (s *segmentUpdaterMock) SynchronizeSegments() (map[string]segment.UpdateResult, error) { - return s.SynchronizeSegmentsCall() -} + func (s *segmentUpdaterMock) SynchronizeSegments() (map[string]segment.UpdateResult, error) { + return s.SynchronizeSegmentsCall() + } -func (s *segmentUpdaterMock) SegmentNames() []interface{} { - return s.SegmentNamesCall() -} + func (s *segmentUpdaterMock) SegmentNames() []interface{} { + return s.SegmentNamesCall() + } -func (s *segmentUpdaterMock) IsSegmentCached(segmentName string) bool { - return s.IsSegmentCachedCall(segmentName) -} + func (s *segmentUpdaterMock) IsSegmentCached(segmentName string) bool { + return s.IsSegmentCachedCall(segmentName) + } */ var _ split.Updater = (*splitUpdaterMock)(nil) var _ storage.SplitStorage = (*splitStorageMock)(nil) diff --git a/splitio/proxy/storage/splits.go b/splitio/proxy/storage/splits.go index 46cfc04d..bb6090b8 100644 --- a/splitio/proxy/storage/splits.go +++ b/splitio/proxy/storage/splits.go @@ -179,6 +179,13 @@ func (*ProxySplitStorageImpl) GetNamesByFlagSets(sets []string) map[string][]str return nil } +// GetAllFlagSetNames implements storage.SplitStorage +func (*ProxySplitStorageImpl) GetAllFlagSetNames() []string { + // NOTE: This method is NOT used by the proxy. + // we need to revisit our interfaces so that we're not obliged to do this smeely empty impls. + panic("unimplemented") +} + func (p *ProxySplitStorageImpl) setStartingPoint(cn int64) { p.mtx.Lock() // will be executed only the first time this method is called or when