Skip to content

Commit

Permalink
Merge branch 'master' into alerting/consumer-based-rbac
Browse files Browse the repository at this point in the history
* master:
  [ML] Remove DragSelect event handlers and selectors on the swim lane unmount  (elastic#72250)
  Add a few asciidoc readmes (elastic#72082)
  re-enable tests. retry on fail (elastic#72061)
  updates advanced settings text (elastic#72249)
  [ML] Fix HTML named characters encoding (elastic#72060)
  Bump @elastic/elasticsearch to v7.9.0-rc1 (elastic#72231)
  Observability landing page title (elastic#72088)
  [QA][Code Coverage] Drop flaky integration tests (elastic#72089)
  [Ingest Manager] Fix failing test conflict error (elastic#72149)
  [Logs UI] Fix display of dataset values in anomaly and category example rows (elastic#71693)
  [SECURITY] Bug truncation on timeline (elastic#72221)
  skip flaky suite (elastic#72146)
  • Loading branch information
gmmorris committed Jul 17, 2020
2 parents cbee849 + 2ad4328 commit 16ab6c6
Show file tree
Hide file tree
Showing 36 changed files with 150 additions and 215 deletions.
5 changes: 4 additions & 1 deletion docs/developer/architecture/code-exploration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,10 @@ WARNING: Missing README.
WARNING: Missing README.
- {kib-repo}blob/{branch}/x-pack/plugins/embeddable_enhanced/README.md[embeddableEnhanced]
- {kib-repo}blob/{branch}/x-pack/plugins/embeddable_enhanced[embeddableEnhanced]
WARNING: Missing README.
- {kib-repo}blob/{branch}/x-pack/plugins/encrypted_saved_objects/README.md[encryptedSavedObjects]
Expand Down
8 changes: 5 additions & 3 deletions examples/README.md → examples/README.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## Example plugins
[[example-plugins]]
== Example plugins

This folder contains example plugins. To run the plugins in this folder, use the `--run-examples` flag, via

```
[source,bash]
----
yarn start --run-examples
```
----
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"@elastic/apm-rum": "^5.2.0",
"@elastic/charts": "19.8.1",
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "7.8.0",
"@elastic/elasticsearch": "7.9.0-rc.1",
"@elastic/ems-client": "7.9.3",
"@elastic/eui": "26.3.1",
"@elastic/filesaver": "1.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@elastic/elasticsearch": "^7.4.0",
"@elastic/elasticsearch": "7.9.0-rc.1",
"@kbn/dev-utils": "1.0.0",
"abort-controller": "^2.0.3",
"chalk": "^2.4.2",
Expand Down
8 changes: 8 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,14 @@
'@types/has-ansi',
],
},
{
groupSlug: 'he',
groupName: 'he related packages',
packageNames: [
'he',
'@types/he',
],
},
{
groupSlug: 'history',
groupName: 'history related packages',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,96 +69,4 @@ describe('Ingesting coverage', () => {
expect(folderStructure.test(actualUrl)).ok();
});
});
describe(`vcsInfo`, () => {
let stdOutWithVcsInfo = '';
describe(`without a commit msg in the vcs info file`, () => {
beforeAll(async () => {
const args = [
'scripts/ingest_coverage.js',
'--verbose',
'--vcsInfoPath',
'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO_missing_commit_msg.txt',
'--path',
];
const opts = [...args, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
stdOutWithVcsInfo = stdout;
});

it(`should be an obj w/o a commit msg`, () => {
const commitMsgRE = /"commitMsg"/;
expect(commitMsgRE.test(stdOutWithVcsInfo)).to.not.be.ok();
});
});
describe(`including previous sha`, () => {
let stdOutWithPrevious = '';
beforeAll(async () => {
const opts = [...verboseArgs, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
stdOutWithPrevious = stdout;
});

it(`should have a vcsCompareUrl`, () => {
const previousCompareUrlRe = /vcsCompareUrl.+\s*.*https.+compare\/FAKE_PREVIOUS_SHA\.\.\.f07b34f6206/;
expect(previousCompareUrlRe.test(stdOutWithPrevious)).to.be.ok();
});
});
describe(`with a commit msg in the vcs info file`, () => {
beforeAll(async () => {
const args = [
'scripts/ingest_coverage.js',
'--verbose',
'--vcsInfoPath',
'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt',
'--path',
];
const opts = [...args, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
stdOutWithVcsInfo = stdout;
});

it(`should be an obj w/ a commit msg`, () => {
const commitMsgRE = /commitMsg/;
expect(commitMsgRE.test(stdOutWithVcsInfo)).to.be.ok();
});
});
});
describe(`team assignment`, () => {
let shouldNotHavePipelineOut = '';
let shouldIndeedHavePipelineOut = '';

const args = [
'scripts/ingest_coverage.js',
'--verbose',
'--vcsInfoPath',
'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt',
'--path',
];

const teamAssignRE = /pipeline:/;

beforeAll(async () => {
const summaryPath = 'jest-combined/coverage-summary-just-total.json';
const resolved = resolve(MOCKS_DIR, summaryPath);
const opts = [...args, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
shouldNotHavePipelineOut = stdout;
});
beforeAll(async () => {
const summaryPath = 'jest-combined/coverage-summary-manual-mix.json';
const resolved = resolve(MOCKS_DIR, summaryPath);
const opts = [...args, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
shouldIndeedHavePipelineOut = stdout;
});

it(`should not occur when going to the totals index`, () => {
const actual = teamAssignRE.test(shouldNotHavePipelineOut);
expect(actual).to.not.be.ok();
});
it(`should indeed occur when going to the coverage index`, () => {
const actual = /ingest-pipe=>team_assignment/.test(shouldIndeedHavePipelineOut);
expect(actual).to.be.ok();
});
});
});
1 change: 1 addition & 0 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const IGNORE_FILE_GLOBS = [
'docs/**/*',
'**/bin/**/*',
'**/+([A-Z_]).md',
'**/+([A-Z_]).asciidoc',
'**/LICENSE',
'**/*.txt',
'**/Gruntfile.js',
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/dashboard/README.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[[kibana-dashboard-plugin]]
== Dashboard plugin

- Registers the dashboard application.
- Adds a dashboard embeddable that can be used in other applications.
3 changes: 2 additions & 1 deletion test/functional/apps/dashboard/dashboard_error_handling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
/**
* Common test suite for testing exception scenarious within dashboard
*/
describe('dashboard error handling', () => {
// Flaky: https://github.com/elastic/kibana/issues/72146
describe.skip('dashboard error handling', () => {
before(async () => {
await esArchiver.loadIfNeeded('dashboard/current/kibana');
await PageObjects.common.navigateToApp('dashboard');
Expand Down
2 changes: 2 additions & 0 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"@types/graphql": "^0.13.2",
"@types/gulp": "^4.0.6",
"@types/hapi__wreck": "^15.0.1",
"@types/he": "^1.1.1",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/history": "^4.7.3",
"@types/jest": "^25.2.3",
Expand Down Expand Up @@ -265,6 +266,7 @@
"graphql-tools": "^3.0.2",
"h2o2": "^8.1.2",
"handlebars": "4.7.6",
"he": "^1.2.0",
"history": "4.9.0",
"history-extra": "^5.0.1",
"i18n-iso-countries": "^4.3.1",
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"@elastic/elasticsearch": "^7.6.1",
"@elastic/elasticsearch": "7.9.0-rc.1",
"@octokit/rest": "^16.35.0",
"@types/console-stamp": "^0.2.32",
"console-stamp": "^0.2.9",
Expand Down
6 changes: 6 additions & 0 deletions x-pack/plugins/embeddable_enhanced/README.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[[enhanced-embeddables-plugin]]
== Enhanced embeddables plugin

Enhances Embeddables by registering a custom factory provider. The enhanced factory provider
adds dynamic actions to every embeddables state, in order to support drilldowns.

1 change: 0 additions & 1 deletion x-pack/plugins/embeddable_enhanced/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { useMemo, useState, useCallback, useContext } from 'react';
import React, { useState, useCallback, useContext } from 'react';
import { i18n } from '@kbn/i18n';
import { encode } from 'rison-node';
import moment from 'moment';
Expand Down Expand Up @@ -40,12 +40,8 @@ export const CategoryExampleMessage: React.FunctionComponent<{
context: LogEntryContext;
}> = ({ id, dataset, message, timestamp, timeRange, tiebreaker, context }) => {
const [, { setContextEntry }] = useContext(ViewLogInContext.Context);
// the dataset must be encoded for the field column and the empty value must
// be turned into a user-friendly value
const encodedDatasetFieldValue = useMemo(
() => JSON.stringify(getFriendlyNameForPartitionId(dataset)),
[dataset]
);
// handle special cases for the dataset value
const humanFriendlyDataset = getFriendlyNameForPartitionId(dataset);

const [isHovered, setIsHovered] = useState<boolean>(false);
const setHovered = useCallback(() => setIsHovered(true), []);
Expand Down Expand Up @@ -100,7 +96,7 @@ export const CategoryExampleMessage: React.FunctionComponent<{
columnValue={{
columnId: datasetColumnId,
field: 'event.dataset',
value: encodedDatasetFieldValue,
value: humanFriendlyDataset,
highlights: [],
}}
highlights={noHighlights}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,8 @@ export const LogEntryExampleMessage: React.FunctionComponent<Props> = ({
const setItemIsHovered = useCallback(() => setIsHovered(true), []);
const setItemIsNotHovered = useCallback(() => setIsHovered(false), []);

// the dataset must be encoded for the field column and the empty value must
// be turned into a user-friendly value
const encodedDatasetFieldValue = useMemo(
() => JSON.stringify(getFriendlyNameForPartitionId(dataset)),
[dataset]
);
// handle special cases for the dataset value
const humanFriendlyDataset = getFriendlyNameForPartitionId(dataset);

const viewInStreamLinkProps = useLinkProps({
app: 'logs',
Expand Down Expand Up @@ -158,7 +154,7 @@ export const LogEntryExampleMessage: React.FunctionComponent<Props> = ({
columnValue={{
columnId: datasetColumnId,
field: 'event.dataset',
value: encodedDatasetFieldValue,
value: humanFriendlyDataset,
highlights: [],
}}
highlights={noHighlights}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ import {
} from 'src/core/server';
import { PACKAGES_SAVED_OBJECT_TYPE } from '../../../../../common';
import * as Registry from '../../registry';
import { AssetType, KibanaAssetType, AssetReference } from '../../../../types';
import {
AssetType,
KibanaAssetType,
AssetReference,
KibanaAssetReference,
} from '../../../../types';
import { deleteKibanaSavedObjectsAssets } from '../../packages/remove';
import { getInstallationObject, savedObjectTypes } from '../../packages';
import { saveInstalledKibanaRefs } from '../../packages/install';

type SavedObjectToBe = Required<SavedObjectsBulkCreateObject> & { type: AssetType };
export type ArchiveAsset = Pick<
Expand Down Expand Up @@ -49,7 +53,7 @@ export async function installKibanaAssets(options: {
pkgName: string;
paths: string[];
isUpdate: boolean;
}): Promise<AssetReference[]> {
}): Promise<KibanaAssetReference[]> {
const { savedObjectsClient, paths, pkgName, isUpdate } = options;

if (isUpdate) {
Expand All @@ -65,16 +69,14 @@ export async function installKibanaAssets(options: {

// install the new assets and save installation references
const kibanaAssetTypes = Object.values(KibanaAssetType);
const installationPromises = kibanaAssetTypes.map((assetType) =>
installKibanaSavedObjects({ savedObjectsClient, assetType, paths })
const installedAssets = await Promise.all(
kibanaAssetTypes.map((assetType) =>
installKibanaSavedObjects({ savedObjectsClient, assetType, paths })
)
);
// installKibanaSavedObjects returns AssetReference[], so .map creates AssetReference[][]
// call .flat to flatten into one dimensional array
const newInstalledKibanaAssets = await Promise.all(installationPromises).then((results) =>
results.flat()
);
await saveInstalledKibanaRefs(savedObjectsClient, pkgName, newInstalledKibanaAssets);
return newInstalledKibanaAssets;
return installedAssets.flat();
}
export const deleteKibanaInstalledRefs = async (
savedObjectsClient: SavedObjectsClientContract,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,20 @@ export async function installPackage(options: {
);
}

// update to newly installed version when all assets are successfully installed
if (isUpdate) await updateVersion(savedObjectsClient, pkgName, pkgVersion);
// get template refs to save
const installedTemplateRefs = installedTemplates.map((template) => ({
id: template.templateName,
type: ElasticsearchAssetType.indexTemplate,
}));

const [installedKibanaAssets] = await Promise.all([
installKibanaAssetsPromise,
installIndexPatternPromise,
]);

await saveInstalledKibanaRefs(savedObjectsClient, pkgName, installedKibanaAssets);
// update to newly installed version when all assets are successfully installed
if (isUpdate) await updateVersion(savedObjectsClient, pkgName, pkgVersion);
return [...installedKibanaAssets, ...installedPipelines, ...installedTemplateRefs];
}
const updateVersion = async (
Expand Down Expand Up @@ -230,7 +233,7 @@ export async function createInstallation(options: {
export const saveInstalledKibanaRefs = async (
savedObjectsClient: SavedObjectsClientContract,
pkgName: string,
installedAssets: AssetReference[]
installedAssets: KibanaAssetReference[]
) => {
await savedObjectsClient.update(PACKAGES_SAVED_OBJECT_TYPE, pkgName, {
installed_kibana: installedAssets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export const AnalysisFieldsTable: FC<{
return (
<Fragment>
<EuiFormRow
data-test-subj="mlAnalyticsCreateJobWizardIncludesTable"
label={i18n.translate('xpack.ml.dataframe.analytics.create.includedFieldsLabel', {
defaultMessage: 'Included fields',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,20 @@ export class ExplorerSwimlane extends React.Component<ExplorerSwimlaneProps> {
});

this.renderSwimlane();

this.dragSelect.stop();
}

componentDidUpdate() {
this.renderSwimlane();
}

componentWillUnmount() {
if (this.dragSelectSubscriber !== null) {
this.dragSelectSubscriber.unsubscribe();
}
const element = d3.select(this.rootNode.current!);
element.html('');
this.dragSelectSubscriber!.unsubscribe();
// Remove selector element from DOM
this.dragSelect.selector.remove();
// removes all mousedown event handlers
this.dragSelect.stop(true);
}

selectCell(cellsToSelect: any[], { laneLabels, bucketScore, times }: SelectedData) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ describe('ML - string utils', () => {
expect(mlEscape('foo<bar')).toBe('foo&lt;bar');
expect(mlEscape('foo>bar')).toBe('foo&gt;bar');
expect(mlEscape('foo"bar')).toBe('foo&quot;bar');
expect(mlEscape("foo'bar")).toBe('foo&#39;bar');
expect(mlEscape('foo/bar')).toBe('foo&#x2F;bar');
expect(mlEscape("foo'bar")).toBe('foo&apos;bar');
expect(mlEscape('foo/bar')).toBe('foo&sol;bar');
expect(mlEscape('escape © everything ≠ / 𝌆 \\')).toBe(
'escape&#x20;&copy;&#x20;everything&#x20;&ne;&#x20;&sol;&#x20;&#xD834;&#xDF06;&#x20;&#x5C;'
);
});
});

Expand Down
Loading

0 comments on commit 16ab6c6

Please sign in to comment.