Skip to content

Commit

Permalink
Merge pull request #271 from splitio/semver
Browse files Browse the repository at this point in the history
Semver
  • Loading branch information
mmelograno authored May 14, 2024
2 parents bd12cf5 + f26231a commit 6e7c41e
Show file tree
Hide file tree
Showing 77 changed files with 557 additions and 295 deletions.
12 changes: 11 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
5.7.0 (TD)
5.8.0 (May 14, 2024)
- Added support for targeting rules based on semantic versions (https://semver.org/).
- Added special impression label "targeting rule type unsupported by sdk" when the matcher type is not supported by the SDK, which returns 'control' treatment.
- Forward TLS server name when in redis-sentinel & redis-cluster
- Fixed vulnerabilities:
- Updated debian image to 12.5
- Updated golang image to 1.21.10
- Updated gin/gonic to 1.10
- Updated go-split-commons to v6

5.7.0 (TBD)
- Add support for FIPS-compliant binaries & docker images

5.6.1 (Jan 29, 2024)
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.proxy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.21.6-bookworm AS builder
FROM golang:1.21.10-bookworm AS builder

ARG EXTRA_BUILD_ARGS
ARG FIPS_MODE
Expand All @@ -17,7 +17,7 @@ RUN bash -c 'if [[ "${FIPS_MODE}" = "enabled" ]]; \
fi'

# Runner stage
FROM debian:12.4 AS runner
FROM debian:12.5 AS runner

RUN apt update -y
RUN apt install -y bash ca-certificates
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.synchronizer
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.21.6-bookworm AS builder
FROM golang:1.21.10-bookworm AS builder

ARG EXTRA_BUILD_ARGS
ARG FIPS_MODE
Expand All @@ -17,7 +17,7 @@ RUN bash -c 'if [[ "${FIPS_MODE}" = "enabled" ]]; \
fi'

# Runner stage
FROM debian:12.4 AS runner
FROM debian:12.5 AS runner

RUN apt update -y
RUN apt install -y bash ca-certificates
Expand Down
40 changes: 21 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,50 @@ go 1.21
require (
github.com/gin-contrib/cors v1.4.0
github.com/gin-contrib/gzip v0.0.6
github.com/gin-gonic/gin v1.9.1
github.com/gin-gonic/gin v1.10.0
github.com/google/uuid v1.3.0
github.com/splitio/gincache v1.0.1
github.com/splitio/go-split-commons/v5 v5.2.1
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.4
github.com/stretchr/testify v1.9.0
go.etcd.io/bbolt v1.3.6
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
)

require (
github.com/bits-and-blooms/bitset v1.3.1 // indirect
github.com/bits-and-blooms/bloom/v3 v3.3.1 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/redis/go-redis/v9 v9.0.4 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/net v0.17.0 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
90 changes: 45 additions & 45 deletions go.sum

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions splitio/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type Options struct {
Snapshotter cstorage.Snapshotter
TLS *tls.Config
FullConfig interface{}
FlagSpecVersion string
}

type AdminServer struct {
Expand Down Expand Up @@ -66,6 +67,7 @@ func NewServer(options *Options) (*AdminServer, error) {
options.EventsEvCalc,
options.Runtime,
options.HcAppMonitor,
options.FlagSpecVersion,
)
if err != nil {
return nil, fmt.Errorf("error instantiating dashboard controller: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion splitio/admin/common/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package common

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

// Storages wraps storages in one struct
type Storages struct {
Expand Down
16 changes: 10 additions & 6 deletions splitio/admin/controllers/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type DashboardController struct {
eventsEvCalc evcalc.Monitor
runtime common.Runtime
appMonitor application.MonitorIterface
FlagSpecVersion string
}

// NewDashboardController instantiates a new dashboard controller
Expand All @@ -41,6 +42,7 @@ func NewDashboardController(
eventsEvCalc evcalc.Monitor,
runtime common.Runtime,
appMonitor application.MonitorIterface,
flagSpecVersion string,
) (*DashboardController, error) {

toReturn := &DashboardController{
Expand All @@ -52,6 +54,7 @@ func NewDashboardController(
eventsEvCalc: eventsEvCalc,
impressionsEvCalc: impressionEvCalc,
appMonitor: appMonitor,
FlagSpecVersion: flagSpecVersion,
}

var err error
Expand Down Expand Up @@ -104,12 +107,13 @@ func (c *DashboardController) segmentKeys(ctx *gin.Context) {
func (c *DashboardController) renderDashboard() ([]byte, error) {
var layoutBuffer bytes.Buffer
err := c.layout.Execute(&layoutBuffer, dashboard.RootObject{
DashboardTitle: c.title,
Version: splitio.Version,
ProxyMode: c.proxy,
RefreshTime: 30000,
Stats: *c.gatherStats(),
Health: c.appMonitor.GetHealthStatus(),
DashboardTitle: c.title,
Version: splitio.Version,
ProxyMode: c.proxy,
RefreshTime: 30000,
Stats: *c.gatherStats(),
Health: c.appMonitor.GetHealthStatus(),
FlagSpecVersion: c.FlagSpecVersion,
})

if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions splitio/admin/controllers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strings"
"time"

"github.com/splitio/go-split-commons/v5/storage"
"github.com/splitio/go-split-commons/v5/telemetry"
"github.com/splitio/go-split-commons/v6/storage"
"github.com/splitio/go-split-commons/v6/telemetry"

"github.com/splitio/split-synchronizer/v5/splitio/admin/views/dashboard"
"github.com/splitio/split-synchronizer/v5/splitio/producer/evcalc"
Expand Down
4 changes: 2 additions & 2 deletions splitio/admin/controllers/observability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"

"github.com/gin-gonic/gin"
"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v5/storage/mocks"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-split-commons/v6/storage/mocks"
"github.com/splitio/go-toolkit/v5/datastructures/set"
"github.com/splitio/go-toolkit/v5/logging"
adminCommon "github.com/splitio/split-synchronizer/v5/splitio/admin/common"
Expand Down
17 changes: 9 additions & 8 deletions splitio/admin/views/dashboard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const main = `
{{template "SplitLogo" .}}
</div>
<div class="pull-right" style="text-align: center; padding-right: 10px;">
<p style="padding-top: 8px; color: white; margin: 0px; font-weight: bold; text-align: right"><span>{{.Version}}</span></p>
<p style="padding-top: 8px; color: white; margin: 0px; font-weight: bold; text-align: right"><span>{{.Version}}</span> | Flag Spec: <span>{{.FlagSpecVersion}}</span></p>
<p class="navbar-text navbar-right" style="padding-top: 0px;margin-bottom: 15px;margin-top: 0px;color:white;min-width: 175px;height: 10px;">
<a href="#" onclick="javascript:sendSignal('graceful'); return false;" class="navbar-link">
<span class="label label-success">Graceful stop</span>
Expand Down Expand Up @@ -76,13 +76,14 @@ const main = `

// RootObject is the main/root object used to render the dashboard
type RootObject struct {
DashboardTitle string
Version string
ProxyMode bool
RefreshTime int64
Stats GlobalStats `json:"stats"`
Health application.HealthDto `json:"health"`
ServicesHealth services.HealthDto `json:"servicesHealth"`
DashboardTitle string
Version string
ProxyMode bool
RefreshTime int64
Stats GlobalStats `json:"stats"`
Health application.HealthDto `json:"health"`
ServicesHealth services.HealthDto `json:"servicesHealth"`
FlagSpecVersion string
}

// GlobalStats runtime stats used to render the dashboard
Expand Down
2 changes: 1 addition & 1 deletion splitio/commitversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ This file is created automatically, please do not edit
*/

// CommitVersion is the version of the last commit previous to release
const CommitVersion = "1ffbd68"
const CommitVersion = "ae5a5ac"
2 changes: 1 addition & 1 deletion splitio/common/conf/advanced.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package conf
import (
"os"

"github.com/splitio/go-split-commons/v5/conf"
"github.com/splitio/go-split-commons/v6/conf"
)

// InitAdvancedOptions initializes an advanced config with default values + overriden urls.
Expand Down
2 changes: 1 addition & 1 deletion splitio/common/conf/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package conf
import (
"strings"

"github.com/splitio/go-split-commons/v5/flagsets"
"github.com/splitio/go-split-commons/v6/flagsets"
)

type FlagSetValidationError struct {
Expand Down
2 changes: 1 addition & 1 deletion splitio/common/conf/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package conf
import (
"testing"

"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion splitio/common/impressionlistener/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"net/http"

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

"github.com/splitio/go-toolkit/v5/struct/traits/lifecycle"
)
Expand Down
2 changes: 1 addition & 1 deletion splitio/common/impressionlistener/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http/httptest"
"testing"

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

func TestImpressionListener(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion splitio/common/impressionlistener/mocks/listener.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/dtos"
"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/split-synchronizer/v5/splitio/common/impressionlistener"
)

Expand Down
2 changes: 1 addition & 1 deletion splitio/common/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"syscall"
"time"

"github.com/splitio/go-split-commons/v5/synchronizer"
"github.com/splitio/go-split-commons/v6/synchronizer"
"github.com/splitio/go-toolkit/v5/logging"
"github.com/splitio/go-toolkit/v5/sync"

Expand Down
6 changes: 3 additions & 3 deletions splitio/common/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package sync
import (
"github.com/splitio/go-toolkit/v5/logging"

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

"github.com/splitio/go-split-commons/v5/synchronizer"
"github.com/splitio/go-split-commons/v5/tasks"
"github.com/splitio/go-split-commons/v6/synchronizer"
"github.com/splitio/go-split-commons/v6/tasks"
)

// WSync is a wrapper for the Regular synchronizer that handles both local telemetry
Expand Down
3 changes: 2 additions & 1 deletion splitio/producer/conf/sections.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package conf

import (
cconf "github.com/splitio/go-split-commons/v5/conf"
cconf "github.com/splitio/go-split-commons/v6/conf"
"github.com/splitio/split-synchronizer/v5/splitio/common/conf"
)

Expand All @@ -17,6 +17,7 @@ type Main struct {
Integrations conf.Integrations `json:"integrations" s-nested:"true"`
Logging conf.Logging `json:"logging" s-nested:"true"`
Healthcheck Healthcheck `json:"healthcheck" s-nested:"true"`
FlagSpecVersion string `json:"flagSpecVersion" s-cli:"flag-spec-version" s-def:"1.1" s-desc:"Spec version for flags"`
}

// BuildAdvancedConfig generates a commons-compatible advancedconfig with default + overriden parameters
Expand Down
31 changes: 17 additions & 14 deletions splitio/producer/initialization.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import (
"fmt"
"time"

cconf "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/provisional/strategy"
"github.com/splitio/go-split-commons/v5/service/api"
"github.com/splitio/go-split-commons/v5/storage/filter"
"github.com/splitio/go-split-commons/v5/storage/inmemory"
"github.com/splitio/go-split-commons/v5/storage/redis"
"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/v5/telemetry"
cconf "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/provisional/strategy"
"github.com/splitio/go-split-commons/v6/service/api"
"github.com/splitio/go-split-commons/v6/storage/filter"
"github.com/splitio/go-split-commons/v6/storage/inmemory"
"github.com/splitio/go-split-commons/v6/storage/redis"
"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-split-commons/v6/telemetry"
"github.com/splitio/go-toolkit/v5/logging"

"github.com/splitio/split-synchronizer/v5/splitio/admin"
Expand Down Expand Up @@ -47,6 +47,8 @@ const (
func Start(logger logging.LoggerInterface, cfg *conf.Main) error {
// Getting initial config data
advanced := cfg.BuildAdvancedConfig()
advanced.AuthSpecVersion = cfg.FlagSpecVersion
advanced.FlagsSpecVersion = cfg.FlagSpecVersion
advanced.FlagSetsFilter = cfg.FlagSetsFilter
metadata := util.GetMetadata(false, cfg.IPAddressEnabled)

Expand Down Expand Up @@ -298,6 +300,7 @@ func Start(logger logging.LoggerInterface, cfg *conf.Main) error {
HcServicesMonitor: servicesMonitor,
FullConfig: cfgForAdmin,
TLS: adminTLSConfig,
FlagSpecVersion: cfg.FlagSpecVersion,
})
if err != nil {
panic(err.Error())
Expand Down
Loading

0 comments on commit 6e7c41e

Please sign in to comment.