Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into hide-lens-actions-s…
Browse files Browse the repository at this point in the history
…erverless
  • Loading branch information
js-jankisalvi committed Aug 11, 2023
2 parents 271f5d8 + ecaa8a7 commit a68df43
Show file tree
Hide file tree
Showing 113 changed files with 4,477 additions and 1,331 deletions.
48 changes: 48 additions & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

Review important information about the {kib} 8.x releases.

* <<release-notes-8.9.1>>
* <<release-notes-8.9.0>>
* <<release-notes-8.8.2>>
* <<release-notes-8.8.1>>
Expand Down Expand Up @@ -45,6 +46,53 @@ Review important information about the {kib} 8.x releases.
* <<release-notes-8.0.0-alpha1>>

--
[[release-notes-8.9.1]]
== {kib} 8.9.1

coming::[8.9.1]

Review the following information about the {kib} 8.9.1 release.

[float]
[[breaking-changes-8.9.1]]
=== Breaking changes

Breaking changes can prevent your application from optimal operation and performance.
Before you upgrade to 8.9.0, review the breaking changes, then mitigate the impact to your application.

There are no breaking changes in the {kib} 8.9.1 release.

To review the breaking changes in the previous release, check {kibana-ref-all}/8.9/release-notes-8.9.0.html#breaking-changes-8.9.0[8.9.0].

[float]
[[fixes-v8.9.1]]
=== Bug Fixes
APM::
* Fixes flame graph rendering on the transaction detail page ({kibana-pull}162968[#162968]).
* Check if documents are missing `span.name` ({kibana-pull}162899[#162899]).
* Fixes transaction action menu for Trace Explorer and dependency operations ({kibana-pull}162213[#162213]).
Canvas::
* Fixes embeddables not rendering in Canvas ({kibana-pull}163013[#163013]).
Discover::
* Fixes grid styles to enable better content wrapping ({kibana-pull}162325[#162325]).
* Fixes search sessions using temporary data views ({kibana-pull}161029[#161029]).
* Make share links and search session information shorter for temporary data views ({kibana-pull}161180[#161180]).
Elastic Security::
For the Elastic Security 8.9.1 release information, refer to {security-guide}/release-notes.html[_Elastic Security Solution Release Notes_].
Fleet::
* Fixes for query error on Agents list in the UI ({kibana-pull}162816[#162816]).
* Remove duplicate path being pushed to package archive ({kibana-pull}162724[#162724]).
Management::
* Resolves potential errors present in v8.9.0 with data views that contain field filters that have been edited ({kibana-pull}162860[#162860]).
Uptime::
* Fixes Monitor not found 404 message display ({kibana-pull}163501[#163501]).

[float]
[[enhancement-v8.9.1]]
=== Enhancements
Discover::
* Set legend width to extra large and enable text wrapping in legend labels ({kibana-pull}163009[#163009]).

[[release-notes-8.9.0]]
== {kib} 8.9.0

Expand Down
2 changes: 1 addition & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ in Kibana, e.g. visualizations. It has the form of a flyout panel.
|{kib-repo}blob/{branch}/src/plugins/interactive_setup/README.md[interactiveSetup]
|The plugin provides UI and APIs for the interactive setup mode.
|This plugin provides UI and APIs for interactive setup mode a.k.a "enrollment flow".
|{kib-repo}blob/{branch}/src/plugins/kibana_overview/README.md[kibanaOverview]
Expand Down
44 changes: 42 additions & 2 deletions src/plugins/interactive_setup/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# `interactiveSetup` plugin
# Interactive Setup Plugin

The plugin provides UI and APIs for the interactive setup mode.
This plugin provides UI and APIs for interactive setup mode a.k.a "enrollment flow".

## How to run interactive setup locally

Kibana does not start interactive setup mode if it detects that an Elasticsearch connection has already been configured. This is always the case when running `yarn start` so in order to trigger interactive setup we need to run Elasticsearch manually and pass a special command line flag to the Kibana start command.

1. Start a clean copy of Elasticsearch from inside your Kibana working directory:

```
cd <kibana-repo>/.es/cache
tar -xzf elasticsearch-8.10.0-SNAPSHOT-darwin-aarch64.tar.gz
cd ./elasticsearch-8.10.0-SNAPSHOT
./bin/elasticsearch
```
You should see the enrollment token get logged:
```
Elasticsearch security features have been automatically configured!
• Copy the following enrollment token and paste it into Kibana in your browser:
eyJ2ZXIiOiI4LjEwLjAiLCJhZHIiOlsiMTkyLjE2OC4xLjIxMTo5MjAwIl0sImZnciI6ImZiYWZjOTgxODM0MjAwNzQ0M2ZhMzNmNTQ2N2QzMTM0YTk1NzU2NjEwOTcxNmJmMjdlYWViZWNlYTE3NmM3MTkiLCJrZXkiOiJxdVVQallrQkhOTkFxOVBqNEY0ejpZUkVMaFR5ZlNlZTZGZW9PQVZwaDRnIn0=
```
2. Start Kibana without dev credentials and config:
```
yarn start --no-dev-credentials --no-dev-config
```
You should see the magic link get logged:
```
i Kibana has not been configured.
Go to http://localhost:5601/tcu/?code=651822 to get started.
```
3. Open the link and copy the enrollment token from Elasticsearch when prompted to complete setup.
Note: If you want to go through the enrollment flow again you will need to clear all Elasticsearch settings (`elasticsearch.*`) from your `kibana.yml` file and trash your Elasticsearch folder before starting with Step 1.
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,37 @@
* Side Public License, v 1.
*/

import moment, { type MomentInput } from 'moment';
import type { Logger, ISavedObjectsRepository, SavedObject } from '@kbn/core/server';
import {
type TestElasticsearchUtils,
type TestKibanaUtils,
createTestServers,
createRootWithCorePlugins,
} from '@kbn/core-test-helpers-kbn-server';
import { rollDailyData } from '../daily';

import { metricsServiceMock } from '@kbn/core/server/mocks';

import {
SAVED_OBJECTS_DAILY_TYPE,
serializeSavedObjectId,
EventLoopDelaysDaily,
} from '../../saved_objects';
import moment from 'moment';
import { rollDailyData } from '../daily';

const eventLoopDelaysMonitor = metricsServiceMock.createEventLoopDelaysMonitor();

/*
* Mocking the constructor of moment, so we can control the time of the day.
* This is to avoid flaky tests when starting to run before midnight and ending the test after midnight
* because the logic might remove one extra document since we moved to the next day.
*/
jest.doMock('moment', () => {
const mockedMoment = (date?: MomentInput) => moment(date ?? '2023-07-04T10:00:00.000Z');
Object.setPrototypeOf(mockedMoment, moment); // inherit the prototype of `moment` so it has all the same methods.
return mockedMoment;
});

function createRawObject(date: moment.MomentInput): SavedObject<EventLoopDelaysDaily> {
const pid = Math.round(Math.random() * 10000);
const instanceUuid = 'mock_instance';
Expand All @@ -45,8 +57,8 @@ function createRawObject(date: moment.MomentInput): SavedObject<EventLoopDelaysD

function createRawEventLoopDelaysDailyDocs() {
const rawEventLoopDelaysDaily = [
createRawObject(moment.now()),
createRawObject(moment.now()),
createRawObject(moment()),
createRawObject(moment()),
createRawObject(moment().subtract(1, 'days')),
createRawObject(moment().subtract(3, 'days')),
];
Expand All @@ -59,8 +71,7 @@ function createRawEventLoopDelaysDailyDocs() {
return { rawEventLoopDelaysDaily, outdatedRawEventLoopDelaysDaily };
}

// FLAKY: https://github.com/elastic/kibana/issues/111821
describe.skip(`daily rollups integration test`, () => {
describe(`daily rollups integration test`, () => {
let esServer: TestElasticsearchUtils;
let root: TestKibanaUtils['root'];
let internalRepository: ISavedObjectsRepository;
Expand All @@ -82,15 +93,6 @@ describe.skip(`daily rollups integration test`, () => {
logger = root.logger.get('test daily rollups');
internalRepository = start.savedObjects.createInternalRepository([SAVED_OBJECTS_DAILY_TYPE]);

// If we are less than 1 second away from midnight, let's wait 1 second before creating the docs.
// Otherwise, we may receive 1 document less than the expected ones.
if (moment().endOf('day').diff(moment(), 's', true) < 1) {
logger.info(
'Delaying the creation of the docs 1s, just in case we create them before midnight and run the tests on the following day.'
);
await new Promise((resolve) => setTimeout(resolve, 1000));
}

// Create the docs now
const rawDailyDocs = createRawEventLoopDelaysDailyDocs();
rawEventLoopDelaysDaily = rawDailyDocs.rawEventLoopDelaysDaily;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
'securitySolution:enableExpandableFlyout': {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
'securitySolution:enableCcsWarning': {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface UsageStats {
'securitySolution:defaultAnomalyScore': number;
'securitySolution:refreshIntervalDefaults': string;
'securitySolution:enableNewsFeed': boolean;
'securitySolution:enableExpandableFlyout': boolean;
'securitySolution:enableCcsWarning': boolean;
'search:includeFrozen': boolean;
'courier:maxConcurrentShardRequests': number;
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9207,6 +9207,12 @@
"description": "Non-default value of setting."
}
},
"securitySolution:enableExpandableFlyout": {
"type": "boolean",
"_meta": {
"description": "Non-default value of setting."
}
},
"securitySolution:enableCcsWarning": {
"type": "boolean",
"_meta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(event.properties.value4).to.be.a('number');
expect(event.properties.value5).to.be.a('number');

if (browser.isChromium) {
if (browser.isChromium()) {
// Kibana Loaded memory
expect(meta).to.have.property('jsHeapSizeLimit');
expect(meta.jsHeapSizeLimit).to.be.a('number');
Expand Down
75 changes: 70 additions & 5 deletions test/functional/services/common/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
*/

import { setTimeout as setTimeoutAsync } from 'timers/promises';
import { cloneDeepWith } from 'lodash';
import { cloneDeepWith, isString } from 'lodash';
import { Key, Origin, WebDriver } from 'selenium-webdriver';
import { Driver as ChromiumWebDriver } from 'selenium-webdriver/chrome';
import { modifyUrl } from '@kbn/std';

import sharp from 'sharp';
import { NoSuchSessionError } from 'selenium-webdriver/lib/error';
import { WebElementWrapper } from '../lib/web_element_wrapper';
import { FtrProviderContext, FtrService } from '../../ftr_provider_context';
import { Browsers } from '../remote/browsers';
import { NetworkOptions, NetworkProfile, NETWORK_PROFILES } from '../remote/network_profiles';

export type Browser = BrowserService;

Expand All @@ -25,19 +27,20 @@ class BrowserService extends FtrService {
*/
public readonly keys = Key;
public readonly isFirefox: boolean;
public readonly isChromium: boolean;

private readonly log = this.ctx.getService('log');

constructor(
ctx: FtrProviderContext,
public readonly browserType: string,
private readonly driver: WebDriver
protected readonly driver: WebDriver | ChromiumWebDriver
) {
super(ctx);
this.isFirefox = this.browserType === Browsers.Firefox;
this.isChromium =
this.browserType === Browsers.Chrome || this.browserType === Browsers.ChromiumEdge;
}

public isChromium(): this is { driver: ChromiumWebDriver } {
return this.driver instanceof ChromiumWebDriver;
}

/**
Expand Down Expand Up @@ -661,6 +664,68 @@ class BrowserService extends FtrService {
}
}
}

/**
* Get the network simulation for chromium browsers if available.
* https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/chrome_exports_Driver.html#getNetworkConditions
*
* @return {Promise<NetworkOptions>}
*/
public async getNetworkConditions() {
if (this.isChromium()) {
return this.driver.getNetworkConditions().catch(() => undefined); // Return undefined instead of throwing if no conditions are set.
} else {
const message =
'WebDriver does not support the .getNetworkConditions method.\nProbably the browser in used is not chromium based.';
this.log.error(message);
throw new Error(message);
}
}

/**
* Delete the network simulation for chromium browsers if available.
*
* @return {Promise<void>}
*/
public async restoreNetworkConditions() {
this.log.debug('Restore network conditions simulation.');
return this.setNetworkConditions('NO_THROTTLING');
}

/**
* Set the network conditions for chromium browsers if available.
*
* __Sample Usage:__
*
* browser.setNetworkConditions('FAST_3G')
* browser.setNetworkConditions('SLOW_3G')
* browser.setNetworkConditions('OFFLINE')
* browser.setNetworkConditions({
* offline: false,
* latency: 5, // Additional latency (ms).
* download_throughput: 500 * 1024, // Maximal aggregated download throughput.
* upload_throughput: 500 * 1024, // Maximal aggregated upload throughput.
* });
*
* https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/chrome_exports_Driver.html#setNetworkConditions
*
* @return {Promise<void>}
*/
public async setNetworkConditions(profileOrOptions: NetworkProfile | NetworkOptions) {
const networkOptions = isString(profileOrOptions)
? NETWORK_PROFILES[profileOrOptions]
: profileOrOptions;

if (this.isChromium()) {
this.log.debug(`Set network conditions with profile "${profileOrOptions}".`);
return this.driver.setNetworkConditions(networkOptions);
} else {
const message =
'WebDriver does not support the .setNetworkCondition method.\nProbably the browser in used is not chromium based.';
this.log.error(message);
throw new Error(message);
}
}
}

export async function BrowserProvider(ctx: FtrProviderContext) {
Expand Down
Loading

0 comments on commit a68df43

Please sign in to comment.