-
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] Move code out of Legacy #67904
Conversation
9f0d370
to
c1b0429
Compare
Pinging @elastic/kibana-reporting-services (Team:Reporting Services) |
0c824ba
to
5d7a5fa
Compare
5d7a5fa
to
57bf1cc
Compare
@@ -9,7 +9,7 @@ import { map, trunc } from 'lodash'; | |||
import open from 'opn'; | |||
import { ElementHandle, EvaluateFn, Page, Response, SerializableOrJSHandle } from 'puppeteer'; | |||
import { parse as parseUrl } from 'url'; | |||
import { ViewZoomWidthHeight } from '../../../../export_types/common/layouts/layout'; | |||
import { ViewZoomWidthHeight } from '../../../export_types/common/layouts/layout'; |
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.
TODO (future PR) move export_type/common
code to server/
and server/lib
error: consoleLogger('error'), | ||
fatal: consoleLogger('fatal'), | ||
log: consoleLogger('log'), | ||
}; |
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.
There may be an easier way to do this, but LoggerFactory
is just an interface. It would be nice to have a constructor to call from here instead of implementing the interface.
Pinging @elastic/apm-ui (Team:apm) |
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.
maps changes LGTM
code review
@@ -40,7 +40,7 @@ echo "Creating bootstrap_cache archive" | |||
# archive cacheable directories | |||
mkdir -p "$HOME/.kibana/bootstrap_cache" | |||
tar -cf "$HOME/.kibana/bootstrap_cache/$branch.tar" \ | |||
x-pack/legacy/plugins/reporting/.chromium \ | |||
x-pack/plugins/reporting/.chromium \ |
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.
Nice find on these
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.
Operations: LGTM
ack: will review tomorrow. |
@pgayvallet this is mostly just us |
Re #67904 (comment), I've updated the PR description to mention the things that had to be done in the code other than moving files. |
@tsullivan I didn't see any reviewers up to this point mention that they did any functional testing of reporting. I don't think our automated coverage is very good on generated PDFs but I could have missed some tests. Could you please comment on the automated test coverage on reporting and any manual tests the reporting team has done on this PR. And also what kind of manual testing (if any) still needs to be done before merging this? |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
@LeeDr automated functional test coverage of PDFs is in fact pretty good, and test coverage of reporting is pretty good in general. Both kind of tests have caught critical issues while this PR was in development. Quick summary of what automated testing has:
Edit: Note that we don't have PDF comparison tests, but we do test that the PDF download status is 200. |
@@ -4,6 +4,7 @@ | |||
* you may not use this file except in compliance with the Elastic License. | |||
*/ | |||
|
|||
import { ReportingCore } from '../../../../'; |
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.
Note: I'm using the "Organize Imports" feature in VS Code to straighten these out. Not sure why it put this one at the top, but it's ok I guess.
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.
LGTM
Thanks @tsullivan Good to hear. |
@LeeDr alongside Tim's comment, I did the following manual tests (with Sample Data ™️):
Alongside that, I did also add numerous automated unit/functional tests for the generation routes. They're not as clear on this PR, but they're here for illustrative purposes: x-pack/legacy/plugins/reporting/server/routes/generation.test.ts → x-pack/plugins/reporting/server/routes/generation.test.ts. I can point to the changes from the route-specific PR if that's helpful. About the only thing I haven't had a chance to check is the code-coverage from our package. I'd be curious to see that since my suspicion is that our coverage has gone up. EDIT: Unit/functional test changes are here: https://github.com/elastic/kibana/pull/66331/files#diff-d1a8df0442cc9e5180f8f3fdd587810b. In most there's a few additional specs I've added where it made sense FINAL EDIT: We also did shore up a few loose |
7.x PR: #68201 (targeting 7.9) |
* [Reporting] Move code out of Legacy (#67904) * [Reporting] Move code out of Legacy * Elasticsearch is not a plugin dep * add data as plugin dependo * diff cleanup 1 * log the browser download * Update paths in outside code for new Reporting home * fix download test * add numeral typing for x-pack/test * Fix jest tests for np migration * Shorten import paths * remove this file, add typings to the node module * remove local typing that has been provided by node module * Add optional security plugin dep * revert conflicting apm typings removal * fix i18n * fix snakecase whitelist Co-authored-by: Joel Griffith <[email protected]> Co-authored-by: Elastic Machine <[email protected]> # Conflicts: # .ci/packer_cache.sh # src/dev/code_coverage/ingest_coverage/__tests__/transforms.test.js # src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-manual-mix.json # x-pack/plugins/reporting/server/export_types/printable_pdf/server/create_job/index.ts * Add back in legacy bwc route * Kill code_coverage since it's not supposed to be here... Co-authored-by: Tim Sullivan <[email protected]>
…ms-column * 'master' of github.com:elastic/kibana: (63 commits) remove scripts. prettire update has been done (elastic#68130) Closes elastic#68055 by detecting the local Kibana version and using that as (elastic#68198) [apm] docs: add deployment annotation example (elastic#67408) [ML] Extend population preview chart to show actual and typical value (elastic#67569) Refactor index management client integration tests for scalability (elastic#67917) Add generator function that creates multiple alerts (elastic#67713) chore(NA): remove config arg from os packages (elastic#67871) [Reporting] Move code out of Legacy (elastic#67904) [Metrics UI] Add overrides to Snapshot API to support alert previews (elastic#68125) [Security] [Cases] Manage timeline UI API (elastic#67719) [ENDPOINT][INGEST]Task/endpoint ingest update (elastic#67234) Fix code coverage for jest, upload merged reports (elastic#68149) Update documentation/examples of deprecated namespaceAgnostic field (elastic#68039) [DOCS] Updates Canvas docs with new menus (elastic#66061) chore(NA): avoids imports of server or public code into common (elastic#67231) [SIEM] Fix GetOneTimeline graphql type (elastic#68137) skip flaky suite (elastic#67838) [Uptime] Add loading message for monitor list no items (elastic#67378) [Ingest Manager] Update indexing strategy docs to use dataset.* (elastic#68068) [Ingest Manager] Fix datasource validation for streams without vars (elastic#67950) ... # Conflicts: # x-pack/plugins/index_management/__jest__/client_integration/helpers/index.ts # x-pack/plugins/index_management/__jest__/client_integration/home.test.ts # x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts
* master: (26 commits) [Console]remove completion for type for filter queries and aggs (elastic#68103) [ML] Transforms: Filter aggregation support (elastic#67591) [ES UI Shared] Monaco XJSON (elastic#67485) [Index Management] Add data streams functionality to indices tab (elastic#67940) [Discover] Fix renaming of saved search not displayed in breadcrumb (elastic#67577) [SECURITY] Rename siem plugin to security_solution (elastic#67902) [Uptime] Fix Telemetry Api flaky test (elastic#67358) [Data plugin] Add configuration property to enable / disable autocomplete (elastic#67847) remove scripts. prettire update has been done (elastic#68130) Closes elastic#68055 by detecting the local Kibana version and using that as (elastic#68198) [apm] docs: add deployment annotation example (elastic#67408) [ML] Extend population preview chart to show actual and typical value (elastic#67569) Refactor index management client integration tests for scalability (elastic#67917) Add generator function that creates multiple alerts (elastic#67713) chore(NA): remove config arg from os packages (elastic#67871) [Reporting] Move code out of Legacy (elastic#67904) [Metrics UI] Add overrides to Snapshot API to support alert previews (elastic#68125) [Security] [Cases] Manage timeline UI API (elastic#67719) [ENDPOINT][INGEST]Task/endpoint ingest update (elastic#67234) Fix code coverage for jest, upload merged reports (elastic#68149) ...
Summary
Closes #53898
Move all the Reporting migrated code from legacy to the Kibana Platform (NP). Previously, Reporting plugin initialization was happening in legacy code, using mocked plugin context and cross-plugin dependences. The legacy code is completely removed in this code, and the New Platform code was updated to absorb the plugin init responsibilities, using true plugin init context and cross-plugin dependencies
This PR has no changes to user-facing features or breaking changes.
Checklist
Delete any items that are not applicable to this PR.
For maintainers