diff --git a/src/core/server/config/__snapshots__/env.test.ts.snap b/src/core/server/config/__snapshots__/env.test.ts.snap index ee1f0cf93936b7..1f4661283de6e7 100644 --- a/src/core/server/config/__snapshots__/env.test.ts.snap +++ b/src/core/server/config/__snapshots__/env.test.ts.snap @@ -31,6 +31,7 @@ Env { "branch": "feature-v1", "buildNum": 9007199254740991, "buildSha": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "dist": false, "version": "v1", }, "pluginSearchPaths": Array [ @@ -74,6 +75,7 @@ Env { "branch": "feature-v1", "buildNum": 9007199254740991, "buildSha": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "dist": false, "version": "v1", }, "pluginSearchPaths": Array [ @@ -116,6 +118,7 @@ Env { "branch": "some-branch", "buildNum": 9007199254740991, "buildSha": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "dist": false, "version": "some-version", }, "pluginSearchPaths": Array [ @@ -158,6 +161,7 @@ Env { "branch": "feature-v1", "buildNum": 100, "buildSha": "feature-v1-build-sha", + "dist": true, "version": "v1", }, "pluginSearchPaths": Array [ @@ -200,6 +204,7 @@ Env { "branch": "feature-v1", "buildNum": 9007199254740991, "buildSha": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "dist": false, "version": "v1", }, "pluginSearchPaths": Array [ @@ -242,6 +247,7 @@ Env { "branch": "feature-v1", "buildNum": 100, "buildSha": "feature-v1-build-sha", + "dist": true, "version": "v1", }, "pluginSearchPaths": Array [ diff --git a/src/core/server/config/env.ts b/src/core/server/config/env.ts index 28751f50c05067..0cf647c3674e36 100644 --- a/src/core/server/config/env.ts +++ b/src/core/server/config/env.ts @@ -28,6 +28,7 @@ export interface PackageInfo { branch: string; buildNum: number; buildSha: string; + dist: boolean; } export interface EnvironmentMode { @@ -132,12 +133,13 @@ export class Env { prod: !isDevMode, }); - const isKibanaDistributable = pkg.build && pkg.build.distributable === true; + const isKibanaDistributable = Boolean(pkg.build && pkg.build.distributable === true); this.packageInfo = Object.freeze({ branch: pkg.branch, buildNum: isKibanaDistributable ? pkg.build.number : Number.MAX_SAFE_INTEGER, buildSha: isKibanaDistributable ? pkg.build.sha : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', version: pkg.version, + dist: isKibanaDistributable, }); } } diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts index 082cd82e5e1f00..17b1ac7b860452 100644 --- a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts @@ -31,6 +31,7 @@ const packageInfo = { buildNum: 1, buildSha: '', version: '7.0.0-alpha1', + dist: false, }; afterEach(() => {