Skip to content

Commit

Permalink
feat: send node version to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-yarmosh committed Apr 23, 2024
1 parent a741f56 commit 629a8ee
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions migrations/create-tables.js.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions src/adoption-code/route/adoption-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const handle = async (ctx: Context): Promise<void> => {
ctx.body = {
uuid: probe.uuid,
version: probe.version,
nodeVersion: probe.nodeVersion,
hardwareDevice: probe.hardwareDevice,
status: probe.status,
city: probe.location.city,
Expand Down
5 changes: 5 additions & 0 deletions src/lib/override/adopted-probes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -53,6 +54,10 @@ export class AdoptedProbes {
connectedField: 'version',
shouldUpdateIfCustomCity: true,
},
nodeVersion: {
connectedField: 'nodeVersion',
shouldUpdateIfCustomCity: true,
},
hardwareDevice: {
connectedField: 'hardwareDevice',
shouldUpdateIfCustomCity: true,
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cases/adopted-probes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions test/tests/integration/adoption-code.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions test/tests/integration/probes/get-probes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 3 additions & 1 deletion test/tests/unit/override/adopted-probes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('AdoptedProbes', () => {
isCustomCity: 0,
status: 'ready',
version: '0.26.0',
nodeVersion: 'v18.17.0',
hardwareDevice: null,
country: 'IE',
state: null,
Expand Down Expand Up @@ -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: {
Expand All @@ -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',
Expand Down

0 comments on commit 629a8ee

Please sign in to comment.