Skip to content
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

Merged
merged 22 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/packer_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find on these

.es \
.chromedriver \
.geckodriver;
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cluster/cluster_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export class ClusterManager {
/debug\.log$/,
...pluginInternalDirsIgnore,
fromRoot('src/legacy/server/sass/__tmp__'),
fromRoot('x-pack/legacy/plugins/reporting/.chromium'),
fromRoot('x-pack/plugins/reporting/.chromium'),
fromRoot('x-pack/plugins/siem/cypress'),
fromRoot('x-pack/plugins/apm/e2e'),
fromRoot('x-pack/plugins/apm/scripts'),
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/tasks/clean_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export const CleanExtraBrowsersTask = {

async run(config, log, build) {
const getBrowserPathsForPlatform = (platform) => {
const reportingDir = 'x-pack/legacy/plugins/reporting';
const reportingDir = 'x-pack/plugins/reporting';
const chromiumDir = '.chromium';
const chromiumPath = (p) =>
build.resolvePathForPlatform(platform, reportingDir, chromiumDir, p);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ describe(`Transform fn`, () => {
it(`should remove the jenkins workspace path`, () => {
const obj = {
staticSiteUrl:
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js',
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.js',
COVERAGE_INGESTION_KIBANA_ROOT:
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana',
};
expect(coveredFilePath(obj)).to.have.property(
'coveredFilePath',
'x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js'
'x-pack/plugins/reporting/server/browsers/extract/unzip.js'
);
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js": {
"/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.js": {
"lines": {
"total": 4,
"covered": 4,
Expand Down
12 changes: 6 additions & 6 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ export const TEMPORARILY_IGNORED_PATHS = [
'x-pack/plugins/monitoring/public/icons/health-green.svg',
'x-pack/plugins/monitoring/public/icons/health-red.svg',
'x-pack/plugins/monitoring/public/icons/health-yellow.svg',
'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Medium.ttf',
'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Regular.ttf',
'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Italic.ttf',
'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Medium.ttf',
'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Regular.ttf',
'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/img/logo-grey.png',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Medium.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Regular.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Italic.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Medium.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Regular.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/img/logo-grey.png',
'x-pack/test/functional/es_archives/monitoring/beats-with-restarted-instance/data.json.gz',
'x-pack/test/functional/es_archives/monitoring/beats-with-restarted-instance/mappings.json',
'x-pack/test/functional/es_archives/monitoring/logstash-pipelines/data.json.gz',
Expand Down
4 changes: 2 additions & 2 deletions x-pack/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
/test/functional/screenshots
/test/functional/apps/reporting/reports/session
/test/reporting/configs/failure_debug/
/legacy/plugins/reporting/.chromium/
/legacy/plugins/reporting/.phantom/
/plugins/reporting/.chromium/
/plugins/reporting/.phantom/
/.aws-config.json
/.env
/.kibana-plugin-helpers.dev.*
Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"xpack.monitoring": ["plugins/monitoring", "legacy/plugins/monitoring"],
"xpack.remoteClusters": "plugins/remote_clusters",
"xpack.painlessLab": "plugins/painless_lab",
"xpack.reporting": ["plugins/reporting", "legacy/plugins/reporting"],
"xpack.reporting": ["plugins/reporting"],
"xpack.rollupJobs": ["legacy/plugins/rollup", "plugins/rollup"],
"xpack.searchProfiler": "plugins/searchprofiler",
"xpack.security": ["legacy/plugins/security", "plugins/security"],
Expand Down
4 changes: 2 additions & 2 deletions x-pack/.kibana-plugin-helpers.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"index.js",
".i18nrc.json",
"plugins/**/*",
"legacy/plugins/reporting/.phantom/*",
"legacy/plugins/reporting/.chromium/*",
"plugins/reporting/.phantom/*",
"plugins/reporting/.chromium/*",
"legacy/common/**/*",
"legacy/plugins/**/*",
"legacy/server/**/*",
Expand Down
2 changes: 1 addition & 1 deletion x-pack/build_chromium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ To run the build, replace the sha in the following commands with the sha that yo

After the build completes, there will be a .zip file and a .md5 file in `~/chromium/chromium/src/out/headless`. These are named like so: `chromium-{first_7_of_SHA}-{platform}`, for example: `chromium-4747cc2-linux`.

The zip files need to be deployed to s3. For testing, I drop them into `headless-shell-dev`, but for production, they need to be in `headless-shell`. And the `x-pack/legacy/plugins/reporting/server/browsers/chromium/paths.js` file needs to be upated to have the correct `archiveChecksum`, `archiveFilename`, `binaryChecksum` and `baseUrl`. Below is a list of what the archive's are:
The zip files need to be deployed to s3. For testing, I drop them into `headless-shell-dev`, but for production, they need to be in `headless-shell`. And the `x-pack/plugins/reporting/server/browsers/chromium/paths.ts` file needs to be upated to have the correct `archiveChecksum`, `archiveFilename`, `binaryChecksum` and `baseUrl`. Below is a list of what the archive's are:

- `archiveChecksum`: The contents of the `.md5` file, which is the `md5` checksum of the zip file.
- `binaryChecksum`: The `md5` checksum of the `headless_shell` binary itself.
Expand Down
2 changes: 0 additions & 2 deletions x-pack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import { xpackMain } from './legacy/plugins/xpack_main';
import { monitoring } from './legacy/plugins/monitoring';
import { reporting } from './legacy/plugins/reporting';
import { security } from './legacy/plugins/security';
import { dashboardMode } from './legacy/plugins/dashboard_mode';
import { beats } from './legacy/plugins/beats_management';
Expand All @@ -18,7 +17,6 @@ module.exports = function (kibana) {
return [
xpackMain(kibana),
monitoring(kibana),
reporting(kibana),
spaces(kibana),
security(kibana),
dashboardMode(kibana),
Expand Down
49 changes: 0 additions & 49 deletions x-pack/legacy/plugins/reporting/index.ts

This file was deleted.

17 changes: 0 additions & 17 deletions x-pack/legacy/plugins/reporting/server/index.ts

This file was deleted.

61 changes: 0 additions & 61 deletions x-pack/legacy/plugins/reporting/server/legacy.ts

This file was deleted.

This file was deleted.

81 changes: 0 additions & 81 deletions x-pack/legacy/plugins/reporting/server/plugin.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class GisMap extends Component {
// - If it's not, then reporting injects a listener into the browser for a custom "renderComplete" event.
// - When that event is fired, we snapshot the viz and move on.
// Failure to not have the dom attribute, or custom event, will timeout the job.
// See x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts for more.
// See x-pack/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts for more.
_onInitialLoadRenderComplete = () => {
const el = document.querySelector(`[data-dom-id="${this.state.domId}"]`);

Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/reporting/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*/

export { CancellationToken } from './cancellation_token';
export { Poller } from './poller';
2 changes: 1 addition & 1 deletion x-pack/plugins/reporting/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

// eslint-disable-next-line @kbn/eslint/no-restricted-paths
export { ConfigType } from '../server/config';
export { ReportingConfigType } from '../server/config';

export type JobId = string;
export type JobStatus =
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/reporting/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"version": "8.0.0",
"kibanaVersion": "kibana",
"optionalPlugins": [
"security",
"usageCollection"
],
"configPath": ["xpack", "reporting"],
"requiredPlugins": [
"data",
"home",
"management",
"licensing",
"uiActions",
"embeddable",
"share",
"kibanaLegacy",
"licensing"
"share"
],
"server": true,
"ui": true
Expand Down
Loading