Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-114436
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Oct 15, 2021
2 parents 38edbf4 + e1d6830 commit 075b2d1
Show file tree
Hide file tree
Showing 235 changed files with 1,426 additions and 1,047 deletions.
9 changes: 8 additions & 1 deletion .buildkite/scripts/steps/es_snapshots/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ export DOCKER_TLS_CERTDIR="$CERTS_DIR"
export DOCKER_HOST=localhost:2377

echo "--- Build Elasticsearch"
./gradlew -Dbuild.docker=true assemble --parallel
./gradlew \
:distribution:archives:darwin-aarch64-tar:assemble \
:distribution:archives:darwin-tar:assemble \
:distribution:docker:docker-export:assemble \
:distribution:archives:linux-aarch64-tar:assemble \
:distribution:archives:linux-tar:assemble \
:distribution:archives:windows-zip:assemble \
--parallel

echo "--- Create distribution archives"
find distribution -type f \( -name 'elasticsearch-*-*-*-*.tar.gz' -o -name 'elasticsearch-*-*-*-*.zip' \) -not -path '*no-jdk*' -not -path '*build-context*' -exec cp {} "$destination" \;
Expand Down
38 changes: 35 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,12 @@ module.exports = {
},

/**
* Security Solution overrides
* Security Solution overrides. These rules below are maintained and owned by
* the people within the security-solution-platform team. Please see ping them
* or check with them if you are encountering issues, have suggestions, or would
* like to add, change, or remove any particular rule. Linters, Typescript, and rules
* evolve and change over time just like coding styles, so please do not hesitate to
* reach out.
*/
{
// front end and common typescript and javascript files only
Expand All @@ -925,6 +930,22 @@ module.exports = {
],
},
},
{
// typescript only for front and back end, but excludes the test files.
// We use this section to add rules in which we do not want to apply to test files.
// This should be a very small set as most linter rules are useful for tests as well.
files: [
'x-pack/plugins/security_solution/**/*.{ts,tsx}',
'x-pack/plugins/timelines/**/*.{ts,tsx}',
],
excludedFiles: [
'x-pack/plugins/security_solution/**/*.{test,mock,test_helper}.{ts,tsx}',
'x-pack/plugins/timelines/**/*.{test,mock,test_helper}.{ts,tsx}',
],
rules: {
'@typescript-eslint/no-non-null-assertion': 'error',
},
},
{
// typescript only for front and back end
files: [
Expand Down Expand Up @@ -1043,7 +1064,12 @@ module.exports = {
},

/**
* Lists overrides
* Lists overrides. These rules below are maintained and owned by
* the people within the security-solution-platform team. Please see ping them
* or check with them if you are encountering issues, have suggestions, or would
* like to add, change, or remove any particular rule. Linters, Typescript, and rules
* evolve and change over time just like coding styles, so please do not hesitate to
* reach out.
*/
{
// front end and common typescript and javascript files only
Expand Down Expand Up @@ -1218,8 +1244,14 @@ module.exports = {
],
},
},

/**
* Metrics entities overrides
* Metrics entities overrides. These rules below are maintained and owned by
* the people within the security-solution-platform team. Please see ping them
* or check with them if you are encountering issues, have suggestions, or would
* like to add, change, or remove any particular rule. Linters, Typescript, and rules
* evolve and change over time just like coding styles, so please do not hesitate to
* reach out.
*/
{
// front end and common typescript and javascript files only
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-es-query/src/es_query/build_es_query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ import { luceneStringToDsl } from './lucene_string_to_dsl';
import { decorateQuery } from './decorate_query';
import { MatchAllFilter, Query } from '../filters';
import { fields } from '../filters/stubs';
import { IndexPatternBase } from './types';
import { DataViewBase } from './types';

jest.mock('../kuery/grammar');

describe('build query', () => {
const indexPattern: IndexPatternBase = {
const indexPattern: DataViewBase = {
fields,
title: 'dataView',
};

describe('buildEsQuery', () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-es-query/src/es_query/from_filters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
import { buildQueryFromFilters } from './from_filters';
import { ExistsFilter, Filter, MatchAllFilter } from '../filters';
import { fields } from '../filters/stubs';
import { IndexPatternBase } from './types';
import { DataViewBase } from './types';

describe('build query', () => {
const indexPattern: IndexPatternBase = {
const indexPattern: DataViewBase = {
fields,
title: 'dataView',
};

describe('buildQueryFromFilters', () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-es-query/src/es_query/from_kuery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
import { buildQueryFromKuery } from './from_kuery';
import { fromKueryExpression, toElasticsearchQuery } from '../kuery';
import { fields } from '../filters/stubs';
import { IndexPatternBase } from './types';
import { DataViewBase } from './types';
import { Query } from '..';

jest.mock('../kuery/grammar');

describe('build query', () => {
const indexPattern: IndexPatternBase = {
const indexPattern: DataViewBase = {
fields,
title: 'dataView',
};

describe('buildQueryFromKuery', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
import { handleNestedFilter } from './handle_nested_filter';
import { fields } from '../filters/stubs';
import { buildPhraseFilter, buildQueryFilter } from '../filters';
import { IndexPatternBase } from './types';
import { DataViewBase } from './types';

describe('handleNestedFilter', function () {
const indexPattern: IndexPatternBase = {
const indexPattern: DataViewBase = {
id: 'logstash-*',
fields,
title: 'dataView',
};

it("should return the filter's query wrapped in nested query if the target field is nested", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es-query/src/es_query/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export type IndexPatternFieldBase = DataViewFieldBase;
export interface DataViewBase {
fields: DataViewFieldBase[];
id?: string;
title?: string;
title: string;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
*/

import { buildFilter, FilterStateStore, FILTERS } from '.';
import { IndexPatternBase } from '../..';
import { DataViewBase } from '../..';
import { fields as stubFields } from '../stubs';

describe('buildFilter', () => {
const stubIndexPattern: IndexPatternBase = {
const stubIndexPattern: DataViewBase = {
id: 'logstash-*',
fields: stubFields,
title: 'dataView',
};

it('should build phrase filters', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
* Side Public License, v 1.
*/

import { IndexPatternBase } from '../../es_query';
import { DataViewBase } from '../../es_query';
import { buildExistsFilter, getExistsFilterField } from './exists_filter';
import { fields } from '../stubs/fields.mocks';

describe('exists filter', function () {
const indexPattern: IndexPatternBase = {
const indexPattern: DataViewBase = {
fields,
title: 'dataView',
};

describe('getExistsFilterField', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
import { buildPhraseFilter } from './phrase_filter';
import { buildQueryFilter } from './query_string_filter';
import { getFilterField } from './get_filter_field';
import { IndexPatternBase } from '../../es_query';
import { DataViewBase } from '../../es_query';
import { fields } from '../stubs/fields.mocks';

describe('getFilterField', function () {
const indexPattern: IndexPatternBase = {
const indexPattern: DataViewBase = {
id: 'logstash-*',
fields,
title: 'dataView',
};

it('should return the field name from known filter types that target a specific field', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ import {
PhraseFilter,
} from './phrase_filter';
import { fields, getField } from '../stubs';
import { IndexPatternBase } from '../../es_query';
import { DataViewBase } from '../../es_query';
import { estypes } from '@elastic/elasticsearch';

describe('Phrase filter builder', () => {
let indexPattern: IndexPatternBase;
let indexPattern: DataViewBase;

beforeEach(() => {
indexPattern = {
id: 'id',
fields,
title: 'dataView',
};
});

Expand Down Expand Up @@ -151,8 +152,9 @@ describe('buildInlineScriptForPhraseFilter', () => {
});

describe('getPhraseFilterField', function () {
const indexPattern: IndexPatternBase = {
const indexPattern: DataViewBase = {
fields,
title: 'dataView',
};

it('should return the name of the field a phrase query is targeting', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
* Side Public License, v 1.
*/

import { IndexPatternBase } from '../../es_query';
import { DataViewBase } from '../../es_query';
import { buildPhrasesFilter, getPhrasesFilterField } from './phrases_filter';
import { fields } from '../stubs';

describe('phrases filter', function () {
const indexPattern: IndexPatternBase = {
const indexPattern: DataViewBase = {
fields,
title: 'dataView',
};

describe('getPhrasesFilterField', function () {
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-es-query/src/kuery/ast/ast.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@

import { fromKueryExpression, fromLiteralExpression, toElasticsearchQuery } from './ast';
import { nodeTypes } from '../node_types';
import { IndexPatternBase } from '../..';
import { DataViewBase } from '../..';
import { KueryNode } from '../types';
import { fields } from '../../filters/stubs';

jest.mock('../grammar');

describe('kuery AST API', () => {
let indexPattern: IndexPatternBase;
let indexPattern: DataViewBase;

beforeEach(() => {
indexPattern = {
fields,
title: 'dataView',
};
});

Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-es-query/src/kuery/functions/and.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { nodeTypes } from '../node_types';
import { fields } from '../../filters/stubs';
import * as ast from '../ast';
import * as and from './and';
import { IndexPatternBase } from '../../es_query';
import { DataViewBase } from '../../es_query';

jest.mock('../grammar');

Expand All @@ -19,11 +19,12 @@ const childNode2 = nodeTypes.function.buildNode('is', 'extension', 'jpg');

describe('kuery functions', () => {
describe('and', () => {
let indexPattern: IndexPatternBase;
let indexPattern: DataViewBase;

beforeEach(() => {
indexPattern = {
fields,
title: 'dataView',
};
});

Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-es-query/src/kuery/functions/exists.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { nodeTypes } from '../node_types';
import { fields } from '../../filters/stubs';
import { IndexPatternBase } from '../..';
import { DataViewBase } from '../..';

jest.mock('../grammar');

Expand All @@ -17,11 +17,12 @@ import * as exists from './exists';

describe('kuery functions', () => {
describe('exists', () => {
let indexPattern: IndexPatternBase;
let indexPattern: DataViewBase;

beforeEach(() => {
indexPattern = {
fields,
title: 'dataView',
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { get } from 'lodash';
import { nodeTypes } from '../node_types';
import { fields } from '../../filters/stubs';
import { IndexPatternBase } from '../..';
import { DataViewBase } from '../..';

import * as geoBoundingBox from './geo_bounding_box';
import { JsonObject } from '@kbn/utility-types';
Expand All @@ -29,11 +29,12 @@ const params = {

describe('kuery functions', () => {
describe('geoBoundingBox', () => {
let indexPattern: IndexPatternBase;
let indexPattern: DataViewBase;

beforeEach(() => {
indexPattern = {
fields,
title: 'dataView',
};
});

Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-es-query/src/kuery/functions/geo_polygon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { nodeTypes } from '../node_types';
import { fields } from '../../filters/stubs';
import { IndexPatternBase } from '../..';
import { DataViewBase } from '../..';

import * as geoPolygon from './geo_polygon';

Expand All @@ -31,11 +31,12 @@ const points = [

describe('kuery functions', () => {
describe('geoPolygon', () => {
let indexPattern: IndexPatternBase;
let indexPattern: DataViewBase;

beforeEach(() => {
indexPattern = {
fields,
title: 'dataView',
};
});

Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-es-query/src/kuery/functions/is.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ import { nodeTypes } from '../node_types';
import { fields } from '../../filters/stubs';

import * as is from './is';
import { IndexPatternBase } from '../..';
import { DataViewBase } from '../..';
import { estypes } from '@elastic/elasticsearch';

jest.mock('../grammar');

describe('kuery functions', () => {
describe('is', () => {
let indexPattern: IndexPatternBase;
let indexPattern: DataViewBase;

beforeEach(() => {
indexPattern = {
fields,
title: 'dataView',
};
});

Expand Down
Loading

0 comments on commit 075b2d1

Please sign in to comment.