[Reporting] Use spaceId from request in export generation#76998
[Reporting] Use spaceId from request in export generation#76998tsullivan merged 20 commits intoelastic:masterfrom
Conversation
dd19128 to
9ef809a
Compare
There was a problem hiding this comment.
This is the no-longer-working code for supporting spaces in our UI Settings clients.
a16c44c to
baafb3f
Compare
1acd05e to
1953026
Compare
1953026 to
d041bc4
Compare
There was a problem hiding this comment.
I refactored getCustomLogo to receive more specific parameters. The other common helper functions here could probably use the same thing
|
Pinging @elastic/kibana-reporting-services (Team:Reporting Services) |
…/get_custom_logo.ts Co-authored-by: Joel Griffith <joel@joelgriffith.net>
| if (spacesService) { | ||
| if (spaceId && spaceId !== DEFAULT_SPACE_ID) { | ||
| this.logger.info(`Generating request for space: ` + spaceId); | ||
| this.getPluginSetupDeps().basePath.set(fakeRequest, `/s/${spaceId}`); |
There was a problem hiding this comment.
cc @jportner Thanks for your help in figuring this part out! Please take a look at how I am using your advice and let me know if you have any thoughts about it.
There was a problem hiding this comment.
As discussed offline -- looks great!
|
@elasticmachine merge upstream |
) * [Reporting] Use spaceId from request in export generation * remove todo that has been done * whitespace * use post params api in test * add logging to core * Update x-pack/plugins/reporting/server/export_types/printable_pdf/lib/get_custom_logo.ts Co-authored-by: Joel Griffith <joel@joelgriffith.net> * more logging * fix interdependence and remove Promise.all * getAbsoluteUrl have only 1 way to provide basePath * --wip-- [skip ci] * log apipath * deleteAllReports at the end * tests pass locally * set config in the tests * re-add skips of flaky tests * test using csv:quoteValues Co-authored-by: Joel Griffith <joel@joelgriffith.net> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
💛 Build succeeded, but was flaky
Test FailuresX-Pack APM API integration tests (basic).x-pack/test/apm_api_integration/basic/tests/metrics_charts/metrics_charts·ts.APM specs (basic) Metrics when data is loaded for opbeans-node returns metrics data CPU usage has correct series overall valuesStandard OutStack TraceBuild metricsdistributable file count
History
To update your PR or re-run it, just comment with: |
…77952) * [Reporting] Use spaceId from request in export generation * remove todo that has been done * whitespace * use post params api in test * add logging to core * Update x-pack/plugins/reporting/server/export_types/printable_pdf/lib/get_custom_logo.ts Co-authored-by: Joel Griffith <joel@joelgriffith.net> * more logging * fix interdependence and remove Promise.all * getAbsoluteUrl have only 1 way to provide basePath * --wip-- [skip ci] * log apipath * deleteAllReports at the end * tests pass locally * set config in the tests * re-add skips of flaky tests * test using csv:quoteValues Co-authored-by: Joel Griffith <joel@joelgriffith.net> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Joel Griffith <joel@joelgriffith.net> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
Release note: Fixed the reporting exports to use the correct Space for advanced settings.
Explanation:
Reporting builds a
fakeRequestobject to use as a source that provides UI Settings. If the request does not have the space ID baked in, the settings will always come from the default space.Right now, none of the fake request objects have a space ID baked in, so the default space settings are always used. This affects:
csv:separatorandcsv:quoteValuesare space-specific settingsxpackReporting:customPdfLogois space-specificThis PR captures the spaceId from the request at job creation time. It plays into the fakeRequest objects at job execution time using:
It replaces code from a very old PR that incorporated the
basePathof the request URL to determine the space ID. It then would incorporate the spaceId into fake requests by adding agetBasePathmethod, which was expected to return the space ID along with the base path. In the new platform, there is nogetBasePathmethod ofKibanaRequest, which makes the basePath handling on the server side useless. This PR removes thebasePathfield from job params since it isn't useful to receive it.Fix #68076
Fix #70175
Fix: PDF Logo is always taken from default space
Checklist
Delete any items that are not applicable to this PR.
For maintainers