Skip to content

Commit

Permalink
Merge branch 'master' into save_and_return
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Aug 5, 2020
2 parents 68c623d + c655f50 commit 2a9fc4f
Show file tree
Hide file tree
Showing 43 changed files with 667 additions and 306 deletions.
13 changes: 13 additions & 0 deletions .ci/pipeline-library/src/test/prChanges.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,17 @@ class PrChangesTest extends KibanaBasePipelineTest {

assertFalse(prChanges.areChangesSkippable())
}

@Test
void 'areChangesSkippable() with plugin readme changes'() {
props([
githubPrs: [
getChanges: { [
[filename: 'src/plugins/foo/README.asciidoc'],
] },
],
])

assertFalse(prChanges.areChangesSkippable())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,20 @@ export const InfoComponent = () => {
<>
<FormattedMessage
id="visualize.experimentalVisInfoText"
defaultMessage="This visualization is marked as experimental. Have feedback? Please create an issue in"
/>{' '}
<EuiLink external href="https://github.com/elastic/kibana/issues/new/choose" target="_blank">
GitHub
</EuiLink>
{'.'}
defaultMessage="This visualization is experimental and is not subject to the support SLA of official GA features.
For feedback, please create an issue in {githubLink}."
values={{
githubLink: (
<EuiLink
external
href="https://github.com/elastic/kibana/issues/new/choose"
target="_blank"
>
GitHub
</EuiLink>
),
}}
/>
</>
);

Expand Down
2 changes: 2 additions & 0 deletions vars/prChanges.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def getNotSkippablePaths() {
return [
// this file is auto-generated and changes to it need to be validated with CI
/^docs\/developer\/architecture\/code-exploration.asciidoc$/,
// don't skip CI on prs with changes to plugin readme files (?i) is for case-insensitive matching
/(?i)\/plugins\/[^\/]+\/readme\.(md|asciidoc)$/,
]
}

Expand Down
17 changes: 12 additions & 5 deletions x-pack/plugins/alerts/server/alerts_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,18 @@ export class AlertsClient {
updateResult.scheduledTaskId &&
!isEqual(alertSavedObject.attributes.schedule, updateResult.schedule)
) {
this.taskManager.runNow(updateResult.scheduledTaskId).catch((err: Error) => {
this.logger.error(
`Alert update failed to run its underlying task. TaskManager runNow failed with Error: ${err.message}`
);
});
this.taskManager
.runNow(updateResult.scheduledTaskId)
.then(() => {
this.logger.debug(
`Alert update has rescheduled the underlying task: ${updateResult.scheduledTaskId}`
);
})
.catch((err: Error) => {
this.logger.error(
`Alert update failed to run its underlying task. TaskManager runNow failed with Error: ${err.message}`
);
});
}
})(),
]);
Expand Down
34 changes: 34 additions & 0 deletions x-pack/plugins/enterprise_search/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,40 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { i18n } from '@kbn/i18n';

export const ENTERPRISE_SEARCH_PLUGIN = {
ID: 'enterpriseSearch',
NAME: i18n.translate('xpack.enterpriseSearch.productName', {
defaultMessage: 'Enterprise Search',
}),
URL: '/app/enterprise_search',
};

export const APP_SEARCH_PLUGIN = {
ID: 'appSearch',
NAME: i18n.translate('xpack.enterpriseSearch.appSearch.productName', {
defaultMessage: 'App Search',
}),
DESCRIPTION: i18n.translate('xpack.enterpriseSearch.appSearch.productDescription', {
defaultMessage:
'Leverage dashboards, analytics, and APIs for advanced application search made simple.',
}),
URL: '/app/enterprise_search/app_search',
};

export const WORKPLACE_SEARCH_PLUGIN = {
ID: 'workplaceSearch',
NAME: i18n.translate('xpack.enterpriseSearch.workplaceSearch.productName', {
defaultMessage: 'Workplace Search',
}),
DESCRIPTION: i18n.translate('xpack.enterpriseSearch.workplaceSearch.productDescription', {
defaultMessage:
'Search all documents, files, and sources available across your virtual workplace.',
}),
URL: '/app/enterprise_search/workplace_search',
};

export const JSON_HEADER = { 'Content-Type': 'application/json' }; // This needs specific casing or Chrome throws a 415 error

export const ENGINES_PAGE_SIZE = 10;
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ import { EuiSpacer, EuiTitle, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

import { APP_SEARCH_PLUGIN } from '../../../../../common/constants';
import { SetupGuide as SetupGuideLayout } from '../../../shared/setup_guide';
import { SetAppSearchBreadcrumbs as SetBreadcrumbs } from '../../../shared/kibana_breadcrumbs';
import { SendAppSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';
import GettingStarted from '../../assets/getting_started.png';

export const SetupGuide: React.FC = () => (
<SetupGuideLayout
productName={i18n.translate('xpack.enterpriseSearch.appSearch.productName', {
defaultMessage: 'App Search',
})}
productName={APP_SEARCH_PLUGIN.NAME}
productEuiIcon="logoAppSearch"
standardAuthLink="https://swiftype.com/documentation/app-search/self-managed/security#standard"
elasticsearchNativeAuthLink="https://swiftype.com/documentation/app-search/self-managed/security#elasticsearch-native-realm"
>
<SetBreadcrumbs text="Setup Guide" />
<SetBreadcrumbs
text={i18n.translate('xpack.enterpriseSearch.setupGuide.title', {
defaultMessage: 'Setup Guide',
})}
/>
<SendTelemetry action="viewed" metric="setup_guide" />

<a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import { EuiBreadcrumb } from '@elastic/eui';
import { History } from 'history';

import {
ENTERPRISE_SEARCH_PLUGIN,
APP_SEARCH_PLUGIN,
WORKPLACE_SEARCH_PLUGIN,
} from '../../../../common/constants';

import { letBrowserHandleEvent } from '../react_router_helpers';

/**
Expand Down Expand Up @@ -44,14 +50,20 @@ export type TBreadcrumbs = IGenerateBreadcrumbProps[];
export const enterpriseSearchBreadcrumbs = (history: History) => (
breadcrumbs: TBreadcrumbs = []
) => [
generateBreadcrumb({ text: 'Enterprise Search' }),
generateBreadcrumb({ text: ENTERPRISE_SEARCH_PLUGIN.NAME }),
...breadcrumbs.map(({ text, path }: IGenerateBreadcrumbProps) =>
generateBreadcrumb({ text, path, history })
),
];

export const appSearchBreadcrumbs = (history: History) => (breadcrumbs: TBreadcrumbs = []) =>
enterpriseSearchBreadcrumbs(history)([{ text: 'App Search', path: '/' }, ...breadcrumbs]);
enterpriseSearchBreadcrumbs(history)([
{ text: APP_SEARCH_PLUGIN.NAME, path: '/' },
...breadcrumbs,
]);

export const workplaceSearchBreadcrumbs = (history: History) => (breadcrumbs: TBreadcrumbs = []) =>
enterpriseSearchBreadcrumbs(history)([{ text: 'Workplace Search', path: '/' }, ...breadcrumbs]);
enterpriseSearchBreadcrumbs(history)([
{ text: WORKPLACE_SEARCH_PLUGIN.NAME, path: '/' },
...breadcrumbs,
]);
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import React from 'react';
import { EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants';
import { ErrorStatePrompt } from '../../../shared/error_state';
import { SetWorkplaceSearchBreadcrumbs as SetBreadcrumbs } from '../../../shared/kibana_breadcrumbs';
import { SendWorkplaceSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';
Expand All @@ -20,11 +20,7 @@ export const ErrorState: React.FC = () => {
<SendTelemetry action="error" metric="cannot_connect" />

<EuiPageBody>
<ViewContentHeader
title={i18n.translate('xpack.enterpriseSearch.workplaceSearch.productName', {
defaultMessage: 'Workplace Search',
})}
/>
<ViewContentHeader title={WORKPLACE_SEARCH_PLUGIN.NAME} />
<EuiPageContent>
<ErrorStatePrompt />
</EuiPageContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { EuiSpacer, EuiTitle, EuiText, EuiButton } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants';
import { SetupGuide as SetupGuideLayout } from '../../../shared/setup_guide';

import { SetWorkplaceSearchBreadcrumbs as SetBreadcrumbs } from '../../../shared/kibana_breadcrumbs';
import { SendWorkplaceSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';
import GettingStarted from '../../assets/getting_started.png';
Expand All @@ -21,14 +21,16 @@ const GETTING_STARTED_LINK_URL =
export const SetupGuide: React.FC = () => {
return (
<SetupGuideLayout
productName={i18n.translate('xpack.enterpriseSearch.workplaceSearch.productName', {
defaultMessage: 'Workplace Search',
})}
productName={WORKPLACE_SEARCH_PLUGIN.NAME}
productEuiIcon="logoWorkplaceSearch"
standardAuthLink="https://www.elastic.co/guide/en/workplace-search/current/workplace-search-security.html#standard"
elasticsearchNativeAuthLink="https://www.elastic.co/guide/en/workplace-search/current/workplace-search-security.html#elasticsearch-native-realm"
>
<SetBreadcrumbs text="Setup Guide" />
<SetBreadcrumbs
text={i18n.translate('xpack.enterpriseSearch.setupGuide.title', {
defaultMessage: 'Setup Guide',
})}
/>
<SendTelemetry action="viewed" metric="setup_guide" />

<a href={GETTING_STARTED_LINK_URL} target="_blank" rel="noopener noreferrer">
Expand Down
31 changes: 15 additions & 16 deletions x-pack/plugins/enterprise_search/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public';
import { LicensingPluginSetup } from '../../licensing/public';

import { APP_SEARCH_PLUGIN, WORKPLACE_SEARCH_PLUGIN } from '../common/constants';
import { getPublicUrl } from './applications/shared/enterprise_search_url';
import AppSearchLogo from './applications/app_search/assets/logo.svg';
import WorkplaceSearchLogo from './applications/workplace_search/assets/logo.svg';
Expand All @@ -44,9 +45,9 @@ export class EnterpriseSearchPlugin implements Plugin {
const config = { host: this.config.host };

core.application.register({
id: 'appSearch',
title: 'App Search',
appRoute: '/app/enterprise_search/app_search',
id: APP_SEARCH_PLUGIN.ID,
title: APP_SEARCH_PLUGIN.NAME,
appRoute: APP_SEARCH_PLUGIN.URL,
category: DEFAULT_APP_CATEGORIES.enterpriseSearch,
mount: async (params: AppMountParameters) => {
const [coreStart] = await core.getStartServices();
Expand All @@ -61,9 +62,9 @@ export class EnterpriseSearchPlugin implements Plugin {
});

core.application.register({
id: 'workplaceSearch',
title: 'Workplace Search',
appRoute: '/app/enterprise_search/workplace_search',
id: WORKPLACE_SEARCH_PLUGIN.ID,
title: WORKPLACE_SEARCH_PLUGIN.NAME,
appRoute: WORKPLACE_SEARCH_PLUGIN.URL,
category: DEFAULT_APP_CATEGORIES.enterpriseSearch,
mount: async (params: AppMountParameters) => {
const [coreStart] = await core.getStartServices();
Expand All @@ -76,23 +77,21 @@ export class EnterpriseSearchPlugin implements Plugin {
});

plugins.home.featureCatalogue.register({
id: 'appSearch',
title: 'App Search',
id: APP_SEARCH_PLUGIN.ID,
title: APP_SEARCH_PLUGIN.NAME,
icon: AppSearchLogo,
description:
'Leverage dashboards, analytics, and APIs for advanced application search made simple.',
path: '/app/enterprise_search/app_search',
description: APP_SEARCH_PLUGIN.DESCRIPTION,
path: APP_SEARCH_PLUGIN.URL,
category: FeatureCatalogueCategory.DATA,
showOnHomePage: true,
});

plugins.home.featureCatalogue.register({
id: 'workplaceSearch',
title: 'Workplace Search',
id: WORKPLACE_SEARCH_PLUGIN.ID,
title: WORKPLACE_SEARCH_PLUGIN.NAME,
icon: WorkplaceSearchLogo,
description:
'Search all documents, files, and sources available across your virtual workplace.',
path: '/app/enterprise_search/workplace_search',
description: WORKPLACE_SEARCH_PLUGIN.DESCRIPTION,
path: WORKPLACE_SEARCH_PLUGIN.URL,
category: FeatureCatalogueCategory.DATA,
showOnHomePage: true,
});
Expand Down
15 changes: 10 additions & 5 deletions x-pack/plugins/enterprise_search/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import { SecurityPluginSetup } from '../../security/server';
import { PluginSetupContract as FeaturesPluginSetup } from '../../features/server';

import {
ENTERPRISE_SEARCH_PLUGIN,
APP_SEARCH_PLUGIN,
WORKPLACE_SEARCH_PLUGIN,
} from '../common/constants';
import { ConfigType } from './';
import { checkAccess } from './lib/check_access';
import { registerPublicUrlRoute } from './routes/enterprise_search/public_url';
Expand Down Expand Up @@ -64,13 +69,13 @@ export class EnterpriseSearchPlugin implements Plugin {
* Register space/feature control
*/
features.registerFeature({
id: 'enterpriseSearch',
name: 'Enterprise Search',
id: ENTERPRISE_SEARCH_PLUGIN.ID,
name: ENTERPRISE_SEARCH_PLUGIN.NAME,
order: 0,
icon: 'logoEnterpriseSearch',
navLinkId: 'appSearch', // TODO - remove this once functional tests no longer rely on navLinkId
app: ['kibana', 'appSearch', 'workplaceSearch'], // TODO: 'enterpriseSearch'
catalogue: ['appSearch', 'workplaceSearch'], // TODO: 'enterpriseSearch'
navLinkId: APP_SEARCH_PLUGIN.ID, // TODO - remove this once functional tests no longer rely on navLinkId
app: ['kibana', APP_SEARCH_PLUGIN.ID, WORKPLACE_SEARCH_PLUGIN.ID],
catalogue: [APP_SEARCH_PLUGIN.ID, WORKPLACE_SEARCH_PLUGIN.ID],
privileges: null,
});

Expand Down
Loading

0 comments on commit 2a9fc4f

Please sign in to comment.