Making schema async, and plugin discovery expose raw package jsons#18926
Making schema async, and plugin discovery expose raw package jsons#18926kobelb merged 5 commits intoelastic:masterfrom
Conversation
| // only emitted once it is fully extended by all | ||
| extendedConfig$: extendConfig$ | ||
| .ignoreElements() | ||
| .concat([config]), |
There was a problem hiding this comment.
The purpose of .concat() here was to wait until extendConfig$ completes and config$ is fully extended before emitting. If the idea here is to subscribe to config$ before extendConfig$ completes, perhaps .combineLatest(extendConfig$.last(), config$).map(x => x[1]) is more what we want.
There was a problem hiding this comment.
What if we just emit the config from the extendConfig$? I pushed a commit that does just this, lemme know what you think.
|
|
||
| export const createPack$ = (packageJson$) => ( | ||
| packageJson$ | ||
| .mergeMap(({ error, packageJson }) => { |
There was a problem hiding this comment.
.map() should be sufficient here, and I suggest making this a bit more resilient by either checking specifically for result.packageJson and either forwarding any result that doesn't have a packageJson property or throwing an informative error when an unexpected result is received.
| } | ||
|
|
||
| return await defaultConfig(settings); | ||
| }); |
There was a problem hiding this comment.
config$ is subscribed to multiple times but not shared.
src/cli/cluster/cluster_manager.js
Outdated
| const extraPaths = [ | ||
| ...settings.plugins.paths, | ||
| ...settings.plugins.scanDirs, | ||
| ...config.get('plugins.paths'), |
| extendedConfig$: extendConfig$ | ||
| .ignoreElements() | ||
| .concat([config]), | ||
| .mergeMap(result => result.config), |
There was a problem hiding this comment.
We should probably include .filter(Boolean).last() here, and might as well add a test that verifies that a single config instance is emitted and that it has the extensions from all plugins when emitted.
💔 Build Failed |
|
Jenkins, test this CI failure appears to be the headless browser dying. |
💔 Build Failed |
|
Jenkins, test this Another unrelated CI failure with the following flaky test: |
💚 Build Succeeded |
…lastic#18926) * Making schema async, and plugin discovery expose raw package jsons * Addressing some peer review comments * Modifying the way we emit the extendedConfig * Removing errant config * Adding filter and last so we only get the last non-null one
|
6.x/6.4: c9cb810 |
Subset of changes introduced by https://github.com/elastic/kibana/pull/17496/files that don't include the introduction of native controllers.