From 3aa094427579f70c373a64e79748ba2bd1032844 Mon Sep 17 00:00:00 2001 From: Mihir Soni Date: Mon, 5 Apr 2021 16:59:25 -0700 Subject: [PATCH] [PURIFY][BUILD] Removes isOSS falg from startup script (#248) Signed-off-by: Mihir Soni --- packages/osd-config/src/__mocks__/env.ts | 1 - .../osd-config/src/__snapshots__/env.test.ts.snap | 6 ------ packages/osd-config/src/env.ts | 1 - src/cli/cluster/cluster_manager.test.ts | 1 - src/cli/cluster/cluster_manager.ts | 10 +--------- src/cli/cluster/run_osd_optimizer.ts | 3 +-- .../reload_logging_config.test.ts | 4 ---- src/cli/serve/serve.js | 15 ++++----------- src/core/test_helpers/osd_server.ts | 1 - 9 files changed, 6 insertions(+), 36 deletions(-) diff --git a/packages/osd-config/src/__mocks__/env.ts b/packages/osd-config/src/__mocks__/env.ts index e0f6f6add168..b84f6f25a489 100644 --- a/packages/osd-config/src/__mocks__/env.ts +++ b/packages/osd-config/src/__mocks__/env.ts @@ -38,7 +38,6 @@ export function getEnvOptions(options: DeepPartial = {}): EnvOptions disableOptimizer: true, cache: true, dist: false, - oss: false, runExamples: false, ...(options.cliArgs || {}), }, diff --git a/packages/osd-config/src/__snapshots__/env.test.ts.snap b/packages/osd-config/src/__snapshots__/env.test.ts.snap index ebe3825cdc35..74a59904411e 100644 --- a/packages/osd-config/src/__snapshots__/env.test.ts.snap +++ b/packages/osd-config/src/__snapshots__/env.test.ts.snap @@ -10,7 +10,6 @@ Env { "disableOptimizer": true, "dist": false, "envName": "development", - "oss": false, "quiet": false, "repl": false, "runExamples": false, @@ -54,7 +53,6 @@ Env { "disableOptimizer": true, "dist": false, "envName": "production", - "oss": false, "quiet": false, "repl": false, "runExamples": false, @@ -97,7 +95,6 @@ Env { "dev": true, "disableOptimizer": true, "dist": false, - "oss": false, "quiet": false, "repl": false, "runExamples": false, @@ -140,7 +137,6 @@ Env { "dev": false, "disableOptimizer": true, "dist": false, - "oss": false, "quiet": false, "repl": false, "runExamples": false, @@ -183,7 +179,6 @@ Env { "dev": false, "disableOptimizer": true, "dist": false, - "oss": false, "quiet": false, "repl": false, "runExamples": false, @@ -226,7 +221,6 @@ Env { "dev": false, "disableOptimizer": true, "dist": false, - "oss": false, "quiet": false, "repl": false, "runExamples": false, diff --git a/packages/osd-config/src/env.ts b/packages/osd-config/src/env.ts index c162039a80a2..3713e5d56a56 100644 --- a/packages/osd-config/src/env.ts +++ b/packages/osd-config/src/env.ts @@ -37,7 +37,6 @@ export interface CliArgs { watch: boolean; repl: boolean; basePath: boolean; - oss: boolean; /** @deprecated use disableOptimizer to know if the @osd/optimizer is disabled in development */ optimize?: boolean; runExamples: boolean; diff --git a/src/cli/cluster/cluster_manager.test.ts b/src/cli/cluster/cluster_manager.test.ts index 7736b9a87a70..4192ab34ea3a 100644 --- a/src/cli/cluster/cluster_manager.test.ts +++ b/src/cli/cluster/cluster_manager.test.ts @@ -38,7 +38,6 @@ import { Worker } from './worker'; const CLI_ARGS: SomeCliArgs = { disableOptimizer: true, - oss: false, quiet: false, repl: false, runExamples: false, diff --git a/src/cli/cluster/cluster_manager.ts b/src/cli/cluster/cluster_manager.ts index 4e768728c6ce..92e613fd080d 100644 --- a/src/cli/cluster/cluster_manager.ts +++ b/src/cli/cluster/cluster_manager.ts @@ -37,15 +37,7 @@ process.env.osdWorkerType = 'managr'; export type SomeCliArgs = Pick< CliArgs, - | 'quiet' - | 'silent' - | 'repl' - | 'disableOptimizer' - | 'watch' - | 'oss' - | 'runExamples' - | 'cache' - | 'dist' + 'quiet' | 'silent' | 'repl' | 'disableOptimizer' | 'watch' | 'runExamples' | 'cache' | 'dist' >; const firstAllTrue = (...sources: Array>) => diff --git a/src/cli/cluster/run_osd_optimizer.ts b/src/cli/cluster/run_osd_optimizer.ts index fe211a122470..7ba01128602e 100644 --- a/src/cli/cluster/run_osd_optimizer.ts +++ b/src/cli/cluster/run_osd_optimizer.ts @@ -31,7 +31,7 @@ import { runOptimizer, OptimizerConfig, logOptimizerState } from '@osd/optimizer import { CliArgs } from '../../core/server/config'; import { LegacyConfig } from '../../core/server/legacy'; -type SomeCliArgs = Pick; +type SomeCliArgs = Pick; export function runOsdOptimizer(opts: SomeCliArgs, config: LegacyConfig) { const optimizerConfig = OptimizerConfig.create({ @@ -40,7 +40,6 @@ export function runOsdOptimizer(opts: SomeCliArgs, config: LegacyConfig) { includeCoreBundle: true, cache: !!opts.cache, dist: !!opts.dist, - oss: !!opts.oss, examples: !!opts.runExamples, pluginPaths: config.get('plugins.paths'), }); diff --git a/src/cli/serve/integration_tests/reload_logging_config.test.ts b/src/cli/serve/integration_tests/reload_logging_config.test.ts index a074ad4dea80..e72c088dc318 100644 --- a/src/cli/serve/integration_tests/reload_logging_config.test.ts +++ b/src/cli/serve/integration_tests/reload_logging_config.test.ts @@ -117,7 +117,6 @@ describe('Server logging configuration', function () { child = Child.spawn(process.execPath, [ opensearchDashboardsPath, - '--oss', '--config', configFilePath, '--verbose', @@ -163,7 +162,6 @@ describe('Server logging configuration', function () { child = Child.spawn(process.execPath, [ opensearchDashboardsPath, - '--oss', '--config', legacyConfig, '--logging.dest', @@ -191,7 +189,6 @@ describe('Server logging configuration', function () { child = Child.spawn(process.execPath, [ opensearchDashboardsPath, - '--oss', '--config', configFilePath, ]); @@ -242,7 +239,6 @@ describe('Server logging configuration', function () { child = Child.spawn(process.execPath, [ opensearchDashboardsPath, - '--oss', '--config', configFilePath, ]); diff --git a/src/cli/serve/serve.js b/src/cli/serve/serve.js index 9321adf653eb..5c1f7c6b0537 100644 --- a/src/cli/serve/serve.js +++ b/src/cli/serve/serve.js @@ -66,10 +66,6 @@ function applyConfigOverrides(rawConfig, opts, extraCliOptions) { const has = _.partial(_.has, rawConfig); const merge = _.partial(_.merge, rawConfig); - if (opts.oss) { - delete rawConfig.xpack; - } - if (opts.dev) { set('env', 'development'); @@ -179,12 +175,10 @@ export default function (program) { } if (!IS_OPENSEARCH_DASHBOARDS_DISTRIBUTABLE) { - command - .option('--oss', 'Start OpenSearch Dashboards without X-Pack') - .option( - '--run-examples', - 'Adds plugin paths for all the OpenSearch Dashboards example plugins and runs with no base path' - ); + command.option( + '--run-examples', + 'Adds plugin paths for all the OpenSearch Dashboards example plugins and runs with no base path' + ); } if (CAN_CLUSTER) { @@ -236,7 +230,6 @@ export default function (program) { basePath: opts.runExamples ? false : !!opts.basePath, optimize: !!opts.optimize, disableOptimizer: !opts.optimizer, - oss: !!opts.oss, cache: !!opts.cache, dist: !!opts.dist, }, diff --git a/src/core/test_helpers/osd_server.ts b/src/core/test_helpers/osd_server.ts index 517de9f73274..90953abee722 100644 --- a/src/core/test_helpers/osd_server.ts +++ b/src/core/test_helpers/osd_server.ts @@ -76,7 +76,6 @@ export function createRootWithSettings( repl: false, basePath: false, runExamples: false, - oss: true, disableOptimizer: true, cache: true, dist: false,