From 519fcfc57be236e141a974f1992976f9a80d16b3 Mon Sep 17 00:00:00 2001 From: Dana Gutride <7306953+dgutride@users.noreply.github.com> Date: Thu, 23 May 2024 11:33:44 -0400 Subject: [PATCH] [RHOAIENG-4219] Add internal dashboard version --- docs/release-steps.md | 1 + frontend/.env | 3 +++ frontend/src/utilities/const.ts | 2 ++ frontend/src/utilities/segmentIOUtils.tsx | 10 +++++++--- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/release-steps.md b/docs/release-steps.md index cc5cb39ca4..6f59596a9d 100644 --- a/docs/release-steps.md +++ b/docs/release-steps.md @@ -14,6 +14,7 @@ Details on how we will do a release are being worked on and will likely update t > Note: the version number should be the last release number with an increment on the patch version (see [release version](#version-numbers)) * Catch up `incubation` branch with the `main` branch +* Change the INTERNAL_DASHBOARD_VERSION value in ~/.env to the next release number * Go to our [quay repo] & "Add New Tag" off of the latest `main` build * `vX.YY.Z-incubation` naming convention (eg. `v1.23.4-incubation`) * Get the latest sha digest value for this release diff --git a/frontend/.env b/frontend/.env index 6fff56ba32..0a6c09a2ec 100644 --- a/frontend/.env +++ b/frontend/.env @@ -6,3 +6,6 @@ ODH_LOGO=odh-logo.svg ODH_PRODUCT_NAME=Open Data Hub ODH_FAVICON=odh-favicon.svg ODH_NOTEBOOK_REPO=opendatahub + +########## Change this version with each dashboard release ########### +INTERNAL_DASHBOARD_VERSION=v2.22.0 diff --git a/frontend/src/utilities/const.ts b/frontend/src/utilities/const.ts index b19a1ea8ec..770010e8ce 100644 --- a/frontend/src/utilities/const.ts +++ b/frontend/src/utilities/const.ts @@ -16,6 +16,7 @@ const { ODH_PRODUCT_NAME } = process.env; const { ODH_NOTEBOOK_REPO } = process.env; const DASHBOARD_CONFIG = process.env.DASHBOARD_CONFIG || 'odh-dashboard-config'; const { EXT_CLUSTER } = process.env; +const { INTERNAL_DASHBOARD_VERSION } = process.env; export { DEV_MODE, @@ -32,6 +33,7 @@ export { DASHBOARD_CONFIG, WS_HOSTNAME, EXT_CLUSTER, + INTERNAL_DASHBOARD_VERSION, }; export const DOC_TYPE_TOOLTIPS = { diff --git a/frontend/src/utilities/segmentIOUtils.tsx b/frontend/src/utilities/segmentIOUtils.tsx index 07d6685cb3..3f4484c7ec 100644 --- a/frontend/src/utilities/segmentIOUtils.tsx +++ b/frontend/src/utilities/segmentIOUtils.tsx @@ -1,5 +1,5 @@ import { TrackingEventProperties } from '~/types'; -import { DEV_MODE } from './const'; +import { DEV_MODE, INTERNAL_DASHBOARD_VERSION } from './const'; // The following is like the original method below, but allows for more 'free form' properties. // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/explicit-module-boundary-types @@ -9,7 +9,9 @@ export const fireTrackingEventRaw = (eventType: string, properties?: any): void /* eslint-disable-next-line no-console */ console.log( `Telemetry event triggered: ${eventType}${ - properties ? ` - ${JSON.stringify(properties)}` : '' + properties + ? ` - ${JSON.stringify(properties)} for version ${INTERNAL_DASHBOARD_VERSION}` + : '' }`, ); } else if (window.analytics) { @@ -26,7 +28,9 @@ export const fireTrackingEvent = ( /* eslint-disable-next-line no-console */ console.log( `Telemetry event triggered: ${eventType}${ - properties ? ` - ${JSON.stringify(properties)}` : '' + properties + ? ` - ${JSON.stringify(properties)} for version ${INTERNAL_DASHBOARD_VERSION}` + : '' }`, ); } else if (window.analytics) {