-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Decouple screenshotting plugin from the reporting #120110
Conversation
00292ee
to
3f508e1
Compare
|
||
layout: { | ||
zoom: config.get('capture', 'zoom'), | ||
...options.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.
It feels like all of these config options could be moved over and given the renameFromRoot
treatment, as the others have. Let's do that in another PR, unless you object.
xpack.reporting.capture.timeouts
xpack.reporting.capture.zoom
xpack.reporting.capture.loadDelay
x-pack/plugins/screenshotting/server/browsers/chromium/paths.ts
Outdated
Show resolved
Hide resolved
823b8b9
to
66391b4
Compare
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 is looking really good so far @dokmic !
Might be a pre-existing issue but generating a PDF report from Canvas resulted in:
[2021-12-03T15:24:37.939+01:00][WARN ][plugins.screenshotting.screenshot.browser-driver] Reporting encountered an uncaught error on the page that will be ignored: Error: TypeError: Cannot read property 'setScreenshotLayout' of undefined
at <anonymous>:1:31
at <anonymous>:1:58
being logged. This was really just a warning since the report did generate successfully. Not sure why that happened though, could be that Canvas just does not depend on screenshot mode.
I tested in Canvas and Dashboard and everything worked as expected. Great work!
[UPDATE]
Happy to merge once CI is green ;)
{ | ||
title: i18n.translate('xpack.reporting.listing.infoPanel.browserTypeInfo', { | ||
defaultMessage: 'Browser type', | ||
}), | ||
description: info.browser_type || NA, | ||
}, |
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.
Thanks for cleaning this up!
6eb0310
to
6032c78
Compare
jobLogger.error(err); | ||
return Rx.throwError(err); | ||
}), | ||
tap({ error: (error) => jobLogger.error(error) }), |
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.
much better 😅
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
Pulled the branch and tested the code. Did yarn build
to test in a VM.
Reviewed the code by merging main
and looking at git diff -M -w main
6032c78
to
7b72877
Compare
Pinging @elastic/kibana-app-services (Team:AppServicesUx) |
That was an actual bug that is fixed now. Thanks, @jloleysens. |
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.
Did not re-test, but approving based on previous testing. Great work!
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
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.
Removing the browser_type
usage field is ok for telemetry. Removing the field from the index mapping would require a reindex, as the indices are strictly mapped.
LGTM
@@ -117,3 +117,4 @@ pageLoadAssetSize: | |||
dataViewManagement: 5000 | |||
reporting: 57003 | |||
visTypeHeatmap: 25340 | |||
screenshotting: 17017 |
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.
Do you mind helping me understand the value of screenshotting
adding a new 2kb request to every page load? It looks like it stored a very tiny amount of state which could easily be managed by the reporting plugin and just increases the overall page load size and request count, but I'm probably missing something.
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.
If there isn't a good reason it would be great if we could set "ui": false
to the kibana.json
file and move the contextStorage
stuff to the reporting
plugin.
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.
That exposes a generic service working with the screenshotting context. The idea is that some of the plugins will use that to extract some serialized data without having a dependency on the reporting. This code will be merged with the screenshotMode
plugin later, so won't stay long here.
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
…-chromium-before-compiling-pdf * 'main' of github.com:elastic/kibana: (121 commits) FTR should use the new kibana_system user (elastic#120436) [Lens] Temporarily exclude Mosaic/Waffle from the suggestions list (elastic#120488) [Reporting] Fix slow CSV with large max size bytes (elastic#120365) [CTI] Threat Intel Card on Overview page needs to accommodate Fleet TI integrations - (elastic#120459) [Dashboard] Added KibanaThemeProvider. (elastic#120122) add more rule_registry unit tests (elastic#120323) [Lens] update xpack.lens.pie.smallValuesWarningMessage text (elastic#120478) [Fleet] Simplified package policy create API, enriching default values (elastic#119739) mock `elastic-apm-node` in `@kbn/test` jest preset (elastic#120324) [RAC] Rename occurrences of alert_type to rule_type in Infra (elastic#120455) [Security Solutions] Removes tech debt of exporting all from linter rule for timeline plugin (elastic#120437) [Workplace Search] Add API Keys view to replace Access tokens (elastic#120147) [Security Solutions] Removes tech debt of exporting all from linter rule for cases plugin in the server section (elastic#120411) Add support for threat.feed.name (elastic#120250) [Rule Registry] Rewrite APM registry rules for Observability (elastic#117740) [docs] Fix artifact layout formatting (elastic#119386) [Workplace Search] Add a technical preview of connecting GitHub via GitHub apps (elastic#119764) add osquery notes for 7.16 (elastic#120407) chore(NA): splits types from code on @kbn/docs-utils (elastic#120533) [Reporting] Decouple screenshotting plugin from the reporting (elastic#120110) ... # Conflicts: # x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.test.ts # x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts # x-pack/plugins/reporting/server/lib/screenshots/observable.test.ts # x-pack/plugins/reporting/server/lib/screenshots/observable.ts # x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts
I'm on M1X chip and I see an error when running Here's what I have in the console:
Let me know if I can help with the debugging. Happy to pair. EDIT: Just found that a PR has already been created to fix it! #120659 |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Removed the 8.0 version label as we are past feature freeze for that branch |
…c#120110) * Add screenshotting plugin * Move screenshotting plugin configuration options * Remove unused browser type configuration option # Conflicts: # packages/kbn-optimizer/limits.yml # x-pack/plugins/reporting/server/export_types/common/generate_png.ts # x-pack/plugins/reporting/server/export_types/png/execute_job/index.ts # x-pack/plugins/reporting/server/export_types/png_v2/execute_job.ts # x-pack/plugins/reporting/server/export_types/printable_pdf/lib/tracker.ts # x-pack/plugins/reporting/server/export_types/printable_pdf_v2/lib/tracker.ts # x-pack/plugins/reporting/server/lib/screenshots/observable.ts # x-pack/plugins/reporting/server/lib/screenshots/observable_handler.ts
… (#120937) * Add screenshotting plugin * Move screenshotting plugin configuration options * Remove unused browser type configuration option # Conflicts: # packages/kbn-optimizer/limits.yml # x-pack/plugins/reporting/server/export_types/common/generate_png.ts # x-pack/plugins/reporting/server/export_types/png/execute_job/index.ts # x-pack/plugins/reporting/server/export_types/png_v2/execute_job.ts # x-pack/plugins/reporting/server/export_types/printable_pdf/lib/tracker.ts # x-pack/plugins/reporting/server/export_types/printable_pdf_v2/lib/tracker.ts # x-pack/plugins/reporting/server/lib/screenshots/observable.ts # x-pack/plugins/reporting/server/lib/screenshots/observable_handler.ts
…c#120110) * Add screenshotting plugin * Move screenshotting plugin configuration options * Remove unused browser type configuration option
Summary
Resolves #116503. This plugin moves all the screenshot taking logic out of the reporting plugin.
Checklist
For maintainers