Skip to content

Commit

Permalink
[7.x] [kbn/optimizer] only build xpack examples when building xpack p…
Browse files Browse the repository at this point in the history
…lugins (#78656) (#78681)

Co-authored-by: spalger <spalger@users.noreply.github.com>

Co-authored-by: spalger <spalger@users.noreply.github.com>
  • Loading branch information
Spencer and spalger authored Sep 28, 2020
1 parent 16d5bbb commit f9abd17
Show file tree
Hide file tree
Showing 29 changed files with 166 additions and 381 deletions.
34 changes: 0 additions & 34 deletions examples/alerting_example/common/constants.ts

This file was deleted.

33 changes: 0 additions & 33 deletions examples/alerting_example/public/alert_types/index.ts

This file was deleted.

22 changes: 0 additions & 22 deletions examples/alerting_example/public/index.ts

This file was deleted.

47 changes: 0 additions & 47 deletions examples/alerting_example/server/alert_types/always_firing.ts

This file was deleted.

23 changes: 0 additions & 23 deletions examples/alerting_example/server/index.ts

This file was deleted.

3 changes: 2 additions & 1 deletion packages/kbn-optimizer/src/optimizer/optimizer_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ export class OptimizerConfig {
Path.resolve(repoRoot, 'src/plugins'),
...(oss ? [] : [Path.resolve(repoRoot, 'x-pack/plugins')]),
Path.resolve(repoRoot, 'plugins'),
...(examples ? [Path.resolve('examples'), Path.resolve('x-pack/examples')] : []),
...(examples ? [Path.resolve('examples')] : []),
...(examples && !oss ? [Path.resolve('x-pack/examples')] : []),
Path.resolve(repoRoot, '../kibana-extra'),
];
if (!pluginScanDirs.every((p) => Path.isAbsolute(p))) {
Expand Down
1 change: 0 additions & 1 deletion test/scripts/jenkins_build_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source src/dev/ci_setup/setup_env.sh
echo " -> building kibana platform plugins"
node scripts/build_kibana_platform_plugins \
--oss \
--filter '!alertingExample' \
--scan-dir "$KIBANA_DIR/test/plugin_functional/plugins" \
--scan-dir "$KIBANA_DIR/test/interpreter_functional/plugins" \
--workers 6 \
Expand Down
8 changes: 4 additions & 4 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"prefix": "xpack",
"paths": {
"xpack.actions": "plugins/actions",
"xpack.uiActionsEnhanced": [
"plugins/ui_actions_enhanced",
"examples/ui_actions_enhanced_examples"
],
"xpack.uiActionsEnhanced": "plugins/ui_actions_enhanced",
"xpack.alerts": "plugins/alerts",
"xpack.eventLog": "plugins/event_log",
"xpack.alertingBuiltins": "plugins/alerting_builtins",
Expand Down Expand Up @@ -59,6 +56,9 @@
"xpack.watcher": "plugins/watcher",
"xpack.observability": "plugins/observability"
},
"exclude": [
"examples"
],
"translations": [
"plugins/translations/translations/zh-CN.json",
"plugins/translations/translations/ja-JP.json"
Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions x-pack/examples/alerting_example/common/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export const ALERTING_EXAMPLE_APP_ID = 'AlertingExample';

// always firing
export const DEFAULT_INSTANCES_TO_GENERATE = 5;

// Astros
export enum Craft {
OuterSpace = 'Outer Space',
ISS = 'ISS',
}
export enum Operator {
AreAbove = 'Are above',
AreBelow = 'Are below',
AreExactly = 'Are exactly',
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { Fragment } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiFieldNumber, EuiFormRow } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { AlertTypeModel } from '../../../../x-pack/plugins/triggers_actions_ui/public';
import { AlertTypeModel } from '../../../../plugins/triggers_actions_ui/public';
import { DEFAULT_INSTANCES_TO_GENERATE } from '../../common/constants';

interface AlwaysFiringParamsProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { useState, useEffect, Fragment } from 'react';
Expand All @@ -32,9 +19,9 @@ import {
import { i18n } from '@kbn/i18n';
import { flatten } from 'lodash';
import { ALERTING_EXAMPLE_APP_ID, Craft, Operator } from '../../common/constants';
import { SanitizedAlert } from '../../../../x-pack/plugins/alerts/common';
import { PluginSetupContract as AlertingSetup } from '../../../../x-pack/plugins/alerts/public';
import { AlertTypeModel } from '../../../../x-pack/plugins/triggers_actions_ui/public';
import { SanitizedAlert } from '../../../../plugins/alerts/common';
import { PluginSetupContract as AlertingSetup } from '../../../../plugins/alerts/public';
import { AlertTypeModel } from '../../../../plugins/triggers_actions_ui/public';

export function registerNavigation(alerts: AlertingSetup) {
alerts.registerNavigation(
Expand Down
20 changes: 20 additions & 0 deletions x-pack/examples/alerting_example/public/alert_types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { registerNavigation as registerPeopleInSpaceNavigation } from './astros';
import { ALERTING_EXAMPLE_APP_ID } from '../../common/constants';
import { SanitizedAlert } from '../../../../plugins/alerts/common';
import { PluginSetupContract as AlertingSetup } from '../../../../plugins/alerts/public';

export function registerNavigation(alerts: AlertingSetup) {
// register default navigation
alerts.registerDefaultNavigation(
ALERTING_EXAMPLE_APP_ID,
(alert: SanitizedAlert) => `/alert/${alert.id}`
);

registerPeopleInSpaceNavigation(alerts);
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
Expand All @@ -28,14 +15,14 @@ import {
DocLinksStart,
ToastsSetup,
ApplicationStart,
} from '../../../src/core/public';
import { DataPublicPluginStart } from '../../../src/plugins/data/public';
import { ChartsPluginStart } from '../../../src/plugins/charts/public';
} from '../../../../src/core/public';
import { DataPublicPluginStart } from '../../../../src/plugins/data/public';
import { ChartsPluginStart } from '../../../../src/plugins/charts/public';

import { Page } from './components/page';
import { DocumentationPage } from './components/documentation';
import { ViewAlertPage } from './components/view_alert';
import { TriggersAndActionsUIPublicPluginStart } from '../../../x-pack/plugins/triggers_actions_ui/public';
import { TriggersAndActionsUIPublicPluginStart } from '../../../plugins/triggers_actions_ui/public';
import { AlertingExamplePublicStartDeps } from './plugin';
import { ViewPeopleInSpaceAlertPage } from './components/view_astros_alert';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { useState } from 'react';

import { EuiIcon, EuiFlexItem, EuiCard, EuiFlexGroup } from '@elastic/eui';

import {
AlertsContextProvider,
AlertAdd,
} from '../../../../x-pack/plugins/triggers_actions_ui/public';
import { AlertsContextProvider, AlertAdd } from '../../../../plugins/triggers_actions_ui/public';
import { AlertingExampleComponentParams } from '../application';
import { ALERTING_EXAMPLE_APP_ID } from '../../common/constants';

Expand Down
Loading

0 comments on commit f9abd17

Please sign in to comment.