From 2982851348ac7b08798b8b09a00608205668bc91 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 20 Sep 2022 14:15:08 -0300 Subject: [PATCH 1/9] upgrade js-commons with updated evaluation flow (don't access storage if SDK is not ready), and update redis E2E tests in consequence --- package-lock.json | 6 +++--- package.json | 2 +- src/__tests__/consumer/node_redis.spec.js | 11 ++++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd183da88..b9734ee7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -486,9 +486,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "1.6.2-rc.6", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.6.2-rc.6.tgz", - "integrity": "sha512-Kk1BSGVw6Xm4DoB3m4lGjOzv2Lc7XdIbzPHdnwzbfLep7BPfGCiAD3vyzIcoLwSI/UZPw5sDO/kzD5+DoVmKhA==", + "version": "1.6.2-rc.9", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.6.2-rc.9.tgz", + "integrity": "sha512-pUTAuhZlkTBgs5nGu5in4jDdlvj0yPRdnqXWUjNml4+GmRuUx827R8FL07jFHV2m88K9BbqZfpztsgbis5hRHQ==", "requires": { "tslib": "^2.3.1" } diff --git a/package.json b/package.json index 399979063..eb0564399 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "node": ">=6" }, "dependencies": { - "@splitsoftware/splitio-commons": "1.6.2-rc.6", + "@splitsoftware/splitio-commons": "1.6.2-rc.9", "@types/google.analytics": "0.0.40", "@types/ioredis": "^4.28.0", "ioredis": "^4.28.0", diff --git a/src/__tests__/consumer/node_redis.spec.js b/src/__tests__/consumer/node_redis.spec.js index 6368e4a31..e4cd95358 100644 --- a/src/__tests__/consumer/node_redis.spec.js +++ b/src/__tests__/consumer/node_redis.spec.js @@ -73,6 +73,10 @@ tape('NodeJS Redis', function (t) { const sdk = SplitFactory(config); const client = sdk.client(); + assert.equal(await client.getTreatment('UT_Segment_member', 'UT_IN_SEGMENT'), 'control', 'Evaluations using Redis storage should be control until connection is stablished.'); + assert.equal(await client.getTreatment('other', 'UT_IN_SEGMENT'), 'control', 'Evaluations using Redis storage should be control until connection is stablished.'); + await client.ready(); + assert.equal(await client.getTreatment('UT_Segment_member', 'UT_IN_SEGMENT'), 'on', 'Evaluations using Redis storage should be correct.'); assert.equal(await client.getTreatment('other', 'UT_IN_SEGMENT'), 'off', 'Evaluations using Redis storage should be correct.'); @@ -125,7 +129,7 @@ tape('NodeJS Redis', function (t) { if (error) assert.fail('Redis server should be reachable'); const trackedImpressionsAndEvents = stdout.split('\n').filter(line => line !== '').map(line => parseInt(line)); - assert.deepEqual(trackedImpressionsAndEvents, [14, 2], 'Tracked impressions and events should be stored in Redis'); + assert.deepEqual(trackedImpressionsAndEvents, [16, 2], 'Tracked impressions and events should be stored in Redis'); // Validate stored telemetry exec(`echo "HLEN ${config.storage.prefix}.SPLITIO.telemetry.latencies \n HLEN ${config.storage.prefix}.SPLITIO.telemetry.exceptions \n HGET ${config.storage.prefix}.SPLITIO.telemetry.init nodejs-${version}/${HOSTNAME_VALUE}/${IP_VALUE}" | redis-cli -p ${redisPort}`, (error, stdout) => { @@ -156,7 +160,7 @@ tape('NodeJS Redis', function (t) { assert.plan(18); client.getTreatment('UT_Segment_member', 'always-on').then(treatment => { - assert.equal(treatment, 'on', 'Evaluations using Redis storage should be correct and resolved once Redis connection is stablished.'); + assert.equal(treatment, 'control', 'Evaluations using Redis storage should be control until Redis connection is stablished.'); }); client.track('nicolas@split.io', 'user', 'test.redis.event', 18).then(result => { assert.true(result, 'If the event was succesfully queued the promise will resolve to true once Redis connection is stablished'); @@ -342,7 +346,7 @@ tape('NodeJS Redis', function (t) { // Redis client and keys required to check Redis store. const setting = settingsFactory(config); const connection = new RedisClient(setting.storage.options.url); - const keys = new KeyBuilderSS(validatePrefix(setting.storage.prefix)); + const keys = new KeyBuilderSS(validatePrefix(setting.storage.prefix), { s: 'js_someversion', i: 'some_ip', n: 'some_hostname' }); const eventKey = keys.buildEventsKey(); const impressionsKey = keys.buildImpressionsKey(); @@ -353,6 +357,7 @@ tape('NodeJS Redis', function (t) { // Init Split client for current config const sdk = SplitFactory(config); const client = sdk.client(); + await client.ready(); // Perform client actions to store a single event and impression objects into Redis await client.getTreatment('UT_Segment_member', 'UT_IN_SEGMENT'); From d4a556e45401464ef7680e6600c29392dd3049e8 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 20 Sep 2022 15:16:08 -0300 Subject: [PATCH 2/9] Fix none impressions mode test (no uniqueKeysCacheSize param in config) and redis test (evaluation flow update) --- .../browserSuites/impressions.none.spec.js | 34 ++++++++++------- src/__tests__/consumer/node_redis.spec.js | 5 ++- .../nodeSuites/impressions.debug.spec.js | 2 - .../nodeSuites/impressions.none.spec.js | 38 +++++++++++-------- src/__tests__/nodeSuites/impressions.spec.js | 2 - 5 files changed, 48 insertions(+), 33 deletions(-) diff --git a/src/__tests__/browserSuites/impressions.none.spec.js b/src/__tests__/browserSuites/impressions.none.spec.js index ba938beb8..93bea3e1e 100644 --- a/src/__tests__/browserSuites/impressions.none.spec.js +++ b/src/__tests__/browserSuites/impressions.none.spec.js @@ -4,6 +4,7 @@ import splitChangesMock1 from '../mocks/splitchanges.since.-1.json'; import splitChangesMock2 from '../mocks/splitchanges.since.1457552620999.json'; import mySegmentsFacundo from '../mocks/mysegments.facundo@split.io.json'; import { NONE } from '@splitsoftware/splitio-commons/src/utils/constants'; +import { truncateTimeFrame } from '@splitsoftware/splitio-commons/src/utils/time'; import { url } from '../testUtils'; const baseUrls = { @@ -27,9 +28,6 @@ const config = { scheduler: { featuresRefreshRate: 1, segmentsRefreshRate: 1, - impressionsRefreshRate: 3000, - impressionsQueueSize: 3, // flush impressions when 3 are queued - uniqueKeysCacheSize: 3 // flush impressions when 3 are queued }, urls: baseUrls, startup: { @@ -47,11 +45,25 @@ export default async function (fetchMock, assert) { fetchMock.get(url(settings, '/splitChanges?since=1457552620999'), { status: 200, body: splitChangesMock2 }); fetchMock.get(url(settings, '/mySegments/facundo%40split.io'), { status: 200, body: mySegmentsFacundo }); fetchMock.get(url(settings, '/mySegments/emma%40split.io'), { status: 200, body: mySegmentsFacundo }); - fetchMock.postOnce(baseUrls.events + '/testImpressions/count', 200); + const splitio = SplitFactory(config); const client = splitio.client(); const sharedClient = splitio.client('emma@split.io'); + fetchMock.postOnce(baseUrls.events + '/testImpressions/count', (url, opts) => { + const data = JSON.parse(opts.body); + const truncatedTimeFrame = truncateTimeFrame(Date.now()); + + assert.deepEqual(data, { + pf: [ + { f: 'split_with_config', m: truncatedTimeFrame, rc: 2 }, + { f: 'always_off', m: truncatedTimeFrame, rc: 4 }, + { f: 'always_on', m: truncatedTimeFrame, rc: 2 } + ] + }); + return 200; + }); + fetchMock.postOnce(url(settings, '/v1/keys/cs'), (url, opts) => { const data = JSON.parse(opts.body); @@ -59,7 +71,7 @@ export default async function (fetchMock, assert) { keys: [ { k: 'facundo@split.io', - fs: ['split_with_config','always_off', 'always_on'] + fs: ['split_with_config', 'always_off', 'always_on'] }, { k: 'emma@split.io', @@ -67,17 +79,10 @@ export default async function (fetchMock, assert) { } ] }, 'We performed evaluations for two keys, so we should have 2 item total.'); - - client.destroy().then(() => { - assert.end(); - }); - return 200; }); - splitio.Logger.enable(); - await client.ready(); client.getTreatment('split_with_config'); @@ -88,5 +93,8 @@ export default async function (fetchMock, assert) { client.getTreatment('always_on'); client.getTreatment('always_off'); client.getTreatment('split_with_config'); - + + client.destroy().then(() => { + assert.end(); + }); } diff --git a/src/__tests__/consumer/node_redis.spec.js b/src/__tests__/consumer/node_redis.spec.js index 5c711647e..4101a5f35 100644 --- a/src/__tests__/consumer/node_redis.spec.js +++ b/src/__tests__/consumer/node_redis.spec.js @@ -172,6 +172,8 @@ tape('NodeJS Redis', function (t) { assert.equal(config.sync.impressionsMode, OPTIMIZED, 'impressionsMode should be OPTIMIZED'); const sdk = SplitFactory(config); const client = sdk.client(); + await client.ready(); + assert.equal(await client.getTreatment('UT_Segment_member', 'UT_IN_SEGMENT'), 'on', 'Evaluations using Redis storage should be correct.'); assert.equal(await client.getTreatment('other', 'UT_IN_SEGMENT'), 'off', 'Evaluations using Redis storage should be correct.'); // this should be deduped @@ -305,6 +307,8 @@ tape('NodeJS Redis', function (t) { assert.equal(config.sync.impressionsMode, NONE, 'impressionsMode should be NONE'); const sdk = SplitFactory(config); const client = sdk.client(); + await client.ready(); + assert.equal(await client.getTreatment('UT_Segment_member', 'UT_IN_SEGMENT'), 'on', 'Evaluations using Redis storage should be correct.'); assert.equal(await client.getTreatment('other', 'UT_IN_SEGMENT'), 'off', 'Evaluations using Redis storage should be correct.'); @@ -390,7 +394,6 @@ tape('NodeJS Redis', function (t) { }); }); - t.test('Connection timeout and then ready', assert => { const readyTimeout = 0.1; // 100 millis const configWithShortTimeout = { ...config, startup: { readyTimeout } }; diff --git a/src/__tests__/nodeSuites/impressions.debug.spec.js b/src/__tests__/nodeSuites/impressions.debug.spec.js index 5c10f8065..0e166403e 100644 --- a/src/__tests__/nodeSuites/impressions.debug.spec.js +++ b/src/__tests__/nodeSuites/impressions.debug.spec.js @@ -89,7 +89,6 @@ export default async function (key, fetchMock, assert) { return 200; }); - splitio.Logger.enable(); evaluationsStart = Date.now(); await client.ready(); @@ -99,7 +98,6 @@ export default async function (key, fetchMock, assert) { client.getTreatment({ matchingKey: key, bucketingKey: 'test_buck_key' }, 'split_with_config'); client.getTreatment({ matchingKey: key, bucketingKey: 'test_buck_key' }, 'split_with_config'); client.getTreatment({ matchingKey: key, bucketingKey: 'test_buck_key' }, 'split_with_config'); - splitio.Logger.disable(); evaluationsEnd = Date.now(); } diff --git a/src/__tests__/nodeSuites/impressions.none.spec.js b/src/__tests__/nodeSuites/impressions.none.spec.js index 5c861689e..632fd77c9 100644 --- a/src/__tests__/nodeSuites/impressions.none.spec.js +++ b/src/__tests__/nodeSuites/impressions.none.spec.js @@ -3,6 +3,7 @@ import { settingsFactory } from '../../settings'; import splitChangesMock1 from '../mocks/splitchanges.since.-1.json'; import splitChangesMock2 from '../mocks/splitchanges.since.1457552620999.json'; import { NONE } from '@splitsoftware/splitio-commons/src/utils/constants'; +import { truncateTimeFrame } from '@splitsoftware/splitio-commons/src/utils/time'; import { url } from '../testUtils'; const baseUrls = { @@ -25,9 +26,6 @@ const config = { scheduler: { featuresRefreshRate: 1, segmentsRefreshRate: 1, - impressionsRefreshRate: 3000, - impressionsQueueSize: 3, // flush impressions when 3 are queued - uniqueKeysCacheSize: 7 // flush impressions when 7 are queued }, urls: baseUrls, startup: { @@ -44,10 +42,24 @@ export default async function (key, fetchMock, assert) { fetchMock.getOnce(url(settings, '/splitChanges?since=-1'), { status: 200, body: splitChangesMock1 }); fetchMock.get(url(settings, '/splitChanges?since=1457552620999'), { status: 200, body: splitChangesMock2 }); fetchMock.get(new RegExp(`${url(settings, '/segmentChanges/')}.*`), { status: 200, body: { since: 10, till: 10, name: 'segmentName', added: [], removed: [] } }); - fetchMock.postOnce(baseUrls.events + '/testImpressions/count', 200); + const splitio = SplitFactory(config); const client = splitio.client(); + fetchMock.postOnce(baseUrls.events + '/testImpressions/count', (url, opts) => { + const data = JSON.parse(opts.body); + const truncatedTimeFrame = truncateTimeFrame(Date.now()); + + assert.deepEqual(data, { + pf: [ + { f: 'split_with_config', m: truncatedTimeFrame, rc: 3 }, + { f: 'always_off', m: truncatedTimeFrame, rc: 3 }, + { f: 'always_on', m: truncatedTimeFrame, rc: 5 } + ] + }); + return 200; + }); + fetchMock.postOnce(url(settings, '/v1/keys/ss'), (url, opts) => { const data = JSON.parse(opts.body); @@ -55,28 +67,21 @@ export default async function (key, fetchMock, assert) { keys: [ { f: 'split_with_config', - ks:['emma@split.io','emi@split.io'] + ks: ['emma@split.io', 'emi@split.io'] }, { f: 'always_off', - ks:['emma@split.io','emi@split.io'] + ks: ['emma@split.io', 'emi@split.io'] }, { f: 'always_on', - ks:['emma@split.io','emi@split.io','nico@split.io'] + ks: ['emma@split.io', 'emi@split.io', 'nico@split.io'] } ] }, 'We performed evaluations for three split, so we should have 3 item total.'); - - client.destroy().then(() => { - assert.end(); - }); - return 200; }); - splitio.Logger.enable(); - await client.ready(); client.getTreatment('emma@split.io', 'split_with_config'); @@ -90,5 +95,8 @@ export default async function (key, fetchMock, assert) { client.getTreatment('nico@split.io', 'always_on'); client.getTreatment('emi@split.io', 'split_with_config'); client.getTreatment('emma@split.io', 'split_with_config'); - + + client.destroy().then(() => { + assert.end(); + }); } diff --git a/src/__tests__/nodeSuites/impressions.spec.js b/src/__tests__/nodeSuites/impressions.spec.js index 9e037db17..8446700dc 100644 --- a/src/__tests__/nodeSuites/impressions.spec.js +++ b/src/__tests__/nodeSuites/impressions.spec.js @@ -125,7 +125,6 @@ export default async function(key, fetchMock, assert) { return 200; }); - splitio.Logger.enable(); evaluationsStart = Date.now(); assert.equal(client.getTreatment(key, 'not_existent_split'), 'control', `If we try to get an evaluation BEFORE the client is ready, we expect ${SDK_NOT_READY} label on the impression.`); @@ -147,7 +146,6 @@ export default async function(key, fetchMock, assert) { }, 'We should get an evaluation as always.'); client.getTreatmentWithConfig({ matchingKey: key, bucketingKey: 'test_buck_key'}, 'split_with_config'); client.getTreatmentWithConfig({ matchingKey: 'different', bucketingKey: 'test_buck_key'}, 'split_with_config'); - splitio.Logger.disable(); evaluationsEnd = Date.now(); } From 221d2484e8d1b57fc557f110ea545cf9b5f828d5 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 21 Sep 2022 12:07:16 -0300 Subject: [PATCH 3/9] update ci-cd for rc --- .github/workflows/ci-cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index eb98398c7..73a91baf3 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -55,14 +55,14 @@ jobs: # run: npm run build:ga-to-split-autorequire - name: Configure AWS credentials (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/update_evaluation_flow' }} uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: arn:aws:iam::079419646996:role/public-assets aws-region: us-east-1 - name: Upload to S3 (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/update_evaluation_flow' }} run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS env: BUCKET: split-public-stage From c56651064a9663b3def3b678903b9d99bac9451b Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 23 Sep 2022 17:38:48 -0300 Subject: [PATCH 4/9] rollback ci-cd --- .github/workflows/ci-cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 73a91baf3..eb98398c7 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -55,14 +55,14 @@ jobs: # run: npm run build:ga-to-split-autorequire - name: Configure AWS credentials (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/update_evaluation_flow' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: arn:aws:iam::079419646996:role/public-assets aws-region: us-east-1 - name: Upload to S3 (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/update_evaluation_flow' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS env: BUCKET: split-public-stage From 2ee9a4753137eafab22be23e02fe963fd93a2862 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 27 Sep 2022 21:55:21 -0300 Subject: [PATCH 5/9] style formatting --- src/platform/filter/bloomFilter.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/platform/filter/bloomFilter.js b/src/platform/filter/bloomFilter.js index 4e7c93915..d3e2f5f21 100644 --- a/src/platform/filter/bloomFilter.js +++ b/src/platform/filter/bloomFilter.js @@ -6,11 +6,11 @@ const REFRESH_RATE = 24 * 60 * 60000; // 24HS export function bloomFilterFactory(expectedInsertions = EXPECTED_INSERTIONS, errorRate = ERROR_RATE, refreshRate = REFRESH_RATE) { let filter = BloomFilter.create(expectedInsertions, errorRate); - - return { - + + return { + refreshRate: refreshRate, - + add(key, value) { const data = `${key}:${value}`; if (filter.has(data)) { @@ -19,15 +19,15 @@ export function bloomFilterFactory(expectedInsertions = EXPECTED_INSERTIONS, err filter.add(data); return true; }, - + contains(key, value) { const data = `${key}:${value}`; return filter.has(data); }, - + clear() { filter = BloomFilter.create(expectedInsertions, errorRate); } - + }; } From 301980b97a76468bfc569e95c741da6dbc633f9d Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 27 Sep 2022 22:27:17 -0300 Subject: [PATCH 6/9] rc --- .github/workflows/ci-cd.yml | 4 ++-- package-lock.json | 8 ++++---- package.json | 5 +++-- src/settings/defaults/version.js | 2 +- ts-tests/package.json | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index eb98398c7..73a91baf3 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -55,14 +55,14 @@ jobs: # run: npm run build:ga-to-split-autorequire - name: Configure AWS credentials (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/update_evaluation_flow' }} uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: arn:aws:iam::079419646996:role/public-assets aws-region: us-east-1 - name: Upload to S3 (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/update_evaluation_flow' }} run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS env: BUCKET: split-public-stage diff --git a/package-lock.json b/package-lock.json index ebe5228ae..fabaccb78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio", - "version": "10.21.2-rc.4", + "version": "10.21.2-rc.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -494,9 +494,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "1.6.2-rc.10", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.6.2-rc.10.tgz", - "integrity": "sha512-Z6zNqaBO9XraodPdaRw7+fIx0ngh2Fs9slhnN/eFgeX91im649trhS/jW3542ik0vggVUEG6SN38g8o7dChuhg==", + "version": "1.6.2-rc.13", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.6.2-rc.13.tgz", + "integrity": "sha512-QwK7EaBCp+r0/Bizk/yvNJXUkIrY5Du3EJVkg6C/yXN7FmgZqBXXjSp2EoP/YGMh2q6SWWv7L5Gfxb6d0TuGSg==", "requires": { "tslib": "^2.3.1" } diff --git a/package.json b/package.json index 3ff303603..b104b2a1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio", - "version": "10.21.2-rc.4", + "version": "10.21.2-rc.5", "description": "Split SDK", "files": [ "README.md", @@ -34,7 +34,7 @@ }, "dependencies": { "@ably/bloomit": "^1.4.2", - "@splitsoftware/splitio-commons": "1.6.2-rc.10", + "@splitsoftware/splitio-commons": "1.6.2-rc.13", "@types/google.analytics": "0.0.40", "@types/ioredis": "^4.28.0", "ioredis": "^4.28.0", @@ -112,6 +112,7 @@ "test-ts-decls": "./scripts/ts-tests.sh", "posttest-ts-decls": "npm unlink && npm install", "test": "npm run test-node && npm run test-browser", + "all": "npm run check && npm run build && npm run test-ts-decls && npm run test", "publish:rc": "npm run check && npm run build && npm publish --tag canary", "publish:stable": "npm run check && npm run build && npm publish" }, diff --git a/src/settings/defaults/version.js b/src/settings/defaults/version.js index fdf5b26bd..cbc987f1f 100644 --- a/src/settings/defaults/version.js +++ b/src/settings/defaults/version.js @@ -1 +1 @@ -export const packageVersion = '10.21.2-rc.4'; +export const packageVersion = '10.21.2-rc.5'; diff --git a/ts-tests/package.json b/ts-tests/package.json index 8d6336589..57c38c344 100644 --- a/ts-tests/package.json +++ b/ts-tests/package.json @@ -6,7 +6,7 @@ "license": "Apache-2.0", "repository": "splitio/javascript-client", "dependencies": { - "@types/node": "^14.18.16", + "@types/node": "^14.18.31", "typescript": "^3.7.4" } } From 1fdef3c7bfdee706a58b22ba354e5f361586f077 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Thu, 29 Sep 2022 17:16:18 -0300 Subject: [PATCH 7/9] upgrade js-commons and prepare rc --- .eslintrc | 3 ++- package-lock.json | 8 ++++---- package.json | 4 ++-- src/factory/node.js | 2 +- src/platform/filter/__tests__/bloomFilter.spec.js | 14 +++++++------- src/settings/defaults/version.js | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.eslintrc b/.eslintrc index b3b5da1c6..c7873c750 100644 --- a/.eslintrc +++ b/.eslintrc @@ -24,7 +24,8 @@ "new-cap" : 0, "no-mixed-requires": 0, "camelcase": [2, {"properties": "never"}], - "no-use-before-define": [2, "nofunc"] + "no-use-before-define": [2, "nofunc"], + "no-trailing-spaces": "error" }, "parserOptions": { diff --git a/package-lock.json b/package-lock.json index fabaccb78..703c8d26f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio", - "version": "10.21.2-rc.5", + "version": "10.21.2-rc.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -494,9 +494,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "1.6.2-rc.13", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.6.2-rc.13.tgz", - "integrity": "sha512-QwK7EaBCp+r0/Bizk/yvNJXUkIrY5Du3EJVkg6C/yXN7FmgZqBXXjSp2EoP/YGMh2q6SWWv7L5Gfxb6d0TuGSg==", + "version": "1.6.2-rc.14", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.6.2-rc.14.tgz", + "integrity": "sha512-cslzWAu0ony85y0SUcXa3vRhES3pwYDROuke79IjyH0UDunr30kmPwXRWONFS+t4KU+9N4ABNNOKgrX/B5sv9Q==", "requires": { "tslib": "^2.3.1" } diff --git a/package.json b/package.json index b104b2a1a..78c18136b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio", - "version": "10.21.2-rc.5", + "version": "10.21.2-rc.6", "description": "Split SDK", "files": [ "README.md", @@ -34,7 +34,7 @@ }, "dependencies": { "@ably/bloomit": "^1.4.2", - "@splitsoftware/splitio-commons": "1.6.2-rc.13", + "@splitsoftware/splitio-commons": "1.6.2-rc.14", "@types/google.analytics": "0.0.40", "@types/ioredis": "^4.28.0", "ioredis": "^4.28.0", diff --git a/src/factory/node.js b/src/factory/node.js index fd8509b10..d8141037a 100644 --- a/src/factory/node.js +++ b/src/factory/node.js @@ -46,7 +46,7 @@ function getModules(settings) { SignalListener, impressionsObserverFactory: impressionObserverSSFactory, - + filterAdapterFactory: bloomFilterFactory }; diff --git a/src/platform/filter/__tests__/bloomFilter.spec.js b/src/platform/filter/__tests__/bloomFilter.spec.js index c6b6e0dbd..2a097adae 100644 --- a/src/platform/filter/__tests__/bloomFilter.spec.js +++ b/src/platform/filter/__tests__/bloomFilter.spec.js @@ -2,21 +2,21 @@ import tape from 'tape-catch'; import { bloomFilterFactory } from '../bloomFilter'; tape('Bloom filter', (assert) => { - + const bloomFilter = bloomFilterFactory(); - + assert.true(bloomFilter.add('feature','key')); assert.false(bloomFilter.contains('feature1','key')); assert.true(bloomFilter.contains('feature','key')); - + bloomFilter.clear(); - + assert.false(bloomFilter.contains('feature','key')); - + assert.true(bloomFilter.add('feature2','key')); assert.false(bloomFilter.contains('feature3','key')); assert.true(bloomFilter.contains('feature2','key')); - + assert.end(); - + }); diff --git a/src/settings/defaults/version.js b/src/settings/defaults/version.js index cbc987f1f..b2090613a 100644 --- a/src/settings/defaults/version.js +++ b/src/settings/defaults/version.js @@ -1 +1 @@ -export const packageVersion = '10.21.2-rc.5'; +export const packageVersion = '10.21.2-rc.6'; From e140b218c888cf19109abf79ad54e8c005b478dc Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 30 Sep 2022 14:28:15 -0300 Subject: [PATCH 8/9] rollback ci-cd --- .github/workflows/ci-cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 73a91baf3..eb98398c7 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -55,14 +55,14 @@ jobs: # run: npm run build:ga-to-split-autorequire - name: Configure AWS credentials (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/update_evaluation_flow' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: arn:aws:iam::079419646996:role/public-assets aws-region: us-east-1 - name: Upload to S3 (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/update_evaluation_flow' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS env: BUCKET: split-public-stage From 9cc7b0b80e3dc6cd50cdd85b1016195c4cd58471 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 30 Sep 2022 14:31:57 -0300 Subject: [PATCH 9/9] update type definitions comment regarding new NONE impression mode option --- types/splitio.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/splitio.d.ts b/types/splitio.d.ts index 917dfbf6f..15ac16ba3 100644 --- a/types/splitio.d.ts +++ b/types/splitio.d.ts @@ -228,9 +228,11 @@ interface ISharedSettings { splitFilters?: SplitIO.SplitFilter[] /** * Impressions Collection Mode. Option to determine how impressions are going to be sent to Split Servers. - * Possible values are 'DEBUG' and 'OPTIMIZED'. + * Possible values are 'DEBUG', 'OPTIMIZED', and 'NONE'. * - DEBUG: will send all the impressions generated (recommended only for debugging purposes). - * - OPTIMIZED: will send unique impressions to Split Servers avoiding a considerable amount of traffic that duplicated impressions could generate. + * - OPTIMIZED: will send unique impressions to Split Servers, avoiding a considerable amount of traffic that duplicated impressions could generate. + * - NONE: will send unique keys evaluated per feature to Split Servers, avoiding a considerable amount of traffic that impressions could generate. + * * @property {string} impressionsMode * @default 'OPTIMIZED' */