From fc9a936a27bd9c8b9f45b918f15c4729804a9200 Mon Sep 17 00:00:00 2001 From: Pudong Zheng Date: Thu, 15 Sep 2022 06:36:25 +0000 Subject: [PATCH] [supervisor-frontend] add version commit --- components/supervisor/frontend/BUILD.yaml | 6 ++++++ components/supervisor/frontend/config.json | 3 +++ .../frontend/src/ide/ide-metrics-service-client.ts | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 components/supervisor/frontend/config.json diff --git a/components/supervisor/frontend/BUILD.yaml b/components/supervisor/frontend/BUILD.yaml index 75e2c3e220..832d0fe913 100644 --- a/components/supervisor/frontend/BUILD.yaml +++ b/components/supervisor/frontend/BUILD.yaml @@ -4,6 +4,7 @@ packages: srcs: - "src/**" - "public/**" + - config.json - package.json - webpack.config.js - tsconfig.json @@ -14,3 +15,8 @@ packages: config: dontTest: true yarnLock: ${coreYarnLockBase}/../yarn.lock + commands: + build: + - sh + - -c + - yq w -i config.json commit commit-${__git_commit} -j && yarn build diff --git a/components/supervisor/frontend/config.json b/components/supervisor/frontend/config.json new file mode 100644 index 0000000000..0a7dc2f1ca --- /dev/null +++ b/components/supervisor/frontend/config.json @@ -0,0 +1,3 @@ +{ + "commit": "" +} diff --git a/components/supervisor/frontend/src/ide/ide-metrics-service-client.ts b/components/supervisor/frontend/src/ide/ide-metrics-service-client.ts index 323fa28529..d880292052 100644 --- a/components/supervisor/frontend/src/ide/ide-metrics-service-client.ts +++ b/components/supervisor/frontend/src/ide/ide-metrics-service-client.ts @@ -6,6 +6,7 @@ import { serverUrl, workspaceUrl } from '../shared/urls'; import { GitpodServiceClient } from './gitpod-service-client'; +const commit = require('../../config.json').commit export enum MetricsName { SupervisorFrontendClientTotal = "gitpod_supervisor_frontend_client_total", @@ -67,7 +68,7 @@ export class IDEMetricsServiceClient { const params: ReportErrorParam = { errorStack: error.stack ?? String(error), component: "supervisor-frontend", - version: "unknown", + version: commit, workspaceId: this.workspaceId ?? "", instanceId: this.instanceId ?? "", userId: this.userId ?? "",