Skip to content

Commit 6a2b64d

Browse files
committed
Merge branch 'master' into actions/feature
* master: [APM] Fix flaky e2e’s (elastic#70790) [Discover] Migrate server side saved object from data to discover plugin (elastic#70342) [APM] Update docs on running API tests (elastic#70765) test: 💍 delete a flaky test (elastic#70785) [Security Solution] Refactor GlobalTime to useGlobalTime hook and cle… (elastic#69345) Remove IE11 mention from PR template [skip ci] (elastic#70486) [GS] add savedObjects result provider (elastic#68619) remove snapshot from disabled test suite. (elastic#70769)
2 parents 76d2818 + e298317 commit 6a2b64d

File tree

80 files changed

+2152
-1068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2152
-1068
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Delete any items that are not applicable to this PR.
1111
- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
1212
- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)
1313
- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)
14-
- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)
14+
- [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
1515

1616
### For maintainers
1717

packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap

Lines changed: 0 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/data/server/saved_objects/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
20-
export { searchSavedObjectType } from './search';
2119
export { querySavedObjectType } from './query';
2220
export { indexPatternSavedObjectType } from './index_patterns';
2321
export { kqlTelemetry } from './kql_telementry';

src/plugins/data/server/search/search_service.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {
2727
} from './types';
2828
import { registerSearchRoute } from './routes';
2929
import { ES_SEARCH_STRATEGY, esSearchStrategyProvider } from './es_search';
30-
import { searchSavedObjectType } from '../saved_objects';
3130
import { DataPluginStart } from '../plugin';
3231

3332
export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
@@ -36,8 +35,6 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
3635
constructor(private initializerContext: PluginInitializerContext) {}
3736

3837
public setup(core: CoreSetup<object, DataPluginStart>): ISearchSetup {
39-
core.savedObjects.registerType(searchSavedObjectType);
40-
4138
this.registerSearchStrategy(
4239
ES_SEARCH_STRATEGY,
4340
esSearchStrategyProvider(this.initializerContext.config.legacy.globalConfig$)

src/plugins/discover/server/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
import { CoreSetup, CoreStart, Plugin } from 'kibana/server';
2121
import { uiSettings } from './ui_settings';
2222
import { capabilitiesProvider } from './capabilities_provider';
23+
import { searchSavedObjectType } from './saved_objects';
2324

2425
export class DiscoverServerPlugin implements Plugin<object, object> {
2526
public setup(core: CoreSetup) {
2627
core.capabilities.registerProvider(capabilitiesProvider);
2728
core.uiSettings.register(uiSettings);
29+
core.savedObjects.registerType(searchSavedObjectType);
2830

2931
return {};
3032
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export { searchSavedObjectType } from './search';

src/plugins/data/server/saved_objects/search.ts renamed to src/plugins/discover/server/saved_objects/search.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import { SavedObjectsType } from 'kibana/server';
21-
import { searchSavedObjectTypeMigrations } from './search_migrations';
21+
import { searchMigrations } from './search_migrations';
2222

2323
export const searchSavedObjectType: SavedObjectsType = {
2424
name: 'search',
@@ -43,18 +43,18 @@ export const searchSavedObjectType: SavedObjectsType = {
4343
},
4444
mappings: {
4545
properties: {
46-
columns: { type: 'keyword' },
46+
columns: { type: 'keyword', index: false },
4747
description: { type: 'text' },
48-
hits: { type: 'integer' },
48+
hits: { type: 'integer', index: false },
4949
kibanaSavedObjectMeta: {
5050
properties: {
51-
searchSourceJSON: { type: 'text' },
51+
searchSourceJSON: { type: 'text', index: false },
5252
},
5353
},
54-
sort: { type: 'keyword' },
54+
sort: { type: 'keyword', index: false },
5555
title: { type: 'text' },
5656
version: { type: 'integer' },
5757
},
5858
},
59-
migrations: searchSavedObjectTypeMigrations as any,
59+
migrations: searchMigrations as any,
6060
};

src/plugins/data/server/saved_objects/search_migrations.test.ts renamed to src/plugins/discover/server/saved_objects/search_migrations.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
*/
1919

2020
import { SavedObjectMigrationContext } from 'kibana/server';
21-
import { searchSavedObjectTypeMigrations } from './search_migrations';
21+
import { searchMigrations } from './search_migrations';
2222

2323
const savedObjectMigrationContext = (null as unknown) as SavedObjectMigrationContext;
2424

2525
describe('migration search', () => {
2626
describe('6.7.2', () => {
27-
const migrationFn = searchSavedObjectTypeMigrations['6.7.2'];
27+
const migrationFn = searchMigrations['6.7.2'];
2828

2929
it('should migrate obsolete match_all query', () => {
3030
const migratedDoc = migrationFn(
@@ -56,7 +56,7 @@ describe('migration search', () => {
5656
});
5757

5858
describe('7.0.0', () => {
59-
const migrationFn = searchSavedObjectTypeMigrations['7.0.0'];
59+
const migrationFn = searchMigrations['7.0.0'];
6060

6161
test('skips errors when searchSourceJSON is null', () => {
6262
const doc = {
@@ -278,7 +278,7 @@ Object {
278278
});
279279

280280
describe('7.4.0', function () {
281-
const migrationFn = searchSavedObjectTypeMigrations['7.4.0'];
281+
const migrationFn = searchMigrations['7.4.0'];
282282

283283
test('transforms one dimensional sort arrays into two dimensional arrays', () => {
284284
const doc = {

src/plugins/data/server/saved_objects/search_migrations.ts renamed to src/plugins/discover/server/saved_objects/search_migrations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import { flow, get } from 'lodash';
2121
import { SavedObjectMigrationFn } from 'kibana/server';
22-
import { DEFAULT_QUERY_LANGUAGE } from '../../common';
22+
import { DEFAULT_QUERY_LANGUAGE } from '../../../data/common';
2323

2424
const migrateMatchAllQuery: SavedObjectMigrationFn<any, any> = (doc) => {
2525
const searchSourceJSON = get(doc, 'attributes.kibanaSavedObjectMeta.searchSourceJSON');
@@ -121,7 +121,7 @@ const migrateSearchSortToNestedArray: SavedObjectMigrationFn<any, any> = (doc) =
121121
};
122122
};
123123

124-
export const searchSavedObjectTypeMigrations = {
124+
export const searchMigrations = {
125125
'6.7.2': flow(migrateMatchAllQuery),
126126
'7.0.0': flow(setNewReferences),
127127
'7.4.0': flow(migrateSearchSortToNestedArray),

src/plugins/expressions/common/execution/execution.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -475,17 +475,6 @@ describe('Execution', () => {
475475
}
476476
});
477477

478-
test('sets duration to 10 milliseconds when function executes 10 milliseconds', async () => {
479-
const execution = createExecution('sleep 10', {}, true);
480-
execution.start(-1);
481-
await execution.result;
482-
483-
const node = execution.state.get().ast.chain[0];
484-
expect(typeof node.debug?.duration).toBe('number');
485-
expect(node.debug?.duration).toBeLessThan(50);
486-
expect(node.debug?.duration).toBeGreaterThanOrEqual(5);
487-
});
488-
489478
test('adds .debug field in expression AST on each executed function', async () => {
490479
const execution = createExecution('add val=1 | add val=2 | add val=3', {}, true);
491480
execution.start(-1);

0 commit comments

Comments
 (0)