From 59388bf546fbb70c1794e5a43e64824dfd4aae61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Toulet?= <35176601+AgnesToulet@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:17:37 +0200 Subject: [PATCH] Config: fix buildInfo initialization (#47402) * Config: fix buildInfo initialization * change default to be parseable * apply default values for buildInfo --- packages/grafana-runtime/src/config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/grafana-runtime/src/config.ts b/packages/grafana-runtime/src/config.ts index 6a0e015626b..f2599a42894 100644 --- a/packages/grafana-runtime/src/config.ts +++ b/packages/grafana-runtime/src/config.ts @@ -119,7 +119,6 @@ export class GrafanaBootConfig implements GrafanaConfig { this.theme2 = createTheme({ colors: { mode } }); this.theme = this.theme2.v1; this.bootData = options.bootData; - this.buildInfo = options.buildInfo; const defaults = { datasources: {}, @@ -131,7 +130,7 @@ export class GrafanaBootConfig implements GrafanaConfig { appUrl: '', appSubUrl: '', buildInfo: { - version: 'v1.0', + version: '1.0', commit: '1', env: 'production', }, @@ -142,6 +141,8 @@ export class GrafanaBootConfig implements GrafanaConfig { merge(this, defaults, options); + this.buildInfo = options.buildInfo || defaults.buildInfo; + if (this.dateFormats) { systemDateFormats.update(this.dateFormats); }