Skip to content

Commit

Permalink
chore(NA): merge and solve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic committed Apr 12, 2022
2 parents dc6c2c3 + 9d5aca5 commit e46bc1d
Show file tree
Hide file tree
Showing 370 changed files with 49,918 additions and 64,050 deletions.
6 changes: 5 additions & 1 deletion .buildkite/pipelines/flaky_tests/groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
"key": "xpack/cypress/fleet_cypress",
"name": "Fleet - Cypress"
},
{
"key": "xpack/cypress/apm_cypress",
"name": "APM - Cypress"
},
{
"key": "xpack/cigroup",
"name": "Default CI Group",
Expand All @@ -43,4 +47,4 @@
"name": "Default Accessibility"
}
]
}
}
9 changes: 1 addition & 8 deletions docs/user/dashboard/make-dashboards-interactive.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ image::images/drilldown_on_panel.png[Drilldown on data table that navigates to a
[[url-drilldowns]]
==== Create URL drilldowns

URL drilldowns enable you to navigate from a dashboard to external websites. Destination URLs can be dynamic, depending on the dashboard context or user interaction with a panel. To create URL drilldowns, you add <<variables,variables>> to a URL template, which configures the behavior of the drilldown.
URL drilldowns enable you to navigate from a dashboard to external websites. Destination URLs can be dynamic, depending on the dashboard context or user interaction with a panel. To create URL drilldowns, you add <<variables,variables>> to a URL template, which configures the behavior of the drilldown. All panels that you create with the visualization editors support dashboard drilldowns.

[role="screenshot"]
image:images/url_drilldown_go_to_github.gif[Drilldown on pie chart that navigates to Github]
Expand All @@ -210,13 +210,6 @@ The <<url-template-variables,variables>> you use to create a <<url_templating-la

For example, *Single click* has `{{event.value}}` and *Range selection* has `{{event.from}}` and `{{event.to}}`.

The panels you create using the following editors support dashboard drilldowns:

* *Lens*
* *Maps*
* *TSVB*
* *Aggregation-based* area chart, data table, heat map, horitizontal bar chart, line chart, pie chart, tag cloud, and vertical bar chart

[float]
===== Create a URL drilldown

Expand Down
7 changes: 4 additions & 3 deletions examples/search_examples/public/search/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
EuiTabbedContentTab,
} from '@elastic/eui';

import { lastValueFrom } from 'rxjs';
import { CoreStart } from '../../../../src/core/public';
import { mountReactNode } from '../../../../src/core/public/utils';
import { NavigationPublicPluginStart } from '../../../../src/plugins/navigation/public';
Expand Down Expand Up @@ -306,9 +307,9 @@ export const SearchExamplesApp = ({
const abortController = new AbortController();
setAbortController(abortController);
setIsLoading(true);
const { rawResponse: res } = await searchSource
.fetch$({ abortSignal: abortController.signal })
.toPromise();
const { rawResponse: res } = await lastValueFrom(
searchSource.fetch$({ abortSignal: abortController.signal })
);
setRawResponse(res);

const message = <EuiText>Searched {res.hits.total} documents.</EuiText>;
Expand Down
9 changes: 4 additions & 5 deletions examples/search_examples/public/search_sessions/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
EuiTitle,
} from '@elastic/eui';
import { catchError, map, tap } from 'rxjs/operators';
import { of } from 'rxjs';
import { lastValueFrom, of } from 'rxjs';

import { CoreStart } from '../../../../src/core/public';
import { mountReactNode } from '../../../../src/core/public/utils';
Expand Down Expand Up @@ -693,9 +693,8 @@ function doSearch(
const startTs = performance.now();

// Submit the search request using the `data.search` service.
return data.search
.search(req, { sessionId })
.pipe(
return lastValueFrom(
data.search.search(req, { sessionId }).pipe(
tap((res) => {
if (isCompleteResponse(res)) {
const avgResult: number | undefined = res.rawResponse.aggregations
Expand Down Expand Up @@ -724,7 +723,7 @@ function doSearch(
return of({ request: req, response: e });
})
)
.toPromise();
);
}

function getNumeric(fields?: DataViewField[]) {
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.2.0-canary.2",
"@elastic/ems-client": "8.2.0",
"@elastic/eui": "53.0.1",
"@elastic/eui": "54.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
"@elastic/react-search-ui": "^1.6.0",
"@elastic/request-crypto": "2.0.1",
"@elastic/safer-lodash-set": "link:bazel-bin/packages/elastic-safer-lodash-set",
"@elastic/search-ui-app-search-connector": "^1.6.0",
"@emotion/cache": "^11.4.0",
"@emotion/css": "^11.4.0",
"@emotion/react": "^11.4.0",
"@emotion/serialize": "^1.0.2",
"@emotion/cache": "^11.7.1",
"@emotion/css": "^11.9.0",
"@emotion/react": "^11.9.0",
"@emotion/serialize": "^1.0.3",
"@hapi/accept": "^5.0.2",
"@hapi/boom": "^9.1.4",
"@hapi/cookie": "^11.0.2",
Expand Down Expand Up @@ -383,7 +383,7 @@
"redux-actions": "^2.6.5",
"redux-devtools-extension": "^2.13.8",
"redux-logger": "^3.0.6",
"redux-observable": "^1.2.0",
"redux-observable": "2.0.0",
"redux-saga": "^1.1.3",
"redux-thunk": "^2.3.0",
"redux-thunks": "^1.0.0",
Expand All @@ -394,7 +394,7 @@
"reselect": "^4.0.0",
"resize-observer-polyfill": "^1.5.1",
"rison-node": "1.0.2",
"rxjs": "^6.5.5",
"rxjs": "^7.5.5",
"safe-squel": "^5.12.5",
"seedrandom": "^3.0.5",
"semver": "^7.3.2",
Expand Down Expand Up @@ -466,7 +466,7 @@
"@elastic/makelogs": "^6.0.0",
"@elastic/synthetics": "^1.0.0-beta.22",
"@emotion/babel-preset-css-prop": "^11.2.0",
"@emotion/jest": "^11.3.0",
"@emotion/jest": "^11.9.0",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@istanbuljs/schema": "^0.1.2",
"@jest/console": "^26.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// eslint-disable-next-line max-classes-per-file
import type { Observable } from 'rxjs';
import { BehaviorSubject, Subject } from 'rxjs';
import { BehaviorSubject, lastValueFrom, Subject } from 'rxjs';
import type { MockedLogger } from '@kbn/logging-mocks';
import { loggerMock } from '@kbn/logging-mocks';
import { AnalyticsClient } from './analytics_client';
Expand Down Expand Up @@ -113,14 +113,14 @@ describe('AnalyticsClient', () => {
},
});

// eslint-disable-next-line dot-notation
const internalQueuePromise = analyticsClient['internalEventQueue$']
.pipe(take(3), toArray())
.toPromise();
const internalQueuePromise = lastValueFrom(
// eslint-disable-next-line dot-notation
analyticsClient['internalEventQueue$'].pipe(take(3), toArray())
);

const telemetryCounterPromise = analyticsClient.telemetryCounter$
.pipe(take(3), toArray())
.toPromise();
const telemetryCounterPromise = lastValueFrom(
analyticsClient.telemetryCounter$.pipe(take(3), toArray())
);

analyticsClient.reportEvent('testEvent', { a_field: 'a' });
analyticsClient.reportEvent('testEvent', { a_field: 'b' });
Expand Down Expand Up @@ -259,7 +259,7 @@ describe('AnalyticsClient', () => {
// Typescript also helps with the config type inference <3
analyticsClient.registerShipper(MockedShipper, { telemetryCounter$: mockTelemetryCounter$ });

const counterEventPromise = analyticsClient.telemetryCounter$.pipe(take(1)).toPromise();
const counterEventPromise = lastValueFrom(analyticsClient.telemetryCounter$.pipe(take(1)));

const counter: TelemetryCounter = {
type: TelemetryCounterType.succeeded,
Expand Down Expand Up @@ -383,7 +383,7 @@ describe('AnalyticsClient', () => {
context$,
});

const globalContextPromise = globalContext$.pipe(take(2), toArray()).toPromise();
const globalContextPromise = lastValueFrom(globalContext$.pipe(take(2), toArray()));
context$.next({ a_field: true });
await expect(globalContextPromise).resolves.toEqual([
{}, // Original empty state
Expand All @@ -392,7 +392,7 @@ describe('AnalyticsClient', () => {
});

test('It does not break if context emits `undefined`', async () => {
const context$ = new Subject<{ a_field: boolean }>();
const context$ = new Subject<{ a_field: boolean } | undefined | void>();
analyticsClient.registerContextProvider({
name: 'contextProviderA',
schema: {
Expand All @@ -406,7 +406,7 @@ describe('AnalyticsClient', () => {
context$,
});

const globalContextPromise = globalContext$.pipe(take(3), toArray()).toPromise();
const globalContextPromise = lastValueFrom(globalContext$.pipe(take(3), toArray()));
context$.next();
context$.next(undefined);
await expect(globalContextPromise).resolves.toEqual([
Expand All @@ -431,7 +431,7 @@ describe('AnalyticsClient', () => {
context$,
});

const globalContextPromise = globalContext$.pipe(take(1), toArray()).toPromise();
const globalContextPromise = lastValueFrom(globalContext$.pipe(take(1), toArray()));
await expect(globalContextPromise).resolves.toEqual([
{ a_field: true }, // No original empty state
]);
Expand Down Expand Up @@ -473,7 +473,7 @@ describe('AnalyticsClient', () => {
context$: contextB$,
});

const globalContextPromise = globalContext$.pipe(take(6), toArray()).toPromise();
const globalContextPromise = lastValueFrom(globalContext$.pipe(take(6), toArray()));
contextA$.next({ a_field: true });
contextB$.next({ b_field: 1 });
contextB$.next({ a_field: false, b_field: 1 });
Expand Down Expand Up @@ -512,7 +512,7 @@ describe('AnalyticsClient', () => {
context$,
});

const globalContextPromise = globalContext$.pipe(take(6), toArray()).toPromise();
const globalContextPromise = lastValueFrom(globalContext$.pipe(take(6), toArray()));
context$.next({ b_field: 1 });
context$.next({ a_field: false, b_field: 1 });
context$.next({ a_field: true, b_field: 1 });
Expand Down Expand Up @@ -582,7 +582,7 @@ describe('AnalyticsClient', () => {
context$,
});

const globalContextPromise = globalContext$.pipe(take(4), toArray()).toPromise();
const globalContextPromise = lastValueFrom(globalContext$.pipe(take(4), toArray()));
context$.next({ a_field: true });
// The size of the registry grows on the first emission
expect(contextProvidersRegistry.size).toBe(1);
Expand Down Expand Up @@ -736,11 +736,11 @@ describe('AnalyticsClient', () => {
// eslint-disable-next-line dot-notation
const internalEventQueue$ = analyticsClient['internalEventQueue$'];

const internalQueuePromise = internalEventQueue$.pipe(take(2), toArray()).toPromise();
const internalQueuePromise = lastValueFrom(internalEventQueue$.pipe(take(2), toArray()));

const telemetryCounterPromise = analyticsClient.telemetryCounter$
.pipe(take(2), toArray())
.toPromise();
const telemetryCounterPromise = lastValueFrom(
analyticsClient.telemetryCounter$.pipe(take(2), toArray())
);

analyticsClient.reportEvent('event-type-a', { a_field: 'a' });
analyticsClient.reportEvent('event-type-b', { b_field: 100 });
Expand Down Expand Up @@ -781,9 +781,9 @@ describe('AnalyticsClient', () => {
});

test('Sends events from the internal queue when there are shippers and an opt-in response is true', async () => {
const telemetryCounterPromise = analyticsClient.telemetryCounter$
.pipe(take(3 + 2), toArray()) // Waiting for 3 enqueued + 2 batch-shipped events
.toPromise();
const telemetryCounterPromise = lastValueFrom(
analyticsClient.telemetryCounter$.pipe(take(3 + 2), toArray()) // Waiting for 3 enqueued + 2 batch-shipped events
);

// Send multiple events of 1 type to test the grouping logic as well
analyticsClient.reportEvent('event-type-a', { a_field: 'a' });
Expand Down Expand Up @@ -862,9 +862,9 @@ describe('AnalyticsClient', () => {
});

test('Discards events from the internal queue when there are shippers and an opt-in response is false', async () => {
const telemetryCounterPromise = analyticsClient.telemetryCounter$
.pipe(take(3), toArray()) // Waiting for 3 enqueued
.toPromise();
const telemetryCounterPromise = lastValueFrom(
analyticsClient.telemetryCounter$.pipe(take(3), toArray()) // Waiting for 3 enqueued
);

// Send multiple events of 1 type to test the grouping logic as well
analyticsClient.reportEvent('event-type-a', { a_field: 'a' });
Expand Down Expand Up @@ -904,9 +904,9 @@ describe('AnalyticsClient', () => {
});

test('Discards only one type of the enqueued events based on event_type config', async () => {
const telemetryCounterPromise = analyticsClient.telemetryCounter$
.pipe(take(3 + 1), toArray()) // Waiting for 3 enqueued + 1 batch-shipped events
.toPromise();
const telemetryCounterPromise = lastValueFrom(
analyticsClient.telemetryCounter$.pipe(take(3 + 1), toArray()) // Waiting for 3 enqueued + 1 batch-shipped events
);

// Send multiple events of 1 type to test the grouping logic as well
analyticsClient.reportEvent('event-type-a', { a_field: 'a' });
Expand Down Expand Up @@ -965,9 +965,9 @@ describe('AnalyticsClient', () => {
});

test('Discards the event at the shipper level (for a specific event)', async () => {
const telemetryCounterPromise = analyticsClient.telemetryCounter$
.pipe(take(3 + 2), toArray()) // Waiting for 3 enqueued + 2 batch-shipped events
.toPromise();
const telemetryCounterPromise = lastValueFrom(
analyticsClient.telemetryCounter$.pipe(take(3 + 2), toArray()) // Waiting for 3 enqueued + 2 batch-shipped events
);

// Send multiple events of 1 type to test the grouping logic as well
analyticsClient.reportEvent('event-type-a', { a_field: 'a' });
Expand Down Expand Up @@ -1061,9 +1061,9 @@ describe('AnalyticsClient', () => {
});

test('Discards all the events at the shipper level (globally disabled)', async () => {
const telemetryCounterPromise = analyticsClient.telemetryCounter$
.pipe(take(3 + 2), toArray()) // Waiting for 3 enqueued + 2 batch-shipped events
.toPromise();
const telemetryCounterPromise = lastValueFrom(
analyticsClient.telemetryCounter$.pipe(take(3 + 2), toArray()) // Waiting for 3 enqueued + 2 batch-shipped events
);

// Send multiple events of 1 type to test the grouping logic as well
analyticsClient.reportEvent('event-type-a', { a_field: 'a' });
Expand Down Expand Up @@ -1154,9 +1154,9 @@ describe('AnalyticsClient', () => {
analyticsClient.registerShipper(MockedShipper1, { reportEventsMock });
analyticsClient.optIn({ global: { enabled: false } });

const telemetryCounterPromise = analyticsClient.telemetryCounter$
.pipe(take(3), toArray()) // Waiting for 3 enqueued
.toPromise();
const telemetryCounterPromise = lastValueFrom(
analyticsClient.telemetryCounter$.pipe(take(3), toArray()) // Waiting for 3 enqueued
);

// Send multiple events of 1 type to test the non-grouping logic at this stage as well
analyticsClient.reportEvent('event-type-a', { a_field: 'a' });
Expand Down Expand Up @@ -1197,9 +1197,9 @@ describe('AnalyticsClient', () => {
analyticsClient.registerShipper(MockedShipper1, { reportEventsMock });
analyticsClient.optIn({ global: { enabled: true } });

const telemetryCounterPromise = analyticsClient.telemetryCounter$
.pipe(take(3 * 2), toArray()) // Waiting for 2 events per each reportEvent call: enqueued and sent_to_shipper
.toPromise();
const telemetryCounterPromise = lastValueFrom(
analyticsClient.telemetryCounter$.pipe(take(3 * 2), toArray()) // Waiting for 2 events per each reportEvent call: enqueued and sent_to_shipper
);

// Send multiple events of 1 type to test the non-grouping logic at this stage as well
analyticsClient.reportEvent('event-type-a', { a_field: 'a' });
Expand Down
10 changes: 4 additions & 6 deletions packages/kbn-cli-dev-mode/src/dev_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* Side Public License, v 1.
*/

import { EventEmitter } from 'events';

import * as Rx from 'rxjs';
import {
map,
Expand Down Expand Up @@ -60,9 +58,9 @@ export class DevServer {
this.script = options.script;
this.argv = options.argv;
this.gracefulTimeout = options.gracefulTimeout;
this.processExit$ = options.processExit$ ?? Rx.fromEvent(process as EventEmitter, 'exit');
this.sigint$ = options.sigint$ ?? Rx.fromEvent(process as EventEmitter, 'SIGINT');
this.sigterm$ = options.sigterm$ ?? Rx.fromEvent(process as EventEmitter, 'SIGTERM');
this.processExit$ = options.processExit$ ?? Rx.fromEvent<void>(process, 'exit');
this.sigint$ = options.sigint$ ?? Rx.fromEvent<void>(process, 'SIGINT');
this.sigterm$ = options.sigterm$ ?? Rx.fromEvent<void>(process, 'SIGTERM');
this.mapLogLine = options.mapLogLine;
}

Expand Down Expand Up @@ -117,7 +115,7 @@ export class DevServer {
*/
run$ = new Rx.Observable<void>((subscriber) => {
// listen for SIGINT and forward to process if it's running, otherwise unsub
const gracefulShutdown$ = new Rx.Subject();
const gracefulShutdown$ = new Rx.Subject<void>();
subscriber.add(
this.sigint$
.pipe(
Expand Down
Loading

0 comments on commit e46bc1d

Please sign in to comment.