Skip to content

Commit

Permalink
Merge branch '7.15' into backport/7.15/pr-114401
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Nov 1, 2021
2 parents 88351fc + 5b44541 commit 6c50c8c
Show file tree
Hide file tree
Showing 118 changed files with 24,546 additions and 1,298 deletions.
3 changes: 1 addition & 2 deletions .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"upstream": "elastic/kibana",
"targetBranchChoices": [
{ "name": "master", "checked": true },
{ "name": "7.x", "checked": true },
{ "name": "7.16", "checked": true },
"7.15",
"7.14",
"7.13",
Expand Down Expand Up @@ -33,7 +33,6 @@
"targetPRLabels": ["backport"],
"branchLabelMapping": {
"^v8.0.0$": "master",
"^v7.16.0$": "7.x",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
}
}
8 changes: 1 addition & 7 deletions .buildkite/pipelines/flaky_tests/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ const inputs = [
default: 0,
required: true,
},
{
key: 'ftsr-concurrency',
text: 'Max concurrency per step',
default: 20,
required: true,
},
];

for (let i = 1; i <= OSS_CI_GROUPS; i++) {
Expand All @@ -36,7 +30,7 @@ for (let i = 1; i <= XPACK_CI_GROUPS; i++) {
const pipeline = {
steps: [
{
input: 'Number of Runs',
input: 'Number of Runs - Click Me',
fields: inputs,
},
{
Expand Down
25 changes: 21 additions & 4 deletions .buildkite/pipelines/flaky_tests/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ const overrideCount = parseInt(
execSync(`buildkite-agent meta-data get 'ftsr-override-count'`).toString().trim()
);

const concurrency =
parseInt(execSync(`buildkite-agent meta-data get 'ftsr-concurrency'`).toString().trim()) || 20;
const concurrency = 25;
const initialJobs = 3;

let totalJobs = initialJobs;

const testSuites = [];
for (const key of keys) {
Expand All @@ -21,12 +23,25 @@ for (const key of keys) {
const value =
overrideCount || execSync(`buildkite-agent meta-data get '${key}'`).toString().trim();

const count = value === '' ? defaultCount : parseInt(value);
totalJobs += count;

testSuites.push({
key: key.replace('ftsr-suite/', ''),
count: value === '' ? defaultCount : parseInt(value),
count: count,
});
}

if (totalJobs > 500) {
console.error('+++ Too many tests');
console.error(
`Buildkite builds can only contain 500 steps in total. Found ${totalJobs} in total. Make sure your test runs are less than ${
500 - initialJobs
}`
);
process.exit(1);
}

const steps = [];
const pipeline = {
env: {
Expand All @@ -46,7 +61,7 @@ steps.push({
for (const testSuite of testSuites) {
const TEST_SUITE = testSuite.key;
const RUN_COUNT = testSuite.count;
const UUID = TEST_SUITE + process.env.UUID;
const UUID = process.env.UUID;

const JOB_PARTS = TEST_SUITE.split('/');
const IS_XPACK = JOB_PARTS[0] === 'xpack';
Expand All @@ -65,6 +80,7 @@ for (const testSuite of testSuites) {
parallelism: RUN_COUNT,
concurrency: concurrency,
concurrency_group: UUID,
concurrency_method: 'eager',
});
} else {
steps.push({
Expand All @@ -75,6 +91,7 @@ for (const testSuite of testSuites) {
parallelism: RUN_COUNT,
concurrency: concurrency,
concurrency_group: UUID,
concurrency_method: 'eager',
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/dashboard-api.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[dashboard-api]]
== Import and export dashboard APIs

deprecated::[7.15.0,Both of these APIs have been deprecated in favor of <<saved-objects-api-import>> and <<saved-objects-api-export>>.]
deprecated::[7.15.0,These experimental APIs have been deprecated in favor of <<saved-objects-api-import>> and <<saved-objects-api-export>>.]

Import and export dashboards with the corresponding saved objects, such as visualizations, saved
searches, and index patterns.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/dashboard/export-dashboard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

deprecated::[7.15.0,Use <<saved-objects-api-export>> instead.]

Export dashboards and corresponding saved objects.
experimental[] Export dashboards and corresponding saved objects.

[[dashboard-api-export-request]]
==== Request
Expand Down
2 changes: 1 addition & 1 deletion docs/api/dashboard/import-dashboard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

deprecated::[7.15.0,Use <<saved-objects-api-import>> instead.]

Import dashboards and corresponding saved objects.
experimental[] Import dashboards and corresponding saved objects.

[[dashboard-api-import-request]]
==== Request
Expand Down
15 changes: 12 additions & 3 deletions docs/concepts/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,18 @@ The structured filters are the only way to use the {es} Query DSL in JSON form,
or to target a specific index pattern for filtering. Each of the structured
filters is combined with AND logic on the rest of the query.

[role="screenshot"]
image:concepts/images/add-filter-popup.png["Add filter popup"]

++++
<script type="text/javascript" async src="https://play.vidyard.com/embed/v4.js">
</script>
<img
style="width: 100%; margin: auto; display: block;"
class="vidyard-player-embed"
src="https://play.vidyard.com/xqpw9GEwma7vUj9TR4CegV.jpg"
data-uuid="xqpw9GEwma7vUj9TR4CegV"
data-v="4"
data-type="inline"
/>
++++

[float]
=== Saving objects
Expand Down
2 changes: 1 addition & 1 deletion docs/management/connectors/action-types/pagerduty.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ PagerDuty actions have the following properties.

Severity:: The perceived severity of on the affected system. This can be one of `Critical`, `Error`, `Warning` or `Info`(default).
Event action:: One of `Trigger` (default), `Resolve`, or `Acknowledge`. See https://v2.developer.pagerduty.com/docs/events-api-v2#event-action[event action] for more details.
Dedup Key:: All actions sharing this key will be associated with the same PagerDuty alert. This value is used to correlate trigger and resolution. This value is *optional*, and if not set, defaults to `<alert ID>:<alert instance ID>`. The maximum length is *255* characters. See https://v2.developer.pagerduty.com/docs/events-api-v2#alert-de-duplication[alert deduplication] for details.
Dedup Key:: All actions sharing this key will be associated with the same PagerDuty alert. This value is used to correlate trigger and resolution. This value is *optional*, and if not set, defaults to `<rule ID>:<alert ID>`. The maximum length is *255* characters. See https://v2.developer.pagerduty.com/docs/events-api-v2#alert-de-duplication[alert deduplication] for details.
Timestamp:: An *optional* https://v2.developer.pagerduty.com/v2/docs/types#datetime[ISO-8601 format date-time], indicating the time the event was detected or generated.
Component:: An *optional* value indicating the component of the source machine that is responsible for the event, for example `mysql` or `eth0`.
Group:: An *optional* value indicating the logical grouping of components of a service, for example `app-stack`.
Expand Down
2 changes: 1 addition & 1 deletion docs/settings/spaces-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ return all spaces using a single `_search` from {es}, so you must
configure this setting lower than the `index.max_result_window` in {es}.
The default is `1000`.

`monitoring.cluster_alerts-allowedSpaces` {ess-icon}::
`monitoring.cluster_alerts.allowedSpaces` {ess-icon}::
Specifies the spaces where cluster alerts are automatically generated.
You must specify all spaces where you want to generate alerts, including the default space.
When the default space is unspecified, {kib} is unable to generate an alert for the default space.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@
"@types/redux-actions": "^2.6.1",
"@types/request": "^2.48.2",
"@types/seedrandom": ">=2.0.0 <4.0.0",
"@types/selenium-webdriver": "^4.0.9",
"@types/selenium-webdriver": "^4.0.15",
"@types/semver": "^7",
"@types/set-value": "^2.0.0",
"@types/sinon": "^7.0.13",
Expand Down Expand Up @@ -814,7 +814,7 @@
"rxjs-marbles": "^5.0.6",
"sass-loader": "^8.0.2",
"sass-resources-loader": "^2.0.1",
"selenium-webdriver": "^4.0.0-alpha.7",
"selenium-webdriver": "^4.0.0",
"serve-static": "1.14.1",
"shelljs": "^0.8.4",
"simple-git": "1.116.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,30 @@
* Side Public License, v 1.
*/

const Fs = require('fs');
const Path = require('path');

const { REPO_ROOT } = require('@kbn/dev-utils');
const { REPO_ROOT: REPO_ROOT_FOLLOWING_SYMLINKS } = require('@kbn/dev-utils');
const BASE_REPO_ROOT = Path.resolve(
Fs.realpathSync(Path.resolve(REPO_ROOT_FOLLOWING_SYMLINKS, 'package.json')),
'..'
);

const transpileKbnPaths = [
'test',
'x-pack/test',
'examples',
'x-pack/examples',
// TODO: should should probably remove this link back to the source
'x-pack/plugins/task_manager/server/config.ts',
'src/core/utils/default_app_categories.ts',
].map((path) => Path.resolve(BASE_REPO_ROOT, path));

// modifies all future calls to require() to automatically
// compile the required source with babel
require('@babel/register')({
ignore: [/[\/\\](node_modules|target|dist)[\/\\]/],
only: [
Path.resolve(REPO_ROOT, 'test'),
Path.resolve(REPO_ROOT, 'x-pack/test'),
Path.resolve(REPO_ROOT, 'examples'),
Path.resolve(REPO_ROOT, 'x-pack/examples'),
// TODO: should should probably remove this link back to the source
Path.resolve(REPO_ROOT, 'x-pack/plugins/task_manager/server/config.ts'),
Path.resolve(REPO_ROOT, 'src/core/utils/default_app_categories.ts'),
],
only: transpileKbnPaths,
babelrc: false,
presets: [require.resolve('@kbn/babel-preset/node_preset')],
extensions: ['.js', '.ts', '.tsx'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ COPY --chown=1000:0 config/kibana.yml /usr/share/kibana/config/kibana.yml

# Add the launcher/wrapper script. It knows how to interpret environment
# variables and translate them to Kibana CLI options.
COPY --chown=1000:0 bin/kibana-docker /usr/local/bin/
COPY bin/kibana-docker /usr/local/bin/

# Ensure gid 0 write permissions for OpenShift.
RUN chmod g+ws /usr/share/kibana && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ describe('Dashboard container lifecycle', () => {
});
});

describe('Dashboard initial state', () => {
// FLAKY: https://github.com/elastic/kibana/issues/116050
// FLAKY: https://github.com/elastic/kibana/issues/105018
describe.skip('Dashboard initial state', () => {
it('Extracts state from Dashboard Saved Object', async () => {
const { renderHookResult, embeddableFactoryResult } = renderDashboardAppStateHook({});
const getResult = () => renderHookResult.result.current;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ describe('AggTypeMetricSinglePercentileProvider class', () => {
).toEqual(123);
});

it('should not throw error for empty buckets', () => {
const agg = aggConfigs.getResponseAggs()[0];
expect(agg.getValue({})).toEqual(NaN);
});

it('produces the expected expression ast', () => {
const agg = aggConfigs.getResponseAggs()[0];
expect(agg.toExpressionAst()).toMatchInlineSnapshot(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export const getSinglePercentileMetricAgg = () => {
if (Number.isInteger(agg.params.percentile)) {
valueKey += '.0';
}
return bucket[agg.id].values[valueKey];
const { values } = bucket[agg.id] ?? {};

return values ? values[valueKey] : NaN;
},
});
};
33 changes: 25 additions & 8 deletions src/plugins/data/public/search/fetch/handle_response.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ import { notificationServiceMock } from '../../../../../core/public/notification
import { setNotifications } from '../../services';
import { IKibanaSearchResponse } from 'src/plugins/data/common';

jest.mock('@kbn/i18n', () => {
return {
i18n: {
translate: (id: string, { defaultMessage }: { defaultMessage: string }) => defaultMessage,
},
};
});

describe('handleResponse', () => {
const notifications = notificationServiceMock.createStartContract();

Expand Down Expand Up @@ -73,4 +65,29 @@ describe('handleResponse', () => {
const result = handleResponse(request, response);
expect(result).toBe(response);
});

test('should notify if has warning', () => {
const request = { body: {} };
const response = {
rawResponse: {},
warning: 'a warning',
} as IKibanaSearchResponse<any>;
const result = handleResponse(request, response);
expect(result).toBe(response);
expect(notifications.toasts.addWarning).toBeCalledWith(
expect.objectContaining({ title: expect.stringContaining(response.warning!) })
);
});

test("shouldn't notify on warning about disabled security", () => {
const request = { body: {} };
const response = {
rawResponse: {},
warning:
'299 Elasticsearch-7.16.0-SNAPSHOT-3e6393bc4ec8f0000b1bcd4371b2e607eb02a1d7 "Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/security-minimal-setup.html to enable security."',
} as IKibanaSearchResponse<any>;
const result = handleResponse(request, response);
expect(result).toBe(response);
expect(notifications.toasts.addWarning).not.toBeCalled();
});
});
9 changes: 8 additions & 1 deletion src/plugins/data/public/search/fetch/handle_response.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { SearchRequest } from '..';

export function handleResponse(request: SearchRequest, response: IKibanaSearchResponse) {
const { rawResponse, warning } = response;
if (warning) {
if (warning && !shouldIgnoreWarning(warning)) {
getNotifications().toasts.addWarning({
title: i18n.translate('data.search.searchSource.fetch.warningMessage', {
defaultMessage: 'Warning: {warning}',
Expand Down Expand Up @@ -64,3 +64,10 @@ export function handleResponse(request: SearchRequest, response: IKibanaSearchRe

return response;
}

function shouldIgnoreWarning(warning: string): boolean {
// https://github.com/elastic/kibana/issues/115632
if (warning.includes('Elasticsearch built-in security features are not enabled')) return true;

return false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const revealImageParentStyle = css`
pointer-events: none;
`;

const revealImageAlignerStyle: CSSObject = {
const revealImageAlignerStyle = {
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
};
Expand Down Expand Up @@ -118,11 +118,11 @@ function RevealImageComponent({
return imgStyles;
}

const additionaAlignerStyles: AlignerStyles = {};
const additionalAlignerStyles: AlignerStyles = {};

if (isValidUrl(emptyImage ?? '')) {
// only use empty image if one is provided
additionaAlignerStyles.backgroundImage = `url(${emptyImage})`;
additionalAlignerStyles.backgroundImage = `url(${emptyImage})`;
}

let additionalImgStyles: ImageStyles = {};
Expand All @@ -136,10 +136,10 @@ function RevealImageComponent({
return (
<div
className="revealImageAligner"
css={css({
style={{
...revealImageAlignerStyle,
...additionaAlignerStyles,
})}
...additionalAlignerStyles,
}}
>
<img
ref={imgRef}
Expand Down
2 changes: 1 addition & 1 deletion src/setup_node_env/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
* Side Public License, v 1.
*/

require('./no_transpilation');
require('./no_transpilation_dist');
require('./polyfill');
10 changes: 1 addition & 9 deletions src/setup_node_env/no_transpilation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,4 @@
*/

require('./ensure_node_preserve_symlinks');

// The following require statements MUST be executed before any others - BEGIN
require('./exit_on_warning');
require('./harden');
// The following require statements MUST be executed before any others - END

require('symbol-observable');
require('source-map-support/register');
require('./node_version_validator');
require('./no_transpilation_dist');
Loading

0 comments on commit 6c50c8c

Please sign in to comment.