-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Use a shim for server config #62086
[Reporting] Use a shim for server config #62086
Conversation
46b12fd
to
58c12cb
Compare
832cb9b
to
79b1481
Compare
79b1481
to
1705882
Compare
@@ -51,15 +51,8 @@ export function registerGenerateCsvFromSavedObjectImmediate( | |||
const request = makeRequestFacade(legacyRequest); | |||
const logger = parentLogger.clone(['savedobject-csv']); | |||
const jobParams = getJobParamsFromRequest(request, { isImmediate: true }); | |||
|
|||
/* TODO these functions should be made available in the export types registry: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we make the "execute job function factory" functions return immediately instead of returning a promise, I'd be satisfied this TODO is no longer needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW a few more of these TODOs have been removed, above
JobParamsType, | ||
unknown, | ||
unknown, | ||
ImmediateExecuteFn<JobParamsType> | ESQueueWorkerExecuteFn<JobDocPayloadType> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replacing the any
here helps provide the correct typing for jobExecutor
parentLogger: Logger | ||
) { | ||
const browserDriverFactory = await reporting.getBrowserDriverFactory(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR starts moving async things in execute job factory function to be resolved in the function that is returned instead of before, so the factory function can return immediately instead of returning a promise. Having reporting.getConfig()
return synchronously (instead of async) kind of helps get that idea working.
@@ -16,7 +16,7 @@ import { ReportingConfig, ReportingConfigType } from './core'; | |||
export interface ReportingSetupDeps { | |||
elasticsearch: ElasticsearchServiceSetup; | |||
security: SecurityPluginSetup; | |||
usageCollection: UsageCollectionSetup; | |||
usageCollection?: UsageCollectionSetup; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whew, LGTM, the difference in additions/subtractions
* config shim * simplify route register calls * switch to in-sync worker functions * fix tests * comment * fix set up config with defaults * reduce loc change * remove test for removed file * reportingconfigtype * revert changing executeJobFactory to synchronous * imports cleanup * Clean up some awaits * undo comment * clean up async * clean up imports * add warning logs for config defaults * Move around some config shim code * Register routes params take ReportingCore * usageCollection is an optional dependency
…into event-log/query-support * 'event-log/query-support' of github.com:gmmorris/kibana: (41 commits) [jenkins] refer to sizes in most pipeline code (elastic#62082) skip flaky suite (elastic#60470) [Discover] Fix flaky FT in field visualize (elastic#62418) [ML] Data Frame Analytics: Fix feature importance (elastic#61761) [Reporting] Use a shim for server config (elastic#62086) [Reporting] Fix reporting for non-default spaces (elastic#62226) Fix bug that coerced empty scaled float value to 0 (elastic#62251) [SIEM] [Detection Engine] Remove has manage api keys requireme… (elastic#62446) [Maps] Safely handle empty string and invalid strings from EuiColorPicker (elastic#62507) Reporting/bug more blacklisted headers (elastic#62389) [SIEM] Prevent undefined behavior in our ML popover (elastic#62498) [SIEM] [Detection Engine] remove all unknowns from all rules t… (elastic#62327) base changes for active/current node styling (elastic#62007) [kbn/ui-shared-deps] expand and split (elastic#62364) [ML] DF Analytics - ensure destination index pattern created (elastic#62450) Mark rule run as failure if there was an error (elastic#62383) Add docs for metric explorer alerts (elastic#62314) skip flaky suite (elastic#62281) [SIEM][Detection Engine] Fixes export of single rule and the icons fixes flakiness (elastic#62406) ...
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
* [Reporting] Use a shim for server config (#62086) * config shim * simplify route register calls * switch to in-sync worker functions * fix tests * comment * fix set up config with defaults * reduce loc change * remove test for removed file * reportingconfigtype * revert changing executeJobFactory to synchronous * imports cleanup * Clean up some awaits * undo comment * clean up async * clean up imports * add warning logs for config defaults * Move around some config shim code * Register routes params take ReportingCore * usageCollection is an optional dependency * get config from ReportingCore for legacy (7.x) routes * fix parse errors * fix 7.x deltas Co-authored-by: Elastic Machine <[email protected]>
Summary
This PR is to break out some changes from #61696. It retains the changes that update the call signatures of the code, but this PR does not actually change the source of config: the config data still comes from
server.config().get()
-- not the New Platform yet.Checklist
Delete any items that are not applicable to this PR.
[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] This was checked for keyboard-only and screenreader accessibility[ ] This renders correctly on smaller devices using a responsive layout. (You can test this in your browser[ ] This was checked for cross-browser compatibility, including a check against IE11For maintainers