Skip to content

Commit

Permalink
Merge branch 'development' of github.com:splitio/go-client into devel…
Browse files Browse the repository at this point in the history
…opment
  • Loading branch information
mmelograno committed Jul 5, 2023
2 parents 46ebbb4 + 052f458 commit a088d88
Show file tree
Hide file tree
Showing 39 changed files with 345 additions and 392 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @splitio/sdk
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

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

## Extra Notes
## Extra Notes
41 changes: 15 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: ci
on:
push:
branches:
- main
branches-ignore:
- none
pull_request:
branches:
- development
Expand All @@ -19,58 +19,47 @@ jobs:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go version
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '1.17.0'
go-version: '1.18.0'

- name: Go mod
run: go mod tidy

- name: Execute tests
run: go test -coverprofile=coverage.out -count=1 -race ./...

- name: Set VERSION env
run: echo "VERSION=$(cat splitio/version.go | grep 'Version =' | awk '{print $4}' | tr -d '"')" >> $GITHUB_ENV

- name: SonarQube Scan (Push)
if: github.event_name == 'push'
uses: SonarSource/sonarcloud-github-action@v1.5
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/development')
uses: SonarSource/sonarcloud-github-action@v1.9
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.projectName=${{ github.event.repository.name }}
-Dsonar.projectKey=${{ github.event.repository.name }}
-Dsonar.sources=.
-Dsonar.exclusions=**/*_test.go
-Dsonar.tests=.
-Dsonar.test.inclusions=**/*_test.go
-Dsonar.go.coverage.reportPaths=coverage.out
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
-Dsonar.projectVersion=${{ env.VERSION }}
- name: SonarQube Scan (Pull Request)
if: github.event_name == 'pull_request'
uses: SonarSource/sonarcloud-github-action@v1.5
uses: SonarSource/sonarcloud-github-action@v1.9
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.projectName=${{ github.event.repository.name }}
-Dsonar.projectKey=${{ github.event.repository.name }}
-Dsonar.go.coverage.reportPaths=coverage.out
-Dsonar.sources=.
-Dsonar.exclusions=**/*_test.go
-Dsonar.tests=.
-Dsonar.test.inclusions=**/*_test.go
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
-Dsonar.projectVersion=${{ env.VERSION }}
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
6 changes: 3 additions & 3 deletions .github/workflows/update-license-year.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Current year
run: "echo CURRENT=$(date +%Y) >> $GITHUB_ENV"

- name: Set Previous Year
run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV"

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ _testmain.go
Gopkg.lock

.vscode/*

coverage.out
.scannerwork
32 changes: 25 additions & 7 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
6.3.3 (Jun 9, 2023)
- Fixed buffering logic in impressions for consumer mode
- Pointed to new version of go-split-commons v4.3.5:
Fixed nil message in error log when trying to connect to Redis
Storing the proper impressions mode for telemetry in consumer mode

6.3.2 (May 15, 2023)
- Updated terminology on the SDKs codebase to be more aligned with current standard without causing a breaking change. The core change is the term split for feature flag on things like logs and godoc comments.
- Pointed to new version of go-split-commons v4.3.3:
- Updated default treatment to be control for json localhost.

6.3.1 (March 21, 2023)
- Fixed Unique Keys dto in redis.

6.3.0 (March 13, 2023)
- Added support to use JSON files in localhost mode.
- Pointed to new version of go-split-commons v4.3.0 for vulnerability fixes

6.2.1 (Oct 28, 2022)
- Updated Matchers logging: demoted the log message to "warning".

Expand All @@ -14,7 +32,7 @@
- Updated the synchronization flow to be more reliable in the event of an edge case generating delay in cache purge propagation, keeping the SDK cache properly synced.

6.1.5 (Jun 6, 2022)
- Updated segments and splits storage to return -1 as default changeNumber instead of zero
- Updated segments and feature flag storage to return -1 as default changeNumber instead of zero

6.1.4 (May 12, 2022)
- Updated config telemetry redis storage
Expand Down Expand Up @@ -43,7 +61,7 @@
- BREAKING CHANGE: Migrated to go modules (dep & bare-bones go-dep no longer supported).

5.3.0 (Oct 6, 2020)
- Added impressions dedupe logic to avoid sending duplicated impressions:
- Added impressions dedupe logic to avoid sending duplicated impressions:
- Added `OPTIMIZED` and `DEBUG` modes in order to enabling/disabling how impressions are going to be sent into Split servers,
- `OPTIMIZED`: will send unique impressions in a timeframe in order to reduce how many times impressions are posted to Split.
- `DEBUG`: will send every impression generated to Split.
Expand All @@ -61,22 +79,22 @@
- Added Streaming support.

5.1.3 (Jan 27, 2020)
- Removed unnecessary Split copy made in memory.
- Removed unnecessary Feature flag copy made in memory.

5.1.2 (Nov 28, 2019)
- Several fixes in tests as a result of a locking & race conditions audit/
- Fixed locking issue for .Treatments() && .TreatmentsWithConfig() methods.

5.1.1 (Oct 15, 2019)
- Added logic to fetch multiple splits at once on getTreatments/getTreatmentsWithConfig.
- Added logic to fetch multiple feature flags at once on getTreatments/getTreatmentsWithConfig.
- Added flag `IPAddressesEnabled` into Config to enable/disable sending MachineName and MachineIP when data is posted in headers.
- Fixed resource leak in `api.ValidateApikey`.

5.1.0 (Jul 19, 2019)
- Added support for TLS connections to redis.
- Refactored initialization process.
- Fixed traffic type count issue.
- Fixed possible concurrency issue with split storage.
- Fixed possible concurrency issue with feature flag storage.

5.0.1 (Jun 19, 2019)
- Added coverage for traffic type validation existence only on ready and non localhost mode.
Expand All @@ -86,7 +104,7 @@
- Added validation for traffic types in track call.
- Added new label when the sdk is not ready.
- Added multiple factory instantiation check.
- Added validation when split does not exist in treatments and manager calls.
- Added validation when feature flag does not exist in treatments and manager calls.
- Moved Impressions in-memory to single-queue approach and refactored ImpressionDTO.

4.0.1 (May 17, 2019)
Expand All @@ -99,7 +117,7 @@
- Added support for YAML file in Localhost mode.

3.0.1 (March 8, 2019)
- Updated Splits refreshing rate.
- Updated Feature flags refreshing rate.

3.0.0 (Feb 19, 2019)
- Updated SDK Parity.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ To run test you can execute the command `go test ./...` on the root folder.

# Contact

If you have any other questions or need to contact us directly in a private manner send us a note at [email protected].
If you have any other questions or need to contact us directly in a private manner send us a note at [email protected].
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2022 Split Software, Inc.
Copyright © 2023 Split Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

## Overview

This SDK is designed to work with Split, the platform for controlled rollouts, which serves features to your users via a Split feature flag to manage your complete customer experience.
This SDK is designed to work with Split, the platform for controlled rollouts, which serves features to your users via feature flags to manage your complete customer experience.

[![Twitter Follow](https://img.shields.io/twitter/follow/splitsoftware.svg?style=social&label=Follow&maxAge=1529000)](https://twitter.com/intent/follow?screen_name=splitsoftware)

## Compatibility

This SDK is compatible with Go 1.8.
This SDK is compatible with Go 1.18.

## Getting started

Expand All @@ -30,7 +30,7 @@ import (

func main() {
cfg := conf.Default()
factory, err := client.NewSplitFactory("YOUR_SDK_TYPE_API_KEY", cfg)
factory, err := client.NewSplitFactory("YOUR_SDK_KEY", cfg)
if err != nil {
// SDK initialization error
}
Expand All @@ -42,7 +42,7 @@ func main() {
// SDK timeout error
}

treatment := client.Treatment("CUSTOMER_ID", "SPLIT_NAME", nil)
treatment := client.Treatment("CUSTOMER_ID", "FEATURE_FLAG_NAME", nil)
if treatment == "on" {
// insert code here to show on treatment
} else if treatment == "off" {
Expand All @@ -69,14 +69,15 @@ Licensed under the Apache License, Version 2.0. See: [Apache License](http://www

## About Split

Split is the leading Feature Delivery Platform for engineering teams that want to confidently deploy features as fast as they can develop them. Split’s fine-grained management, real-time monitoring, and data-driven experimentation ensure that new features will improve the customer experience without breaking or degrading performance. Companies like Twilio, Salesforce, GoDaddy and WePay trust Split to power their feature delivery.
Split is the leading Feature Delivery Platform for engineering teams that want to confidently deploy feature flags as fast as they can develop them. Split’s fine-grained management, real-time monitoring, and data-driven experimentation ensure that new feature flags will improve the customer experience without breaking or degrading performance. Companies like Twilio, Salesforce, GoDaddy and WePay trust Split to power their feature delivery.

To learn more about Split, contact [email protected], or get started with feature flags for free at [Split](https://www.split.io/signup).

Split has built and maintains SDKs for:

* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
* Javascript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
* JavaScript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
* JavaScript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
* .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)
Expand All @@ -85,6 +86,10 @@ Split has built and maintains SDKs for:
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
* Angular [Github](https://github.com/splitio/angular-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/6495326064397-Angular-utilities)
* React [Github](https://github.com/splitio/react-client) [Docs](https://help.split.io/hc/en-us/articles/360038825091-React-SDK)
* React Native [Github](https://github.com/splitio/react-native-client) [Docs](https://help.split.io/hc/en-us/articles/4406066357901-React-Native-SDK)
* Redux [Github](https://github.com/splitio/redux-client) [Docs](https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK)

For a comprehensive list of open source projects visit our [Github page](https://github.com/splitio?utf8=%E2%9C%93&query=%20only%3Apublic%20).

Expand Down
30 changes: 0 additions & 30 deletions build-utils/sonar-scanner

This file was deleted.

15 changes: 12 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
module github.com/splitio/go-client/v6

go 1.13
go 1.18

require (
github.com/splitio/go-split-commons/v4 v4.2.0
github.com/splitio/go-toolkit/v5 v5.2.2
github.com/splitio/go-split-commons/v4 v4.3.5
github.com/splitio/go-toolkit/v5 v5.3.1
)

require (
github.com/bits-and-blooms/bitset v1.3.1 // indirect
github.com/bits-and-blooms/bloom/v3 v3.3.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/redis/go-redis/v9 v9.0.4 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit a088d88

Please sign in to comment.