Skip to content

Commit

Permalink
Merge pull request #38 from splitio/feature/semver
Browse files Browse the repository at this point in the history
Feature/semver
  • Loading branch information
mmelograno authored May 14, 2024
2 parents ae80227 + 80850bb commit d46a130
Show file tree
Hide file tree
Showing 28 changed files with 111 additions and 87 deletions.
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

0 comments on commit d46a130

Please sign in to comment.