splitclient-rb 6.3.0 → 8.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.github/pull_request_template.md +9 -0
- data/.github/workflows/ci.yml +90 -0
- data/.github/workflows/update-license-year.yml +45 -0
- data/.gitignore +4 -0
- data/.rubocop.yml +46 -3
- data/CHANGES.txt +158 -11
- data/CONTRIBUTORS-GUIDE.md +49 -0
- data/LICENSE +169 -13
- data/NOTICE.txt +5 -0
- data/README.md +67 -27
- data/Rakefile +1 -8
- data/ext/murmurhash/3_x64_128.c +117 -0
- data/ext/murmurhash/murmurhash.c +5 -1
- data/lib/murmurhash/murmurhash.jar +0 -0
- data/lib/splitclient-rb/cache/adapters/cache_adapter.rb +3 -3
- data/lib/splitclient-rb/cache/adapters/memory_adapters/map_adapter.rb +4 -0
- data/lib/splitclient-rb/cache/adapters/memory_adapters/queue_adapter.rb +7 -0
- data/lib/splitclient-rb/cache/adapters/redis_adapter.rb +12 -4
- data/lib/splitclient-rb/cache/fetchers/segment_fetcher.rb +83 -0
- data/lib/splitclient-rb/cache/fetchers/split_fetcher.rb +70 -0
- data/lib/splitclient-rb/cache/filter/bloom_filter.rb +67 -0
- data/lib/splitclient-rb/cache/filter/filter_adapter.rb +32 -0
- data/lib/splitclient-rb/cache/filter/flag_set_filter.rb +40 -0
- data/lib/splitclient-rb/cache/hashers/impression_hasher.rb +34 -0
- data/lib/splitclient-rb/cache/observers/impression_observer.rb +22 -0
- data/lib/splitclient-rb/cache/observers/noop_impression_observer.rb +10 -0
- data/lib/splitclient-rb/cache/repositories/events/memory_repository.rb +26 -14
- data/lib/splitclient-rb/cache/repositories/events/redis_repository.rb +9 -14
- data/lib/splitclient-rb/cache/repositories/events_repository.rb +31 -10
- data/lib/splitclient-rb/cache/repositories/flag_sets/memory_repository.rb +40 -0
- data/lib/splitclient-rb/cache/repositories/flag_sets/redis_repository.rb +49 -0
- data/lib/splitclient-rb/cache/repositories/impressions/memory_repository.rb +22 -23
- data/lib/splitclient-rb/cache/repositories/impressions/redis_repository.rb +15 -22
- data/lib/splitclient-rb/cache/repositories/impressions_repository.rb +6 -31
- data/lib/splitclient-rb/cache/repositories/repository.rb +6 -5
- data/lib/splitclient-rb/cache/repositories/rule_based_segments_repository.rb +136 -0
- data/lib/splitclient-rb/cache/repositories/segments_repository.rb +46 -6
- data/lib/splitclient-rb/cache/repositories/splits_repository.rb +232 -43
- data/lib/splitclient-rb/cache/routers/impression_router.rb +24 -22
- data/lib/splitclient-rb/cache/senders/events_sender.rb +12 -29
- data/lib/splitclient-rb/cache/senders/impressions_adapter/memory_sender.rb +71 -0
- data/lib/splitclient-rb/cache/senders/impressions_adapter/redis_sender.rb +69 -0
- data/lib/splitclient-rb/cache/senders/impressions_count_sender.rb +43 -0
- data/lib/splitclient-rb/cache/senders/impressions_formatter.rb +27 -13
- data/lib/splitclient-rb/cache/senders/impressions_sender.rb +11 -25
- data/lib/splitclient-rb/cache/senders/impressions_sender_adapter.rb +21 -0
- data/lib/splitclient-rb/cache/senders/localhost_repo_cleaner.rb +47 -0
- data/lib/splitclient-rb/cache/stores/localhost_split_builder.rb +95 -0
- data/lib/splitclient-rb/cache/stores/localhost_split_store.rb +110 -0
- data/lib/splitclient-rb/cache/stores/store_utils.rb +13 -0
- data/lib/splitclient-rb/clients/split_client.rb +385 -138
- data/lib/splitclient-rb/constants.rb +16 -0
- data/lib/splitclient-rb/engine/api/client.rb +38 -43
- data/lib/splitclient-rb/engine/api/events.rb +19 -11
- data/lib/splitclient-rb/engine/api/faraday_middleware/gzip.rb +1 -0
- data/lib/splitclient-rb/engine/api/impressions.rb +49 -14
- data/lib/splitclient-rb/engine/api/segments.rb +31 -24
- data/lib/splitclient-rb/engine/api/splits.rb +108 -33
- data/lib/splitclient-rb/engine/api/telemetry_api.rb +47 -0
- data/lib/splitclient-rb/engine/auth_api_client.rb +96 -0
- data/lib/splitclient-rb/engine/back_off.rb +26 -0
- data/lib/splitclient-rb/engine/common/impressions_counter.rb +45 -0
- data/lib/splitclient-rb/engine/common/impressions_manager.rb +165 -0
- data/lib/splitclient-rb/engine/common/noop_impressions_counter.rb +27 -0
- data/lib/splitclient-rb/engine/events/events_delivery.rb +20 -0
- data/lib/splitclient-rb/engine/events/events_manager.rb +194 -0
- data/lib/splitclient-rb/engine/events/events_manager_config.rb +96 -0
- data/lib/splitclient-rb/engine/events/events_task.rb +50 -0
- data/lib/splitclient-rb/engine/events/noop_events_queue.rb +13 -0
- data/lib/splitclient-rb/engine/fallback_treatment_calculator.rb +48 -0
- data/lib/splitclient-rb/engine/impressions/noop_unique_keys_tracker.rb +17 -0
- data/lib/splitclient-rb/engine/impressions/unique_keys_tracker.rb +144 -0
- data/lib/splitclient-rb/engine/matchers/all_keys_matcher.rb +1 -1
- data/lib/splitclient-rb/engine/matchers/between_matcher.rb +7 -5
- data/lib/splitclient-rb/engine/matchers/between_semver_matcher.rb +33 -0
- data/lib/splitclient-rb/engine/matchers/combining_matcher.rb +10 -8
- data/lib/splitclient-rb/engine/matchers/contains_all_matcher.rb +2 -6
- data/lib/splitclient-rb/engine/matchers/contains_any_matcher.rb +1 -5
- data/lib/splitclient-rb/engine/matchers/contains_matcher.rb +7 -5
- data/lib/splitclient-rb/engine/matchers/dependency_matcher.rb +6 -5
- data/lib/splitclient-rb/engine/matchers/ends_with_matcher.rb +5 -4
- data/lib/splitclient-rb/engine/matchers/equal_to_boolean_matcher.rb +3 -2
- data/lib/splitclient-rb/engine/matchers/equal_to_matcher.rb +6 -4
- data/lib/splitclient-rb/engine/matchers/equal_to_semver_matcher.rb +28 -0
- data/lib/splitclient-rb/engine/matchers/equal_to_set_matcher.rb +1 -5
- data/lib/splitclient-rb/engine/matchers/greater_than_or_equal_to_matcher.rb +6 -4
- data/lib/splitclient-rb/engine/matchers/greater_than_or_equal_to_semver_matcher.rb +28 -0
- data/lib/splitclient-rb/engine/matchers/in_list_semver_matcher.rb +36 -0
- data/lib/splitclient-rb/engine/matchers/less_than_or_equal_to_matcher.rb +6 -4
- data/lib/splitclient-rb/engine/matchers/less_than_or_equal_to_semver_matcher.rb +28 -0
- data/lib/splitclient-rb/engine/matchers/matcher.rb +22 -0
- data/lib/splitclient-rb/engine/matchers/matches_string_matcher.rb +3 -2
- data/lib/splitclient-rb/engine/matchers/negation_matcher.rb +3 -2
- data/lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb +2 -6
- data/lib/splitclient-rb/engine/matchers/prerequisites_matcher.rb +31 -0
- data/lib/splitclient-rb/engine/matchers/rule_based_segment_matcher.rb +78 -0
- data/lib/splitclient-rb/engine/matchers/semver.rb +201 -0
- data/lib/splitclient-rb/engine/matchers/set_matcher.rb +2 -1
- data/lib/splitclient-rb/engine/matchers/starts_with_matcher.rb +4 -3
- data/lib/splitclient-rb/engine/matchers/user_defined_segment_matcher.rb +3 -2
- data/lib/splitclient-rb/engine/matchers/whitelist_matcher.rb +7 -5
- data/lib/splitclient-rb/engine/metrics/binary_search_latency_tracker.rb +3 -65
- data/lib/splitclient-rb/engine/models/evaluation_options.rb +9 -0
- data/lib/splitclient-rb/engine/models/event_active_subscriptions.rb +14 -0
- data/lib/splitclient-rb/engine/models/events_metadata.rb +10 -0
- data/lib/splitclient-rb/engine/models/fallback_treatment.rb +11 -0
- data/lib/splitclient-rb/engine/models/fallback_treatments_configuration.rb +36 -0
- data/lib/splitclient-rb/engine/models/label.rb +3 -0
- data/lib/splitclient-rb/engine/models/sdk_event.rb +4 -0
- data/lib/splitclient-rb/engine/models/sdk_event_type.rb +4 -0
- data/lib/splitclient-rb/engine/models/sdk_internal_event.rb +8 -0
- data/lib/splitclient-rb/engine/models/sdk_internal_event_notification.rb +14 -0
- data/lib/splitclient-rb/engine/models/segment_type.rb +4 -0
- data/lib/splitclient-rb/engine/models/split_http_response.rb +19 -0
- data/lib/splitclient-rb/engine/models/valid_sdk_event.rb +14 -0
- data/lib/splitclient-rb/engine/parser/condition.rb +81 -20
- data/lib/splitclient-rb/engine/parser/evaluator.rb +40 -51
- data/lib/splitclient-rb/engine/push_manager.rb +66 -0
- data/lib/splitclient-rb/engine/status_manager.rb +39 -0
- data/lib/splitclient-rb/engine/sync_manager.rb +180 -0
- data/lib/splitclient-rb/engine/synchronizer.rb +231 -0
- data/lib/splitclient-rb/exceptions.rb +20 -1
- data/lib/splitclient-rb/helpers/decryption_helper.rb +25 -0
- data/lib/splitclient-rb/helpers/evaluator_helper.rb +37 -0
- data/lib/splitclient-rb/helpers/repository_helper.rb +61 -0
- data/lib/splitclient-rb/helpers/thread_helper.rb +24 -0
- data/lib/splitclient-rb/helpers/util.rb +26 -0
- data/lib/splitclient-rb/managers/split_manager.rb +58 -20
- data/lib/splitclient-rb/spec.rb +9 -0
- data/lib/splitclient-rb/split_config.rb +336 -54
- data/lib/splitclient-rb/split_factory.rb +219 -33
- data/lib/splitclient-rb/split_factory_builder.rb +1 -22
- data/lib/splitclient-rb/split_factory_registry.rb +63 -0
- data/lib/splitclient-rb/split_logger.rb +9 -10
- data/lib/splitclient-rb/sse/event_source/client.rb +263 -0
- data/lib/splitclient-rb/sse/event_source/event_parser.rb +65 -0
- data/lib/splitclient-rb/sse/event_source/event_types.rb +15 -0
- data/lib/splitclient-rb/sse/event_source/stream_data.rb +22 -0
- data/lib/splitclient-rb/sse/notification_manager_keeper.rb +84 -0
- data/lib/splitclient-rb/sse/notification_processor.rb +48 -0
- data/lib/splitclient-rb/sse/sse_handler.rb +44 -0
- data/lib/splitclient-rb/sse/workers/segments_worker.rb +62 -0
- data/lib/splitclient-rb/sse/workers/splits_worker.rb +149 -0
- data/lib/splitclient-rb/telemetry/domain/constants.rb +48 -0
- data/lib/splitclient-rb/telemetry/domain/structs.rb +35 -0
- data/lib/splitclient-rb/telemetry/evaluation_consumer.rb +14 -0
- data/lib/splitclient-rb/telemetry/evaluation_producer.rb +21 -0
- data/lib/splitclient-rb/telemetry/init_consumer.rb +14 -0
- data/lib/splitclient-rb/telemetry/init_producer.rb +19 -0
- data/lib/splitclient-rb/telemetry/memory/memory_evaluation_consumer.rb +32 -0
- data/lib/splitclient-rb/telemetry/memory/memory_evaluation_producer.rb +24 -0
- data/lib/splitclient-rb/telemetry/memory/memory_init_consumer.rb +28 -0
- data/lib/splitclient-rb/telemetry/memory/memory_init_producer.rb +34 -0
- data/lib/splitclient-rb/telemetry/memory/memory_runtime_consumer.rb +119 -0
- data/lib/splitclient-rb/telemetry/memory/memory_runtime_producer.rb +87 -0
- data/lib/splitclient-rb/telemetry/memory/memory_synchronizer.rb +213 -0
- data/lib/splitclient-rb/telemetry/redis/redis_evaluation_producer.rb +38 -0
- data/lib/splitclient-rb/telemetry/redis/redis_init_producer.rb +37 -0
- data/lib/splitclient-rb/telemetry/redis/redis_synchronizer.rb +27 -0
- data/lib/splitclient-rb/telemetry/runtime_consumer.rb +25 -0
- data/lib/splitclient-rb/telemetry/runtime_producer.rb +25 -0
- data/lib/splitclient-rb/telemetry/storages/memory.rb +159 -0
- data/lib/splitclient-rb/telemetry/sync_task.rb +36 -0
- data/lib/splitclient-rb/telemetry/synchronizer.rb +33 -0
- data/lib/splitclient-rb/utilitites.rb +8 -0
- data/lib/splitclient-rb/validators.rb +142 -38
- data/lib/splitclient-rb/version.rb +1 -1
- data/lib/splitclient-rb.rb +101 -16
- data/sonar-project.properties +6 -0
- data/splitclient-rb.gemspec +28 -23
- metadata +262 -82
- data/.travis.yml +0 -11
- data/Appraisals +0 -10
- data/Detailed-README.md +0 -588
- data/NEWS +0 -141
- data/lib/splitclient-rb/cache/repositories/metrics/memory_repository.rb +0 -127
- data/lib/splitclient-rb/cache/repositories/metrics/redis_repository.rb +0 -96
- data/lib/splitclient-rb/cache/repositories/metrics_repository.rb +0 -21
- data/lib/splitclient-rb/cache/senders/metrics_sender.rb +0 -56
- data/lib/splitclient-rb/cache/stores/sdk_blocker.rb +0 -46
- data/lib/splitclient-rb/cache/stores/segment_store.rb +0 -81
- data/lib/splitclient-rb/cache/stores/split_store.rb +0 -102
- data/lib/splitclient-rb/clients/localhost_split_client.rb +0 -183
- data/lib/splitclient-rb/engine/api/faraday_adapter/patched_net_http_persistent.rb +0 -46
- data/lib/splitclient-rb/engine/api/metrics.rb +0 -60
- data/lib/splitclient-rb/engine/metrics/metrics.rb +0 -80
- data/lib/splitclient-rb/engine/parser/split_adapter.rb +0 -81
- data/lib/splitclient-rb/localhost_split_factory.rb +0 -13
- data/lib/splitclient-rb/localhost_utils.rb +0 -59
- data/lib/splitclient-rb/managers/localhost_split_manager.rb +0 -60
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 41d269b5dc5e38906001aefe42cb60bb4ef8de5376b9d71c613b5c8345cc9451
|
|
4
|
+
data.tar.gz: 6d66df400c0e2279ac23250dc22540135bd4e358467b5ba17ade47f8efdc6be9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1fd4c042221d85b902894870073ec8dda740807f59348c83ce470e5571d929b6e4ca88d19e014c597a91841464a89b4f3c558b35993f091b2d5bc142dc0bfb0e
|
|
7
|
+
data.tar.gz: b1bb37265463a9a8023f70cce31dbc880a2a84c0618b3defc4e0bef9075bb62cc558f68f212e9ea1b4310be51d180a1f5538333b6b30a2e079ce704fd4da638d
|
data/.github/CODEOWNERS
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @splitio/sdk
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
branches:
|
|
5
|
+
- development
|
|
6
|
+
- master
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- development
|
|
10
|
+
- master
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
name: Test
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
services:
|
|
21
|
+
redis:
|
|
22
|
+
image: redis
|
|
23
|
+
ports:
|
|
24
|
+
- 6379:6379
|
|
25
|
+
strategy:
|
|
26
|
+
fail-fast: false
|
|
27
|
+
matrix:
|
|
28
|
+
version:
|
|
29
|
+
- '2.5.0'
|
|
30
|
+
- '3.2.2'
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- name: Checkout code
|
|
34
|
+
uses: actions/checkout@v3
|
|
35
|
+
with:
|
|
36
|
+
fetch-depth: 0
|
|
37
|
+
|
|
38
|
+
- name: Set up Java
|
|
39
|
+
uses: actions/setup-java@v2
|
|
40
|
+
with:
|
|
41
|
+
java-version: 17
|
|
42
|
+
distribution: "temurin"
|
|
43
|
+
|
|
44
|
+
- name: Setup Ruby ${{ matrix.version }}
|
|
45
|
+
uses: ruby/setup-ruby@v1
|
|
46
|
+
with:
|
|
47
|
+
ruby-version: ${{ matrix.version }}
|
|
48
|
+
|
|
49
|
+
- name: Install dependencies
|
|
50
|
+
run: bundle install
|
|
51
|
+
|
|
52
|
+
- name: Run tests
|
|
53
|
+
run: bundle exec rake
|
|
54
|
+
|
|
55
|
+
- name: Fix code coverage paths
|
|
56
|
+
working-directory: coverage
|
|
57
|
+
run: |
|
|
58
|
+
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' .resultset.json
|
|
59
|
+
ruby -rjson -e 'sqube = JSON.load(File.read(".resultset.json"))["RSpec"]["coverage"].transform_values {|lines| lines["lines"]}; total = { "RSpec" => { "coverage" => sqube, "timestamp" => Time.now.to_i }}; puts JSON.dump(total)' > .resultset.sonarqube.json
|
|
60
|
+
|
|
61
|
+
- name: Set VERSION env
|
|
62
|
+
run: echo "VERSION=$(cat lib/splitclient-rb/version.rb | grep VERSION | awk -F "'" '{print $2}')" >> $GITHUB_ENV
|
|
63
|
+
|
|
64
|
+
- name: SonarQube Scan (Push)
|
|
65
|
+
if: matrix.version == '3.2.2' && github.event_name == 'push'
|
|
66
|
+
uses: SonarSource/sonarcloud-github-action@v5.0.0
|
|
67
|
+
env:
|
|
68
|
+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
|
69
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
70
|
+
with:
|
|
71
|
+
projectBaseDir: .
|
|
72
|
+
args: >
|
|
73
|
+
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
|
|
74
|
+
-Dsonar.projectVersion=${{ env.VERSION }}
|
|
75
|
+
|
|
76
|
+
- name: SonarQube Scan (Pull Request)
|
|
77
|
+
if: matrix.version == '3.2.2' && github.event_name == 'pull_request'
|
|
78
|
+
uses: SonarSource/sonarcloud-github-action@v5.0.0
|
|
79
|
+
env:
|
|
80
|
+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
|
81
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
82
|
+
with:
|
|
83
|
+
projectBaseDir: .
|
|
84
|
+
args: >
|
|
85
|
+
-Dsonar.java.source=17
|
|
86
|
+
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
|
|
87
|
+
-Dsonar.projectVersion=${{ env.VERSION }}
|
|
88
|
+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
|
|
89
|
+
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
|
|
90
|
+
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Update License Year
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: "0 3 1 1 *" # 03:00 AM on January 1
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
pull-requests: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v2
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
|
|
20
|
+
- name: Set Current year
|
|
21
|
+
run: "echo CURRENT=$(date +%Y) >> $GITHUB_ENV"
|
|
22
|
+
|
|
23
|
+
- name: Set Previous Year
|
|
24
|
+
run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV"
|
|
25
|
+
|
|
26
|
+
- name: Update LICENSE
|
|
27
|
+
uses: jacobtomlinson/gha-find-replace@v2
|
|
28
|
+
with:
|
|
29
|
+
find: ${{ env.PREVIOUS }}
|
|
30
|
+
replace: ${{ env.CURRENT }}
|
|
31
|
+
include: "LICENSE"
|
|
32
|
+
regex: false
|
|
33
|
+
|
|
34
|
+
- name: Commit files
|
|
35
|
+
run: |
|
|
36
|
+
git config user.name 'github-actions[bot]'
|
|
37
|
+
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
|
38
|
+
git commit -m "Updated License Year" -a
|
|
39
|
+
|
|
40
|
+
- name: Create Pull Request
|
|
41
|
+
uses: peter-evans/create-pull-request@v3
|
|
42
|
+
with:
|
|
43
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
44
|
+
title: Update License Year
|
|
45
|
+
branch: update-license
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
1
|
Documentation:
|
|
2
2
|
Enabled: false
|
|
3
3
|
|
|
4
|
+
Metrics/AbcSize:
|
|
5
|
+
Max: 26
|
|
6
|
+
Exclude:
|
|
7
|
+
- lib/splitclient-rb/telemetry/memory/memory_synchronizer.rb
|
|
8
|
+
|
|
4
9
|
Metrics/MethodLength:
|
|
5
|
-
Max:
|
|
10
|
+
Max: 20
|
|
11
|
+
Exclude:
|
|
12
|
+
- lib/splitclient-rb/telemetry/memory/memory_synchronizer.rb
|
|
13
|
+
- lib/splitclient-rb/engine/sync_manager.rb
|
|
14
|
+
|
|
15
|
+
Metrics/ClassLength:
|
|
16
|
+
Max: 150
|
|
17
|
+
Exclude:
|
|
18
|
+
- lib/splitclient-rb/telemetry/memory/memory_synchronizer.rb
|
|
19
|
+
|
|
20
|
+
Metrics/CyclomaticComplexity:
|
|
21
|
+
Max: 11
|
|
22
|
+
|
|
23
|
+
Metrics/ParameterLists:
|
|
24
|
+
Max: 8
|
|
25
|
+
Exclude:
|
|
26
|
+
- lib/splitclient-rb/engine/sync_manager.rb
|
|
6
27
|
|
|
7
28
|
Metrics/LineLength:
|
|
8
|
-
Max:
|
|
29
|
+
Max: 135
|
|
9
30
|
|
|
10
31
|
Metrics/BlockLength:
|
|
11
32
|
Exclude:
|
|
@@ -16,8 +37,24 @@ Naming/FileName:
|
|
|
16
37
|
Exclude:
|
|
17
38
|
- splitclient-rb.gemspec
|
|
18
39
|
|
|
40
|
+
Style/OptionalBooleanParameter:
|
|
41
|
+
Exclude:
|
|
42
|
+
- lib/splitclient-rb/engine/matchers/between_matcher.rb
|
|
43
|
+
- lib/splitclient-rb/engine/matchers/combining_matcher.rb
|
|
44
|
+
- lib/splitclient-rb/engine/matchers/equal_to_matcher.rb
|
|
45
|
+
- lib/splitclient-rb/engine/matchers/less_than_or_equal_to_matcher.rb
|
|
46
|
+
- lib/splitclient-rb/engine/matchers/greater_than_or_equal_to_matcher.rb
|
|
47
|
+
|
|
48
|
+
Style/HashTransformKeys:
|
|
49
|
+
Exclude:
|
|
50
|
+
- lib/splitclient-rb/engine/matchers/combining_matcher.rb
|
|
51
|
+
|
|
52
|
+
Style/RedundantReturn:
|
|
53
|
+
Exclude:
|
|
54
|
+
- lib/splitclient-rb/engine/common/impressions_manager.rb
|
|
55
|
+
|
|
19
56
|
AllCops:
|
|
20
|
-
TargetRubyVersion: 2.
|
|
57
|
+
TargetRubyVersion: 2.5
|
|
21
58
|
Exclude:
|
|
22
59
|
- gemfiles/* # excluded as appraisal generates them with errors
|
|
23
60
|
- lib/*
|
|
@@ -31,3 +68,9 @@ AllCops:
|
|
|
31
68
|
- lib/splitclient-rb/engine/metrics/**/*
|
|
32
69
|
- lib/splitclient-rb/engine/models/**/*
|
|
33
70
|
- lib/splitclient-rb/engine/parser/**/*
|
|
71
|
+
- spec/telemetry/synchronizer_spec.rb
|
|
72
|
+
- lib/splitclient-rb/engine/synchronizer.rb
|
|
73
|
+
- tmp/**/*
|
|
74
|
+
- lib/splitclient-rb/sse/event_source/client.rb
|
|
75
|
+
- spec/**/*
|
|
76
|
+
- .simplecov
|
data/CHANGES.txt
CHANGED
|
@@ -1,5 +1,161 @@
|
|
|
1
|
-
|
|
1
|
+
CHANGES
|
|
2
|
+
|
|
3
|
+
8.10.1 (Jan 28, 2025)
|
|
4
|
+
- Fixed rule-based segment matcher to exit when a conition is met.
|
|
5
|
+
- Fixed impressions properties format in redis mode.
|
|
6
|
+
|
|
7
|
+
8.10.0 (Nov 28, 2025)
|
|
8
|
+
- Updated socketry gem used in streaming feature with built-in socket lib.
|
|
9
|
+
|
|
10
|
+
8.9.0 (Oct 8, 2025)
|
|
11
|
+
- Added new configuration for Fallback Treatments, which allows setting a treatment value and optional config to be returned in place of "control", either globally or by flag. Read more in our docs.
|
|
12
|
+
|
|
13
|
+
8.8.0 (Sep 26, 2025)
|
|
14
|
+
- Added a maximum size payload when posting unique keys telemetry in batches
|
|
15
|
+
|
|
16
|
+
8.7.0 (Aug 1, 2025)
|
|
17
|
+
- Added a new optional argument to the client `getTreatment` methods to allow passing additional evaluation options, such as a map of properties to append to the generated impressions sent to Split backend. Read more in our docs.
|
|
18
|
+
|
|
19
|
+
8.6.0 (Jun 17, 2025)
|
|
20
|
+
- Added support for rule-based segments. These segments determine membership at runtime by evaluating their configured rules against the user attributes provided to the SDK.
|
|
21
|
+
- Added support for feature flag prerequisites. This allows customers to define dependency conditions between flags, which are evaluated before any allowlists or targeting rules.
|
|
22
|
+
|
|
23
|
+
8.5.0 (Jan 17, 2025)
|
|
24
|
+
- Fixed high cpu usage when unique keys are cleared every 24 hours.
|
|
25
|
+
- Added support for the new impressions tracking toggle available on feature flags, both respecting the setting and including the new field being returned on SplitView type objects. Read more in our docs.
|
|
26
|
+
|
|
27
|
+
8.4.0 (May 3, 2024)
|
|
28
|
+
- Fixed issue preventing Impressopns and Events posting if client.destroy is called before the post threads started
|
|
29
|
+
- Added support for targeting rules based on semantic versions (https://semver.org/).
|
|
30
|
+
|
|
31
|
+
8.3.1 (Mar 22, 2024)
|
|
32
|
+
- Fixed ruby process hanging due to failed thread.join command, when calling destroy and a http request still active.
|
|
33
|
+
- Fixed streaming notification parser. Issue ref: https://github.com/splitio/ruby-client/issues/511
|
|
34
|
+
|
|
35
|
+
8.3.0 (Dec 11, 2023)
|
|
36
|
+
- Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation):
|
|
37
|
+
- Added new variations of the get treatment methods to support evaluating flags in given flag set/s.
|
|
38
|
+
- get_treatments_by_flag_set and get_treatments_by_flag_sets
|
|
39
|
+
- get_treatments_with_config_by_flag_set and get_treatments_with_config_by_flag_sets
|
|
40
|
+
- Added a new optional Split Filter configuration option. This allows the SDK and Split services to only synchronize the flags in the specified flag sets, avoiding unused or unwanted flags from being synced on the SDK instance, bringing all the benefits from a reduced payload.
|
|
41
|
+
- Note: Only applicable when the SDK is in charge of the rollout data synchronization. When not applicable, the SDK will log a warning on init.
|
|
42
|
+
- Added `default_treatment` and `sets` property to the `split_view` object returned by the `split` and `splits` methods of the SDK manager.
|
|
43
|
+
|
|
44
|
+
8.2.0 (Jul 18, 2023)
|
|
45
|
+
- Improved streaming architecture implementation to apply feature flag updates from the notification received which is now enhanced, improving efficiency and reliability of the whole update system.
|
|
46
|
+
|
|
47
|
+
8.1.2 (May 15, 2023)
|
|
48
|
+
- Updated terminology on the SDKs codebase to be more aligned with current standard without causing a breaking change. The core change is the term split for feature flag on things like logs and IntelliSense comments.
|
|
49
|
+
|
|
50
|
+
8.1.1 (Mar 17, 2023)
|
|
51
|
+
- Added retries with backoff when the sdk tries to connect to the Streaming service and it is not available.
|
|
52
|
+
- Updated the way that the sdk write mtks in redis.
|
|
53
|
+
- Fixed calculation of timeUntilReady in telemetry.
|
|
54
|
+
|
|
55
|
+
8.1.0 (Oct 5, 2022)
|
|
56
|
+
- Added a new impressions mode for the SDK called NONE , to be used in factory when there is no desire to capture impressions on an SDK factory to feed Split's analytics engine. Running NONE mode, the SDK will only capture unique keys evaluated for a particular feature flag instead of full blown impressions.
|
|
57
|
+
|
|
58
|
+
8.0.1 (Jul 20, 2022)
|
|
59
|
+
- Updated dependencies to support faraday > 2.0
|
|
60
|
+
|
|
61
|
+
8.0.0 (May 10, 2022)
|
|
62
|
+
- BREAKING CHANGE: Deprecated support for ruby 2.3 and 2.4 versions. The minimum ruby version required is 2.5 now.
|
|
63
|
+
- Updated redis command for config telemetry, using hset instead of rpush now.
|
|
64
|
+
- Updated dependencies:
|
|
65
|
+
- rake to ~> 13.0
|
|
66
|
+
- faraday to >= 1.1, < 2.0
|
|
67
|
+
|
|
68
|
+
7.3.4 (Feb 21, 2022)
|
|
69
|
+
- Updated streaming events architecture with a new queue logic.
|
|
70
|
+
- Fixed redis integration Pipelining command deprecation warning.
|
|
71
|
+
|
|
72
|
+
7.3.3 (Jan 28, 2022)
|
|
73
|
+
- Fixed edge cases where the sdk lost streaming connection.
|
|
74
|
+
- Updated default auth service url to https://auth.split.io/api/v2/auth
|
|
75
|
+
- Updated dependencies:
|
|
76
|
+
- faraday to >= 0.8, < 2.0
|
|
77
|
+
- net-http-persistent to >= 2.9, < 5.0
|
|
78
|
+
- redis to >= 4.0.0, < 5.0
|
|
79
|
+
- socketry to >= 0.4, < 1.0
|
|
80
|
+
- thread_safe to ~> 0.3
|
|
81
|
+
|
|
82
|
+
7.3.2 (Dec 10, 2021)
|
|
83
|
+
- Updated the readiness flow to be more consistent with the other sdks and improve the readiness time.
|
|
84
|
+
- Updated the name of telemety key latencies in Redis.
|
|
85
|
+
|
|
86
|
+
7.3.1 (Jul 26, 2021)
|
|
87
|
+
- Updated the synchronization flow to be more reliable in the event of an edge case generating delay in cache purge propagation, keeping the SDK cache properly synced.
|
|
88
|
+
|
|
89
|
+
7.3.0 (Jul 12, 2021)
|
|
90
|
+
- Updated SDK telemetry storage, metrics and updater to be more effective and send less often.
|
|
91
|
+
- Fixed high cpu usage when api key is wrong.
|
|
92
|
+
|
|
93
|
+
7.2.3 (Feb 24, 2021)
|
|
94
|
+
- Fixed missing segment fetch after an SPLIT_UPDATE.
|
|
95
|
+
- Updated streaming logic to support multiregion.
|
|
96
|
+
- Updated sse client connection logic to read confirmation event.
|
|
97
|
+
- Updated naming of retryable erros.
|
|
98
|
+
|
|
99
|
+
7.2.2 (Dec 18, 2020)
|
|
100
|
+
- Fixed issue: undefined local variable or method post_impressions_count
|
|
101
|
+
|
|
102
|
+
7.2.1 (Oct 23, 2020)
|
|
103
|
+
- Updated redis dependency to >= 4.2.2.
|
|
104
|
+
- Updated ably error handling.
|
|
105
|
+
|
|
106
|
+
7.2.0 (Sep 25, 2020)
|
|
107
|
+
- Added impressions dedupe logic to avoid sending duplicated impressions:
|
|
108
|
+
- Added `OPTIMIZED` and `DEBUG` modes in order to enabling/disabling how impressions are going to be sent into Split servers,
|
|
109
|
+
- `OPTIMIZED`: will send unique impressions in a timeframe in order to reduce how many times impressions are posted to Split.
|
|
110
|
+
- `DEBUG`: will send every impression generated to Split.
|
|
111
|
+
|
|
112
|
+
7.1.3 (Jul 31, 2020)
|
|
113
|
+
- Updated rake development dependency to ~> 12.3.3.
|
|
114
|
+
|
|
115
|
+
7.1.2 (Jun 15, 2020)
|
|
116
|
+
- Fixed uninitialized constant LocalhostSplitStore::YAML for console apps.
|
|
117
|
+
- Updated default_streaming_enabled to true.
|
|
118
|
+
|
|
119
|
+
7.1.1 (May 19, 2020)
|
|
120
|
+
- Updated streaming domain.
|
|
121
|
+
|
|
122
|
+
7.1.0 (Apr 30, 2020)
|
|
123
|
+
- Added support for the new Split streaming architecture. When enabled, the SDK will not poll for updates but instead receive notifications every time there's a change in your environments, allowing to process those much quicker. If disabled (default) or in the event of an issue, the SDK will fallback to the known polling mechanism to provide a seamless experience.
|
|
124
|
+
|
|
125
|
+
7.0.3 (Jan 20, 2020)
|
|
126
|
+
- Added integration tests.
|
|
127
|
+
- Fixed impressions labels.
|
|
128
|
+
|
|
129
|
+
7.0.2 (Nov 11, 2019)
|
|
130
|
+
- Fixed an issue about empty logs.
|
|
131
|
+
- Fixed an issue about reducing scan commands in redis.
|
|
132
|
+
|
|
133
|
+
7.0.1 (Oct 31, 2019)
|
|
134
|
+
- Updated localhost mode so that parsing of test files results in JSON data for splits analogous to that returned by the Split backend.
|
|
135
|
+
- Updated localhost mode to parse the mock data into Split objects to keep differences in operation to a minimum.
|
|
136
|
+
- Removed specific spare code dealing with localhost operations.
|
|
137
|
+
- Removed the disable_impressions configuration param.
|
|
138
|
+
- Fixed an issue about Event properties were not sent to be.
|
|
139
|
+
- Added ip_addresses_enabled to enable/disable sending MachineName and MachineIP headers when data is posted to Split Servers.
|
|
140
|
+
- Fixed an issue about attributes in matchers.
|
|
141
|
+
- Fixed an issue about trying to access a nil property when sending telemetry metrics.
|
|
142
|
+
|
|
143
|
+
7.0.0 (Aug 23, 2019)
|
|
144
|
+
- BREAKING CHANGE: block_until_ready is now a method in both split_client and split_manager that needs to be explicitly called. The block_until_ready parameter is now ignored if passed in the configuration, and defaults to 15s unless passed as a parameter of the block_until_ready method.
|
|
145
|
+
- Added warning to track calls when traffic type does not belong to an existing split (only issued in the online client and when SDK is ready).
|
|
146
|
+
- Added warning to the get_treatment's method family when split does not exist in the current environment (only issued by online client and when SDK is ready).
|
|
147
|
+
- Added warning to the split_manager's split method when split does not exist in the current environment (only issued by online client and when SDK is ready).
|
|
148
|
+
- Added ability to create multiple split_factory instances. Added factory counts and warnings.
|
|
149
|
+
- Added SDK not ready impressions label.
|
|
150
|
+
- Changed the splits method implementation in the splits_repository to make use of get_splits, which outperforms the current implementation.
|
|
151
|
+
|
|
152
|
+
6.4.1 (Jul 26, 2019)
|
|
153
|
+
- Fixed an issue in the latency metrics format preventing the synchronizer from correctly picking them up (consumer mode only). Old keys will be deleted on SDK startup.
|
|
154
|
+
|
|
155
|
+
6.4.0 (Jul 05, 2019)
|
|
156
|
+
- Added properties to track method.
|
|
2
157
|
|
|
158
|
+
6.3.0 (Apr 30, 2019)
|
|
3
159
|
- Added Dynamic Configurations support through two new methods that mimick the regular ones, changing the type of what is returned.
|
|
4
160
|
- get_treatment_with_config: Same as get_treatment but returning the treatment with it's config.
|
|
5
161
|
- get_treatments_with_config: Same as get_treatments, but instead of a map of string it returns a map of treatments with config.
|
|
@@ -8,7 +164,7 @@
|
|
|
8
164
|
define configurations for your treatments and also whitelisted keys. Read more in our docs!
|
|
9
165
|
|
|
10
166
|
6.2.0 (Mar 7th, 2019)
|
|
11
|
-
- Reworked SplitClient#destroy to ensure events, impressions and metrics are sent to Split backend when called
|
|
167
|
+
- Reworked SplitClient#destroy to ensure events, impressions and metrics are sent to Split backend when called.
|
|
12
168
|
- Ensured destroy is called when keyboard interrupts are sent to the application
|
|
13
169
|
- Changed SDK blocker (and block_until_ready) to have no effect in consumer mode
|
|
14
170
|
- Added support for applications tied to Faraday < 0.13 and net-http-persistent 3 using a patched Faraday adapter
|
|
@@ -163,34 +319,27 @@
|
|
|
163
319
|
- Detach implementation for local factory and regular one.
|
|
164
320
|
|
|
165
321
|
3.0.3
|
|
166
|
-
|
|
167
322
|
- Fix nil ref in manager
|
|
168
323
|
|
|
169
324
|
3.0.2
|
|
170
|
-
|
|
171
325
|
- add ability to provide different bucketing/matching keys
|
|
172
326
|
|
|
173
327
|
3.0.1
|
|
174
|
-
|
|
175
328
|
- fix segments not deleting from the cache
|
|
176
329
|
|
|
177
330
|
3.0.0
|
|
178
|
-
|
|
179
331
|
- add new caching interface
|
|
180
332
|
- add replaceable adapters to store cache in
|
|
181
333
|
- add first cache adapter: MemoryAdapter
|
|
182
334
|
- refactoring
|
|
183
335
|
|
|
184
336
|
2.0.1
|
|
185
|
-
|
|
186
337
|
- Supress warnings cause by Net::HTTP when it already exists.
|
|
187
338
|
|
|
188
339
|
2.0.0
|
|
189
|
-
|
|
190
340
|
- Add Factory for creation of Client and Manager interface.
|
|
191
341
|
|
|
192
342
|
1.0.4
|
|
193
|
-
|
|
194
343
|
- added support for AND combiner on conditions
|
|
195
344
|
- added events_uri as config param which defines the metrics post url
|
|
196
345
|
- updated metrics post default endpoint to be https://events.split.io/api/
|
|
@@ -206,10 +355,8 @@
|
|
|
206
355
|
- added condition to return CONTROL on the deleted features
|
|
207
356
|
|
|
208
357
|
1.0.1
|
|
209
|
-
|
|
210
358
|
- .splits to .split for local env
|
|
211
359
|
- isTreatment was removed from the API.
|
|
212
360
|
|
|
213
361
|
1.0.0
|
|
214
|
-
|
|
215
362
|
- Support multivariate treatment
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Contributing to the Split Ruby SDK
|
|
2
|
+
|
|
3
|
+
Split SDK is an open source project and we welcome feedback and contribution. The information below describes how to build the project with your changes, run the tests, and send the Pull Request(PR).
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
### Development process
|
|
8
|
+
|
|
9
|
+
1. Fork the repository and create a topic branch from `development` branch. Please use a descriptive name for your branch.
|
|
10
|
+
2. While developing, use descriptive messages in your commits. Avoid short or meaningless sentences like "fix bug".
|
|
11
|
+
3. Make sure to add tests for both positive and negative cases.
|
|
12
|
+
4. Run the linter script of the project and fix any issues you find.
|
|
13
|
+
5. Run the build script and make sure it runs with no errors.
|
|
14
|
+
6. Run all tests and make sure there are no failures.
|
|
15
|
+
7. `git push` your changes to GitHub within your topic branch.
|
|
16
|
+
8. Open a Pull Request(PR) from your forked repo and into the `development` branch of the original repository.
|
|
17
|
+
9. When creating your PR, please fill out all the fields of the PR template, as applicable, for the project.
|
|
18
|
+
10. Check for conflicts once the pull request is created to make sure your PR can be merged cleanly into `development`.
|
|
19
|
+
11. Keep an eye out for any feedback or comments from Split's SDK team.
|
|
20
|
+
|
|
21
|
+
### Building the SDK
|
|
22
|
+
To install this gem dependencies onto your local machine, run `bundle exec rake install`.
|
|
23
|
+
|
|
24
|
+
Then you can build the gem using `gem build splitclient-rb.gemspec` and install on your Ruby version with `gem install splitclient-rb-X.X.X.gem` (_the version number should match what you just built_).
|
|
25
|
+
|
|
26
|
+
### Running tests
|
|
27
|
+
The gem uses `rspec` for unit testing. You can find the files for the unit tests and the specs helper file (`spec_helper.rb`) under the default `/spec` folder.
|
|
28
|
+
|
|
29
|
+
To run all the specs in the `spec` folder, use the provided rake task (_make sure Redis is running in localhost_):
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
bundle exec rspec
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`Simplecov` is used for coverage reporting. Upon executing the rake task it will store the reports in the `/coverage` folder.
|
|
36
|
+
|
|
37
|
+
### Linting and other useful checks
|
|
38
|
+
To run the static code analysis using Rubocop run:
|
|
39
|
+
```bash
|
|
40
|
+
bundle exec rubocop
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If you want to benchmark the hashing algorithm (MurmurHash) run:
|
|
44
|
+
```bash
|
|
45
|
+
bundle exec rake compile:murmurhash
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
# Contact
|
|
49
|
+
If you have any other questions or need to contact us directly in a private manner send us a note at developers@split.io
|