diff --git a/CHANGES b/CHANGES index fa6d93cc..e5582468 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +10.0.0 (Jun 29, 2025) +- Updated license. +- Added logic for configs. + 9.1.0 (Dec 17, 2025) - Added impression properties. diff --git a/LICENSE b/LICENSE index df08de3f..989e2c59 100644 --- a/LICENSE +++ b/LICENSE @@ -1,13 +1,201 @@ -Copyright © 2025 Split Software, Inc. +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - http://www.apache.org/licenses/LICENSE-2.0 + 1. Definitions. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/conf/conf.go b/conf/conf.go index 13669a87..c6ad36bf 100644 --- a/conf/conf.go +++ b/conf/conf.go @@ -3,7 +3,7 @@ package conf import ( "crypto/tls" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" ) // RedisConfig struct is used to cofigure the redis parameters diff --git a/dtos/impression.go b/dtos/impression.go index 6133359a..b7d4467d 100644 --- a/dtos/impression.go +++ b/dtos/impression.go @@ -2,16 +2,17 @@ package dtos // Impression struct to map an impression type Impression struct { - KeyName string `json:"k"` - BucketingKey string `json:"b"` - FeatureName string `json:"f"` - Treatment string `json:"t"` - Label string `json:"r"` - ChangeNumber int64 `json:"c"` - Time int64 `json:"m"` - Pt int64 `json:"pt,omitempty"` - Disabled bool `json:"-"` - Properties string `json:"properties,omitempty"` + KeyName string `json:"k"` + BucketingKey string `json:"b"` + DefinitionName string `json:"f"` + Treatment string `json:"t"` + Label string `json:"r"` + ChangeNumber int64 `json:"c"` + Time int64 `json:"m"` + Pt int64 `json:"pt,omitempty"` + Disabled bool `json:"-"` + Properties string `json:"properties,omitempty"` + EntityType string `json:"et,omitempty"` } // ImpressionQueueObject struct mapping impressions @@ -30,6 +31,7 @@ type ImpressionDTO struct { BucketingKey string `json:"b,omitempty"` Pt int64 `json:"pt,omitempty"` Properties string `json:"properties,omitempty"` + EntityType string `json:"et,omitempty"` } // ImpressionsDTO struct mapping impressions to post diff --git a/engine/engine.go b/engine/engine.go index dc9eefe2..6142ac9d 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -4,10 +4,10 @@ import ( "fmt" "math" - "github.com/splitio/go-split-commons/v9/engine/evaluator/impressionlabels" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/engine/hash" + "github.com/splitio/go-split-commons/v10/engine/evaluator/impressionlabels" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/engine/hash" "github.com/splitio/go-toolkit/v5/hasher" "github.com/splitio/go-toolkit/v5/logging" diff --git a/engine/engine_test.go b/engine/engine_test.go index b2473efc..1244a97a 100644 --- a/engine/engine_test.go +++ b/engine/engine_test.go @@ -7,10 +7,10 @@ import ( "os" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/engine/hash" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/engine/hash" "github.com/splitio/go-toolkit/v5/hasher" "github.com/splitio/go-toolkit/v5/logging" diff --git a/engine/evaluator/evaluator.go b/engine/evaluator/evaluator.go index 4af478b4..8fbf174a 100644 --- a/engine/evaluator/evaluator.go +++ b/engine/evaluator/evaluator.go @@ -4,11 +4,11 @@ import ( "fmt" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine" - "github.com/splitio/go-split-commons/v9/engine/evaluator/impressionlabels" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine" + "github.com/splitio/go-split-commons/v10/engine/evaluator/impressionlabels" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/logging" ) @@ -71,7 +71,7 @@ func (e *Evaluator) evaluateTreatment(key string, bucketingKey string, featureFl label := impressionlabels.SplitNotFound if splitDto == nil { fallbackTratment := e.fallbackTratmentCalculator.Resolve(featureFlag, &label) - e.logger.Warning(fmt.Sprintf("Feature flag %s not found, returning fallback treatment.", featureFlag)) + e.logger.Warning(fmt.Sprintf("Definition %s not found, returning fallback.", featureFlag)) return &Result{Treatment: *fallbackTratment.Treatment, Label: *fallbackTratment.Label(), Config: fallbackTratment.Config} } @@ -121,9 +121,10 @@ func (e *Evaluator) evaluateTreatment(key string, bucketingKey string, featureFl if *treatment == Control { fallbackTreatment := e.fallbackTratmentCalculator.Resolve(featureFlag, &label) return &Result{ - Treatment: *fallbackTreatment.Treatment, - Label: *fallbackTreatment.Label(), - Config: fallbackTreatment.Config, + Treatment: *fallbackTreatment.Treatment, + Label: *fallbackTreatment.Label(), + Config: fallbackTreatment.Config, + SplitChangeNumber: split.ChangeNumber(), } } @@ -212,3 +213,33 @@ func (e *Evaluator) EvaluateDependency(key string, bucketingKey *string, feature res := e.EvaluateFeature(key, bucketingKey, featureFlag, attributes) return res.Treatment } + +// EvaluateDefault returns the default treatment and its configuration for a given definition name. +// This method is designed for cases where no target (key) is provided. +func (e *Evaluator) EvaluateDefault(definitionName string) *Result { + definition := e.splitStorage.Split(definitionName) + + if definition == nil { + label := impressionlabels.SplitNotFound + fallbackTratment := e.fallbackTratmentCalculator.Resolve(definitionName, &label) + e.logger.Warning(fmt.Sprintf("Definition %s not found, returning fallback.", definitionName)) + return &Result{ + Treatment: *fallbackTratment.Treatment, + Config: nil, + Label: *fallbackTratment.Label(), + } + } + + var config *string + if definition.Configurations != nil { + if val, ok := definition.Configurations[definition.DefaultTreatment]; ok { + config = &val + } + } + + return &Result{ + Treatment: definition.DefaultTreatment, + Config: config, + Label: impressionlabels.NoConditionMatched, + } +} diff --git a/engine/evaluator/evaluator_test.go b/engine/evaluator/evaluator_test.go index e242ba69..ca336649 100644 --- a/engine/evaluator/evaluator_test.go +++ b/engine/evaluator/evaluator_test.go @@ -3,14 +3,14 @@ package evaluator import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine" - "github.com/splitio/go-split-commons/v9/engine/evaluator/impressionlabels" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/flagsets" - "github.com/splitio/go-split-commons/v9/storage/inmemory/mutexmap" - "github.com/splitio/go-split-commons/v9/storage/mocks" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine" + "github.com/splitio/go-split-commons/v10/engine/evaluator/impressionlabels" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/flagsets" + "github.com/splitio/go-split-commons/v10/storage/inmemory/mutexmap" + "github.com/splitio/go-split-commons/v10/storage/mocks" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" "github.com/stretchr/testify/assert" @@ -784,3 +784,329 @@ func TestEvaluationByFlagSetsASetEmpty(t *testing.T) { t.Error("evaluations size should be 0") } } + +func TestEvaluateDefaultDefinitionNotFound(t *testing.T) { + logger := logging.NewLogger(nil) + + // Setup fallback treatment calculator + fallbackTreatment := "control" + fallbackTreatmentConfig := dtos.FallbackTreatmentConfig{ + GlobalFallbackTreatment: &dtos.FallbackTreatment{ + Treatment: &fallbackTreatment, + }, + } + + // Mock storage that returns nil for unknown definition + mockedStorage := mocks.MockSplitStorage{ + SplitCall: func(splitName string) *dtos.SplitDTO { + return nil + }, + } + + evaluator := NewEvaluator( + mockedStorage, + nil, + nil, + nil, + nil, + logger, + syncProxyFeatureFlagsRules, + syncProxyRuleBasedSegmentRules, + dtos.NewFallbackTreatmentCalculatorImp(&fallbackTreatmentConfig)) + + result := evaluator.EvaluateDefault("nonexistent_definition") + + // Verify fallback treatment is returned + assert.Equal(t, "control", result.Treatment, "Should return fallback treatment") + assert.Equal(t, "fallback - "+impressionlabels.SplitNotFound, result.Label, "Should return prefixed SplitNotFound label") + assert.Nil(t, result.Config, "Config should be nil for definition not found") +} + +func TestEvaluateDefaultDefinitionExistsWithConfig(t *testing.T) { + logger := logging.NewLogger(nil) + + // Create a definition with config for default treatment + definitionWithConfig := &dtos.SplitDTO{ + Name: "definition_with_config", + DefaultTreatment: "on", + Configurations: map[string]string{ + "on": "{\"color\": \"red\", \"size\": 15}", + "off": "{\"color\": \"blue\", \"size\": 10}", + }, + Status: "ACTIVE", + } + + mockedStorage := mocks.MockSplitStorage{ + SplitCall: func(splitName string) *dtos.SplitDTO { + if splitName == "definition_with_config" { + return definitionWithConfig + } + return nil + }, + } + + evaluator := NewEvaluator( + mockedStorage, + nil, + nil, + nil, + nil, + logger, + syncProxyFeatureFlagsRules, + syncProxyRuleBasedSegmentRules, + nil) + + result := evaluator.EvaluateDefault("definition_with_config") + + // Verify default treatment and config are returned + assert.Equal(t, "on", result.Treatment, "Should return default treatment") + assert.Equal(t, impressionlabels.NoConditionMatched, result.Label, "Should return NoConditionMatched label") + assert.NotNil(t, result.Config, "Config should not be nil") + assert.Equal(t, "{\"color\": \"red\", \"size\": 15}", *result.Config, "Should return config for default treatment") +} + +func TestEvaluateDefaultDefinitionExistsWithoutConfig(t *testing.T) { + logger := logging.NewLogger(nil) + + // Create a definition without any configurations + definitionWithoutConfig := &dtos.SplitDTO{ + Name: "definition_without_config", + DefaultTreatment: "off", + Configurations: nil, + Status: "ACTIVE", + } + + mockedStorage := mocks.MockSplitStorage{ + SplitCall: func(splitName string) *dtos.SplitDTO { + if splitName == "definition_without_config" { + return definitionWithoutConfig + } + return nil + }, + } + + evaluator := NewEvaluator( + mockedStorage, + nil, + nil, + nil, + nil, + logger, + syncProxyFeatureFlagsRules, + syncProxyRuleBasedSegmentRules, + nil) + + result := evaluator.EvaluateDefault("definition_without_config") + + // Verify default treatment is returned without config + assert.Equal(t, "off", result.Treatment, "Should return default treatment") + assert.Equal(t, impressionlabels.NoConditionMatched, result.Label, "Should return NoConditionMatched label") + assert.Nil(t, result.Config, "Config should be nil when Configurations map is nil") +} + +func TestEvaluateDefaultDefinitionExistsConfigMapMissingDefaultTreatmentKey(t *testing.T) { + logger := logging.NewLogger(nil) + + // Create a definition with configs but missing the default treatment key + definitionMissingKey := &dtos.SplitDTO{ + Name: "definition_missing_key", + DefaultTreatment: "default", + Configurations: map[string]string{ + "on": "{\"color\": \"green\", \"size\": 20}", + "off": "{\"color\": \"yellow\", \"size\": 5}", + }, + Status: "ACTIVE", + } + + mockedStorage := mocks.MockSplitStorage{ + SplitCall: func(splitName string) *dtos.SplitDTO { + if splitName == "definition_missing_key" { + return definitionMissingKey + } + return nil + }, + } + + evaluator := NewEvaluator( + mockedStorage, + nil, + nil, + nil, + nil, + logger, + syncProxyFeatureFlagsRules, + syncProxyRuleBasedSegmentRules, + nil) + + result := evaluator.EvaluateDefault("definition_missing_key") + + // Verify default treatment is returned without config + assert.Equal(t, "default", result.Treatment, "Should return default treatment") + assert.Equal(t, impressionlabels.NoConditionMatched, result.Label, "Should return NoConditionMatched label") + assert.Nil(t, result.Config, "Config should be nil when default treatment key is not in Configurations map") +} + +func TestEvaluateDefaultDefinitionExistsEmptyConfigMap(t *testing.T) { + logger := logging.NewLogger(nil) + + // Create a definition with empty configurations map + definitionEmptyMap := &dtos.SplitDTO{ + Name: "definition_empty_map", + DefaultTreatment: "control", + Configurations: map[string]string{}, + Status: "ACTIVE", + } + + mockedStorage := mocks.MockSplitStorage{ + SplitCall: func(splitName string) *dtos.SplitDTO { + if splitName == "definition_empty_map" { + return definitionEmptyMap + } + return nil + }, + } + + evaluator := NewEvaluator( + mockedStorage, + nil, + nil, + nil, + nil, + logger, + syncProxyFeatureFlagsRules, + syncProxyRuleBasedSegmentRules, + nil) + + result := evaluator.EvaluateDefault("definition_empty_map") + + // Verify default treatment is returned without config + assert.Equal(t, "control", result.Treatment, "Should return default treatment") + assert.Equal(t, impressionlabels.NoConditionMatched, result.Label, "Should return NoConditionMatched label") + assert.Nil(t, result.Config, "Config should be nil when Configurations map is empty") +} + +func TestEvaluateDefaultWithPerFlagFallback(t *testing.T) { + logger := logging.NewLogger(nil) + + // Setup fallback treatment calculator with per-flag fallback + globalFallback := "control" + perFlagFallback := "special_fallback" + fallbackTreatmentConfig := dtos.FallbackTreatmentConfig{ + GlobalFallbackTreatment: &dtos.FallbackTreatment{ + Treatment: &globalFallback, + }, + ByFlagFallbackTreatment: map[string]dtos.FallbackTreatment{ + "special_definition": { + Treatment: &perFlagFallback, + }, + }, + } + + mockedStorage := mocks.MockSplitStorage{ + SplitCall: func(splitName string) *dtos.SplitDTO { + return nil + }, + } + + evaluator := NewEvaluator( + mockedStorage, + nil, + nil, + nil, + nil, + logger, + syncProxyFeatureFlagsRules, + syncProxyRuleBasedSegmentRules, + dtos.NewFallbackTreatmentCalculatorImp(&fallbackTreatmentConfig)) + + result := evaluator.EvaluateDefault("special_definition") + + // Verify per-flag fallback is used + assert.Equal(t, "special_fallback", result.Treatment, "Should return per-flag fallback treatment") + assert.Equal(t, "fallback - "+impressionlabels.SplitNotFound, result.Label, "Should return prefixed SplitNotFound label") + assert.Nil(t, result.Config, "Config should be nil for definition not found") +} + +// TestEvaluateFeatureWithUnsupportedMatcherPreservesChangeNumber tests that when a split +// has an unsupported matcher and returns Control treatment with fallback, the SplitChangeNumber +// from the original split is preserved in the evaluation result for proper impression tracking +func TestEvaluateFeatureWithUnsupportedMatcherPreservesChangeNumber(t *testing.T) { + logger := logging.NewLogger(nil) + + // Create a split with an unsupported matcher that will return Control + // This simulates what happens when validator replaces unsupported matchers + splitWithUnsupportedMatcher := &dtos.SplitDTO{ + Name: "split_with_unsupported_matcher", + ChangeNumber: 123456789, // This should be preserved in the result + DefaultTreatment: "off", + Status: "ACTIVE", + Killed: false, + TrafficAllocation: 100, + Conditions: []dtos.ConditionDTO{ + { + ConditionType: "WHITELIST", + Label: impressionlabels.UnsupportedMatcherType, + MatcherGroup: dtos.MatcherGroupDTO{ + Combiner: "AND", + Matchers: []dtos.MatcherDTO{ + { + MatcherType: constants.MatcherTypeAllKeys, + Negate: false, + }, + }, + }, + Partitions: []dtos.PartitionDTO{ + { + Treatment: Control, // This will trigger the fallback path + Size: 100, + }, + }, + }, + }, + } + + // Setup fallback treatment calculator with a global fallback + fallbackTreatment := "fallback_treatment" + fallbackConfig := "{\"fallback\": true}" + fallbackTreatmentConfig := dtos.FallbackTreatmentConfig{ + GlobalFallbackTreatment: &dtos.FallbackTreatment{ + Treatment: &fallbackTreatment, + Config: &fallbackConfig, + }, + } + + // Mock storage that returns our split + mockedStorage := mocks.MockSplitStorage{ + SplitCall: func(splitName string) *dtos.SplitDTO { + if splitName == "split_with_unsupported_matcher" { + return splitWithUnsupportedMatcher + } + return nil + }, + } + + evaluator := NewEvaluator( + mockedStorage, + nil, + nil, + nil, + nil, + logger, + syncProxyFeatureFlagsRules, + syncProxyRuleBasedSegmentRules, + dtos.NewFallbackTreatmentCalculatorImp(&fallbackTreatmentConfig)) + + // Evaluate with a key and bucketing key + bucketingKey := "bucketing_key" + result := evaluator.EvaluateFeature("test_key", &bucketingKey, "split_with_unsupported_matcher", nil) + + // Verify the fallback treatment is returned + assert.Equal(t, "fallback_treatment", result.Treatment, "Should return fallback treatment") + assert.Equal(t, "fallback - "+impressionlabels.UnsupportedMatcherType, result.Label, "Should return prefixed UnsupportedMatcherType label") + assert.NotNil(t, result.Config, "Config should be set from fallback") + + // CRITICAL: Verify that SplitChangeNumber is preserved from the original split + // This is essential for proper impression tracking - even when using fallback, + // the impression should record the actual split's change number, not 0 + assert.Equal(t, int64(123456789), result.SplitChangeNumber, "SplitChangeNumber should be preserved from the original split, not default to 0") +} diff --git a/engine/evaluator/mocks/mocks.go b/engine/evaluator/mocks/mocks.go index 55a8cf60..93709eee 100644 --- a/engine/evaluator/mocks/mocks.go +++ b/engine/evaluator/mocks/mocks.go @@ -1,7 +1,7 @@ package mocks import ( - "github.com/splitio/go-split-commons/v9/engine/evaluator" + "github.com/splitio/go-split-commons/v10/engine/evaluator" "github.com/stretchr/testify/mock" ) diff --git a/engine/grammar/allkeys_test.go b/engine/grammar/allkeys_test.go index 5eb1c92d..aa34f5bf 100644 --- a/engine/grammar/allkeys_test.go +++ b/engine/grammar/allkeys_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/allofset_test.go b/engine/grammar/allofset_test.go index 8e6f3845..4e914bf0 100644 --- a/engine/grammar/allofset_test.go +++ b/engine/grammar/allofset_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/anyofset_test.go b/engine/grammar/anyofset_test.go index 5fb84410..3fca657d 100644 --- a/engine/grammar/anyofset_test.go +++ b/engine/grammar/anyofset_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/between.go b/engine/grammar/between.go index 2a3d80b9..478b18f9 100644 --- a/engine/grammar/between.go +++ b/engine/grammar/between.go @@ -4,7 +4,7 @@ import ( "fmt" "reflect" - "github.com/splitio/go-split-commons/v9/engine/grammar/datatypes" + "github.com/splitio/go-split-commons/v10/engine/grammar/datatypes" ) // BetweenMatcher will match if two numbers or two datetimes are equal diff --git a/engine/grammar/between_test.go b/engine/grammar/between_test.go index eacd8982..d2259563 100644 --- a/engine/grammar/between_test.go +++ b/engine/grammar/between_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/boolean_test.go b/engine/grammar/boolean_test.go index cbd328c0..7e606e08 100644 --- a/engine/grammar/boolean_test.go +++ b/engine/grammar/boolean_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/condition.go b/engine/grammar/condition.go index 9e453fe2..e801754c 100644 --- a/engine/grammar/condition.go +++ b/engine/grammar/condition.go @@ -1,8 +1,8 @@ package grammar import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/datatypes" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/datatypes" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/condition_test.go b/engine/grammar/condition_test.go index 1cf30afb..7a7f58a0 100644 --- a/engine/grammar/condition_test.go +++ b/engine/grammar/condition_test.go @@ -3,9 +3,9 @@ package grammar import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/engine/grammar/datatypes" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/engine/grammar/datatypes" "github.com/splitio/go-toolkit/v5/logging" "github.com/stretchr/testify/assert" ) diff --git a/engine/grammar/contains_test.go b/engine/grammar/contains_test.go index b7b43dff..99af88ae 100644 --- a/engine/grammar/contains_test.go +++ b/engine/grammar/contains_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/dependency_test/dependency_test.go b/engine/grammar/dependency_test/dependency_test.go index 52db22f1..7ca09fef 100644 --- a/engine/grammar/dependency_test/dependency_test.go +++ b/engine/grammar/dependency_test/dependency_test.go @@ -7,13 +7,13 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine" - "github.com/splitio/go-split-commons/v9/engine/evaluator" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/flagsets" - "github.com/splitio/go-split-commons/v9/storage/inmemory/mutexmap" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine" + "github.com/splitio/go-split-commons/v10/engine/evaluator" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/flagsets" + "github.com/splitio/go-split-commons/v10/storage/inmemory/mutexmap" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/endswith_test.go b/engine/grammar/endswith_test.go index f8242510..10023a15 100644 --- a/engine/grammar/endswith_test.go +++ b/engine/grammar/endswith_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/equalto.go b/engine/grammar/equalto.go index d8a77690..fe165322 100644 --- a/engine/grammar/equalto.go +++ b/engine/grammar/equalto.go @@ -4,7 +4,7 @@ import ( "fmt" "reflect" - "github.com/splitio/go-split-commons/v9/engine/grammar/datatypes" + "github.com/splitio/go-split-commons/v10/engine/grammar/datatypes" ) // EqualToMatcher will match if two numbers or two datetimes are equal diff --git a/engine/grammar/equalto_test.go b/engine/grammar/equalto_test.go index 08b1e684..73470224 100644 --- a/engine/grammar/equalto_test.go +++ b/engine/grammar/equalto_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/equaltoset_test.go b/engine/grammar/equaltoset_test.go index 4e07344c..c390caa7 100644 --- a/engine/grammar/equaltoset_test.go +++ b/engine/grammar/equaltoset_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/gtoet.go b/engine/grammar/gtoet.go index 0130855b..1a3d8ffd 100644 --- a/engine/grammar/gtoet.go +++ b/engine/grammar/gtoet.go @@ -3,7 +3,7 @@ package grammar import ( "fmt" - "github.com/splitio/go-split-commons/v9/engine/grammar/datatypes" + "github.com/splitio/go-split-commons/v10/engine/grammar/datatypes" ) // GreaterThanOrEqualToMatcher will match if two numbers or two datetimes are equal diff --git a/engine/grammar/gtoet_test.go b/engine/grammar/gtoet_test.go index a1d5acbd..bd0e4274 100644 --- a/engine/grammar/gtoet_test.go +++ b/engine/grammar/gtoet_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/inlargesegment.go b/engine/grammar/inlargesegment.go index 01bba997..d895e91c 100644 --- a/engine/grammar/inlargesegment.go +++ b/engine/grammar/inlargesegment.go @@ -3,7 +3,7 @@ package grammar import ( "fmt" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/storage" ) // InLargeSegmentMatcher matches if the key passed is in the large segment which the matcher was constructed with diff --git a/engine/grammar/inlargesegment_test.go b/engine/grammar/inlargesegment_test.go index 5bb96f0f..b93ee676 100644 --- a/engine/grammar/inlargesegment_test.go +++ b/engine/grammar/inlargesegment_test.go @@ -4,9 +4,9 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/storage/inmemory/mutexmap" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/storage/inmemory/mutexmap" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/inrulebasedsegment.go b/engine/grammar/inrulebasedsegment.go index 591c31cf..229cda9c 100644 --- a/engine/grammar/inrulebasedsegment.go +++ b/engine/grammar/inrulebasedsegment.go @@ -3,7 +3,7 @@ package grammar import ( "fmt" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "golang.org/x/exp/slices" ) diff --git a/engine/grammar/inrulebasedsegment_test.go b/engine/grammar/inrulebasedsegment_test.go index 4604bee3..1f7644ee 100644 --- a/engine/grammar/inrulebasedsegment_test.go +++ b/engine/grammar/inrulebasedsegment_test.go @@ -3,9 +3,9 @@ package grammar import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/storage/inmemory/mutexmap" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/storage/inmemory/mutexmap" "github.com/splitio/go-toolkit/v5/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/engine/grammar/insegment.go b/engine/grammar/insegment.go index 07342677..572087c1 100644 --- a/engine/grammar/insegment.go +++ b/engine/grammar/insegment.go @@ -3,7 +3,7 @@ package grammar import ( "fmt" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/storage" ) // InSegmentMatcher matches if the key passed is in the segment which the matcher was constructed with diff --git a/engine/grammar/insegment_test.go b/engine/grammar/insegment_test.go index 778df432..679b4dab 100644 --- a/engine/grammar/insegment_test.go +++ b/engine/grammar/insegment_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage/inmemory/mutexmap" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage/inmemory/mutexmap" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" diff --git a/engine/grammar/ltoet.go b/engine/grammar/ltoet.go index 3ac77063..be153ea4 100644 --- a/engine/grammar/ltoet.go +++ b/engine/grammar/ltoet.go @@ -3,7 +3,7 @@ package grammar import ( "fmt" - "github.com/splitio/go-split-commons/v9/engine/grammar/datatypes" + "github.com/splitio/go-split-commons/v10/engine/grammar/datatypes" ) // LessThanOrEqualToMatcher will match if two numbers or two datetimes are equal diff --git a/engine/grammar/ltoet_test.go b/engine/grammar/ltoet_test.go index b5412b95..95811006 100644 --- a/engine/grammar/ltoet_test.go +++ b/engine/grammar/ltoet_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/matcher_test.go b/engine/grammar/matcher_test.go index 5c4d1d6e..b56d66ca 100644 --- a/engine/grammar/matcher_test.go +++ b/engine/grammar/matcher_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/matchers_test.go b/engine/grammar/matchers_test.go index d846fb43..9dcaed20 100644 --- a/engine/grammar/matchers_test.go +++ b/engine/grammar/matchers_test.go @@ -3,8 +3,8 @@ package grammar import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" "github.com/splitio/go-toolkit/v5/logging" "github.com/stretchr/testify/assert" ) diff --git a/engine/grammar/partofset_test.go b/engine/grammar/partofset_test.go index 34b7a829..07096074 100644 --- a/engine/grammar/partofset_test.go +++ b/engine/grammar/partofset_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/prerequisites.go b/engine/grammar/prerequisites.go index 85166098..5a85f982 100644 --- a/engine/grammar/prerequisites.go +++ b/engine/grammar/prerequisites.go @@ -1,7 +1,7 @@ package grammar import ( - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "golang.org/x/exp/slices" ) diff --git a/engine/grammar/prerequisites_test.go b/engine/grammar/prerequisites_test.go index 8ab17e68..83d2c338 100644 --- a/engine/grammar/prerequisites_test.go +++ b/engine/grammar/prerequisites_test.go @@ -3,7 +3,7 @@ package grammar import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/engine/grammar/regex_test.go b/engine/grammar/regex_test.go index 9c932264..c2aca12e 100644 --- a/engine/grammar/regex_test.go +++ b/engine/grammar/regex_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/rulebuilder.go b/engine/grammar/rulebuilder.go index 467d787b..fc424a47 100644 --- a/engine/grammar/rulebuilder.go +++ b/engine/grammar/rulebuilder.go @@ -6,10 +6,10 @@ import ( "golang.org/x/exp/slices" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/engine/grammar/datatypes" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/engine/grammar/datatypes" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/semver.go b/engine/grammar/semver.go index 73181ae4..0a47ae14 100644 --- a/engine/grammar/semver.go +++ b/engine/grammar/semver.go @@ -3,7 +3,7 @@ package grammar import ( "fmt" - "github.com/splitio/go-split-commons/v9/engine/grammar/datatypes" + "github.com/splitio/go-split-commons/v10/engine/grammar/datatypes" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/semver_test.go b/engine/grammar/semver_test.go index c96ce80f..7acf37d6 100644 --- a/engine/grammar/semver_test.go +++ b/engine/grammar/semver_test.go @@ -7,8 +7,8 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/split.go b/engine/grammar/split.go index 2ea4ebaf..648b5960 100644 --- a/engine/grammar/split.go +++ b/engine/grammar/split.go @@ -1,9 +1,9 @@ package grammar import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/evaluator/impressionlabels" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/evaluator/impressionlabels" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/split_test.go b/engine/grammar/split_test.go index 8b769d4b..97731655 100644 --- a/engine/grammar/split_test.go +++ b/engine/grammar/split_test.go @@ -3,8 +3,8 @@ package grammar import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/startswith_test.go b/engine/grammar/startswith_test.go index 1d1accdc..67db6d26 100644 --- a/engine/grammar/startswith_test.go +++ b/engine/grammar/startswith_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/grammar/whitelist_test.go b/engine/grammar/whitelist_test.go index fabcd30d..a8079e11 100644 --- a/engine/grammar/whitelist_test.go +++ b/engine/grammar/whitelist_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/validator/matchers.go b/engine/validator/matchers.go index 857cb962..17a1d115 100644 --- a/engine/validator/matchers.go +++ b/engine/validator/matchers.go @@ -1,12 +1,12 @@ package validator import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/evaluator" - "github.com/splitio/go-split-commons/v9/engine/evaluator/impressionlabels" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/engine/grammar/datatypes" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/evaluator" + "github.com/splitio/go-split-commons/v10/engine/evaluator/impressionlabels" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/engine/grammar/datatypes" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/engine/validator/matchers_test.go b/engine/validator/matchers_test.go index b7d75fe0..893c8e46 100644 --- a/engine/validator/matchers_test.go +++ b/engine/validator/matchers_test.go @@ -3,9 +3,9 @@ package validator import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/flagsets/featuresbyset.go b/flagsets/featuresbyset.go index 1bc1d97f..51b5af4b 100644 --- a/flagsets/featuresbyset.go +++ b/flagsets/featuresbyset.go @@ -1,6 +1,6 @@ package flagsets -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" type FeaturesBySet struct { data map[string]map[string]struct{} diff --git a/flagsets/featuresbyset_test.go b/flagsets/featuresbyset_test.go index b44c72cc..6c179efd 100644 --- a/flagsets/featuresbyset_test.go +++ b/flagsets/featuresbyset_test.go @@ -3,7 +3,7 @@ package flagsets import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" ) func TestFeaturesBySet(t *testing.T) { diff --git a/flagsets/flag_set_validator.go b/flagsets/flag_set_validator.go index 5a82c7bf..0baa42f7 100644 --- a/flagsets/flag_set_validator.go +++ b/flagsets/flag_set_validator.go @@ -6,7 +6,7 @@ import ( "sort" "strings" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "golang.org/x/exp/slices" ) diff --git a/go.mod b/go.mod index 708e4309..34b5b09d 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/splitio/go-split-commons/v9 +module github.com/splitio/go-split-commons/v10 go 1.18 diff --git a/healthcheck/mocks/applicationmonitor.go b/healthcheck/mocks/applicationmonitor.go index 0bd6e776..8e1f79b9 100644 --- a/healthcheck/mocks/applicationmonitor.go +++ b/healthcheck/mocks/applicationmonitor.go @@ -1,7 +1,7 @@ package mocks import ( - "github.com/splitio/go-split-commons/v9/healthcheck/application" + "github.com/splitio/go-split-commons/v10/healthcheck/application" "github.com/stretchr/testify/mock" ) diff --git a/provisional/impmanager.go b/provisional/impmanager.go index e5d9ea8d..ecf3fc8e 100644 --- a/provisional/impmanager.go +++ b/provisional/impmanager.go @@ -1,8 +1,8 @@ package provisional import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/provisional/strategy" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/provisional/strategy" ) // ImpressionManager interface diff --git a/provisional/impmanager_test.go b/provisional/impmanager_test.go index 8c0ee92c..6a334939 100644 --- a/provisional/impmanager_test.go +++ b/provisional/impmanager_test.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/provisional/strategy" - "github.com/splitio/go-split-commons/v9/storage/filter" - "github.com/splitio/go-split-commons/v9/storage/inmemory" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/provisional/strategy" + "github.com/splitio/go-split-commons/v10/storage/filter" + "github.com/splitio/go-split-commons/v10/storage/inmemory" + "github.com/splitio/go-split-commons/v10/telemetry" ) func TestImpManagerInMemoryDebugListenerDisabled(t *testing.T) { @@ -18,13 +18,13 @@ func TestImpManagerInMemoryDebugListenerDisabled(t *testing.T) { now := time.Now().UTC().UnixNano() imp1 := &dtos.Impression{ - BucketingKey: "someBucketingKey", - ChangeNumber: 123456789, - FeatureName: "someFeature", - KeyName: "someKey", - Label: "someLabel", - Time: now, - Treatment: "someTreatment", + BucketingKey: "someBucketingKey", + ChangeNumber: 123456789, + DefinitionName: "someFeature", + KeyName: "someKey", + Label: "someLabel", + Time: now, + Treatment: "someTreatment", } impressionsForLog, impressionsForListener := impManager.ProcessImpressions([]dtos.Impression{*imp1}) @@ -51,13 +51,13 @@ func TestImpManagerInMemoryDebug(t *testing.T) { now := time.Now().UTC().UnixNano() imp1 := &dtos.Impression{ - BucketingKey: "someBucketingKey", - ChangeNumber: 123456789, - FeatureName: "someFeature", - KeyName: "someKey", - Label: "someLabel", - Time: now, - Treatment: "someTreatment", + BucketingKey: "someBucketingKey", + ChangeNumber: 123456789, + DefinitionName: "someFeature", + KeyName: "someKey", + Label: "someLabel", + Time: now, + Treatment: "someTreatment", } impressionsForLog, impressionsForListener := impManager.ProcessImpressions([]dtos.Impression{*imp1}) @@ -86,13 +86,13 @@ func TestImpManagerInMemoryOptimized(t *testing.T) { now := time.Now().UTC().UnixNano() imp1 := &dtos.Impression{ - BucketingKey: "someBucketingKey", - ChangeNumber: 123456789, - FeatureName: "someFeature", - KeyName: "someKey", - Label: "someLabel", - Time: now, - Treatment: "someTreatment", + BucketingKey: "someBucketingKey", + ChangeNumber: 123456789, + DefinitionName: "someFeature", + KeyName: "someKey", + Label: "someLabel", + Time: now, + Treatment: "someTreatment", } impressionsForLog, impressionsForListener := impManager.ProcessImpressions([]dtos.Impression{*imp1}) @@ -128,13 +128,13 @@ func TestImpManagerInMemoryNone(t *testing.T) { now := time.Now().UTC().UnixNano() imp1 := &dtos.Impression{ - BucketingKey: "someBucketingKey", - ChangeNumber: 123456789, - FeatureName: "someFeature", - KeyName: "someKey", - Label: "someLabel", - Time: now, - Treatment: "someTreatment", + BucketingKey: "someBucketingKey", + ChangeNumber: 123456789, + DefinitionName: "someFeature", + KeyName: "someKey", + Label: "someLabel", + Time: now, + Treatment: "someTreatment", } impressionsForLog, impressionsForListener := impManager.ProcessImpressions([]dtos.Impression{*imp1}) @@ -157,13 +157,13 @@ func TestImpManagerRedis(t *testing.T) { now := time.Now().UTC().UnixNano() imp1 := &dtos.Impression{ - BucketingKey: "someBucketingKey", - ChangeNumber: 123456789, - FeatureName: "someFeature", - KeyName: "someKey", - Label: "someLabel", - Time: now, - Treatment: "someTreatment", + BucketingKey: "someBucketingKey", + ChangeNumber: 123456789, + DefinitionName: "someFeature", + KeyName: "someKey", + Label: "someLabel", + Time: now, + Treatment: "someTreatment", } impressionsForLog, impressionsForListener := impManager.ProcessImpressions([]dtos.Impression{*imp1}) @@ -197,34 +197,34 @@ func TestProcess(t *testing.T) { now := time.Now().UTC().UnixNano() impressions := []dtos.Impression{ { - BucketingKey: "someBucketingKey", - ChangeNumber: 123456789, - FeatureName: "someFeature", - KeyName: "someKey", - Label: "someLabel", - Time: now, - Treatment: "someTreatment", - Disabled: true, + BucketingKey: "someBucketingKey", + ChangeNumber: 123456789, + DefinitionName: "someFeature", + KeyName: "someKey", + Label: "someLabel", + Time: now, + Treatment: "someTreatment", + Disabled: true, }, { - BucketingKey: "someBucketingKey", - ChangeNumber: 123456789, - FeatureName: "harnessFlag", - KeyName: "someKey", - Label: "someLabel", - Time: now, - Treatment: "someTreatment", - Disabled: true, + BucketingKey: "someBucketingKey", + ChangeNumber: 123456789, + DefinitionName: "harnessFlag", + KeyName: "someKey", + Label: "someLabel", + Time: now, + Treatment: "someTreatment", + Disabled: true, }, { - BucketingKey: "someBucketingKey", - ChangeNumber: 123456789, - FeatureName: "featureTest", - KeyName: "someKey", - Label: "someLabel", - Time: now, - Treatment: "someTreatment", - Disabled: false, + BucketingKey: "someBucketingKey", + ChangeNumber: 123456789, + DefinitionName: "featureTest", + KeyName: "someKey", + Label: "someLabel", + Time: now, + Treatment: "someTreatment", + Disabled: false, }, } diff --git a/provisional/strategy/debug.go b/provisional/strategy/debug.go index af32de70..1d4b7552 100644 --- a/provisional/strategy/debug.go +++ b/provisional/strategy/debug.go @@ -1,6 +1,6 @@ package strategy -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // DebugImpl struct for debug impression mode strategy. type DebugImpl struct { @@ -18,7 +18,7 @@ func NewDebugImpl(impressionObserver ImpressionObserver, listenerEnabled bool) P func (s *DebugImpl) apply(impression *dtos.Impression) bool { if len(impression.Properties) == 0 { - impression.Pt, _ = s.impressionObserver.TestAndSet(impression.FeatureName, impression) + impression.Pt, _ = s.impressionObserver.TestAndSet(impression.DefinitionName, impression) } return true diff --git a/provisional/strategy/debug_test.go b/provisional/strategy/debug_test.go index c0a80db4..32418362 100644 --- a/provisional/strategy/debug_test.go +++ b/provisional/strategy/debug_test.go @@ -3,7 +3,7 @@ package strategy import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/stretchr/testify/assert" ) @@ -12,13 +12,13 @@ func TestDebugMode(t *testing.T) { debug := NewDebugImpl(observer, true) imp := dtos.Impression{ - BucketingKey: "someBuck", - ChangeNumber: 123, - KeyName: "someKey", - Label: "someLabel", - Time: 123456, - Treatment: "on", - FeatureName: "feature-test", + BucketingKey: "someBuck", + ChangeNumber: 123, + KeyName: "someKey", + Label: "someLabel", + Time: 123456, + Treatment: "on", + DefinitionName: "feature-test", } toLog, toListener := debug.Apply([]dtos.Impression{imp}) @@ -37,14 +37,14 @@ func TestDebugModeWithProperties(t *testing.T) { debug := NewDebugImpl(observer, true) imp := dtos.Impression{ - BucketingKey: "someBuck", - ChangeNumber: 123, - KeyName: "someKey", - Label: "someLabel", - Time: 123456, - Treatment: "on", - FeatureName: "feature-test", - Properties: "{'hello':'world'}", + BucketingKey: "someBuck", + ChangeNumber: 123, + KeyName: "someKey", + Label: "someLabel", + Time: 123456, + Treatment: "on", + DefinitionName: "feature-test", + Properties: "{'hello':'world'}", } toLog, toListener := debug.Apply([]dtos.Impression{imp}) @@ -62,13 +62,13 @@ func TestApplySingleDebug(t *testing.T) { observer, _ := NewImpressionObserver(5000) debug := NewDebugImpl(observer, true) imp := dtos.Impression{ - BucketingKey: "someBuck", - ChangeNumber: 123, - KeyName: "someKey", - Label: "someLabel", - Time: 123456, - Treatment: "on", - FeatureName: "feature-test", + BucketingKey: "someBuck", + ChangeNumber: 123, + KeyName: "someKey", + Label: "someLabel", + Time: 123456, + Treatment: "on", + DefinitionName: "feature-test", } toLog := debug.ApplySingle(&imp) diff --git a/provisional/strategy/impcounter.go b/provisional/strategy/impcounter.go index ceb3ee30..a1cd1b13 100644 --- a/provisional/strategy/impcounter.go +++ b/provisional/strategy/impcounter.go @@ -3,13 +3,13 @@ package strategy import ( "sync" - "github.com/splitio/go-split-commons/v9/util" + "github.com/splitio/go-split-commons/v10/util" ) // Key struct for mapping each key to an amount type Key struct { - FeatureName string - TimeFrame int64 + DefinitionName string + TimeFrame int64 } // ImpressionsCounter struct for storing generated impressions counts @@ -28,8 +28,8 @@ func NewImpressionsCounter() *ImpressionsCounter { func makeKey(splitName string, timeFrame int64) Key { return Key{ - FeatureName: splitName, - TimeFrame: util.TruncateTimeFrame(timeFrame), + DefinitionName: splitName, + TimeFrame: util.TruncateTimeFrame(timeFrame), } } diff --git a/provisional/strategy/impcounter_test.go b/provisional/strategy/impcounter_test.go index e0b4ec24..8c1d0649 100644 --- a/provisional/strategy/impcounter_test.go +++ b/provisional/strategy/impcounter_test.go @@ -10,19 +10,19 @@ func TestMakeKey(t *testing.T) { timestamp := time.Date(2020, 9, 2, 10, 0, 0, 0, time.UTC).UnixNano() / int64(time.Millisecond) actualKey := makeKey("someFeature", time.Date(2020, 9, 2, 10, 0, 0, 0, time.UTC).UnixNano()) - expectedKey := Key{FeatureName: "someFeature", TimeFrame: timestamp} + expectedKey := Key{DefinitionName: "someFeature", TimeFrame: timestamp} if actualKey != expectedKey { t.Error(fmt.Sprintf("Unexpected key generated %v, %v", actualKey, expectedKey)) } actualKey2 := makeKey("", time.Date(2020, 9, 2, 10, 0, 0, 0, time.UTC).UnixNano()) - expectedKey2 := Key{FeatureName: "", TimeFrame: timestamp} + expectedKey2 := Key{DefinitionName: "", TimeFrame: timestamp} if actualKey2 != expectedKey2 { t.Error(fmt.Sprintf("Unexpected key generated %v, %v", actualKey2, expectedKey2)) } actualKey3 := makeKey("someFeature", 0) - expectedKey3 := Key{FeatureName: "someFeature", TimeFrame: 0} + expectedKey3 := Key{DefinitionName: "someFeature", TimeFrame: 0} if actualKey3 != expectedKey3 { t.Error(fmt.Sprintf("Unexpected key generated %v, %v", actualKey3, expectedKey3)) } diff --git a/provisional/strategy/imphasher.go b/provisional/strategy/imphasher.go index f8b0f9da..10bf6d30 100644 --- a/provisional/strategy/imphasher.go +++ b/provisional/strategy/imphasher.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/provisional/hashing" ) diff --git a/provisional/strategy/imphasher_test.go b/provisional/strategy/imphasher_test.go index ab9f7062..802aeefd 100644 --- a/provisional/strategy/imphasher_test.go +++ b/provisional/strategy/imphasher_test.go @@ -3,7 +3,7 @@ package strategy import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" ) func TestHasher(t *testing.T) { diff --git a/provisional/strategy/impobserver.go b/provisional/strategy/impobserver.go index 6048021a..37551a14 100644 --- a/provisional/strategy/impobserver.go +++ b/provisional/strategy/impobserver.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/provisional/int64cache" ) diff --git a/provisional/strategy/impobserver_test.go b/provisional/strategy/impobserver_test.go index 8ec60d4a..a9e20a8d 100644 --- a/provisional/strategy/impobserver_test.go +++ b/provisional/strategy/impobserver_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/provisional/int64cache" ) diff --git a/provisional/strategy/interfaces.go b/provisional/strategy/interfaces.go index d6e4aef0..e196ab88 100644 --- a/provisional/strategy/interfaces.go +++ b/provisional/strategy/interfaces.go @@ -1,6 +1,6 @@ package strategy -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // ProcessStrategyInterface interface type ProcessStrategyInterface interface { diff --git a/provisional/strategy/none.go b/provisional/strategy/none.go index 96e2ad90..f0a8de23 100644 --- a/provisional/strategy/none.go +++ b/provisional/strategy/none.go @@ -3,7 +3,7 @@ package strategy import ( "time" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" ) // NoneImpl struct for none impression mode strategy. @@ -23,8 +23,8 @@ func NewNoneImpl(impressionCounter *ImpressionsCounter, uniqueKeysTracker Unique } func (s *NoneImpl) apply(impression *dtos.Impression, now int64) bool { - s.impressionsCounter.Inc(impression.FeatureName, now, 1) - s.uniqueKeysTracker.Track(impression.FeatureName, impression.KeyName) + s.impressionsCounter.Inc(impression.DefinitionName, now, 1) + s.uniqueKeysTracker.Track(impression.DefinitionName, impression.KeyName) return false } diff --git a/provisional/strategy/none_test.go b/provisional/strategy/none_test.go index ce440df1..f314d193 100644 --- a/provisional/strategy/none_test.go +++ b/provisional/strategy/none_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage/filter" - "github.com/splitio/go-split-commons/v9/util" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage/filter" + "github.com/splitio/go-split-commons/v10/util" ) func TestNoneMode(t *testing.T) { @@ -17,13 +17,13 @@ func TestNoneMode(t *testing.T) { none := NewNoneImpl(counter, tracker, true) imp := dtos.Impression{ - BucketingKey: "someBuck", - ChangeNumber: 123, - KeyName: "someKey", - Label: "someLabel", - Time: now, - Treatment: "on", - FeatureName: "feature-test", + BucketingKey: "someBuck", + ChangeNumber: 123, + KeyName: "someKey", + Label: "someLabel", + Time: now, + Treatment: "on", + DefinitionName: "feature-test", } toLog, toListener := none.Apply([]dtos.Impression{imp}) @@ -40,8 +40,8 @@ func TestNoneMode(t *testing.T) { counts := counter.PopAll() value := counts[Key{ - FeatureName: imp.FeatureName, - TimeFrame: util.TruncateTimeFrame(now), + DefinitionName: imp.DefinitionName, + TimeFrame: util.TruncateTimeFrame(now), }] if value != 2 { @@ -57,13 +57,13 @@ func TestApplySingleNone(t *testing.T) { none := NewNoneImpl(counter, tracker, true) imp := dtos.Impression{ - BucketingKey: "someBuck", - ChangeNumber: 123, - KeyName: "someKey", - Label: "someLabel", - Time: now, - Treatment: "on", - FeatureName: "feature-test", + BucketingKey: "someBuck", + ChangeNumber: 123, + KeyName: "someKey", + Label: "someLabel", + Time: now, + Treatment: "on", + DefinitionName: "feature-test", } toLog := none.ApplySingle(&imp) diff --git a/provisional/strategy/optimized.go b/provisional/strategy/optimized.go index ad6bb683..543ea9b0 100644 --- a/provisional/strategy/optimized.go +++ b/provisional/strategy/optimized.go @@ -3,10 +3,10 @@ package strategy import ( "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" - "github.com/splitio/go-split-commons/v9/util" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" + "github.com/splitio/go-split-commons/v10/util" ) // OptimizedImpl struct for optimized impression mode strategy. @@ -31,9 +31,9 @@ func (s *OptimizedImpl) apply(impression *dtos.Impression, now int64) bool { if len(impression.Properties) != 0 { return true } - impression.Pt, _ = s.impressionObserver.TestAndSet(impression.FeatureName, impression) + impression.Pt, _ = s.impressionObserver.TestAndSet(impression.DefinitionName, impression) if impression.Pt != 0 { - s.impressionsCounter.Inc(impression.FeatureName, now, 1) + s.impressionsCounter.Inc(impression.DefinitionName, now, 1) } if impression.Pt == 0 || impression.Pt < util.TruncateTimeFrame(now) { diff --git a/provisional/strategy/optimized_test.go b/provisional/strategy/optimized_test.go index aca1b446..6799407d 100644 --- a/provisional/strategy/optimized_test.go +++ b/provisional/strategy/optimized_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage/inmemory" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage/inmemory" "github.com/stretchr/testify/assert" ) @@ -15,13 +15,13 @@ func TestOptimizedMode(t *testing.T) { runtimeTelemetry, _ := inmemory.NewTelemetryStorage() optimized := NewOptimizedImpl(observer, counter, runtimeTelemetry, true) imp := dtos.Impression{ - BucketingKey: "someBuck", - ChangeNumber: 123, - KeyName: "someKey", - Label: "someLabel", - Time: time.Now().UTC().UnixNano(), - Treatment: "on", - FeatureName: "feature-test", + BucketingKey: "someBuck", + ChangeNumber: 123, + KeyName: "someKey", + Label: "someLabel", + Time: time.Now().UTC().UnixNano(), + Treatment: "on", + DefinitionName: "feature-test", } toLog, toListener := optimized.Apply([]dtos.Impression{imp}) @@ -38,7 +38,7 @@ func TestOptimizedMode(t *testing.T) { rawCounts := counter.PopAll() assert.Equal(t, 1, len(rawCounts), "Should have counts") for key, counts := range counter.PopAll() { - assert.Equal(t, "feature-test", key.FeatureName, "Feature should be feature-test") + assert.Equal(t, "feature-test", key.DefinitionName, "Feature should be feature-test") assert.Equal(t, 1, counts, "It should be tracked only once") } } @@ -49,14 +49,14 @@ func TestOptimizedModeWithProperties(t *testing.T) { runtimeTelemetry, _ := inmemory.NewTelemetryStorage() optimized := NewOptimizedImpl(observer, counter, runtimeTelemetry, true) imp := dtos.Impression{ - BucketingKey: "someBuck", - ChangeNumber: 123, - KeyName: "someKey", - Label: "someLabel", - Time: time.Now().UTC().UnixNano(), - Treatment: "on", - FeatureName: "feature-test", - Properties: "{'hello':'world'}", + BucketingKey: "someBuck", + ChangeNumber: 123, + KeyName: "someKey", + Label: "someLabel", + Time: time.Now().UTC().UnixNano(), + Treatment: "on", + DefinitionName: "feature-test", + Properties: "{'hello':'world'}", } toLog, toListener := optimized.Apply([]dtos.Impression{imp}) @@ -72,7 +72,7 @@ func TestOptimizedModeWithProperties(t *testing.T) { rawCounts := counter.PopAll() assert.Equal(t, 0, len(rawCounts), "Should doesn't have counts") for key, counts := range counter.PopAll() { - assert.Equal(t, "feature-test", key.FeatureName, "Feature should be feature-test") + assert.Equal(t, "feature-test", key.DefinitionName, "Feature should be feature-test") assert.Equal(t, 1, counts, "It should be tracked empty") } } @@ -83,13 +83,13 @@ func TestApplySingleOptimized(t *testing.T) { runtimeTelemetry, _ := inmemory.NewTelemetryStorage() optimized := NewOptimizedImpl(observer, counter, runtimeTelemetry, true) imp := dtos.Impression{ - BucketingKey: "someBuck", - ChangeNumber: 123, - KeyName: "someKey", - Label: "someLabel", - Time: time.Now().UTC().UnixNano(), - Treatment: "on", - FeatureName: "feature-test", + BucketingKey: "someBuck", + ChangeNumber: 123, + KeyName: "someKey", + Label: "someLabel", + Time: time.Now().UTC().UnixNano(), + Treatment: "on", + DefinitionName: "feature-test", } toLog := optimized.ApplySingle(&imp) diff --git a/provisional/strategy/uniquekeystracker.go b/provisional/strategy/uniquekeystracker.go index ad8d8e26..c6bf7b6b 100644 --- a/provisional/strategy/uniquekeystracker.go +++ b/provisional/strategy/uniquekeystracker.go @@ -3,8 +3,8 @@ package strategy import ( "sync" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/datastructures/set" ) diff --git a/provisional/strategy/uniquekeystracker_test.go b/provisional/strategy/uniquekeystracker_test.go index caac8bce..4554ad22 100644 --- a/provisional/strategy/uniquekeystracker_test.go +++ b/provisional/strategy/uniquekeystracker_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/splitio/go-split-commons/v9/storage/filter" + "github.com/splitio/go-split-commons/v10/storage/filter" ) func Test(t *testing.T) { diff --git a/push/borrowed.go b/push/borrowed.go index 56b76d9e..b58bd14d 100644 --- a/push/borrowed.go +++ b/push/borrowed.go @@ -1,6 +1,6 @@ package push -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // Borrowed synchronizer interface to break circular dependencies type synchronizerInterface interface { diff --git a/push/largesegment.go b/push/largesegment.go index b78b74be..831b73ab 100644 --- a/push/largesegment.go +++ b/push/largesegment.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/struct/traits/lifecycle" ) diff --git a/push/largesegment_test.go b/push/largesegment_test.go index 91e475a9..27ecfafc 100644 --- a/push/largesegment_test.go +++ b/push/largesegment_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/push/mocks" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/push/mocks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/push/manager.go b/push/manager.go index cbc565d6..df683e0a 100644 --- a/push/manager.go +++ b/push/manager.go @@ -7,12 +7,12 @@ import ( "sync" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/api/sse" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/api/sse" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/struct/traits/lifecycle" diff --git a/push/manager_test.go b/push/manager_test.go index b666c829..4b319150 100644 --- a/push/manager_test.go +++ b/push/manager_test.go @@ -6,14 +6,14 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - pushMocks "github.com/splitio/go-split-commons/v9/push/mocks" - "github.com/splitio/go-split-commons/v9/service/api/sse" - sseMocks "github.com/splitio/go-split-commons/v9/service/api/sse/mocks" - serviceMocks "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + pushMocks "github.com/splitio/go-split-commons/v10/push/mocks" + "github.com/splitio/go-split-commons/v10/service/api/sse" + sseMocks "github.com/splitio/go-split-commons/v10/service/api/sse/mocks" + serviceMocks "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/logging" diff --git a/push/mocks/parser.go b/push/mocks/parser.go index 1c59debb..b3ea9eaa 100644 --- a/push/mocks/parser.go +++ b/push/mocks/parser.go @@ -1,7 +1,7 @@ package mocks import ( - "github.com/splitio/go-split-commons/v9/service/api/sse" + "github.com/splitio/go-split-commons/v10/service/api/sse" ) type NotificationParserMock struct { diff --git a/push/mocks/sync.go b/push/mocks/sync.go index eea2abcf..78bcbb9e 100644 --- a/push/mocks/sync.go +++ b/push/mocks/sync.go @@ -1,6 +1,6 @@ package mocks -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" type LocalSyncMock struct { SyncAllCall func() error diff --git a/push/parser.go b/push/parser.go index ce094235..810c91b2 100644 --- a/push/parser.go +++ b/push/parser.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service/api/sse" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service/api/sse" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/datautils" diff --git a/push/parser_test.go b/push/parser_test.go index 5aac792b..4fcc41fa 100644 --- a/push/parser_test.go +++ b/push/parser_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/datautils" "github.com/splitio/go-toolkit/v5/logging" diff --git a/push/processor.go b/push/processor.go index 274991e8..18c92c75 100644 --- a/push/processor.go +++ b/push/processor.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/push/processor_test.go b/push/processor_test.go index 8ac79ad2..c688d1dc 100644 --- a/push/processor_test.go +++ b/push/processor_test.go @@ -3,9 +3,9 @@ package push import ( "testing" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/push/mocks" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/push/mocks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/push/segment.go b/push/segment.go index 3ad6c333..2c245224 100644 --- a/push/segment.go +++ b/push/segment.go @@ -5,7 +5,7 @@ import ( "fmt" "sync/atomic" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/struct/traits/lifecycle" diff --git a/push/segment_test.go b/push/segment_test.go index 392c1b57..acd3b6e0 100644 --- a/push/segment_test.go +++ b/push/segment_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/push/mocks" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/push/mocks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/push/split.go b/push/split.go index 76328dca..9f069450 100644 --- a/push/split.go +++ b/push/split.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/struct/traits/lifecycle" ) diff --git a/push/split_test.go b/push/split_test.go index 868fdf59..538ec676 100644 --- a/push/split_test.go +++ b/push/split_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/push/mocks" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/push/mocks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/push/statustracker.go b/push/statustracker.go index 2ca2ea80..7a3a2087 100644 --- a/push/statustracker.go +++ b/push/statustracker.go @@ -4,9 +4,9 @@ import ( "fmt" "sync" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/push/statustracker_test.go b/push/statustracker_test.go index 869b4a1b..573a4a4a 100644 --- a/push/statustracker_test.go +++ b/push/statustracker_test.go @@ -3,9 +3,9 @@ package push import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/api/auth.go b/service/api/auth.go index 31676df1..43481894 100644 --- a/service/api/auth.go +++ b/service/api/auth.go @@ -3,10 +3,10 @@ package api import ( "encoding/json" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/api/specs" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/api/specs" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/api/auth_test.go b/service/api/auth_test.go index 7c603428..1f954198 100644 --- a/service/api/auth_test.go +++ b/service/api/auth_test.go @@ -6,10 +6,10 @@ import ( "net/http/httptest" "testing" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/api/mocks" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/api/mocks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/api/client.go b/service/api/client.go index 8c4435d4..f30d032f 100644 --- a/service/api/client.go +++ b/service/api/client.go @@ -9,9 +9,9 @@ import ( "net/http" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/api/client_test.go b/service/api/client_test.go index e4963455..b0ccbbdd 100644 --- a/service/api/client_test.go +++ b/service/api/client_test.go @@ -8,9 +8,9 @@ import ( "net/http/httptest" "testing" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/api/helpers.go b/service/api/helpers.go index afa70bca..52c1b770 100644 --- a/service/api/helpers.go +++ b/service/api/helpers.go @@ -6,8 +6,8 @@ import ( "io" "net/http" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service/api/specs" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service/api/specs" ) const ( diff --git a/service/api/helpers_test.go b/service/api/helpers_test.go index 2260c25c..db69fefb 100644 --- a/service/api/helpers_test.go +++ b/service/api/helpers_test.go @@ -3,7 +3,7 @@ package api import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" ) func TestAddMetadataToHeaders(t *testing.T) { diff --git a/service/api/http_fetchers.go b/service/api/http_fetchers.go index 4c28adbb..26bee00d 100644 --- a/service/api/http_fetchers.go +++ b/service/api/http_fetchers.go @@ -7,10 +7,10 @@ import ( "net/http" "strings" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/api/specs" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/api/specs" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/api/http_fetchers_test.go b/service/api/http_fetchers_test.go index 2832e5e5..70589d78 100644 --- a/service/api/http_fetchers_test.go +++ b/service/api/http_fetchers_test.go @@ -13,10 +13,10 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/api/specs" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/api/specs" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/logging" "github.com/stretchr/testify/assert" diff --git a/service/api/http_recorders.go b/service/api/http_recorders.go index 31d1da45..ca324954 100644 --- a/service/api/http_recorders.go +++ b/service/api/http_recorders.go @@ -3,8 +3,8 @@ package api import ( "encoding/json" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/api/http_recorders_test.go b/service/api/http_recorders_test.go index 0551a6e6..a9650a13 100644 --- a/service/api/http_recorders_test.go +++ b/service/api/http_recorders_test.go @@ -9,8 +9,8 @@ import ( "net/http/httptest" "testing" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/api/mocks/client.go b/service/api/mocks/client.go index a7cf9ad9..b5a45cf8 100644 --- a/service/api/mocks/client.go +++ b/service/api/mocks/client.go @@ -1,6 +1,6 @@ package mocks -import "github.com/splitio/go-split-commons/v9/service" +import "github.com/splitio/go-split-commons/v10/service" // ClientMock mocks client type ClientMock struct { diff --git a/service/api/specs/splitversionfilter.go b/service/api/specs/splitversionfilter.go index 420703da..890cf813 100644 --- a/service/api/specs/splitversionfilter.go +++ b/service/api/specs/splitversionfilter.go @@ -1,7 +1,7 @@ package specs import ( - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" ) type SplitVersionFilter struct { diff --git a/service/api/specs/splitversionfilter_test.go b/service/api/specs/splitversionfilter_test.go index abf6f515..070ba748 100644 --- a/service/api/specs/splitversionfilter_test.go +++ b/service/api/specs/splitversionfilter_test.go @@ -3,7 +3,7 @@ package specs import ( "testing" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" ) func TestParseAndValidate(t *testing.T) { diff --git a/service/api/split.go b/service/api/split.go index beedcce3..76fa5eff 100644 --- a/service/api/split.go +++ b/service/api/split.go @@ -1,9 +1,9 @@ package api import ( - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/api/sse/client.go b/service/api/sse/client.go index 6e989d9d..4870cfb3 100644 --- a/service/api/sse/client.go +++ b/service/api/sse/client.go @@ -4,9 +4,9 @@ import ( "errors" "strings" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service/api" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service/api" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/sse" "github.com/splitio/go-toolkit/v5/struct/traits/lifecycle" diff --git a/service/api/sse/client_test.go b/service/api/sse/client_test.go index a9586fc4..16190d07 100644 --- a/service/api/sse/client_test.go +++ b/service/api/sse/client_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/sse" ) diff --git a/service/api/sse/mocks/mock.go b/service/api/sse/mocks/mock.go index cb3ee9bd..dcbe4b98 100644 --- a/service/api/sse/mocks/mock.go +++ b/service/api/sse/mocks/mock.go @@ -1,6 +1,6 @@ package mocks -import "github.com/splitio/go-split-commons/v9/service/api/sse" +import "github.com/splitio/go-split-commons/v10/service/api/sse" type StreamingClientMock struct { ConnectStreamingCall func(token string, streamingStatus chan int, channelList []string, handleIncomingMessage func(sse.IncomingMessage)) diff --git a/service/commons_test.go b/service/commons_test.go index 1bed60a7..88ead349 100644 --- a/service/commons_test.go +++ b/service/commons_test.go @@ -4,7 +4,7 @@ import ( "net/http" "testing" - "github.com/splitio/go-split-commons/v9/service/api/specs" + "github.com/splitio/go-split-commons/v10/service/api/specs" "github.com/splitio/go-toolkit/v5/common" diff --git a/service/interfaces.go b/service/interfaces.go index 567f47b3..5bc218e6 100644 --- a/service/interfaces.go +++ b/service/interfaces.go @@ -1,6 +1,6 @@ package service -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // AuthClient inteface to be implemneted by AuthClient type AuthClient interface { diff --git a/service/local/sanitizer.go b/service/local/sanitizer.go index aabe40a8..fcc91048 100644 --- a/service/local/sanitizer.go +++ b/service/local/sanitizer.go @@ -4,7 +4,7 @@ import ( "fmt" "math/rand" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" ) func splitSanitization(splitChange *dtos.FFResponseLocalV13) *dtos.FFResponseLocalV13 { diff --git a/service/local/segmentFetcher.go b/service/local/segmentFetcher.go index d5430b65..9ac9451b 100644 --- a/service/local/segmentFetcher.go +++ b/service/local/segmentFetcher.go @@ -7,8 +7,8 @@ import ( "fmt" "sync" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/local/segmentFetcher_test.go b/service/local/segmentFetcher_test.go index 32e5b1da..bbca3aba 100644 --- a/service/local/segmentFetcher_test.go +++ b/service/local/segmentFetcher_test.go @@ -5,9 +5,9 @@ import ( "fmt" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/local/mocks" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/local/mocks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/local/splitFetcher.go b/service/local/splitFetcher.go index 8d2171af..77fd63f0 100644 --- a/service/local/splitFetcher.go +++ b/service/local/splitFetcher.go @@ -9,8 +9,8 @@ import ( "strings" "sync" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" "github.com/splitio/go-toolkit/v5/logging" yaml "gopkg.in/yaml.v3" diff --git a/service/local/splitFetcher_test.go b/service/local/splitFetcher_test.go index 9da7eee9..8383e014 100644 --- a/service/local/splitFetcher_test.go +++ b/service/local/splitFetcher_test.go @@ -5,8 +5,8 @@ import ( "os" "testing" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/local/mocks" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/local/mocks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/service/mocks/auth.go b/service/mocks/auth.go index c256602d..67f4758f 100644 --- a/service/mocks/auth.go +++ b/service/mocks/auth.go @@ -1,6 +1,6 @@ package mocks -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // MockAuthClient mocked implementation of auth type MockAuthClient struct { diff --git a/service/mocks/event.go b/service/mocks/event.go index 1e258d7a..149533e3 100644 --- a/service/mocks/event.go +++ b/service/mocks/event.go @@ -1,6 +1,6 @@ package mocks -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // MockEventRecorder mocked implementation of event recorder type MockEventRecorder struct { diff --git a/service/mocks/impression.go b/service/mocks/impression.go index aa63f134..a70fb8c7 100644 --- a/service/mocks/impression.go +++ b/service/mocks/impression.go @@ -1,6 +1,6 @@ package mocks -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // MockImpressionRecorder mocked implementation of impression recorder type MockImpressionRecorder struct { diff --git a/service/mocks/large_segment.go b/service/mocks/large_segment.go index 42cfc52a..e29617e8 100644 --- a/service/mocks/large_segment.go +++ b/service/mocks/large_segment.go @@ -1,8 +1,8 @@ package mocks import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" ) type MockLargeSegmentFetcher struct { diff --git a/service/mocks/segment.go b/service/mocks/segment.go index fcb280c6..1b2b762c 100644 --- a/service/mocks/segment.go +++ b/service/mocks/segment.go @@ -1,8 +1,8 @@ package mocks import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" ) // MockSegmentFetcher mocked implementation of segment fetcher diff --git a/service/mocks/split.go b/service/mocks/split.go index 4117177c..a4a84c13 100644 --- a/service/mocks/split.go +++ b/service/mocks/split.go @@ -1,8 +1,8 @@ package mocks import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" "github.com/stretchr/testify/mock" ) diff --git a/service/mocks/telemetry.go b/service/mocks/telemetry.go index 8ce996df..a539cb6f 100644 --- a/service/mocks/telemetry.go +++ b/service/mocks/telemetry.go @@ -1,6 +1,6 @@ package mocks -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // MockTelemetryRecorder mocked implementation of telemetry recorder type MockTelemetryRecorder struct { diff --git a/storage/filter/bloom_filter.go b/storage/filter/bloom_filter.go index 349d8ae9..9edda9d2 100644 --- a/storage/filter/bloom_filter.go +++ b/storage/filter/bloom_filter.go @@ -4,7 +4,7 @@ import ( "sync" "github.com/bits-and-blooms/bloom/v3" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/storage" ) // BloomFilter description diff --git a/storage/inmemory/mutexmap/largesegments.go b/storage/inmemory/mutexmap/largesegments.go index 86b0812b..df679ddd 100644 --- a/storage/inmemory/mutexmap/largesegments.go +++ b/storage/inmemory/mutexmap/largesegments.go @@ -5,7 +5,7 @@ import ( "sort" "sync" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/storage" ) // LargeSegmentsStorageImpl implements the LargeSegmentsStorage interface diff --git a/storage/inmemory/mutexmap/mutexmap_test.go b/storage/inmemory/mutexmap/mutexmap_test.go index 9a44cc33..6cba8db4 100644 --- a/storage/inmemory/mutexmap/mutexmap_test.go +++ b/storage/inmemory/mutexmap/mutexmap_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/flagsets" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/flagsets" ) func TestSplitMutexMapConcurrency(t *testing.T) { diff --git a/storage/inmemory/mutexmap/rulebasedsegment.go b/storage/inmemory/mutexmap/rulebasedsegment.go index fed63723..f972fe3e 100644 --- a/storage/inmemory/mutexmap/rulebasedsegment.go +++ b/storage/inmemory/mutexmap/rulebasedsegment.go @@ -4,8 +4,8 @@ import ( "fmt" "sync" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" "github.com/splitio/go-toolkit/v5/datastructures/set" ) diff --git a/storage/inmemory/mutexmap/rulebasedsegment_test.go b/storage/inmemory/mutexmap/rulebasedsegment_test.go index eb4b9812..6b721cec 100644 --- a/storage/inmemory/mutexmap/rulebasedsegment_test.go +++ b/storage/inmemory/mutexmap/rulebasedsegment_test.go @@ -4,8 +4,8 @@ import ( "sync" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" "github.com/stretchr/testify/assert" ) diff --git a/storage/inmemory/mutexmap/segments_test.go b/storage/inmemory/mutexmap/segments_test.go index 71611f97..1821faff 100644 --- a/storage/inmemory/mutexmap/segments_test.go +++ b/storage/inmemory/mutexmap/segments_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/flagsets" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/flagsets" "github.com/splitio/go-toolkit/v5/datastructures/set" ) diff --git a/storage/inmemory/mutexmap/splits.go b/storage/inmemory/mutexmap/splits.go index bf54ae73..b15b445f 100644 --- a/storage/inmemory/mutexmap/splits.go +++ b/storage/inmemory/mutexmap/splits.go @@ -3,10 +3,10 @@ package mutexmap import ( "sync" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/flagsets" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/flagsets" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/datastructures/set" ) diff --git a/storage/inmemory/mutexmap/splits_test.go b/storage/inmemory/mutexmap/splits_test.go index 5e830a1c..7a5a3a4e 100644 --- a/storage/inmemory/mutexmap/splits_test.go +++ b/storage/inmemory/mutexmap/splits_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/flagsets" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/flagsets" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/stretchr/testify/assert" ) diff --git a/storage/inmemory/mutexqueue/events.go b/storage/inmemory/mutexqueue/events.go index a766b12e..f2ce0d56 100644 --- a/storage/inmemory/mutexqueue/events.go +++ b/storage/inmemory/mutexqueue/events.go @@ -5,9 +5,9 @@ import ( "fmt" "sync" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/storage/inmemory/mutexqueue/events_test.go b/storage/inmemory/mutexqueue/events_test.go index 0fe5ff2f..3bfb448a 100644 --- a/storage/inmemory/mutexqueue/events_test.go +++ b/storage/inmemory/mutexqueue/events_test.go @@ -4,9 +4,9 @@ import ( "strconv" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage/inmemory" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage/inmemory" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/storage/inmemory/mutexqueue/impressions.go b/storage/inmemory/mutexqueue/impressions.go index 92de9509..2084e18c 100644 --- a/storage/inmemory/mutexqueue/impressions.go +++ b/storage/inmemory/mutexqueue/impressions.go @@ -4,9 +4,9 @@ import ( "container/list" "sync" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/storage/inmemory/mutexqueue/impressions_test.go b/storage/inmemory/mutexqueue/impressions_test.go index 3cf5370f..538af42f 100644 --- a/storage/inmemory/mutexqueue/impressions_test.go +++ b/storage/inmemory/mutexqueue/impressions_test.go @@ -4,9 +4,9 @@ import ( "strconv" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage/inmemory" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage/inmemory" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) @@ -14,16 +14,16 @@ func TestMSImpressionsStorage(t *testing.T) { logger := logging.NewLogger(nil) runtimeTelemetry, _ := inmemory.NewTelemetryStorage() - i0 := dtos.Impression{FeatureName: "feature0", BucketingKey: "123", ChangeNumber: 123, KeyName: "k0", Time: 123, Treatment: "i0"} - i1 := dtos.Impression{FeatureName: "feature1", BucketingKey: "123", ChangeNumber: 123, KeyName: "k1", Time: 123, Treatment: "i1"} - i2 := dtos.Impression{FeatureName: "feature2", BucketingKey: "123", ChangeNumber: 123, KeyName: "k2", Time: 123, Treatment: "i2"} - i3 := dtos.Impression{FeatureName: "feature3", BucketingKey: "123", ChangeNumber: 123, KeyName: "k3", Time: 123, Treatment: "i3"} - i4 := dtos.Impression{FeatureName: "feature4", BucketingKey: "123", ChangeNumber: 123, KeyName: "k4", Time: 123, Treatment: "i4"} - i5 := dtos.Impression{FeatureName: "feature5", BucketingKey: "123", ChangeNumber: 123, KeyName: "k5", Time: 123, Treatment: "i5"} - i6 := dtos.Impression{FeatureName: "feature6", BucketingKey: "123", ChangeNumber: 123, KeyName: "k6", Time: 123, Treatment: "i6"} - i7 := dtos.Impression{FeatureName: "feature7", BucketingKey: "123", ChangeNumber: 123, KeyName: "k7", Time: 123, Treatment: "i7"} - i8 := dtos.Impression{FeatureName: "feature8", BucketingKey: "123", ChangeNumber: 123, KeyName: "k8", Time: 123, Treatment: "i8"} - i9 := dtos.Impression{FeatureName: "feature9", BucketingKey: "123", ChangeNumber: 123, KeyName: "k9", Time: 123, Treatment: "i9"} + i0 := dtos.Impression{DefinitionName: "feature0", BucketingKey: "123", ChangeNumber: 123, KeyName: "k0", Time: 123, Treatment: "i0"} + i1 := dtos.Impression{DefinitionName: "feature1", BucketingKey: "123", ChangeNumber: 123, KeyName: "k1", Time: 123, Treatment: "i1"} + i2 := dtos.Impression{DefinitionName: "feature2", BucketingKey: "123", ChangeNumber: 123, KeyName: "k2", Time: 123, Treatment: "i2"} + i3 := dtos.Impression{DefinitionName: "feature3", BucketingKey: "123", ChangeNumber: 123, KeyName: "k3", Time: 123, Treatment: "i3"} + i4 := dtos.Impression{DefinitionName: "feature4", BucketingKey: "123", ChangeNumber: 123, KeyName: "k4", Time: 123, Treatment: "i4"} + i5 := dtos.Impression{DefinitionName: "feature5", BucketingKey: "123", ChangeNumber: 123, KeyName: "k5", Time: 123, Treatment: "i5"} + i6 := dtos.Impression{DefinitionName: "feature6", BucketingKey: "123", ChangeNumber: 123, KeyName: "k6", Time: 123, Treatment: "i6"} + i7 := dtos.Impression{DefinitionName: "feature7", BucketingKey: "123", ChangeNumber: 123, KeyName: "k7", Time: 123, Treatment: "i7"} + i8 := dtos.Impression{DefinitionName: "feature8", BucketingKey: "123", ChangeNumber: 123, KeyName: "k8", Time: 123, Treatment: "i8"} + i9 := dtos.Impression{DefinitionName: "feature9", BucketingKey: "123", ChangeNumber: 123, KeyName: "k9", Time: 123, Treatment: "i9"} isFull := make(chan string, 1) queueSize := 20 @@ -49,8 +49,8 @@ func TestMSImpressionsStorage(t *testing.T) { t.Error("KeyName error") } - if impressions[i].FeatureName != "feature"+strconv.Itoa(i) { - t.Error("FeatureName error") + if impressions[i].DefinitionName != "feature"+strconv.Itoa(i) { + t.Error("DefinitionName error") } if impressions[i].Treatment != "i"+strconv.Itoa(i) { @@ -66,7 +66,7 @@ func TestMSImpressionsStorage(t *testing.T) { func TestMSImpressionsStorageMaxSize(t *testing.T) { logger := logging.NewLogger(nil) runtimeTelemetry, _ := inmemory.NewTelemetryStorage() - impression := dtos.Impression{FeatureName: "feature0", BucketingKey: "123", ChangeNumber: 123, KeyName: "k0", Time: 123, Treatment: "i0"} + impression := dtos.Impression{DefinitionName: "feature0", BucketingKey: "123", ChangeNumber: 123, KeyName: "k0", Time: 123, Treatment: "i0"} isFull := make(chan string, 1) maxSize := 10 diff --git a/storage/inmemory/telemetry.go b/storage/inmemory/telemetry.go index a6b472c8..30ab9326 100644 --- a/storage/inmemory/telemetry.go +++ b/storage/inmemory/telemetry.go @@ -6,9 +6,9 @@ import ( "sync/atomic" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" - constants "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" + constants "github.com/splitio/go-split-commons/v10/telemetry" ) type latencies struct { diff --git a/storage/inmemory/telemetry_test.go b/storage/inmemory/telemetry_test.go index a9f25b68..4be49d5e 100644 --- a/storage/inmemory/telemetry_test.go +++ b/storage/inmemory/telemetry_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/telemetry" ) func TestTelemetryStorage(t *testing.T) { diff --git a/storage/interfaces.go b/storage/interfaces.go index 63c5859f..0d66c2bd 100644 --- a/storage/interfaces.go +++ b/storage/interfaces.go @@ -3,7 +3,7 @@ package storage import ( "time" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/datastructures/set" ) diff --git a/storage/mocks/event.go b/storage/mocks/event.go index bd8d2058..e19df0b4 100644 --- a/storage/mocks/event.go +++ b/storage/mocks/event.go @@ -1,6 +1,6 @@ package mocks -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // MockEventStorage is a mocked implementation of Event Storage type MockEventStorage struct { diff --git a/storage/mocks/impression.go b/storage/mocks/impression.go index 0a75b666..d3f3e242 100644 --- a/storage/mocks/impression.go +++ b/storage/mocks/impression.go @@ -1,6 +1,6 @@ package mocks -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // MockImpressionStorage is a mocked implementation of Impression Storage type MockImpressionStorage struct { diff --git a/storage/mocks/impressionscount.go b/storage/mocks/impressionscount.go index 258cd703..a3269aa5 100644 --- a/storage/mocks/impressionscount.go +++ b/storage/mocks/impressionscount.go @@ -1,6 +1,6 @@ package mocks -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" type MockImpressionsCountStorage struct { RecordImpressionsCountCall func(impressions dtos.ImpressionsCountDTO) error diff --git a/storage/mocks/rulebasedsegment.go b/storage/mocks/rulebasedsegment.go index 80ab4f3e..bf3cec29 100644 --- a/storage/mocks/rulebasedsegment.go +++ b/storage/mocks/rulebasedsegment.go @@ -1,8 +1,8 @@ package mocks import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/stretchr/testify/mock" ) diff --git a/storage/mocks/split.go b/storage/mocks/split.go index b048f52d..8fab67d7 100644 --- a/storage/mocks/split.go +++ b/storage/mocks/split.go @@ -1,8 +1,8 @@ package mocks import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/stretchr/testify/mock" ) diff --git a/storage/mocks/telemetry.go b/storage/mocks/telemetry.go index 63a06099..f85774c4 100644 --- a/storage/mocks/telemetry.go +++ b/storage/mocks/telemetry.go @@ -3,7 +3,7 @@ package mocks import ( "time" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" ) // MockTelemetryStorage is a mocked implementation of Telemetry Storage diff --git a/storage/redis/events.go b/storage/redis/events.go index cf88b082..58a92dfc 100644 --- a/storage/redis/events.go +++ b/storage/redis/events.go @@ -6,7 +6,7 @@ import ( "math" "sync" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/queuecache" "github.com/splitio/go-toolkit/v5/redis" diff --git a/storage/redis/events_test.go b/storage/redis/events_test.go index ef39a90e..429c1b39 100644 --- a/storage/redis/events_test.go +++ b/storage/redis/events_test.go @@ -5,7 +5,7 @@ import ( "errors" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" "github.com/splitio/go-toolkit/v5/redis/mocks" diff --git a/storage/redis/helpers.go b/storage/redis/helpers.go index f4dfdf55..6d00345e 100644 --- a/storage/redis/helpers.go +++ b/storage/redis/helpers.go @@ -5,8 +5,8 @@ import ( "fmt" "strings" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/flagsets" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/flagsets" "github.com/splitio/go-toolkit/v5/redis" ) diff --git a/storage/redis/impressions.go b/storage/redis/impressions.go index acd53fb6..513cd69f 100644 --- a/storage/redis/impressions.go +++ b/storage/redis/impressions.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" ) diff --git a/storage/redis/impressions_test.go b/storage/redis/impressions_test.go index 04f96245..1d321bf1 100644 --- a/storage/redis/impressions_test.go +++ b/storage/redis/impressions_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" "github.com/splitio/go-toolkit/v5/redis/mocks" @@ -30,13 +30,13 @@ func TestLogImpressionsError(t *testing.T) { impressionStorage := NewImpressionStorage(mockPrefixedClient, dtos.Metadata{}, logging.NewLogger(&logging.LoggerOptions{})) impression := dtos.Impression{ - BucketingKey: "someBuck", - ChangeNumber: 123456789, - FeatureName: "someFeature", - KeyName: "someKey", - Label: "someLabel", - Time: 123456789, - Treatment: "someTreatment", + BucketingKey: "someBuck", + ChangeNumber: 123456789, + DefinitionName: "someFeature", + KeyName: "someKey", + Label: "someLabel", + Time: 123456789, + Treatment: "someTreatment", } err := impressionStorage.LogImpressions([]dtos.Impression{impression}) @@ -74,13 +74,13 @@ func TestLogImpressions(t *testing.T) { impressionStorage := NewImpressionStorage(mockPrefixedClient, dtos.Metadata{}, logging.NewLogger(&logging.LoggerOptions{})) impression := dtos.Impression{ - BucketingKey: "someBuck", - ChangeNumber: 123456789, - FeatureName: "someFeature", - KeyName: "someKey", - Label: "someLabel", - Time: 123456789, - Treatment: "someTreatment", + BucketingKey: "someBuck", + ChangeNumber: 123456789, + DefinitionName: "someFeature", + KeyName: "someKey", + Label: "someLabel", + Time: 123456789, + Treatment: "someTreatment", } err := impressionStorage.LogImpressions([]dtos.Impression{impression}) @@ -91,13 +91,13 @@ func TestLogImpressions(t *testing.T) { func wrapImpression(feature string) dtos.Impression { return dtos.Impression{ - BucketingKey: "someBucketingKey", - ChangeNumber: 123456789, - KeyName: "someKey", - Label: "someLabel", - Time: 123456789, - Treatment: "someTreatment", - FeatureName: feature, + BucketingKey: "someBucketingKey", + ChangeNumber: 123456789, + KeyName: "someKey", + Label: "someLabel", + Time: 123456789, + Treatment: "someTreatment", + DefinitionName: feature, } } diff --git a/storage/redis/impressionscount.go b/storage/redis/impressionscount.go index 419dfd94..b934fc9e 100644 --- a/storage/redis/impressionscount.go +++ b/storage/redis/impressionscount.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" ) diff --git a/storage/redis/impressionscount_test.go b/storage/redis/impressionscount_test.go index 36801bf4..b03da1fb 100644 --- a/storage/redis/impressionscount_test.go +++ b/storage/redis/impressionscount_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" "github.com/splitio/go-toolkit/v5/redis/mocks" diff --git a/storage/redis/redis.go b/storage/redis/redis.go index e3fb78ad..c3404315 100644 --- a/storage/redis/redis.go +++ b/storage/redis/redis.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/splitio/go-split-commons/v9/conf" + "github.com/splitio/go-split-commons/v10/conf" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" ) diff --git a/storage/redis/redis_test.go b/storage/redis/redis_test.go index 374d21ea..7e404b5b 100644 --- a/storage/redis/redis_test.go +++ b/storage/redis/redis_test.go @@ -5,7 +5,7 @@ import ( "net" "testing" - "github.com/splitio/go-split-commons/v9/conf" + "github.com/splitio/go-split-commons/v10/conf" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/storage/redis/rulebasedsegment_test.go b/storage/redis/rulebasedsegment_test.go index c3c85848..d9e027ae 100644 --- a/storage/redis/rulebasedsegment_test.go +++ b/storage/redis/rulebasedsegment_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" diff --git a/storage/redis/rulebasedsegments.go b/storage/redis/rulebasedsegments.go index 18c5de89..190145f8 100644 --- a/storage/redis/rulebasedsegments.go +++ b/storage/redis/rulebasedsegments.go @@ -8,9 +8,9 @@ import ( "strings" "sync" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" diff --git a/storage/redis/segments.go b/storage/redis/segments.go index 921bac27..c480ae95 100644 --- a/storage/redis/segments.go +++ b/storage/redis/segments.go @@ -6,7 +6,7 @@ import ( "strings" "sync" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" diff --git a/storage/redis/splits.go b/storage/redis/splits.go index d2801661..e6d31391 100644 --- a/storage/redis/splits.go +++ b/storage/redis/splits.go @@ -8,10 +8,10 @@ import ( "strings" "sync" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/flagsets" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/flagsets" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" diff --git a/storage/redis/splits_test.go b/storage/redis/splits_test.go index dcc32c1a..217eee58 100644 --- a/storage/redis/splits_test.go +++ b/storage/redis/splits_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/flagsets" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/flagsets" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" diff --git a/storage/redis/telemetry.go b/storage/redis/telemetry.go index 9a7753f9..73ea6801 100644 --- a/storage/redis/telemetry.go +++ b/storage/redis/telemetry.go @@ -7,9 +7,9 @@ import ( "strings" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" ) diff --git a/storage/redis/telemetry_test.go b/storage/redis/telemetry_test.go index fafcfd96..b52228a0 100644 --- a/storage/redis/telemetry_test.go +++ b/storage/redis/telemetry_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" "github.com/splitio/go-toolkit/v5/redis/mocks" diff --git a/storage/redis/uniquekeys.go b/storage/redis/uniquekeys.go index 6ac925fa..92e965a5 100644 --- a/storage/redis/uniquekeys.go +++ b/storage/redis/uniquekeys.go @@ -3,7 +3,7 @@ package redis import ( "sync" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" ) diff --git a/storage/redis/uniquekeys_test.go b/storage/redis/uniquekeys_test.go index 542bab8f..dfe18791 100644 --- a/storage/redis/uniquekeys_test.go +++ b/storage/redis/uniquekeys_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/redis" "github.com/splitio/go-toolkit/v5/redis/mocks" diff --git a/synchronizer/local.go b/synchronizer/local.go index 6419bb45..eee5d86d 100644 --- a/synchronizer/local.go +++ b/synchronizer/local.go @@ -3,16 +3,16 @@ package synchronizer import ( "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/flagsets" - "github.com/splitio/go-split-commons/v9/healthcheck/application" - "github.com/splitio/go-split-commons/v9/service/api" - "github.com/splitio/go-split-commons/v9/service/api/specs" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/segment" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/split" - "github.com/splitio/go-split-commons/v9/tasks" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/flagsets" + "github.com/splitio/go-split-commons/v10/healthcheck/application" + "github.com/splitio/go-split-commons/v10/service/api" + "github.com/splitio/go-split-commons/v10/service/api/specs" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/segment" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/split" + "github.com/splitio/go-split-commons/v10/tasks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/synchronizer/local_test.go b/synchronizer/local_test.go index 9ef8e8bf..b09085b7 100644 --- a/synchronizer/local_test.go +++ b/synchronizer/local_test.go @@ -5,17 +5,17 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/flagsets" - hcMock "github.com/splitio/go-split-commons/v9/healthcheck/mocks" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/api" - "github.com/splitio/go-split-commons/v9/service/api/specs" - httpMocks "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/split" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/flagsets" + hcMock "github.com/splitio/go-split-commons/v10/healthcheck/mocks" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/api" + "github.com/splitio/go-split-commons/v10/service/api/specs" + httpMocks "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/split" "github.com/splitio/go-toolkit/v5/logging" diff --git a/synchronizer/manager.go b/synchronizer/manager.go index dbb7cf2d..8a26679f 100644 --- a/synchronizer/manager.go +++ b/synchronizer/manager.go @@ -6,13 +6,13 @@ import ( "sync/atomic" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - hc "github.com/splitio/go-split-commons/v9/healthcheck/application" - "github.com/splitio/go-split-commons/v9/push" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + hc "github.com/splitio/go-split-commons/v10/healthcheck/application" + "github.com/splitio/go-split-commons/v10/push" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/backoff" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/struct/traits/lifecycle" diff --git a/synchronizer/manager_test.go b/synchronizer/manager_test.go index b5860535..aa5f2cfb 100644 --- a/synchronizer/manager_test.go +++ b/synchronizer/manager_test.go @@ -6,16 +6,16 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/healthcheck/application" - hcMock "github.com/splitio/go-split-commons/v9/healthcheck/mocks" - "github.com/splitio/go-split-commons/v9/push" - pushMocks "github.com/splitio/go-split-commons/v9/push/mocks" - apiMocks "github.com/splitio/go-split-commons/v9/service/mocks" - storageMocks "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/synchronizer/mocks" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/healthcheck/application" + hcMock "github.com/splitio/go-split-commons/v10/healthcheck/mocks" + "github.com/splitio/go-split-commons/v10/push" + pushMocks "github.com/splitio/go-split-commons/v10/push/mocks" + apiMocks "github.com/splitio/go-split-commons/v10/service/mocks" + storageMocks "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/synchronizer/mocks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/synchronizer/mocks/mocks.go b/synchronizer/mocks/mocks.go index 8e7eca77..fd02da2e 100644 --- a/synchronizer/mocks/mocks.go +++ b/synchronizer/mocks/mocks.go @@ -3,7 +3,7 @@ package mocks import ( "time" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/dtos" ) // MockSynchronizer mock implementation diff --git a/synchronizer/mocks/workers.go b/synchronizer/mocks/workers.go index 2f987d72..3fe1edbd 100644 --- a/synchronizer/mocks/workers.go +++ b/synchronizer/mocks/workers.go @@ -1,12 +1,12 @@ package mocks import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/event" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/impression" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/largesegment" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/segment" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/split" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/event" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/impression" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/largesegment" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/segment" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/split" "github.com/stretchr/testify/mock" ) diff --git a/synchronizer/redis_test.go b/synchronizer/redis_test.go index 9a07af7f..b2e77ddd 100644 --- a/synchronizer/redis_test.go +++ b/synchronizer/redis_test.go @@ -3,7 +3,7 @@ package synchronizer import ( "testing" - "github.com/splitio/go-split-commons/v9/synchronizer/mocks" + "github.com/splitio/go-split-commons/v10/synchronizer/mocks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/synchronizer/synchronizer.go b/synchronizer/synchronizer.go index 6b2ba3ae..6857062a 100644 --- a/synchronizer/synchronizer.go +++ b/synchronizer/synchronizer.go @@ -3,16 +3,16 @@ package synchronizer import ( "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/event" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/impression" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/impressionscount" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/largesegment" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/segment" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/split" - "github.com/splitio/go-split-commons/v9/tasks" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/event" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/impression" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/impressionscount" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/largesegment" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/segment" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/split" + "github.com/splitio/go-split-commons/v10/tasks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/asynctask" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/sync" diff --git a/synchronizer/synchronizer_test.go b/synchronizer/synchronizer_test.go index 5b385bcc..dd96e493 100644 --- a/synchronizer/synchronizer_test.go +++ b/synchronizer/synchronizer_test.go @@ -7,28 +7,28 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/flagsets" - hcMock "github.com/splitio/go-split-commons/v9/healthcheck/mocks" - "github.com/splitio/go-split-commons/v9/push" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/api" - "github.com/splitio/go-split-commons/v9/service/api/specs" - httpMocks "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/mocks" - storageMock "github.com/splitio/go-split-commons/v9/storage/mocks" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/flagsets" + hcMock "github.com/splitio/go-split-commons/v10/healthcheck/mocks" + "github.com/splitio/go-split-commons/v10/push" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/api" + "github.com/splitio/go-split-commons/v10/service/api/specs" + httpMocks "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/mocks" + storageMock "github.com/splitio/go-split-commons/v10/storage/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - syncMocks "github.com/splitio/go-split-commons/v9/synchronizer/mocks" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/event" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/impression" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/segment" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/split" - "github.com/splitio/go-split-commons/v9/tasks" - "github.com/splitio/go-split-commons/v9/telemetry" + syncMocks "github.com/splitio/go-split-commons/v10/synchronizer/mocks" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/event" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/impression" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/segment" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/split" + "github.com/splitio/go-split-commons/v10/tasks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/datastructures/set" @@ -376,13 +376,13 @@ func TestPeriodicRecording(t *testing.T) { PopNCall: func(n int64) ([]dtos.Impression, error) { assert.Equal(t, int64(100), n) return []dtos.Impression{{ - BucketingKey: "someBucketingKey", - ChangeNumber: 123456789, - FeatureName: "someFeature", - KeyName: "someKey", - Label: "someLabel", - Time: 123456789, - Treatment: "someTreatment", + BucketingKey: "someBucketingKey", + ChangeNumber: 123456789, + DefinitionName: "someFeature", + KeyName: "someKey", + Label: "someLabel", + Time: 123456789, + Treatment: "someTreatment", }}, nil }, EmptyCall: func() bool { return atomic.LoadInt64(&impressionsCalled) != 1 }, diff --git a/synchronizer/worker/event/single.go b/synchronizer/worker/event/single.go index 2e976c36..3942aa03 100644 --- a/synchronizer/worker/event/single.go +++ b/synchronizer/worker/event/single.go @@ -4,10 +4,10 @@ import ( "errors" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/synchronizer/worker/event/single_test.go b/synchronizer/worker/event/single_test.go index 46cc77ac..ffd867b3 100644 --- a/synchronizer/worker/event/single_test.go +++ b/synchronizer/worker/event/single_test.go @@ -10,14 +10,14 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service/api" - recorderMock "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/inmemory" - "github.com/splitio/go-split-commons/v9/storage/inmemory/mutexqueue" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service/api" + recorderMock "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/inmemory" + "github.com/splitio/go-split-commons/v10/storage/inmemory/mutexqueue" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/synchronizer/worker/impression/redis.go b/synchronizer/worker/impression/redis.go index f86248c6..3aa406de 100644 --- a/synchronizer/worker/impression/redis.go +++ b/synchronizer/worker/impression/redis.go @@ -3,7 +3,7 @@ package impression import ( "errors" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/synchronizer/worker/impression/redis_test.go b/synchronizer/worker/impression/redis_test.go index 5f7cf4a3..b14d7095 100644 --- a/synchronizer/worker/impression/redis_test.go +++ b/synchronizer/worker/impression/redis_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage/mocks" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage/mocks" "github.com/splitio/go-toolkit/v5/logging" ) @@ -16,13 +16,13 @@ func getImpressions(amount int) []dtos.Impression { i := 1 for i <= amount { impressions = append(impressions, dtos.Impression{ - BucketingKey: fmt.Sprintf("someBucketingKey%d", i), - ChangeNumber: 123456789, - FeatureName: fmt.Sprintf("someFeature%d", i), - KeyName: fmt.Sprintf("someKey%d", i), - Label: "someLabel", - Time: 123456789, - Treatment: fmt.Sprintf("someTreatment%d", i), + BucketingKey: fmt.Sprintf("someBucketingKey%d", i), + ChangeNumber: 123456789, + DefinitionName: fmt.Sprintf("someFeature%d", i), + KeyName: fmt.Sprintf("someKey%d", i), + Label: "someLabel", + Time: 123456789, + Treatment: fmt.Sprintf("someTreatment%d", i), }) i++ diff --git a/synchronizer/worker/impression/single.go b/synchronizer/worker/impression/single.go index a63d7c12..84d17473 100644 --- a/synchronizer/worker/impression/single.go +++ b/synchronizer/worker/impression/single.go @@ -4,10 +4,10 @@ import ( "errors" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) @@ -75,14 +75,15 @@ func (i *RecorderSingle) SynchronizeImpressions(bulkSize int64) error { BucketingKey: impression.BucketingKey, Pt: impression.Pt, Properties: impression.Properties, + EntityType: impression.EntityType, } - v, ok := impressionsToPost[impression.FeatureName] + v, ok := impressionsToPost[impression.DefinitionName] if ok { v = append(v, keyImpression) } else { v = []dtos.ImpressionDTO{keyImpression} } - impressionsToPost[impression.FeatureName] = v + impressionsToPost[impression.DefinitionName] = v } bulkImpressions := make([]dtos.ImpressionsDTO, 0) diff --git a/synchronizer/worker/impression/single_test.go b/synchronizer/worker/impression/single_test.go index c4eb73b5..9d73b58a 100644 --- a/synchronizer/worker/impression/single_test.go +++ b/synchronizer/worker/impression/single_test.go @@ -10,14 +10,14 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service/api" - recorderMock "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/inmemory" - "github.com/splitio/go-split-commons/v9/storage/inmemory/mutexqueue" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service/api" + recorderMock "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/inmemory" + "github.com/splitio/go-split-commons/v10/storage/inmemory/mutexqueue" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" "github.com/stretchr/testify/assert" ) @@ -64,7 +64,7 @@ func TestImpressionRecorderWithoutImpressions(t *testing.T) { func TestSynhronizeEventErrorRecorder(t *testing.T) { impression := dtos.Impression{ - BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, FeatureName: "someFeature1", Properties: "{'prop':'val'}", + BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, DefinitionName: "someFeature1", Properties: "{'prop':'val'}", KeyName: "someKey1", Label: "someLabel", Time: 123456789, Treatment: "someTreatment1", } @@ -104,11 +104,11 @@ func TestSynhronizeEventErrorRecorder(t *testing.T) { func TestImpressionRecorder(t *testing.T) { before := time.Now().UTC() impression1 := dtos.Impression{ - BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, FeatureName: "someFeature1", + BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, DefinitionName: "someFeature1", KeyName: "someKey1", Label: "someLabel", Time: 123456789, Treatment: "someTreatment1", Properties: "{'prop':'val'}", } impression2 := dtos.Impression{ - BucketingKey: "someBucketingKey2", ChangeNumber: 123456789, FeatureName: "someFeature2", + BucketingKey: "someBucketingKey2", ChangeNumber: 123456789, DefinitionName: "someFeature2", KeyName: "someKey2", Label: "someLabel", Time: 123456789, Treatment: "someTreatment2", } @@ -228,15 +228,15 @@ func TestImpressionRecorderSync(t *testing.T) { impressionRecorder := api.NewHTTPImpressionRecorder("", conf.AdvancedConfig{EventsURL: ts.URL}, logger) impression1 := dtos.Impression{ - BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, FeatureName: "someFeature1", + BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, DefinitionName: "someFeature1", KeyName: "someKey1", Label: "someLabel", Time: 123456789, Treatment: "someTreatment1", Properties: "{'prop':'val'}", } impression2 := dtos.Impression{ - BucketingKey: "someBucketingKey2", ChangeNumber: 123456789, FeatureName: "someFeature2", + BucketingKey: "someBucketingKey2", ChangeNumber: 123456789, DefinitionName: "someFeature2", KeyName: "someKey2", Label: "someLabel", Time: 123456789, Treatment: "someTreatment2", } impression3 := dtos.Impression{ - BucketingKey: "someBucketingKey3", ChangeNumber: 123456789, FeatureName: "someFeature1", + BucketingKey: "someBucketingKey3", ChangeNumber: 123456789, DefinitionName: "someFeature1", KeyName: "someKey3", Label: "someLabel", Time: 123456789, Treatment: "someTreatment3", } @@ -311,7 +311,7 @@ func TestImpressionLastSeen(t *testing.T) { impressionRecorder := api.NewHTTPImpressionRecorder("", conf.AdvancedConfig{EventsURL: ts.URL}, logger) impression1 := dtos.Impression{ - BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, FeatureName: "someFeature1", + BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, DefinitionName: "someFeature1", KeyName: "someKey1", Label: "someLabel", Time: 123456789, Treatment: "someTreatment1", } diff --git a/synchronizer/worker/impressionscount/redis.go b/synchronizer/worker/impressionscount/redis.go index 9d9a8972..d2c97049 100644 --- a/synchronizer/worker/impressionscount/redis.go +++ b/synchronizer/worker/impressionscount/redis.go @@ -1,8 +1,8 @@ package impressionscount import ( - "github.com/splitio/go-split-commons/v9/provisional/strategy" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/provisional/strategy" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/synchronizer/worker/impressionscount/redis_test.go b/synchronizer/worker/impressionscount/redis_test.go index d718a4cc..cfd32222 100644 --- a/synchronizer/worker/impressionscount/redis_test.go +++ b/synchronizer/worker/impressionscount/redis_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/provisional/strategy" - "github.com/splitio/go-split-commons/v9/storage/mocks" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/provisional/strategy" + "github.com/splitio/go-split-commons/v10/storage/mocks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/synchronizer/worker/impressionscount/single.go b/synchronizer/worker/impressionscount/single.go index fbc053b6..0ff98eaf 100644 --- a/synchronizer/worker/impressionscount/single.go +++ b/synchronizer/worker/impressionscount/single.go @@ -3,11 +3,11 @@ package impressionscount import ( "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/provisional/strategy" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/provisional/strategy" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) @@ -65,7 +65,7 @@ func impressionsCountMapper(impressionsCount map[strategy.Key]int64) dtos.Impres impressionsInTimeFrame := make([]dtos.ImpressionsInTimeFrameDTO, 0) for key, count := range impressionsCount { impressionInTimeFrame := dtos.ImpressionsInTimeFrameDTO{ - FeatureName: key.FeatureName, + FeatureName: key.DefinitionName, RawCount: count, TimeFrame: key.TimeFrame, } diff --git a/synchronizer/worker/impressionscount/single_test.go b/synchronizer/worker/impressionscount/single_test.go index 0de2bf13..0498e220 100644 --- a/synchronizer/worker/impressionscount/single_test.go +++ b/synchronizer/worker/impressionscount/single_test.go @@ -4,12 +4,12 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/provisional/strategy" - "github.com/splitio/go-split-commons/v9/service/mocks" - st "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/telemetry" - "github.com/splitio/go-split-commons/v9/util" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/provisional/strategy" + "github.com/splitio/go-split-commons/v10/service/mocks" + st "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/telemetry" + "github.com/splitio/go-split-commons/v10/util" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/synchronizer/worker/largesegment/largesegment.go b/synchronizer/worker/largesegment/largesegment.go index 1c77a1d9..3648402f 100644 --- a/synchronizer/worker/largesegment/largesegment.go +++ b/synchronizer/worker/largesegment/largesegment.go @@ -7,11 +7,11 @@ import ( "sync" "time" - "github.com/splitio/go-split-commons/v9/dtos" - hc "github.com/splitio/go-split-commons/v9/healthcheck/application" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/utils" + "github.com/splitio/go-split-commons/v10/dtos" + hc "github.com/splitio/go-split-commons/v10/healthcheck/application" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/utils" "github.com/splitio/go-toolkit/v5/backoff" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" diff --git a/synchronizer/worker/largesegment/largesegment_test.go b/synchronizer/worker/largesegment/largesegment_test.go index 319c71bf..a1007ed2 100644 --- a/synchronizer/worker/largesegment/largesegment_test.go +++ b/synchronizer/worker/largesegment/largesegment_test.go @@ -9,13 +9,13 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - hcMock "github.com/splitio/go-split-commons/v9/healthcheck/mocks" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/api/specs" - fetcherMock "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/inmemory/mutexmap" - "github.com/splitio/go-split-commons/v9/storage/mocks" + "github.com/splitio/go-split-commons/v10/dtos" + hcMock "github.com/splitio/go-split-commons/v10/healthcheck/mocks" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/api/specs" + fetcherMock "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/inmemory/mutexmap" + "github.com/splitio/go-split-commons/v10/storage/mocks" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/synchronizer/worker/segment/segment.go b/synchronizer/worker/segment/segment.go index 626109c9..66832c12 100644 --- a/synchronizer/worker/segment/segment.go +++ b/synchronizer/worker/segment/segment.go @@ -6,12 +6,12 @@ import ( "sync" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/healthcheck/application" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/utils" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/healthcheck/application" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/utils" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/backoff" "github.com/splitio/go-toolkit/v5/common" diff --git a/synchronizer/worker/segment/segment_test.go b/synchronizer/worker/segment/segment_test.go index 92f4fe04..7ae28293 100644 --- a/synchronizer/worker/segment/segment_test.go +++ b/synchronizer/worker/segment/segment_test.go @@ -8,17 +8,17 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/flagsets" - "github.com/splitio/go-split-commons/v9/healthcheck/application" - hcMock "github.com/splitio/go-split-commons/v9/healthcheck/mocks" - "github.com/splitio/go-split-commons/v9/service" - fetcherMock "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/inmemory" - "github.com/splitio/go-split-commons/v9/storage/inmemory/mutexmap" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/flagsets" + "github.com/splitio/go-split-commons/v10/healthcheck/application" + hcMock "github.com/splitio/go-split-commons/v10/healthcheck/mocks" + "github.com/splitio/go-split-commons/v10/service" + fetcherMock "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/inmemory" + "github.com/splitio/go-split-commons/v10/storage/inmemory/mutexmap" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" diff --git a/synchronizer/worker/split/split.go b/synchronizer/worker/split/split.go index b5067ee1..785fc2ae 100644 --- a/synchronizer/worker/split/split.go +++ b/synchronizer/worker/split/split.go @@ -6,16 +6,16 @@ import ( "net/http" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/engine/validator" - "github.com/splitio/go-split-commons/v9/flagsets" - "github.com/splitio/go-split-commons/v9/healthcheck/application" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/api/specs" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/engine/validator" + "github.com/splitio/go-split-commons/v10/flagsets" + "github.com/splitio/go-split-commons/v10/healthcheck/application" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/api/specs" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/backoff" "github.com/splitio/go-toolkit/v5/common" diff --git a/synchronizer/worker/split/split_test.go b/synchronizer/worker/split/split_test.go index ffe107c9..953bb62d 100644 --- a/synchronizer/worker/split/split_test.go +++ b/synchronizer/worker/split/split_test.go @@ -6,18 +6,18 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/flagsets" - hcMock "github.com/splitio/go-split-commons/v9/healthcheck/mocks" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/service/api/specs" - fetcherMock "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/inmemory" - "github.com/splitio/go-split-commons/v9/storage/inmemory/mutexmap" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/flagsets" + hcMock "github.com/splitio/go-split-commons/v10/healthcheck/mocks" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/service/api/specs" + fetcherMock "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/inmemory" + "github.com/splitio/go-split-commons/v10/storage/inmemory/mutexmap" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/common" "github.com/splitio/go-toolkit/v5/logging" diff --git a/tasks/cleanfiltersync.go b/tasks/cleanfiltersync.go index 598c33c5..80ed4509 100644 --- a/tasks/cleanfiltersync.go +++ b/tasks/cleanfiltersync.go @@ -1,7 +1,7 @@ package tasks import ( - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/asynctask" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/cleanfiltersync_test.go b/tasks/cleanfiltersync_test.go index db468782..2c692444 100644 --- a/tasks/cleanfiltersync_test.go +++ b/tasks/cleanfiltersync_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - st "github.com/splitio/go-split-commons/v9/storage/mocks" + st "github.com/splitio/go-split-commons/v10/storage/mocks" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/eventsync.go b/tasks/eventsync.go index 725c345d..b437ad19 100644 --- a/tasks/eventsync.go +++ b/tasks/eventsync.go @@ -3,7 +3,7 @@ package tasks import ( "fmt" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/event" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/event" "github.com/splitio/go-toolkit/v5/asynctask" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/eventsync_test.go b/tasks/eventsync_test.go index a25e80a5..a5423e89 100644 --- a/tasks/eventsync_test.go +++ b/tasks/eventsync_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - recorderMock "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/event" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + recorderMock "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/event" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/impressionscountsync.go b/tasks/impressionscountsync.go index 179b97cb..51e2ae1d 100644 --- a/tasks/impressionscountsync.go +++ b/tasks/impressionscountsync.go @@ -1,7 +1,7 @@ package tasks import ( - "github.com/splitio/go-split-commons/v9/synchronizer/worker/impressionscount" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/impressionscount" "github.com/splitio/go-toolkit/v5/asynctask" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/impressionscountsync_test.go b/tasks/impressionscountsync_test.go index 4011ea1d..ab25ac54 100644 --- a/tasks/impressionscountsync_test.go +++ b/tasks/impressionscountsync_test.go @@ -4,12 +4,12 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/provisional/strategy" - "github.com/splitio/go-split-commons/v9/service/mocks" - st "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/impressionscount" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/provisional/strategy" + "github.com/splitio/go-split-commons/v10/service/mocks" + st "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/impressionscount" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/impressionsync.go b/tasks/impressionsync.go index c93883b0..6cb30ad5 100644 --- a/tasks/impressionsync.go +++ b/tasks/impressionsync.go @@ -3,7 +3,7 @@ package tasks import ( "fmt" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/impression" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/impression" "github.com/splitio/go-toolkit/v5/asynctask" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/impressionsync_test.go b/tasks/impressionsync_test.go index 9c403a64..dcf8e76a 100644 --- a/tasks/impressionsync_test.go +++ b/tasks/impressionsync_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - recorderMock "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/impression" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + recorderMock "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/impression" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" ) @@ -18,19 +18,19 @@ func TestImpressionSyncTask(t *testing.T) { call := 0 logger := logging.NewLogger(&logging.LoggerOptions{}) impression1 := dtos.Impression{ - BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, FeatureName: "someFeature1", + BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, DefinitionName: "someFeature1", KeyName: "someKey1", Label: "someLabel", Time: 123456789, Treatment: "someTreatment1", } impression2 := dtos.Impression{ - BucketingKey: "someBucketingKey2", ChangeNumber: 123456789, FeatureName: "someFeature2", + BucketingKey: "someBucketingKey2", ChangeNumber: 123456789, DefinitionName: "someFeature2", KeyName: "someKey2", Label: "someLabel", Time: 123456789, Treatment: "someTreatment2", } impression3 := dtos.Impression{ - BucketingKey: "someBucketingKey3", ChangeNumber: 123456789, FeatureName: "someFeature3", + BucketingKey: "someBucketingKey3", ChangeNumber: 123456789, DefinitionName: "someFeature3", KeyName: "someKey3", Label: "someLabel", Time: 123456789, Treatment: "someTreatment3", } impression4 := dtos.Impression{ - BucketingKey: "someBucketingKey3", ChangeNumber: 123456789, FeatureName: "someFeature2", + BucketingKey: "someBucketingKey3", ChangeNumber: 123456789, DefinitionName: "someFeature2", KeyName: "someKey22", Label: "someLabel", Time: 123456789, Treatment: "someTreatment3", } @@ -113,15 +113,15 @@ func TestImpressionSyncTaskMultiple(t *testing.T) { var call int64 logger := logging.NewLogger(&logging.LoggerOptions{}) impression1 := dtos.Impression{ - BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, FeatureName: "someFeature1", + BucketingKey: "someBucketingKey1", ChangeNumber: 123456789, DefinitionName: "someFeature1", KeyName: "someKey1", Label: "someLabel", Time: 123456789, Treatment: "someTreatment1", } impression2 := dtos.Impression{ - BucketingKey: "someBucketingKey2", ChangeNumber: 123456789, FeatureName: "someFeature2", + BucketingKey: "someBucketingKey2", ChangeNumber: 123456789, DefinitionName: "someFeature2", KeyName: "someKey2", Label: "someLabel", Time: 123456789, Treatment: "someTreatment2", } impression3 := dtos.Impression{ - BucketingKey: "someBucketingKey3", ChangeNumber: 123456789, FeatureName: "someFeature3", + BucketingKey: "someBucketingKey3", ChangeNumber: 123456789, DefinitionName: "someFeature3", KeyName: "someKey3", Label: "someLabel", Time: 123456789, Treatment: "someTreatment3", } diff --git a/tasks/largesegmentsync.go b/tasks/largesegmentsync.go index 17585409..10185f18 100644 --- a/tasks/largesegmentsync.go +++ b/tasks/largesegmentsync.go @@ -5,9 +5,9 @@ import ( "fmt" "sync/atomic" - hc "github.com/splitio/go-split-commons/v9/healthcheck/application" - "github.com/splitio/go-split-commons/v9/storage" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/largesegment" + hc "github.com/splitio/go-split-commons/v10/healthcheck/application" + "github.com/splitio/go-split-commons/v10/storage" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/largesegment" "github.com/splitio/go-toolkit/v5/asynctask" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/workerpool" diff --git a/tasks/largesegmentsync_test.go b/tasks/largesegmentsync_test.go index 3d2d3b86..ed96453c 100644 --- a/tasks/largesegmentsync_test.go +++ b/tasks/largesegmentsync_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - hcMock "github.com/splitio/go-split-commons/v9/healthcheck/mocks" - "github.com/splitio/go-split-commons/v9/storage/mocks" - syncMocks "github.com/splitio/go-split-commons/v9/synchronizer/mocks" + hcMock "github.com/splitio/go-split-commons/v10/healthcheck/mocks" + "github.com/splitio/go-split-commons/v10/storage/mocks" + syncMocks "github.com/splitio/go-split-commons/v10/synchronizer/mocks" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" diff --git a/tasks/segmentsync.go b/tasks/segmentsync.go index bd95f01a..e352f9a9 100644 --- a/tasks/segmentsync.go +++ b/tasks/segmentsync.go @@ -5,8 +5,8 @@ import ( "fmt" "sync/atomic" - healthcheck "github.com/splitio/go-split-commons/v9/healthcheck/application" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/segment" + healthcheck "github.com/splitio/go-split-commons/v10/healthcheck/application" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/segment" "github.com/splitio/go-toolkit/v5/asynctask" "github.com/splitio/go-toolkit/v5/logging" "github.com/splitio/go-toolkit/v5/workerpool" diff --git a/tasks/segmentsync_test.go b/tasks/segmentsync_test.go index 2c8c5544..0892541b 100644 --- a/tasks/segmentsync_test.go +++ b/tasks/segmentsync_test.go @@ -5,13 +5,13 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - hcMock "github.com/splitio/go-split-commons/v9/healthcheck/mocks" - "github.com/splitio/go-split-commons/v9/service" - fetcherMock "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/segment" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + hcMock "github.com/splitio/go-split-commons/v10/healthcheck/mocks" + "github.com/splitio/go-split-commons/v10/service" + fetcherMock "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/segment" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/splitsync.go b/tasks/splitsync.go index 6a6b2317..99b54ea9 100644 --- a/tasks/splitsync.go +++ b/tasks/splitsync.go @@ -1,7 +1,7 @@ package tasks import ( - "github.com/splitio/go-split-commons/v9/synchronizer/worker/split" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/split" "github.com/splitio/go-toolkit/v5/asynctask" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/splitsync_test.go b/tasks/splitsync_test.go index 5134b813..14059ded 100644 --- a/tasks/splitsync_test.go +++ b/tasks/splitsync_test.go @@ -4,16 +4,16 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/engine/grammar" - "github.com/splitio/go-split-commons/v9/engine/grammar/constants" - "github.com/splitio/go-split-commons/v9/flagsets" - hcMock "github.com/splitio/go-split-commons/v9/healthcheck/mocks" - "github.com/splitio/go-split-commons/v9/service/api/specs" - fetcherMock "github.com/splitio/go-split-commons/v9/service/mocks" - "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/synchronizer/worker/split" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/engine/grammar" + "github.com/splitio/go-split-commons/v10/engine/grammar/constants" + "github.com/splitio/go-split-commons/v10/flagsets" + hcMock "github.com/splitio/go-split-commons/v10/healthcheck/mocks" + "github.com/splitio/go-split-commons/v10/service/api/specs" + fetcherMock "github.com/splitio/go-split-commons/v10/service/mocks" + "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/synchronizer/worker/split" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/logging" "github.com/stretchr/testify/assert" diff --git a/tasks/telemetrysync.go b/tasks/telemetrysync.go index 7d529ee0..cc9ad8a0 100644 --- a/tasks/telemetrysync.go +++ b/tasks/telemetrysync.go @@ -1,7 +1,7 @@ package tasks import ( - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/asynctask" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/telemetrysync_test.go b/tasks/telemetrysync_test.go index f928b9dc..cbc933a5 100644 --- a/tasks/telemetrysync_test.go +++ b/tasks/telemetrysync_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service/mocks" - st "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service/mocks" + st "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/uniquekeyssync.go b/tasks/uniquekeyssync.go index 37fa1be3..67933f74 100644 --- a/tasks/uniquekeyssync.go +++ b/tasks/uniquekeyssync.go @@ -1,8 +1,8 @@ package tasks import ( - "github.com/splitio/go-split-commons/v9/provisional/strategy" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/provisional/strategy" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/asynctask" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/tasks/uniquekeyssync_test.go b/tasks/uniquekeyssync_test.go index daa736d6..68f37db7 100644 --- a/tasks/uniquekeyssync_test.go +++ b/tasks/uniquekeyssync_test.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/provisional/strategy" - "github.com/splitio/go-split-commons/v9/service/mocks" - st "github.com/splitio/go-split-commons/v9/storage/mocks" - "github.com/splitio/go-split-commons/v9/telemetry" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/provisional/strategy" + "github.com/splitio/go-split-commons/v10/service/mocks" + st "github.com/splitio/go-split-commons/v10/storage/mocks" + "github.com/splitio/go-split-commons/v10/telemetry" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/telemetry/constants.go b/telemetry/constants.go index 3f76ff64..aec7f4ca 100644 --- a/telemetry/constants.go +++ b/telemetry/constants.go @@ -1,6 +1,6 @@ package telemetry -import "github.com/splitio/go-split-commons/v9/conf" +import "github.com/splitio/go-split-commons/v10/conf" const ( // Treatment getTreatment diff --git a/telemetry/helpers.go b/telemetry/helpers.go index 3cc280db..7677888d 100644 --- a/telemetry/helpers.go +++ b/telemetry/helpers.go @@ -3,8 +3,8 @@ package telemetry import ( "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" ) // GetStreamingEvent get streaming event diff --git a/telemetry/helpers_test.go b/telemetry/helpers_test.go index 2ab817d6..a337edcb 100644 --- a/telemetry/helpers_test.go +++ b/telemetry/helpers_test.go @@ -3,7 +3,7 @@ package telemetry import ( "testing" - "github.com/splitio/go-split-commons/v9/conf" + "github.com/splitio/go-split-commons/v10/conf" ) func TestGetURLOVerrides(t *testing.T) { diff --git a/telemetry/interface.go b/telemetry/interface.go index 67bc59ab..15853354 100644 --- a/telemetry/interface.go +++ b/telemetry/interface.go @@ -1,6 +1,6 @@ package telemetry -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" // TelemetrySynchronizer interface type TelemetrySynchronizer interface { diff --git a/telemetry/localhost.go b/telemetry/localhost.go index aceb80d6..1a0b0307 100644 --- a/telemetry/localhost.go +++ b/telemetry/localhost.go @@ -1,6 +1,6 @@ package telemetry -import "github.com/splitio/go-split-commons/v9/dtos" +import "github.com/splitio/go-split-commons/v10/dtos" type NoOp struct{} diff --git a/telemetry/memory.go b/telemetry/memory.go index 769e0ccd..03130548 100644 --- a/telemetry/memory.go +++ b/telemetry/memory.go @@ -5,9 +5,9 @@ import ( "strings" "time" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/telemetry/memory_test.go b/telemetry/memory_test.go index 3c111286..d6cff0ca 100644 --- a/telemetry/memory_test.go +++ b/telemetry/memory_test.go @@ -9,11 +9,11 @@ import ( "testing" "time" - "github.com/splitio/go-split-commons/v9/conf" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/service/api" - "github.com/splitio/go-split-commons/v9/service/mocks" - st "github.com/splitio/go-split-commons/v9/storage/mocks" + "github.com/splitio/go-split-commons/v10/conf" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/service/api" + "github.com/splitio/go-split-commons/v10/service/mocks" + st "github.com/splitio/go-split-commons/v10/storage/mocks" "github.com/splitio/go-toolkit/v5/datastructures/set" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/telemetry/redis.go b/telemetry/redis.go index 22b37995..1311a76d 100644 --- a/telemetry/redis.go +++ b/telemetry/redis.go @@ -1,8 +1,8 @@ package telemetry import ( - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage" "github.com/splitio/go-toolkit/v5/logging" ) diff --git a/telemetry/redis_test.go b/telemetry/redis_test.go index 0e9f583b..70e068bc 100644 --- a/telemetry/redis_test.go +++ b/telemetry/redis_test.go @@ -3,8 +3,8 @@ package telemetry import ( "testing" - "github.com/splitio/go-split-commons/v9/dtos" - "github.com/splitio/go-split-commons/v9/storage/mocks" + "github.com/splitio/go-split-commons/v10/dtos" + "github.com/splitio/go-split-commons/v10/storage/mocks" "github.com/splitio/go-toolkit/v5/logging" )