diff --git a/migrations/create-tables.js.sql b/migrations/create-tables.js.sql index 536b29bb..129f7b9d 100644 --- a/migrations/create-tables.js.sql +++ b/migrations/create-tables.js.sql @@ -17,6 +17,7 @@ CREATE TABLE IF NOT EXISTS gp_adopted_probes ( tags LONGTEXT, status VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, + nodeVersion VARCHAR(255) NOT NULL, hardwareDevice VARCHAR(255) NULL, country VARCHAR(255) NOT NULL, city VARCHAR(255), diff --git a/src/adoption-code/route/adoption-code.ts b/src/adoption-code/route/adoption-code.ts index bc470177..799f3992 100644 --- a/src/adoption-code/route/adoption-code.ts +++ b/src/adoption-code/route/adoption-code.ts @@ -18,6 +18,7 @@ const handle = async (ctx: Context): Promise => { ctx.body = { uuid: probe.uuid, version: probe.version, + nodeVersion: probe.nodeVersion, hardwareDevice: probe.hardwareDevice, status: probe.status, city: probe.location.city, diff --git a/src/lib/override/adopted-probes.ts b/src/lib/override/adopted-probes.ts index a1267c8b..dfbbad4f 100644 --- a/src/lib/override/adopted-probes.ts +++ b/src/lib/override/adopted-probes.ts @@ -24,6 +24,7 @@ export type AdoptedProbe = { isCustomCity: boolean; status: string; version: string | null; + nodeVersion: string | null; hardwareDevice: string | null; country: string | null; countryOfCustomCity: string | null; @@ -53,6 +54,10 @@ export class AdoptedProbes { connectedField: 'version', shouldUpdateIfCustomCity: true, }, + nodeVersion: { + connectedField: 'nodeVersion', + shouldUpdateIfCustomCity: true, + }, hardwareDevice: { connectedField: 'hardwareDevice', shouldUpdateIfCustomCity: true, diff --git a/test/e2e/cases/adopted-probes.test.ts b/test/e2e/cases/adopted-probes.test.ts index 2c8586b7..b7dbdad5 100644 --- a/test/e2e/cases/adopted-probes.test.ts +++ b/test/e2e/cases/adopted-probes.test.ts @@ -18,6 +18,7 @@ describe('adopted probe', () => { tags: '[{"prefix":"jimaek","value":"dashboardtag1"}]', status: 'ready', version: '0.28.0', + nodeVersion: 'v18.14.2', hardwareDevice: null, country: 'FR', countryOfCustomCity: 'FR', diff --git a/test/tests/integration/adoption-code.test.ts b/test/tests/integration/adoption-code.test.ts index 4974bf3a..09ed9d4b 100644 --- a/test/tests/integration/adoption-code.test.ts +++ b/test/tests/integration/adoption-code.test.ts @@ -42,6 +42,7 @@ describe('Adoption code', () => { expect(response.body).to.deep.equal({ uuid: '1-1-1-1-1', version: '0.14.0', + nodeVersion: 'v18.17.0', hardwareDevice: null, status: 'initializing', city: 'Dallas', diff --git a/test/tests/integration/measurement/create-measurement.test.ts b/test/tests/integration/measurement/create-measurement.test.ts index 27de2b14..6517c59f 100644 --- a/test/tests/integration/measurement/create-measurement.test.ts +++ b/test/tests/integration/measurement/create-measurement.test.ts @@ -656,6 +656,7 @@ describe('Create measurement', () => { tags: '[{"prefix":"jsdelivr","value":"Dashboard-Tag"}]', status: 'ready', version: '0.26.0', + nodeVersion: 'v18.14.2', hardwareDevice: null, country: 'US', countryOfCustomCity: 'US', diff --git a/test/tests/integration/probes/get-probes.test.ts b/test/tests/integration/probes/get-probes.test.ts index 3e43394d..09b4cfad 100644 --- a/test/tests/integration/probes/get-probes.test.ts +++ b/test/tests/integration/probes/get-probes.test.ts @@ -280,6 +280,7 @@ describe('Get Probes', () => { tags: '[{"prefix":"jimaek","value":"dashboardtag1"}]', status: 'ready', version: '0.26.0', + nodeVersion: 'v18.14.2', hardwareDevice: null, country: 'AR', countryOfCustomCity: 'AR', diff --git a/test/tests/unit/override/adopted-probes.test.ts b/test/tests/unit/override/adopted-probes.test.ts index 07e33bf0..23ce47e8 100644 --- a/test/tests/unit/override/adopted-probes.test.ts +++ b/test/tests/unit/override/adopted-probes.test.ts @@ -16,6 +16,7 @@ describe('AdoptedProbes', () => { isCustomCity: 0, status: 'ready', version: '0.26.0', + nodeVersion: 'v18.17.0', hardwareDevice: null, country: 'IE', state: null, @@ -205,7 +206,7 @@ describe('AdoptedProbes', () => { uuid: '1-1-1-1-1', status: 'initializing', version: '0.27.0', - nodeVersion: 'v18.17.0', + nodeVersion: 'v18.17.1', isHardware: true, hardwareDevice: 'v1', location: { @@ -231,6 +232,7 @@ describe('AdoptedProbes', () => { expect(updateStub.args[0]).to.deep.equal([{ status: 'initializing', version: '0.27.0', + nodeVersion: 'v18.17.1', hardwareDevice: 'v1', asn: 20473, network: 'The Constant Company, LLC',