Skip to content

Commit

Permalink
Merge branch 'master' into ml-validation-cardinality-no-results
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Dec 17, 2020
2 parents ded944e + df32ff8 commit 66211b2
Show file tree
Hide file tree
Showing 168 changed files with 5,548 additions and 1,031 deletions.
3 changes: 2 additions & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"targetBranchChoices": [
{ "name": "master", "checked": true },
{ "name": "7.x", "checked": true },
"7.11",
"7.10",
"7.9",
"7.8",
Expand All @@ -28,7 +29,7 @@
"targetPRLabels": ["backport"],
"branchLabelMapping": {
"^v8.0.0$": "master",
"^v7.11.0$": "7.x",
"^v7.12.0$": "7.x",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
}
}
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/ @elastic/kibana-alerting-services
/docs/user/alerting/ @elastic/kibana-alerting-services
/docs/management/alerting/ @elastic/kibana-alerting-services
#CC# /x-pack/plugins/stack_alerts @elastic/kibana-alerting-services
#CC# /x-pack/plugins/stack_alerts/ @elastic/kibana-alerting-services

# Enterprise Search
# Shared
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/management/images/tags/create-tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions docs/management/managing-tags.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[role="xpack"]
[[managing-tags]]
== Tags

Tags enable you to categorize your saved objects. You can then easily filter for related objects based on shared tags.

To begin, open the main menu, click *Stack Management*, then click *Tags*.

[role="screenshot"]
image::images/tags/tag-management-section.png[Tags management section]

[float]
=== Required permissions

Access to *Tags* requires the `Tag Management` {kib} privilege. To add the privilege, open the menu,
click *Stack Management*, then click *Roles*.

In addition:

* The `read` privilege allows you to assign tags to the saved objects for which you have write permission.
* The `write` privilege enables you to create, edit, and delete tags.


NOTE: Having the `Tag Management` {kib} privilege is not required to
view tags assigned on objects the user has `read` access to, or to filter objects by tags
in {kib} applications or from the navigational search.

[float]
[[settings-create-tag]]
=== Create a tag

Create a tag to assign to your saved objects.

. Click *Create tag*.
+
[role="screenshot"]
image::images/tags/create-tag.png[Tag creation popin]
. Enter a name and select a color for the new tag.
+
The name can include alphanumeric characters (English letters and digits), `:`, `-`, `_` and the space character,
and cannot be longer than 50 characters.
. Click *Create tag*.

[float]
[[settings-assign-tag]]
=== Assign a tag to saved objects

Assign or remove tags to one or more saved objects. You must have `write` permission
on the objects to which you assign the tags.

. Click the action (...) icon in the tag row, and then select the *Manage assignments* action.
+
[role="screenshot"]
image::images/tags/manage-assignments-flyout.png[Assign flyout]
. Select the objects to which you want to assign or remove tags.
. Click on *Save tag assignments*.

TIP: To assign multiple tags to objects at once, select their checkboxes
and then select *Manage tag assignments* from the *selected tags* menu.

[role="screenshot"]
image::images/tags/bulk-assign-selection.png[Bulk assign tags]

[float]
[[settings-delete-tag]]
=== Delete a tag

Delete a tag and remove it from any saved objects.

. Click the action (...) icon in the tag row, and then select the *Delete* action.

. Click *Delete tag*.

TIP: To delete multiple tags at once, select their checkboxes in the list view,
and then select *Delete* action from the *selected tags* menu.
5 changes: 5 additions & 0 deletions docs/user/management.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ a| <<index-patterns, Index Patterns>>
| Copy, edit, delete, import, and export your saved objects.
These include dashboards, visualizations, maps, index patterns, Canvas workpads, and more.

| <<managing-tags, Tags>>
|Create, manage, and assign tags to your saved objects.

| <<xpack-spaces, Spaces>>
| Create spaces to organize your dashboards and other saved objects into categories.
A space is isolated from all other spaces,
Expand Down Expand Up @@ -196,6 +199,8 @@ include::{kib-repo-dir}/management/rollups/create_and_manage_rollups.asciidoc[]

include::{kib-repo-dir}/management/managing-saved-objects.asciidoc[]

include::{kib-repo-dir}/management/managing-tags.asciidoc[]

include::security/index.asciidoc[]

include::{kib-repo-dir}/management/snapshot-restore/index.asciidoc[]
Expand Down
2 changes: 1 addition & 1 deletion jest.config.oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

module.exports = {
preset: '@kbn/test',
rootDir: '.',
projects: [
'<rootDir>/packages/*/jest.config.js',
Expand All @@ -26,5 +27,4 @@ module.exports = {
'<rootDir>/src/plugins/*/jest.config.js',
'<rootDir>/test/*/jest.config.js',
],
reporters: ['default', '<rootDir>/packages/kbn-test/target/jest/junit_reporter'],
};
2 changes: 1 addition & 1 deletion src/dev/code_coverage/shell_scripts/extract_archives.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ EXTRACT_DIR=/tmp/extracted_coverage
mkdir -p $EXTRACT_DIR

echo "### Extracting downloaded artifacts"
for x in kibana-intake kibana-oss-tests kibana-xpack-tests; do #x-pack-intake skipping due to failures
for x in kibana-intake x-pack-intake kibana-oss-tests kibana-xpack-tests; do
tar -xzf $DOWNLOAD_DIR/coverage/${x}/kibana-coverage.tar.gz -C $EXTRACT_DIR || echo "### Error 'tarring': ${x}"
done

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ TEAM_ASSIGN_PATH=$5
# Build team assignments dat file
node scripts/generate_team_assignments.js --verbose --src .github/CODEOWNERS --dest $TEAM_ASSIGN_PATH

for x in functional; do #jest skip due to failures
for x in jest functional; do
echo "### Ingesting coverage for ${x}"

COVERAGE_SUMMARY_FILE=target/kibana-coverage/${x}-combined/coverage-summary.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ COVERAGE_TEMP_DIR=/tmp/extracted_coverage/target/kibana-coverage/
export COVERAGE_TEMP_DIR

echo "### Merge coverage reports"
for x in functional; do # jest skip due to failures
for x in jest functional; do
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.${x}.config.js
done
2 changes: 1 addition & 1 deletion src/plugins/dashboard/public/dashboard_strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const dashboardExportCsvAction = {
}),
getUntitledFilename: () =>
i18n.translate('dashboard.actions.downloadOptionsUnsavedFilename', {
defaultMessage: 'unsaved',
defaultMessage: 'untitled',
}),
};

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/common/es_query/kuery/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

export { KQLSyntaxError } from './kuery_syntax_error';
export { nodeTypes } from './node_types';
export { nodeTypes, nodeBuilder } from './node_types';
export * from './ast';

export * from './types';
1 change: 1 addition & 0 deletions src/plugins/data/common/es_query/kuery/node_types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import * as wildcard from './wildcard';
import { NodeTypes } from './types';

export { NodeTypes };
export { nodeBuilder } from './node_builder';

export const nodeTypes: NodeTypes = {
// This requires better typing of the different typings and their return types.
Expand Down
38 changes: 38 additions & 0 deletions src/plugins/data/common/es_query/kuery/node_types/node_builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { KueryNode, nodeTypes } from '../types';

export const nodeBuilder = {
is: (fieldName: string, value: string | KueryNode) => {
return nodeTypes.function.buildNodeWithArgumentNodes('is', [
nodeTypes.literal.buildNode(fieldName),
typeof value === 'string' ? nodeTypes.literal.buildNode(value) : value,
nodeTypes.literal.buildNode(false),
]);
},
or: ([first, ...args]: KueryNode[]): KueryNode => {
return args.length ? nodeTypes.function.buildNode('or', [first, nodeBuilder.or(args)]) : first;
},
and: ([first, ...args]: KueryNode[]): KueryNode => {
return args.length
? nodeTypes.function.buildNode('and', [first, nodeBuilder.and(args)])
: first;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface Point {
table: Table;
column: number;
row: number;
value: number;
value: string;
title: string;
};
parent: Aspect | null;
Expand Down Expand Up @@ -94,7 +94,7 @@ export function getPoint(
table: table.$parent.table,
column: table.$parent.column,
row: table.$parent.row,
value: table.$parent.key,
value: table.$parent.formattedKey,
title: table.$parent.name,
},
parent: series ? series[0] : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ function tableResponseHandler(table, dimensions) {

table.rows.forEach((row, rowIndex) => {
const splitValue = row[splitColumn.id];
const formattedValue = splitColumnFormatter.convert(splitValue);

if (!splitMap.hasOwnProperty(splitValue)) {
splitMap[splitValue] = splitIndex++;
const tableGroup = {
$parent: converted,
title: `${splitColumnFormatter.convert(splitValue)}: ${splitColumn.name}`,
title: `${formattedValue}: ${splitColumn.name}`,
name: splitColumn.name,
key: splitValue,
formattedKey: formattedValue,
column: splitColumnIndex,
row: rowIndex,
table,
Expand Down
1 change: 1 addition & 0 deletions src/plugins/vis_type_vislib/public/vislib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface TableParent {
column: number;
row: number;
key: number;
formattedKey: string;
name: string;
}
export interface Table {
Expand Down
20 changes: 10 additions & 10 deletions test/scripts/jenkins_unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ if [[ -z "$CODE_COVERAGE" ]] ; then
./test/scripts/checks/test_projects.sh
./test/scripts/checks/test_hardening.sh
else
# echo " -> Running jest tests with coverage"
# node scripts/jest --ci --verbose --coverage --config jest.config.oss.js
# rename_coverage_file "oss"
# echo ""
# echo ""
# echo " -> Running jest integration tests with coverage"
# node --max-old-space-size=8192 scripts/jest_integration --ci --verbose --coverage || true;
# rename_coverage_file "oss-integration"
# echo ""
# echo ""
echo " -> Running jest tests with coverage"
node scripts/jest --ci --verbose --coverage --config jest.config.oss.js
rename_coverage_file "oss"
echo ""
echo ""
echo " -> Running jest integration tests with coverage"
node --max-old-space-size=8192 scripts/jest_integration --ci --verbose --coverage || true;
rename_coverage_file "oss-integration"
echo ""
echo ""
echo " -> Running mocha tests with coverage"
./test/scripts/checks/mocha_coverage.sh
echo ""
Expand Down
7 changes: 4 additions & 3 deletions test/scripts/jenkins_xpack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ if [[ -z "$CODE_COVERAGE" ]] ; then

./test/scripts/test/xpack_jest_unit.sh
else
echo " -> Running jest tests with coverage"

echo " -> Build runtime for canvas"
# build runtime for canvas
echo "NODE_ENV=$NODE_ENV"
node ./x-pack/plugins/canvas/scripts/shareable_runtime
node --max-old-space-size=6144 scripts/jest x-pack --ci --verbose --coverage
echo " -> Running jest tests with coverage"
cd x-pack
node --max-old-space-size=6144 scripts/jest --ci --verbose --maxWorkers=5 --coverage --config jest.config.js
# rename file in order to be unique one
test -f ../target/kibana-coverage/jest/coverage-final.json \
&& mv ../target/kibana-coverage/jest/coverage-final.json \
Expand Down
17 changes: 8 additions & 9 deletions vars/kibanaCoverage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def uploadBaseWebsiteFiles(prefix) {
def uploadCoverageHtmls(prefix) {
[
'target/kibana-coverage/functional-combined',
// 'target/kibana-coverage/jest-combined', skipped due to failures
'target/kibana-coverage/jest-combined',
'target/kibana-coverage/mocha-combined',
].each { uploadWithVault(prefix, it) }
}
Expand Down Expand Up @@ -200,14 +200,13 @@ def ingest(jobName, buildNumber, buildUrl, timestamp, previousSha, teamAssignmen
def runTests() {
parallel([
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
// skipping due to failures
// 'x-pack-intake-agent': {
// withEnv([
// 'NODE_ENV=test' // Needed for jest tests only
// ]) {
// workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh')()
// }
// },
'x-pack-intake-agent': {
withEnv([
'NODE_ENV=test' // Needed for jest tests only
]) {
workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh')()
}
},
'kibana-oss-agent' : workers.functional(
'kibana-oss-tests',
{ kibanaPipeline.buildOss() },
Expand Down
5 changes: 1 addition & 4 deletions x-pack/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
*/

module.exports = {
preset: '@kbn/test',
rootDir: '..',
projects: ['<rootDir>/x-pack/plugins/*/jest.config.js'],
reporters: [
'default',
['<rootDir>/packages/kbn-test/target/jest/junit_reporter', { reportName: 'X-Pack Jest Tests' }],
],
};
7 changes: 4 additions & 3 deletions x-pack/plugins/alerts/server/alerts_client/alerts_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { TaskManagerStartContract } from '../../../task_manager/server';
import { taskInstanceToAlertTaskInstance } from '../task_runner/alert_task_instance';
import { deleteTaskIfItExists } from '../lib/delete_task_if_it_exists';
import { RegistryAlertType } from '../alert_type_registry';
import { AlertsAuthorization, WriteOperations, ReadOperations, and } from '../authorization';
import { AlertsAuthorization, WriteOperations, ReadOperations } from '../authorization';
import { IEventLogClient } from '../../../../plugins/event_log/server';
import { parseIsoOrRelativeDate } from '../lib/iso_or_relative_date';
import { alertInstanceSummaryFromEventLog } from '../lib/alert_instance_summary_from_event_log';
Expand All @@ -56,6 +56,7 @@ import { retryIfConflicts } from '../lib/retry_if_conflicts';
import { partiallyUpdateAlert } from '../saved_objects';
import { markApiKeyForInvalidation } from '../invalidate_pending_api_keys/mark_api_key_for_invalidation';
import { alertAuditEvent, AlertAuditAction } from './audit_events';
import { nodeBuilder } from '../../../../../src/plugins/data/common';

export interface RegistryAlertTypeWithAuth extends RegistryAlertType {
authorizedConsumers: string[];
Expand Down Expand Up @@ -455,7 +456,7 @@ export class AlertsClient {
...options,
filter:
(authorizationFilter && options.filter
? and([esKuery.fromKueryExpression(options.filter), authorizationFilter])
? nodeBuilder.and([esKuery.fromKueryExpression(options.filter), authorizationFilter])
: authorizationFilter) ?? options.filter,
fields: fields ? this.includeFieldsRequiredForAuthentication(fields) : fields,
type: 'alert',
Expand Down Expand Up @@ -517,7 +518,7 @@ export class AlertsClient {
...options,
filter:
(authorizationFilter && filter
? and([esKuery.fromKueryExpression(filter), authorizationFilter])
? nodeBuilder.and([esKuery.fromKueryExpression(filter), authorizationFilter])
: authorizationFilter) ?? filter,
page: 1,
perPage: 0,
Expand Down
Loading

0 comments on commit 66211b2

Please sign in to comment.