Skip to content

Commit

Permalink
Merge branch 'main' into kbn-120137-sample-data-alias
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jan 17, 2022
2 parents fc510d7 + f4b117a commit 31b0594
Show file tree
Hide file tree
Showing 716 changed files with 9,332 additions and 4,178 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,11 @@
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
/x-pack/plugins/security/ @elastic/kibana-security
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security
/x-pack/test/api_integration/apis/spaces/ @elastic/kibana-security
/x-pack/test/ui_capabilities/ @elastic/kibana-security
/x-pack/test/encrypted_saved_objects_api_integration/ @elastic/kibana-security
/x-pack/test/functional/apps/security/ @elastic/kibana-security
/x-pack/test/functional/apps/spaces/ @elastic/kibana-security
/x-pack/test/security_api_integration/ @elastic/kibana-security
/x-pack/test/security_functional/ @elastic/kibana-security
/x-pack/test/spaces_api_integration/ @elastic/kibana-security
Expand Down
32 changes: 20 additions & 12 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,19 @@ The `xpack.apm.autocreateApmIndexPattern` APM setting has been removed. For more
*Impact* +
To automatically create data views in APM, use `xpack.apm.autoCreateApmDataView`.
====

[discrete]
[[deprecation-119494]]
.Updates Fleet API responses for consistency
.Updates Fleet API to improve consistency
[%collapsible]
====
*Details* +
To make sure all Fleet API GET resposes return `items`, the following have been updated:
The Fleet API has been updated to improve consistency:
* `/api/fleet/enrollment-api-keys`
* `/api/fleet/agents`
* Hyphens are changed to underscores in some names.
* The `pkgkey` path parameter in the packages endpoint is split.
* The `response` and `list` properties are renamed to `items` or `item` in some
responses.
For more information, refer to {kibana-pull}119494[#119494].
Expand All @@ -157,24 +159,30 @@ When you upgrade to 8.0.0, use the following API changes:
* Use `service_tokens` instead of `service-tokens`.
* `check-permissions` is no longer supported.
* Use `/epm/packages/{packageName}/{version}` instead of `/epm/packages/{pkgkey}`.
* Use `items[]` or `item` instead of `response[]` in the following:
* Use `items[]` instead of `response[]` in:
+
[source,text]
--
/api/fleet/enrollment_api_keys
/api/fleet/agents
/epm/packages/
/epm/packages/{pkgkey}
/epm/categories
/epm/packages/_bulk
/epm/packages/limited
/epm/packages/{packageName}/{version} <1>
--
<1> Use `items[]` when the verb is `POST` or `DELETE`. Use `item` when the verb
is `GET` or `PUT`.
For more information, refer to {fleet-guide}/fleet-api-docs.html[Fleet APIs].
====

To review the depcrecations in previous versions, refer to the <<deprecations-8.0.0-alpha1,8.0.0-alpha1 release notes>>.

To review the deprecations in previous versions, refer to the <<deprecations-8.0.0-alpha1,8.0.0-alpha1 release notes>>.


[float]
[[features-8.0.0-rc1]]
=== Features
Expand Down
2 changes: 1 addition & 1 deletion docs/apm/troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ There are two things you can do to if you'd like to ensure a field is searchable
1. Index your additional data as {apm-guide-ref}/metadata.html[labels] instead.
These are dynamic by default, which means they will be indexed and become searchable and aggregatable.

2. Use the {apm-guide-ref}/configuration-template.html[`append_fields`] feature. As an example,
2. Use the `append_fields` feature. As an example,
adding the following to `apm-server.yml` will enable dynamic indexing for `http.request.cookies`:

[source,yml]
Expand Down
2 changes: 1 addition & 1 deletion docs/management/connectors/action-types/email.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ NOTE: For emails to have a footer with a link back to {kib}, set the <<server-pu
Email connectors have the following configuration properties.

Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action.
Sender:: The from address for all emails sent with this connector. This can be specified in `user@host-name` format or as `"human name <user@host-name>"` format. See the https://nodemailer.com/message/addresses/[Nodemailer address documentation] for more information.
Sender:: The from address for all emails sent with this connector. This must be specified in `user@host-name` format. See the https://nodemailer.com/message/addresses/[Nodemailer address documentation] for more information.
Service:: The name of the email service. If `service` is one of Nodemailer's https://nodemailer.com/smtp/well-known/[well-known email service providers], the `host`, `port`, and `secure` properties are defined with the default values and disabled for modification. If `service` is `MS Exchange Server`, the `host`, `port`, and `secure` properties are ignored and `tenantId`, `clientId`, `clientSecret` are required instead. If `service` is `other`, the `host` and `port` properties must be defined.
Host:: Host name of the service provider. If you are using the <<action-settings, `xpack.actions.allowedHosts`>> setting, make sure this hostname is added to the allowed hosts.
Port:: The port to connect to on the service provider.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@
"cpy": "^8.1.1",
"css-loader": "^3.4.2",
"cssnano": "^4.1.11",
"cypress": "^9.2.0",
"cypress": "^9.2.1",
"cypress-axe": "^0.14.0",
"cypress-cucumber-preprocessor": "^2.5.2",
"cypress-file-upload": "^5.0.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ export const isQueryStringFilter = (filter: Filter): filter is QueryStringFilter
*
* @public
*/
export const buildQueryFilter = (query: QueryStringFilter['query'], index: string, alias: string) =>
({
query,
meta: {
index,
alias,
},
} as QueryStringFilter);
export const buildQueryFilter = (
query: QueryStringFilter['query'],
index: string,
alias?: string,
meta: QueryStringFilterMeta = {}
) => ({ query, meta: { index, alias, ...meta } });
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('migration v2', () => {
es: {
license: 'basic',
dataArchive: Path.join(__dirname, 'archives', '7.14.0_xpack_sample_saved_objects.zip'),
esArgs: ['http.max_content_length=1715275b'],
esArgs: ['http.max_content_length=1715329b'],
},
},
}));
Expand All @@ -85,7 +85,7 @@ describe('migration v2', () => {
});

it('completes the migration even when a full batch would exceed ES http.max_content_length', async () => {
root = createRoot({ maxBatchSizeBytes: 1715275 });
root = createRoot({ maxBatchSizeBytes: 1715329 });
esServer = await startES();
await root.preboot();
await root.setup();
Expand All @@ -109,7 +109,7 @@ describe('migration v2', () => {
await root.preboot();
await root.setup();
await expect(root.start()).rejects.toMatchInlineSnapshot(
`[Error: Unable to complete saved object migrations for the [.kibana] index: The document with _id "canvas-workpad-template:workpad-template-061d7868-2b4e-4dc8-8bf7-3772b52926e5" is 1715274 bytes which exceeds the configured maximum batch size of 1015275 bytes. To proceed, please increase the 'migrations.maxBatchSizeBytes' Kibana configuration option and ensure that the Elasticsearch 'http.max_content_length' configuration option is set to an equal or larger value.]`
`[Error: Unable to complete saved object migrations for the [.kibana] index: The document with _id "canvas-workpad-template:workpad-template-061d7868-2b4e-4dc8-8bf7-3772b52926e5" is 1715329 bytes which exceeds the configured maximum batch size of 1015275 bytes. To proceed, please increase the 'migrations.maxBatchSizeBytes' Kibana configuration option and ensure that the Elasticsearch 'http.max_content_length' configuration option is set to an equal or larger value.]`
);

await retryAsync(
Expand All @@ -122,7 +122,7 @@ describe('migration v2', () => {
expect(
records.find((rec) =>
rec.message.startsWith(
`Unable to complete saved object migrations for the [.kibana] index: The document with _id "canvas-workpad-template:workpad-template-061d7868-2b4e-4dc8-8bf7-3772b52926e5" is 1715274 bytes which exceeds the configured maximum batch size of 1015275 bytes. To proceed, please increase the 'migrations.maxBatchSizeBytes' Kibana configuration option and ensure that the Elasticsearch 'http.max_content_length' configuration option is set to an equal or larger value.`
`Unable to complete saved object migrations for the [.kibana] index: The document with _id "canvas-workpad-template:workpad-template-061d7868-2b4e-4dc8-8bf7-3772b52926e5" is 1715329 bytes which exceeds the configured maximum batch size of 1015275 bytes. To proceed, please increase the 'migrations.maxBatchSizeBytes' Kibana configuration option and ensure that the Elasticsearch 'http.max_content_length' configuration option is set to an equal or larger value.`
)
)
).toBeDefined();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('migration v2', () => {
});

it('fails with a descriptive message when maxBatchSizeBytes exceeds ES http.max_content_length', async () => {
root = createRoot({ maxBatchSizeBytes: 1715275 });
root = createRoot({ maxBatchSizeBytes: 1715329 });
esServer = await startES();
await root.preboot();
await root.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { forwardAllContext } from '../editor/forward_all_context';
import { controlGroupReducers } from '../state/control_group_reducers';
import { ControlClone, SortableControl } from './control_group_sortable_item';
import { useReduxContainerContext } from '../../../../presentation_util/public';
import { ControlsIllustration } from './controls_illustration';

export const ControlGroup = () => {
// Controls Services Context
Expand Down Expand Up @@ -108,8 +109,8 @@ export const ControlGroup = () => {
return null;
}

let panelBg: 'subdued' | 'primary' | 'success' = 'subdued';
if (emptyState) panelBg = 'primary';
let panelBg: 'subdued' | 'plain' | 'success' = 'subdued';
if (emptyState) panelBg = 'plain';
if (draggingId) panelBg = 'success';

return (
Expand Down Expand Up @@ -201,10 +202,18 @@ export const ControlGroup = () => {
) : (
<>
<EuiFlexGroup alignItems="center" gutterSize="xs" data-test-subj="controls-empty">
<EuiFlexItem grow={1}>
<EuiText className="emptyStateText eui-textCenter" size="s">
<p>{ControlGroupStrings.emptyState.getCallToAction()}</p>
</EuiText>
<EuiFlexItem grow={1} className="controlsIllustration__container">
<EuiFlexGroup alignItems="center" gutterSize="xs" responsive={false}>
<EuiFlexItem grow={false}>
<ControlsIllustration />
</EuiFlexItem>
<EuiFlexItem>
{' '}
<EuiText className="emptyStateText" size="s">
<p>{ControlGroupStrings.emptyState.getCallToAction()}</p>
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<div className="addControlButton">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@include euiBreakpoint('xs', 's') {
.controlsIllustration {
width: $euiSize * 6;
height: $euiSize * 6;
}
}

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions src/plugins/controls/public/control_group/control_group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ $controlMinWidth: $euiSize * 14;
&--empty {
display: flex;
@include euiBreakpoint('m', 'l', 'xl') {
background: url(opt_a.svg);
background-position: left top;
background-repeat: no-repeat;
.addControlButton {
text-align: center;
}
.emptyStateText {
padding-left: $euiSize * 2;
}
height: $euiSize * 4;
overflow: hidden;
}
@include euiBreakpoint('xs', 's') {
.addControlButton {
text-align: center;
}
.emptyStateText {
text-align: center;
}
.controlsIllustration__container {
margin-bottom: 0 !important;
}
}
min-height: $euiSize * 4;
}

&--twoLine {
Expand Down
5 changes: 0 additions & 5 deletions src/plugins/controls/public/control_group/opt_a.svg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,19 @@ export class DashboardContainer extends Container<InheritedChildInput, Dashboard
ReactDOM.unmountComponentAtNode(this.domNode);
}
this.domNode = dom;
const controlsEnabled = this.services.presentationUtil.labsService.isProjectEnabled(
'labs:dashboard:dashboardControls'
);
ReactDOM.render(
<I18nProvider>
<KibanaContextProvider services={this.services}>
<KibanaThemeProvider theme$={this.services.theme.theme$}>
<this.services.presentationUtil.ContextProvider>
<DashboardViewport container={this} controlGroup={this.controlGroup} />
<DashboardViewport
controlsEnabled={controlsEnabled}
container={this}
controlGroup={this.controlGroup}
/>
</this.services.presentationUtil.ContextProvider>
</KibanaThemeProvider>
</KibanaContextProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

.dshDashboardViewport-controlGroup {
margin: 0 $euiSizeS 0 $euiSizeS;
padding-bottom: $euiSizeXS;
}

.dshDashboardEmptyScreen {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ControlGroupContainer } from '../../../../../controls/public';
export interface DashboardViewportProps {
container: DashboardContainer;
controlGroup?: ControlGroupContainer;
controlsEnabled?: boolean;
}

interface State {
Expand Down Expand Up @@ -93,13 +94,15 @@ export class DashboardViewport extends React.Component<DashboardViewportProps, S
};

public render() {
const { container } = this.props;
const { container, controlsEnabled } = this.props;
const isEditMode = container.getInput().viewMode !== ViewMode.VIEW;
const { isEmbeddedExternally, isFullScreenMode, panelCount, title, description, useMargins } =
this.state;
return (
<>
<div className="dshDashboardViewport-controlGroup" ref={this.controlsRoot} />
{controlsEnabled ? (
<div className="dshDashboardViewport-controlGroup" ref={this.controlsRoot} />
) : null}
<div
data-shared-items-count={panelCount}
data-shared-items-container
Expand Down
14 changes: 11 additions & 3 deletions src/plugins/data/common/search/expressions/kibana_context_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { ExpressionValueBoxed } from 'src/plugins/expressions/common';
import { Filter } from '../../es_query';
import { Filter } from '@kbn/es-query';
import { ExpressionValueBoxed, ExpressionValueFilter } from 'src/plugins/expressions/common';
import { Query, TimeRange } from '../../query';
import { IndexPatternField } from '../..';
import { adaptToExpressionValueFilter, IndexPatternField } from '../..';

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export type ExecutionContextSearch = {
Expand Down Expand Up @@ -45,5 +45,13 @@ export const kibanaContext = {
type: 'null',
};
},
filter: (input: KibanaContext): ExpressionValueFilter => {
const { filters = [] } = input;
return {
type: 'filter',
filterType: 'filter',
and: filters.map(adaptToExpressionValueFilter),
};
},
},
};
22 changes: 20 additions & 2 deletions src/plugins/data/common/search/expressions/select_filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ describe('interpreter/functions#selectFilter', () => {
},
query: {},
},
{
meta: {
group: 'g3',
},
query: {},
},
{
meta: {
group: 'g1',
Expand Down Expand Up @@ -68,6 +74,12 @@ describe('interpreter/functions#selectFilter', () => {
},
"query": Object {},
},
Object {
"meta": Object {
"group": "g3",
},
"query": Object {},
},
Object {
"meta": Object {
"controlledBy": "i1",
Expand All @@ -94,8 +106,8 @@ describe('interpreter/functions#selectFilter', () => {
`);
});

it('selects filters belonging to certain group', () => {
const actual = fn(kibanaContext, { group: 'g1' }, createMockContext());
it('selects filters belonging to certain groups', () => {
const actual = fn(kibanaContext, { group: ['g1', 'g3'] }, createMockContext());
expect(actual).toMatchInlineSnapshot(`
Object {
"filters": Array [
Expand All @@ -105,6 +117,12 @@ describe('interpreter/functions#selectFilter', () => {
},
"query": Object {},
},
Object {
"meta": Object {
"group": "g3",
},
"query": Object {},
},
Object {
"meta": Object {
"controlledBy": "i1",
Expand Down
Loading

0 comments on commit 31b0594

Please sign in to comment.