Skip to content

Commit

Permalink
Merge branch 'main' into issue_162777
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Aug 7, 2023
2 parents ee6392d + 7ff43da commit c4be75e
Show file tree
Hide file tree
Showing 91 changed files with 2,864 additions and 2,313 deletions.
14 changes: 10 additions & 4 deletions docs/developer/advanced/upgrading-nodejs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,21 @@ Use best judgement when backporting.

==== Node.js patch upgrades

Typically, you want to backport Node.js *patch* upgrades to all supported release branches that run the same *major* Node.js version (which currently is all of them, but this might change in the future once Node.js v18 is released and becomes LTS):
Typically, you want to backport Node.js *patch* upgrades to all supported release branches that run the same *major* Node.js version (which currently is all of them, but this might change in the future):

- If upgrading Node.js 16, and the current release is 8.1.x, the main PR should target `main` and be backported to `7.17` and `8.1`.
- If the current release is 8.1.x, the main PR should target `main` and be backported to `7.17` and `8.1` (GitHub tag example: `backport:all-open`).

==== Node.js minor upgrades

Typically, you want to backport Node.js *minor* upgrades to the next minor {kib} release branch that runs the same *major* Node.js version:
Typically, you want to backport Node.js *minor* upgrades to the previous major {kib} release branch (if it runs the same *major* Node.js version):

- If upgrading Node.js 16, and the current release is 8.1.x, the main PR should target `main` and be backported to `7.17`, while leaving the `8.1` branch as-is.
- If the current release is 8.1.x, the main PR should target `main` and be backported to `7.17`, while leaving the `8.1` branch as-is (GitHub tag example: `auto-backport` + `v7.17.13`).

==== Node.js major upgrades

Typically, you want to backport Node.js *major* upgrades to the previous major {kib} release branch:

- If the current release is 8.1.x, the main PR should target `main` and be backported to `7.17`, while leaving the `8.1` branch as-is (GitHub tag example: `auto-backport` + `v7.17.13`).

=== Upgrading installed Node.js version

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ export const GaugeComponent: FC<GaugeRenderProps> = memo(
const onRenderChange = useCallback(
(isRendered: boolean = true) => {
if (isRendered) {
renderComplete();
// this requestAnimationFrame call is a temporary fix for https://github.com/elastic/elastic-charts/issues/2124
window.requestAnimationFrame(() => {
renderComplete();
});
}
},
[renderComplete]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ export const HeatmapComponent: FC<HeatmapRenderProps> = memo(
const onRenderChange = useCallback(
(isRendered: boolean = true) => {
if (isRendered) {
renderComplete();
// this requestAnimationFrame call is a temporary fix for https://github.com/elastic/elastic-charts/issues/2124
window.requestAnimationFrame(() => {
renderComplete();
});
}
},
[renderComplete]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,11 @@ describe('MetricVisComponent', function () {
});

it('should report render complete', () => {
jest.spyOn(window, 'requestAnimationFrame').mockImplementation((cb) => {
cb(0);
return 0;
});

const renderCompleteSpy = jest.fn();
const component = shallow(
<MetricVis
Expand All @@ -995,6 +1000,8 @@ describe('MetricVisComponent', function () {
component.find(Settings).props().onRenderChange!(true);

expect(renderCompleteSpy).toHaveBeenCalledTimes(1);

(window.requestAnimationFrame as jest.Mock).mockRestore();
});

it('should convert null values to NaN', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ export const MetricVis = ({
const onRenderChange = useCallback<RenderChangeListener>(
(isRendered) => {
if (isRendered) {
renderComplete();
// this requestAnimationFrame call is a temporary fix for https://github.com/elastic/elastic-charts/issues/2124
window.requestAnimationFrame(() => {
renderComplete();
});
}
},
[renderComplete]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,11 @@ const PartitionVisComponent = (props: PartitionVisComponentProps) => {
const onRenderChange = useCallback(
(isRendered: boolean = true) => {
if (isRendered) {
props.renderComplete();
setChartIsLoaded(true);
// this requestAnimationFrame call is a temporary fix for https://github.com/elastic/elastic-charts/issues/2124
window.requestAnimationFrame(() => {
props.renderComplete();
setChartIsLoaded(true);
});
}
},
[props]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ export const TagCloudChart = ({
const onRenderChange = useCallback<RenderChangeListener>(
(isRendered) => {
if (isRendered) {
renderComplete();
// this requestAnimationFrame call is a temporary fix for https://github.com/elastic/elastic-charts/issues/2124
window.requestAnimationFrame(() => {
renderComplete();
});
}
},
[renderComplete]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,10 @@ export function XYChart({
const onRenderChange = useCallback(
(isRendered: boolean = true) => {
if (isRendered) {
renderComplete();
// this requestAnimationFrame call is a temporary fix for https://github.com/elastic/elastic-charts/issues/2124
window.requestAnimationFrame(() => {
renderComplete();
});
}
},
[renderComplete]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,32 @@
* 2.0.
*/

import {
EuiEmptyPrompt,
EuiPageTemplate_Deprecated as EuiPageTemplate,
} from '@elastic/eui';
import { EuiEmptyPrompt } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';

export function FailurePrompt() {
return (
<EuiPageTemplate
pageContentProps={{
color: 'transparent',
}}
template="centeredBody"
>
<EuiEmptyPrompt
color="danger"
iconType="warning"
layout="vertical"
title={
<h2>
{i18n.translate('xpack.apm.infraTabs.failurePromptTitle', {
defaultMessage: 'Unable to load your infrastructure data',
})}
</h2>
}
titleSize="m"
body={
<p>
{i18n.translate('xpack.apm.infraTabs.failurePromptDescription', {
defaultMessage:
'There was a problem loading the Infrastructure tab and your data. You can contact your administrator for help.',
})}
</p>
}
/>
</EuiPageTemplate>
<EuiEmptyPrompt
color="danger"
iconType="warning"
layout="vertical"
title={
<h2>
{i18n.translate('xpack.apm.infraTabs.failurePromptTitle', {
defaultMessage: 'Unable to load your infrastructure data',
})}
</h2>
}
titleSize="m"
body={
<p>
{i18n.translate('xpack.apm.infraTabs.failurePromptDescription', {
defaultMessage:
'There was a problem loading the Infrastructure tab and your data. You can contact your administrator for help.',
})}
</p>
}
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,27 @@ const KibanaReactContext = createKibanaReactContext(coreMock);

const agentKeys: ApiKey[] = [
{
type: 'rest',
id: 'M96XSX4BQcLuJqE2VX29',
name: 'apm_api_key1',
creation: 1641912161726,
invalidated: false,
username: 'elastic',
realm: 'reserved',
expiration: 0,
role_descriptors: {},
metadata: { application: 'apm' },
},

{
type: 'rest',
id: 'Nd6XSX4BQcLuJqE2eH2A',
name: 'apm_api_key2',
creation: 1641912170624,
invalidated: false,
username: 'elastic',
realm: 'reserved',
expiration: 0,
role_descriptors: {},
metadata: { application: 'apm' },
},
];
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/server/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const APM_FEATURE = {
privileges: {
all: {
app: [APM_SERVER_FEATURE_ID, 'ux', 'kibana'],
api: [APM_SERVER_FEATURE_ID, 'apm_write', 'rac', 'ai_assistant'],
api: [APM_SERVER_FEATURE_ID, 'apm_write', 'rac'],
catalogue: [APM_SERVER_FEATURE_ID],
savedObject: {
all: [],
Expand All @@ -56,7 +56,7 @@ export const APM_FEATURE = {
},
read: {
app: [APM_SERVER_FEATURE_ID, 'ux', 'kibana'],
api: [APM_SERVER_FEATURE_ID, 'rac', 'ai_assistant'],
api: [APM_SERVER_FEATURE_ID, 'rac'],
catalogue: [APM_SERVER_FEATURE_ID],
savedObject: {
all: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.canvasEmbeddable {
.embPanel {
border: none;
border-style: none !important;
outline: none !important;
background: none;
border-radius: 0 !important;

.embPanel__title {
margin-bottom: $euiSizeXS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const Toolbar: FC<Props> = ({
iconType="arrowLeft"
isDisabled={selectedPageNumber <= 1}
aria-label={strings.getPreviousPageAriaLabel()}
data-test-subj="previousPageButton"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
Expand All @@ -124,6 +125,7 @@ export const Toolbar: FC<Props> = ({
iconType="arrowRight"
isDisabled={selectedPageNumber >= totalPages}
aria-label={strings.getNextPageAriaLabel()}
data-test-subj="nextPageButton"
/>
</EuiFlexItem>
<EuiFlexItem />
Expand Down
18 changes: 3 additions & 15 deletions x-pack/plugins/canvas/public/state/actions/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { createAction } from 'redux-actions';
import immutable from 'object-path-immutable';
import { get, pick, cloneDeep, without, last, debounce } from 'lodash';
import { get, pick, cloneDeep, without, last } from 'lodash';
import { toExpression, safeElementFromExpression } from '@kbn/interpreter';
import { createThunk } from '../../lib/create_thunk';
import { isGroupId } from '../../lib/workpad';
Expand Down Expand Up @@ -112,13 +112,7 @@ const fetchContextFn = ({ dispatch, getState }, index, element, fullRefresh = fa
});
};

// It is necessary to debounce fetching of the context in the situations
// when the components of the arguments update the expression. For example, suppose there are
// multiple datacolumns that change the column to the first one from the list after datasource update.
// In that case, it is necessary to fetch the context only for the last version of the expression.
const fetchContextFnDebounced = debounce(fetchContextFn, 100);

export const fetchContext = createThunk('fetchContext', fetchContextFnDebounced);
export const fetchContext = createThunk('fetchContext', fetchContextFn);

const fetchRenderableWithContextFn = ({ dispatch, getState }, element, ast, context) => {
const argumentPath = [element.id, 'expressionRenderable'];
Expand Down Expand Up @@ -148,15 +142,9 @@ const fetchRenderableWithContextFn = ({ dispatch, getState }, element, ast, cont
});
};

// It is necessary to debounce fetching of the renderable with the context in the situations
// when the components of the arguments update the expression. For example, suppose there are
// multiple datacolumns that change the column to the first one from the list after datasource update.
// In that case, it is necessary to fetch the context only for the last version of the expression.
const fetchRenderableWithContextFnDebounced = debounce(fetchRenderableWithContextFn, 100);

export const fetchRenderableWithContext = createThunk(
'fetchRenderableWithContext',
fetchRenderableWithContextFnDebounced
fetchRenderableWithContextFn
);

export const fetchRenderable = createThunk('fetchRenderable', ({ dispatch }, element) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
* 2.0.
*/

import type { CreateAPIKeyParams } from '@kbn/security-plugin/server';
import type {
CreateRestAPIKeyParams,
CreateRestAPIKeyWithKibanaPrivilegesParams,
} from '@kbn/security-plugin/server';
import type { FakeRawRequest, Headers } from '@kbn/core-http-server';
import { CoreKibanaRequest } from '@kbn/core-http-router-server-internal';

Expand Down Expand Up @@ -60,7 +63,7 @@ export async function generateTransformSecondaryAuthHeaders({
}: {
authorizationHeader: HTTPAuthorizationHeader | null | undefined;
logger: Logger;
createParams?: CreateAPIKeyParams;
createParams?: CreateRestAPIKeyParams | CreateRestAPIKeyWithKibanaPrivilegesParams;
username?: string;
pkgName?: string;
pkgVersion?: string;
Expand Down
8 changes: 4 additions & 4 deletions x-pack/plugins/infra/server/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const METRICS_FEATURE = {
all: {
app: ['infra', 'metrics', 'kibana'],
catalogue: ['infraops', 'metrics'],
api: ['infra', 'rac', 'ai_assistant'],
api: ['infra', 'rac'],
savedObject: {
all: ['infrastructure-ui-source'],
read: ['index-pattern'],
Expand All @@ -54,7 +54,7 @@ export const METRICS_FEATURE = {
read: {
app: ['infra', 'metrics', 'kibana'],
catalogue: ['infraops', 'metrics'],
api: ['infra', 'rac', 'ai_assistant'],
api: ['infra', 'rac'],
savedObject: {
all: [],
read: ['infrastructure-ui-source', 'index-pattern'],
Expand Down Expand Up @@ -92,7 +92,7 @@ export const LOGS_FEATURE = {
all: {
app: ['infra', 'logs', 'kibana'],
catalogue: ['infralogging', 'logs'],
api: ['infra', 'rac', 'ai_assistant'],
api: ['infra', 'rac'],
savedObject: {
all: [infraSourceConfigurationSavedObjectName, logViewSavedObjectName],
read: [],
Expand All @@ -113,7 +113,7 @@ export const LOGS_FEATURE = {
read: {
app: ['infra', 'logs', 'kibana'],
catalogue: ['infralogging', 'logs'],
api: ['infra', 'rac', 'ai_assistant'],
api: ['infra', 'rac'],
alerting: {
rule: {
read: [LOG_DOCUMENT_COUNT_RULE_TYPE_ID],
Expand Down
Loading

0 comments on commit c4be75e

Please sign in to comment.