[Reporting] Remove any types and references to Hapi#49250
[Reporting] Remove any types and references to Hapi#49250tsullivan merged 5 commits intoelastic:masterfrom
Conversation
f779325 to
470c47f
Compare
| */ | ||
|
|
||
| interface AvailableTotal { | ||
| export interface AvailableTotal { |
There was a problem hiding this comment.
This change doesn't seem to fix any problems, but I am not sure how this works without the export. Another file imports this interface!
This comment has been minimized.
This comment has been minimized.
|
Pinging @elastic/kibana-stack-services (Team:Stack Services) |
joelgriffith
left a comment
There was a problem hiding this comment.
Really nice to see these types coming through, just a few follow ups/questions I had!
| const workerFn = (job: JobSource, jobdoc: JobDocPayload | JobDoc, cancellationToken?: any) => { | ||
| const workerFn = ( | ||
| job: JobSource, | ||
| arg1: JobDocPayload | JobDoc, |
There was a problem hiding this comment.
Maybe:
arg1 => job
arg2 => cancelToken?
There was a problem hiding this comment.
This is not a great part of the code - without Typescript, some bad design problems were hidden.
The idea is "worker functions" can come from different export types, but one export type changes the idea about what a worker function could be, that's the "immediate" execute type, which is in CSV export from Panel Action and doesn't go through job queuing. It registers a worker function that has a different signature. It'll be great to figure this out better when ESQueue goes away :)
There was a problem hiding this comment.
I'm going to leave this as-is because the arguments don't have a single semantic meaning
| import crypto from 'crypto'; | ||
| import { Logger } from '../../../types'; | ||
| import { ServerFacade, Logger } from '../../../types'; | ||
|
|
There was a problem hiding this comment.
This is a tough one since it's setting and defaulting a config... I wonder if we can push this in our joi schema somehow?
EDIT: This was said with the thought that we should insulate ourselves from the server object as much as possible.
There was a problem hiding this comment.
I agree, it is tough because we could do more here to protect the environment from bad things happening. But giving them a made-up encryptionKey on the fly does help the first-time user experience.
| switch (exportType.jobContentEncoding) { | ||
| case 'base64': | ||
| return Buffer.from(content, 'base64'); | ||
| return content ? Buffer.from(content, 'base64') : content; |
There was a problem hiding this comment.
This is an interesting change, could you explain why we only do Buffer.from when it's defined (assuming the truthy check is for that)
There was a problem hiding this comment.
It is because Buffer.from complains about null, so this may have been a bug hiding here.
|
@elasticmachine merge upstream |
💔 Build Failed |
💚 Build Succeeded |
|
Nice work! We'll need to figure out that encryption key stuff at some point, but save that for another PR |
| config.set('xpack.reporting.encryptionKey', crypto.randomBytes(16).toString('hex')); | ||
|
|
||
| // @ts-ignore: No set() method on KibanaConfig, just get() and has() | ||
| config.set('xpack.reporting.encryptionKey', crypto.randomBytes(16).toString('hex')); // update config in memory to contain a usable encryption key |
There was a problem hiding this comment.
Hm, this part in particular might need a followup, if .set is not in the type because it is going away...
💚 Build Succeeded |
|
Backporting to 7.x/7.6 depends on #50694 going in first |
…ger-ace-theme * 'master' of github.com:elastic/kibana: (54 commits) [ML] Fixes word wrap in Overview page sidebar on IE (elastic#50668) Upgrade to TypeScript 3.7.2 (elastic#47188) fix: hide 'edit' button for mobile for dashboards (elastic#50639) fixes conditional links tests (elastic#50642) [SIEM] Fix IE11 timeline drag and drop issue (elastic#50528) [SIEM] Add SavedQuery in Timeline (elastic#49813) chore(NA): remove code plugin from codeowners (elastic#50451) [DOCS] Adds documentation on telemetry settings (elastic#50739) [Logs UI] Add IE11-specific CSS fixes for anomalies table (elastic#49980) [DOCS][SIEM]: Change Kibana advanced settings to match UI (elastic#50679) Change URLs for support menu (elastic#50700) [Reporting] Remove any types and references to Hapi (elastic#49250) [DOCS] Adds note about backups to Upgrade doc (elastic#50525) [Logs UI] Improve infra plugin compatibility with TS 3.7 (elastic#50491) [Task manager] Adds ensureScheduling api to allow safer rescheduling of existing tasks (elastic#50232) [DOCS] Adds link to content security policy doc (elastic#50698) Remove duplicate but in error message (elastic#50530) [ML] DF Analytics: Ensure creation flyout can be opened when no jobs exist (elastic#50417) Add filebeat notice (elastic#49065) [Monitoring] De-duplicate pipeline ids based on the ephemeral_id changing (elastic#49978) ... # Conflicts: # x-pack/legacy/plugins/grokdebugger/public/components/grok_debugger/brace_imports.ts
|
Backport: #50948 |
* [Reporting] Remove any types and references to Hapi * clarification comment * fix import
Summary
Follow along #48825 in migrating Reporting to the Kibana new platform.
anytypes and replace them with the typed correctionRelease Notes: Changes to prepare Reporting for Kibana v8.0.0
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] 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[ ] Unit or functional tests were updated or added to match the most common scenarios[ ] This was checked for keyboard-only and screenreader accessibility