Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reporting] Switch Serverside Config Wrapper to NP #62500

Merged
merged 33 commits into from
Apr 15, 2020

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Apr 3, 2020

Summary

Followup of: #62086
Replaces: #61696

#62086 shimmed the server code with a module that abstracts reading config settings in Reporting. This PR switches the internals of the shim to source the config from NP instead of legacy.

Checklist

Delete any items that are not applicable to this PR.

  • Unit or functional tests were updated or added to match the most common scenarios
  • Updated docs to reflect latest log messages

For maintainers

@@ -12,8 +12,6 @@ import { createQueueFactory, enqueueJobFactory, LevelLogger, runValidations } fr
import { setFieldFormats } from './services';
import { ReportingSetup, ReportingSetupDeps, ReportingStart, ReportingStartDeps } from './types';
import { registerReportingUsageCollector } from './usage';
// @ts-ignore no module definition
import { mirrorPluginStatus } from '../../../server/lib/mirror_plugin_status';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts-ignore was hiding this dead code

@tsullivan tsullivan force-pushed the reporting/server-config-np-switch branch 7 times, most recently from ed4ea89 to b887cec Compare April 4, 2020 14:33
@tsullivan tsullivan force-pushed the reporting/server-config-np-switch branch from b887cec to 886f976 Compare April 5, 2020 04:15
@tsullivan tsullivan marked this pull request as ready for review April 6, 2020 18:33
@@ -204,11 +78,12 @@ export const buildConfig = (
};

// spreading arguments as an array allows the return type to be known by the compiler
reportingConfig = addConfigDefaults(server, core, reportingConfig);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Config defaults are now being applied in NP code in createConfig$

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

public async setup(core: CoreSetup): Promise<PluginsSetup> {
return {
__legacy: {
config$: createConfig$(core, this.initializerContext, this.log).pipe(first()),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, the only role of the Reporting server-side plugin in NP is to expose the config in the plugin contract.

@tsullivan tsullivan requested review from joelgriffith and a team April 6, 2020 19:07
Copy link
Contributor

@joelgriffith joelgriffith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@@ -10,7 +10,7 @@ type ViewportConfig = CaptureConfig['viewport'];
type BrowserConfig = CaptureConfig['browser']['chromium'];

interface LaunchArgs {
userDataDir: BrowserConfig['userDataDir'];
userDataDir: string;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a bug with pre-existing type defs


interface BrowserConfig {
inspect: boolean;
userDataDir: string;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

userDataDir is actually not in the reporting plugin config

@@ -11,7 +11,7 @@ import { PluginStart as DataPluginStart } from '../../../../../src/plugins/data/
import { SecurityPluginSetup } from '../../../../plugins/security/server';
import { XPackMainPlugin } from '../../xpack_main/server/xpack_main';
import { ReportingPluginSpecOptions } from '../types';
import { ReportingConfig, ReportingConfigType } from './core';
import { ReportingConfigType } from './core';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaned up unused import

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Contributor

@poffdeluxe poffdeluxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small questions on the PR but otherwise lgtm

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@tsullivan tsullivan merged commit f4c81b4 into elastic:master Apr 15, 2020
@tsullivan tsullivan deleted the reporting/server-config-np-switch branch April 15, 2020 21:52
tsullivan added a commit to tsullivan/kibana that referenced this pull request Apr 15, 2020
* New config

* fix translations json

* add csv.useByteOrderMarkEncoding to schema

* imports cleanup

* restore "get default chromium sandbox disabled" functionality

* integrate getDefaultChromiumSandboxDisabled

* fix tests

* --wip-- [skip ci]

* add more schema tests

* diff prettiness

* trash legacy files that moved to NP

* create_config tests

* Hoist create_config

* better disableSandbox tests

* fix ts

* fix export

* fix bad code

* make comments better

* fix i18n

* comment

* automatically setting... logs

* replace log_configuration

* fix lint

* This is f2

* improve startup log about sandbox info

* update docs with log reference

* revert log removal

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
tsullivan added a commit that referenced this pull request Apr 16, 2020
* New config

* fix translations json

* add csv.useByteOrderMarkEncoding to schema

* imports cleanup

* restore "get default chromium sandbox disabled" functionality

* integrate getDefaultChromiumSandboxDisabled

* fix tests

* --wip-- [skip ci]

* add more schema tests

* diff prettiness

* trash legacy files that moved to NP

* create_config tests

* Hoist create_config

* better disableSandbox tests

* fix ts

* fix export

* fix bad code

* make comments better

* fix i18n

* comment

* automatically setting... logs

* replace log_configuration

* fix lint

* This is f2

* improve startup log about sandbox info

* update docs with log reference

* revert log removal

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Apr 17, 2020
* master: (56 commits)
  [i18n] Update CODEOWNERS (elastic#63354)
  add platform team definition of done (elastic#59993)
  [SIEM] move away from Joi for importing/exporting timeline (elastic#62125)
  Fix discover preserve url (elastic#63580)
  [alerting] Adds an alertServices mock and uses it in siem, monitoring and uptime (elastic#63489)
  Closes elastic#63109 for Service Map by resetting edges styles for the selected node (elastic#63655)
  MIgrated index_header to react (elastic#63490)
  Index pattern management UI -> TypeScript and New Platform Ready (indexed_fields_table) (elastic#63364)
  [SIEM] [Cases] Insert timeline and reporters/tags in table bug fixes (elastic#63642)
  [Reporting] Make usable default element positions (elastic#63191)
  [Reporting] Switch Serverside Config Wrapper to NP (elastic#62500)
  [Reporting] Add "warning" status as an alternate type of completed job (elastic#63498)
  Split action types into own page (elastic#63516)
  [Lens] Only show copy on save for previously saved docs (elastic#63535)
  Update README.md (elastic#63622)
  Bugfix clear saved query crashes kibana on Discover in some cases (elastic#63554)
  Add uptime CODEOWNER entries. (elastic#63616)
  [ML] Extract apiDoc params from the schema definitions (elastic#62933)
  Fix alerting documentation encryption key requirement (elastic#63512)
  Fix CODEOWNERS and sass lint paths (elastic#63552)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration release_note:skip Skip the PR/issue when compiling release notes v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants