Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/semver #38

Merged
merged 15 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPLIT DAEMON

## What did you accomplish?
<!-- A brief explanation synthesizing the feature, bug or fix. -->
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change

## How do we test the changes introduced in this PR?

## Extra Notes
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- name: Version validation
if: ${{ github.event_name == 'pull_request' }}
uses: mukunku/tag-exists-action@v1.5.0
uses: mukunku/tag-exists-action@v1.6.0
id: checkTag
with:
tag: v${{ env.VERSION }}
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
run: make binaries_release

- name: SonarQube Scan
uses: SonarSource/sonarcloud-github-action@v2.0.0
uses: SonarSource/sonarcloud-github-action@v2.1.1
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -67,14 +67,14 @@ jobs:

- name: Git tag
if: ${{ github.event_name == 'push' }}
uses: mathieudutour/github-tag-action@v6.1
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.VERSION }}
tag_prefix: 'v'

- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: ${{ github.event_name == 'push' }}
with:
name: splitd-${{ env.VERSION }}
Expand Down
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.4.0 (May 14, 2024):
- Updated go-split-commons to v6
- Added support for targeting rules based on semantic versions (https://semver.org/).
- Added the logic to handle correctly when the SDK receives an unsupported Matcher type.

1.3.1 (March 4, 2024):
- Add socat in runner image

Expand Down
2 changes: 1 addition & 1 deletion external/commons/mocks/evaluator.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mocks

import (
"github.com/splitio/go-split-commons/v5/engine/evaluator"
"github.com/splitio/go-split-commons/v6/engine/evaluator"
"github.com/stretchr/testify/mock"
)

Expand Down
4 changes: 2 additions & 2 deletions external/commons/mocks/impmanager.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mocks

import (
"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v5/provisional"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-split-commons/v6/provisional"
"github.com/stretchr/testify/mock"
)

Expand Down
4 changes: 2 additions & 2 deletions external/commons/mocks/imprecorder.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mocks

import (
"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v5/service"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-split-commons/v6/service"
"github.com/stretchr/testify/mock"
)

Expand Down
9 changes: 7 additions & 2 deletions external/commons/mocks/splitstorage.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mocks

import (
"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v5/storage"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-split-commons/v6/storage"
"github.com/splitio/go-toolkit/v5/datastructures/set"
"github.com/stretchr/testify/mock"
)
Expand Down Expand Up @@ -63,4 +63,9 @@ func (m *SplitStorageMock) GetNamesByFlagSets(sets []string) map[string][]string
return args.Get(0).(map[string][]string)
}

func (m *SplitStorageMock) GetAllFlagSetNames() []string {
args := m.Called()
return args.Get(0).([]string)
}

var _ storage.SplitStorage = (*SplitStorageMock)(nil)
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/splitio/splitd
go 1.21

require (
github.com/splitio/go-split-commons/v5 v5.1.0
github.com/splitio/go-toolkit/v5 v5.3.2
github.com/splitio/go-split-commons/v6 v6.0.0
github.com/splitio/go-toolkit/v5 v5.4.0
github.com/stretchr/testify v1.8.1
github.com/vmihailenco/msgpack/v5 v5.3.5
golang.org/x/sync v0.3.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
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-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/v6 v6.0.0 h1:qenr5qbXafjvM832C64CVpjtlShuQiWCwtR5I2h4ogM=
github.com/splitio/go-split-commons/v6 v6.0.0/go.mod h1:TsvIh3XP7yjc7ly4vpj06AkoBND36SodPs5qfhb8rHc=
github.com/splitio/go-toolkit/v5 v5.4.0 h1:g5WFpRhQomnXCmvfsNOWV4s5AuUrWIZ+amM68G8NBKM=
github.com/splitio/go-toolkit/v5 v5.4.0/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
2 changes: 1 addition & 1 deletion splitio/link/client/types/interfaces.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package types

import (
"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/splitd/splitio/sdk"
)

Expand Down
2 changes: 1 addition & 1 deletion splitio/link/client/v1/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v1
import (
"fmt"

"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-toolkit/v5/logging"
"github.com/splitio/splitd/splitio"
"github.com/splitio/splitd/splitio/link/client/types"
Expand Down
2 changes: 1 addition & 1 deletion splitio/link/client/v1/impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v1
import (
"testing"

"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-toolkit/v5/logging"
"github.com/splitio/splitd/splitio/common/lang"
v1 "github.com/splitio/splitd/splitio/link/protocol/v1"
Expand Down
2 changes: 1 addition & 1 deletion splitio/link/service/v1/clientmgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"testing"

"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-toolkit/v5/logging"
"github.com/splitio/splitd/splitio/common/lang"
"github.com/splitio/splitd/splitio/link/protocol"
Expand Down
9 changes: 6 additions & 3 deletions splitio/sdk/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package conf
import (
"time"

"github.com/splitio/go-split-commons/v5/conf"
"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v5/flagsets"
"github.com/splitio/go-split-commons/v6/conf"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-split-commons/v6/flagsets"
"github.com/splitio/go-split-commons/v6/service/api/specs"
)

const (
Expand Down Expand Up @@ -78,6 +79,8 @@ func (c *Config) ToAdvancedConfig() *conf.AdvancedConfig {
d.TelemetryServiceURL = c.URLs.Telemetry

d.ImpressionsQueueSize = c.Impressions.QueueSize
d.AuthSpecVersion = specs.FLAG_V1_1
d.FlagsSpecVersion = specs.FLAG_V1_1

return &d
}
Expand Down
30 changes: 15 additions & 15 deletions splitio/sdk/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import (
sss "github.com/splitio/splitd/splitio/sdk/storage"
"github.com/splitio/splitd/splitio/sdk/workers"

"github.com/splitio/go-split-commons/v5/conf"
"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v5/flagsets"
"github.com/splitio/go-split-commons/v5/healthcheck/application"
"github.com/splitio/go-split-commons/v5/provisional"
"github.com/splitio/go-split-commons/v5/provisional/strategy"
"github.com/splitio/go-split-commons/v5/service/api"
"github.com/splitio/go-split-commons/v5/storage"
"github.com/splitio/go-split-commons/v5/storage/inmemory"
"github.com/splitio/go-split-commons/v5/storage/inmemory/mutexmap"
"github.com/splitio/go-split-commons/v5/synchronizer"
"github.com/splitio/go-split-commons/v5/synchronizer/worker/impressionscount"
"github.com/splitio/go-split-commons/v5/synchronizer/worker/segment"
"github.com/splitio/go-split-commons/v5/synchronizer/worker/split"
"github.com/splitio/go-split-commons/v5/tasks"
"github.com/splitio/go-split-commons/v6/conf"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-split-commons/v6/flagsets"
"github.com/splitio/go-split-commons/v6/healthcheck/application"
"github.com/splitio/go-split-commons/v6/provisional"
"github.com/splitio/go-split-commons/v6/provisional/strategy"
"github.com/splitio/go-split-commons/v6/service/api"
"github.com/splitio/go-split-commons/v6/storage"
"github.com/splitio/go-split-commons/v6/storage/inmemory"
"github.com/splitio/go-split-commons/v6/storage/inmemory/mutexmap"
"github.com/splitio/go-split-commons/v6/synchronizer"
"github.com/splitio/go-split-commons/v6/synchronizer/worker/impressionscount"
"github.com/splitio/go-split-commons/v6/synchronizer/worker/segment"
"github.com/splitio/go-split-commons/v6/synchronizer/worker/split"
"github.com/splitio/go-split-commons/v6/tasks"
"github.com/splitio/go-toolkit/v5/logging"
)

Expand Down
2 changes: 1 addition & 1 deletion splitio/sdk/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sdk
import (
"testing"

"github.com/splitio/go-split-commons/v5/flagsets"
"github.com/splitio/go-split-commons/v6/flagsets"
sdkConf "github.com/splitio/splitd/splitio/sdk/conf"
"github.com/stretchr/testify/assert"
)
Expand Down
6 changes: 5 additions & 1 deletion splitio/sdk/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
"sync/atomic"
"testing"

"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-split-commons/v6/service/api/specs"
"github.com/splitio/go-toolkit/v5/logging"
"github.com/splitio/splitd/splitio/sdk/conf"
"github.com/splitio/splitd/splitio/sdk/types"
Expand Down Expand Up @@ -55,6 +56,9 @@ func TestInstantiationAndGetTreatmentE2E(t *testing.T) {
Till: 3,
}

assert.Equal(t, "-1", r.URL.Query().Get("since"))
assert.Equal(t, specs.FLAG_V1_1, r.URL.Query().Get("s"))

raw, err := json.Marshal(splitChanges)
assert.Nil(t, err)

Expand Down
2 changes: 1 addition & 1 deletion splitio/sdk/results.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package sdk

import "github.com/splitio/go-split-commons/v5/dtos"
import "github.com/splitio/go-split-commons/v6/dtos"

type EvaluationResult struct {
Treatment string
Expand Down
18 changes: 9 additions & 9 deletions splitio/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (
"github.com/splitio/splitd/splitio/sdk/storage"
"github.com/splitio/splitd/splitio/sdk/types"

"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v5/engine"
"github.com/splitio/go-split-commons/v5/engine/evaluator"
"github.com/splitio/go-split-commons/v5/flagsets"
"github.com/splitio/go-split-commons/v5/healthcheck/application"
"github.com/splitio/go-split-commons/v5/provisional"
"github.com/splitio/go-split-commons/v5/service/api"
commonStorage "github.com/splitio/go-split-commons/v5/storage"
"github.com/splitio/go-split-commons/v5/synchronizer"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-split-commons/v6/engine"
"github.com/splitio/go-split-commons/v6/engine/evaluator"
"github.com/splitio/go-split-commons/v6/flagsets"
"github.com/splitio/go-split-commons/v6/healthcheck/application"
"github.com/splitio/go-split-commons/v6/provisional"
"github.com/splitio/go-split-commons/v6/service/api"
commonStorage "github.com/splitio/go-split-commons/v6/storage"
"github.com/splitio/go-split-commons/v6/synchronizer"
"github.com/splitio/go-toolkit/v5/common"
"github.com/splitio/go-toolkit/v5/logging"
"github.com/splitio/splitd/splitio"
Expand Down
Loading