Skip to content

Commit

Permalink
Merge pull request #257 from splitio/SDKS-7840
Browse files Browse the repository at this point in the history
Adding flag sets in DataInspector view.
  • Loading branch information
sanzmauro authored Jan 11, 2024
2 parents 2212401 + 8b2aefc commit 5e0177b
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 32 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 4 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
1 change: 1 addition & 0 deletions splitio/admin/controllers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down
9 changes: 5 additions & 4 deletions splitio/admin/views/dashboard/datainspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ const dataInspector = `
<input type="text" id="filterFeatureFlagNameInput" class="form-control" placeholder="Filter by Feature Flag name">
<span class="input-group-btn">
<button class="btn btn-default" type="button" onclick="javascript:filterFeatureFlags();">
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
</button>
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
</button>
<button class="btn btn-default" type="button" onclick="javascript:resetFilterFeatureFlags();">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</button>
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</button>
</span>
</div>
</div>
Expand All @@ -79,6 +79,7 @@ const dataInspector = `
<th>Status</th>
<th>Killed</th>
<th>Treatments</th>
<th>Flag Sets</th>
<th>Last Modified</th>
</tr>
</thead>
Expand Down
1 change: 1 addition & 0 deletions splitio/admin/views/dashboard/js.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ const mainScript = `
(!featureFlag.active ? '<td class="danger">ARCHIVED</td>' : '<td class="">ACTIVE</td>') +
(featureFlag.killed ? '<td class="danger">true</td>' : '<td class="">false</td>') +
' <td>' + formatTreatments(featureFlag) + '</td>' +
' <td>' + featureFlag.flagSets + '</td>' +
' <td>' + featureFlag.cn + '</td>' +
'</tr>\n');
};
Expand Down
1 change: 1 addition & 0 deletions splitio/admin/views/dashboard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down
39 changes: 21 additions & 18 deletions splitio/proxy/caching/workers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions splitio/proxy/storage/splits.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e0177b

Please sign in to comment.