From 18d328ecc100f5008830ec8f98dc35e7a92b4afa Mon Sep 17 00:00:00 2001 From: Risto Stevcev Date: Thu, 1 Oct 2020 18:56:27 +0200 Subject: [PATCH 1/5] Added registry url to setup-node action for publishing --- .github/workflows/build-test-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index 642fc34..1421c0e 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -58,6 +58,7 @@ jobs: uses: actions/setup-node@v1 with: node-version: 12 + registry-url: 'https://registry.npmjs.org' - name: Install dependencies run: npm install From 5143dd143691f15b398600b3f88a3f323b66f54e Mon Sep 17 00:00:00 2001 From: Risto Stevcev Date: Fri, 2 Oct 2020 10:26:25 +0200 Subject: [PATCH 2/5] Bumped version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 46371b2..25405c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@airgrid/edgekit", - "version": "0.0.0-dev.15", + "version": "0.0.0-dev.16", "homepage": "https://edgekit.org/", "author": "AirGrid ", "license": "MIT", From 13745dc2bf1b85b4c029a0d88a6ef56c197e7d04 Mon Sep 17 00:00:00 2001 From: Risto Stevcev Date: Mon, 5 Oct 2020 15:21:59 +0200 Subject: [PATCH 3/5] Fixed logic to differentiate between audience and feature versions --- package-lock.json | 2 +- src/audiences/index.ts | 3 +++ src/engine/translate.ts | 4 ++-- src/index.ts | 1 + test/gdpr.test.ts | 1 + test/run.test.ts | 12 ++++++++++-- types/index.ts | 2 ++ 7 files changed, 20 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index f862ecc..6d83363 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@airgrid/edgekit", - "version": "0.0.0-dev.14", + "version": "0.0.0-dev.16", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/audiences/index.ts b/src/audiences/index.ts index dd80949..b3b25c0 100644 --- a/src/audiences/index.ts +++ b/src/audiences/index.ts @@ -13,6 +13,7 @@ export const sportInterestAudience: AudienceDefinition = { name: 'Interest | Sport', version: VERSION, definition: { + featureVersion: 1, ttl: TTL_IN_SECS, lookBack: LOOK_BACK_IN_SECS, occurrences: OCCURRENCES, @@ -27,6 +28,7 @@ export const travelInterestAudience: AudienceDefinition = { name: 'Interest | Travel', version: VERSION, definition: { + featureVersion: 1, ttl: TTL_IN_SECS, lookBack: LOOK_BACK_IN_SECS, occurrences: OCCURRENCES, @@ -41,6 +43,7 @@ export const automotiveInterestAudience: AudienceDefinition = { name: 'Interest | Automotive', version: VERSION, definition: { + featureVersion: 1, ttl: TTL_IN_SECS, lookBack: LOOK_BACK_IN_SECS, occurrences: OCCURRENCES, diff --git a/src/engine/translate.ts b/src/engine/translate.ts index 443e6af..2d4c0d2 100644 --- a/src/engine/translate.ts +++ b/src/engine/translate.ts @@ -12,7 +12,7 @@ export const translate = ( isStringArray(audienceDefinition.definition.queryValue) ? [ { - version: audienceDefinition.version, + version: audienceDefinition.definition.featureVersion, property: audienceDefinition.definition.queryProperty, filterComparisonType: audienceDefinition.definition.queryFilterComparisonType, @@ -24,7 +24,7 @@ export const translate = ( isVectorQueryValue(audienceDefinition.definition.queryValue) ? [ { - version: audienceDefinition.version, + version: audienceDefinition.definition.featureVersion, property: audienceDefinition.definition.queryProperty, filterComparisonType: audienceDefinition.definition.queryFilterComparisonType, diff --git a/src/index.ts b/src/index.ts index 6dc0af8..e4cf8e3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -26,6 +26,7 @@ const run = async (config: Config): Promise => { const { pageFeatureGetters, audienceDefinitions } = config; const pageFeatures = await getPageFeatures(pageFeatureGetters); + console.log('OS EDGEKIT', { pageFeatures }); viewStore.insert(pageFeatures); const matchedAudiences = audienceDefinitions diff --git a/test/gdpr.test.ts b/test/gdpr.test.ts index 1051903..d0d9ab5 100644 --- a/test/gdpr.test.ts +++ b/test/gdpr.test.ts @@ -24,6 +24,7 @@ const sportAudience: AudienceDefinition = { name: 'Sport Audience', version: 1, definition: { + featureVersion: 1, ttl: TTL, lookBack: 10, occurrences: 0, diff --git a/test/run.test.ts b/test/run.test.ts index e4251bd..67f321d 100644 --- a/test/run.test.ts +++ b/test/run.test.ts @@ -41,6 +41,7 @@ const sportAudience: AudienceDefinition = { name: 'Sport Audience', version: 1, definition: { + featureVersion: 1, ttl: TTL, lookBack: 10, occurrences: 2, @@ -55,6 +56,7 @@ const lookBackInfinityAudience: AudienceDefinition = { name: 'Look Back Audience', version: 1, definition: { + featureVersion: 1, ttl: TTL, lookBack: 0, occurrences: 2, @@ -69,6 +71,7 @@ const lookBackAudience: AudienceDefinition = { name: 'Look Back Audience', version: 1, definition: { + featureVersion: 1, ttl: TTL, lookBack: 2, occurrences: 2, @@ -83,6 +86,7 @@ const topicModelAudience: AudienceDefinition = { name: 'Look Back Audience', version: 1, definition: { + featureVersion: 1, ttl: 100, lookBack: 2, occurrences: 1, @@ -317,6 +321,7 @@ describe('Topic model run with additional audience', () => { name: 'Interest | Sport', version: 1, definition: { + featureVersion: 1, occurrences: 1, ttl: 1000, lookBack: 1000, @@ -334,6 +339,7 @@ describe('Topic model run with additional audience', () => { name: 'Interest | Sport', version: 1, definition: { + featureVersion: 1, occurrences: 1, ttl: 1000, lookBack: 1000, @@ -427,8 +433,9 @@ describe('Topic model run version mismatch', () => { const topicModelAudience: AudienceDefinition = { id: 'iab-608', name: 'Interest | Sport', - version: 2, + version: 1, definition: { + featureVersion: 2, occurrences: 1, ttl: 1000, lookBack: 1000, @@ -444,8 +451,9 @@ describe('Topic model run version mismatch', () => { const keywordsAudience: AudienceDefinition = { id: 'iab-607', name: 'Interest | Sport', - version: 2, + version: 1, definition: { + featureVersion: 2, occurrences: 1, ttl: 1000, lookBack: 1000, diff --git a/types/index.ts b/types/index.ts index af1ca7d..0a5e214 100644 --- a/types/index.ts +++ b/types/index.ts @@ -64,6 +64,7 @@ export interface AudienceDefinition { name: string; definition: | { + featureVersion: number; ttl: number; lookBack: number; occurrences: number; @@ -72,6 +73,7 @@ export interface AudienceDefinition { queryFilterComparisonType: 'vectorDistance'; } | { + featureVersion: number; ttl: number; lookBack: number; occurrences: number; From 67cfe92226286c90711aa67b234db14b8dba3719 Mon Sep 17 00:00:00 2001 From: Risto Stevcev Date: Mon, 5 Oct 2020 15:35:21 +0200 Subject: [PATCH 4/5] Removed log --- src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e4cf8e3..6dc0af8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -26,7 +26,6 @@ const run = async (config: Config): Promise => { const { pageFeatureGetters, audienceDefinitions } = config; const pageFeatures = await getPageFeatures(pageFeatureGetters); - console.log('OS EDGEKIT', { pageFeatures }); viewStore.insert(pageFeatures); const matchedAudiences = audienceDefinitions From c0f189b6e8c609bdcbc5d88d3b77cb7be7f62502 Mon Sep 17 00:00:00 2001 From: ydennisy Date: Mon, 5 Oct 2020 14:53:24 +0100 Subject: [PATCH 5/5] release: v0.0.0-dev.17 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 25405c0..0e640d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@airgrid/edgekit", - "version": "0.0.0-dev.16", + "version": "0.0.0-dev.17", "homepage": "https://edgekit.org/", "author": "AirGrid ", "license": "MIT",