Skip to content

Commit

Permalink
Merge branch 'main' into mvt_joins
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Apr 12, 2022
2 parents 23269b8 + bced9d2 commit 2b30281
Show file tree
Hide file tree
Showing 399 changed files with 5,604 additions and 8,883 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0
5.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ sleep 120

cd "$XPACK_DIR"

jobId=$(npx uuid)
export TEST_JOB_ID="$jobId"

journeys=("ecommerce_dashboard" "flight_dashboard" "web_logs_dashboard" "promotion_tracking_dashboard")
journeys=("login" "ecommerce_dashboard" "flight_dashboard" "web_logs_dashboard" "promotion_tracking_dashboard")

for i in "${journeys[@]}"; do
echo "JOURNEY[${i}] is running"
Expand Down
126 changes: 0 additions & 126 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1242,132 +1242,6 @@ module.exports = {
},
},

/**
* 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
files: [
'x-pack/plugins/metrics_entities/public/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/metrics_entities/common/**/*.{js,mjs,ts,tsx}',
],
rules: {
'import/no-nodejs-modules': 'error',
'no-restricted-imports': [
'error',
{
// prevents UI code from importing server side code and then webpack including it when doing builds
patterns: ['**/server/*'],
},
],
},
},
{
// typescript and javascript for front and back end
files: ['x-pack/plugins/metrics_entities/**/*.{js,mjs,ts,tsx}'],
plugins: ['eslint-plugin-node'],
env: {
jest: true,
},
rules: {
'accessor-pairs': 'error',
'array-callback-return': 'error',
'no-array-constructor': 'error',
complexity: 'error',
'consistent-return': 'error',
'func-style': ['error', 'expression'],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
'node/no-deprecated-api': 'error',
'no-bitwise': 'error',
'no-continue': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-label': 'error',
'no-func-assign': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-regexp': 'error',
'no-inner-declarations': 'error',
'no-lone-blocks': 'error',
'no-multi-assign': 'error',
'no-misleading-character-class': 'error',
'no-new-symbol': 'error',
'no-obj-calls': 'error',
'no-param-reassign': ['error', { props: true }],
'no-process-exit': 'error',
'no-prototype-builtins': 'error',
'no-return-await': 'error',
'no-self-compare': 'error',
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-this-before-super': 'error',
// rely on typescript
'no-undef': 'off',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-concat': 'error',
'no-useless-computed-key': 'error',
'no-useless-escape': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'one-var-declaration-per-line': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'require-atomic-updates': 'error',
'symbol-description': 'error',
'vars-on-top': 'error',
'@typescript-eslint/explicit-member-accessibility': 'error',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'no-template-curly-in-string': 'error',
'sort-keys': 'error',
'prefer-destructuring': 'error',
'no-restricted-imports': [
'error',
{
// prevents code from importing files that contain the name "legacy" within their name. This is a mechanism
// to help deprecation and prevent accidental re-use/continued use of code we plan on removing. If you are
// finding yourself turning this off a lot for "new code" consider renaming the file and functions if it has valid uses.
patterns: ['*legacy*'],
},
],
},
},
/**
* Alerting Services overrides
*/
Expand Down
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
### Observability Plugins

# Observability Shared
/x-pack/plugins/observability/ @elastic/observability-ui
/x-pack/plugins/observability/public/components/shared/date_picker/ @elastic/uptime

# Unified Observability
Expand All @@ -103,6 +102,7 @@
/x-pack/plugins/observability/public/rules @elastic/actionable-observability
/x-pack/plugins/observability/public/pages/alerts @elastic/actionable-observability
/x-pack/plugins/observability/public/pages/cases @elastic/actionable-observability
/x-pack/plugins/observability/public/pages/rules @elastic/actionable-observability

# Infra Monitoring
/x-pack/plugins/infra/ @elastic/infra-monitoring-ui
Expand Down Expand Up @@ -394,7 +394,6 @@
/x-pack/test/plugin_functional/plugins/resolver_test/ @elastic/security-solution
/x-pack/test/plugin_functional/test_suites/resolver/ @elastic/security-solution
/x-pack/plugins/security_solution/ @elastic/security-solution
/x-pack/plugins/metrics_entities/ @elastic/security-solution
/x-pack/test/detection_engine_api_integration @elastic/security-solution
/x-pack/test/lists_api_integration @elastic/security-solution
/x-pack/test/api_integration/apis/security_solution @elastic/security-solution
Expand Down
3 changes: 2 additions & 1 deletion docs/api/cases.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ these APIs:
* <<cases-api-get-status>>
* <<cases-api-get-comments>>
* {security-guide}/cases-get-connector.html[Get current connector]
* {security-guide}/cases-api-get-reporters.html[Get reporters]
* <<cases-api-get-reporters>>
* <<cases-api-get-tag>>
* {security-guide}/cases-api-push.html[Push case]
* {security-guide}/assign-connector.html[Set default Elastic Security UI connector]
Expand All @@ -40,6 +40,7 @@ include::cases/cases-api-get-case-activity.asciidoc[leveloffset=+1]
include::cases/cases-api-get-case.asciidoc[leveloffset=+1]
include::cases/cases-api-get-status.asciidoc[leveloffset=+1]
include::cases/cases-api-get-comments.asciidoc[leveloffset=+1]
include::cases/cases-api-get-reporters.asciidoc[leveloffset=+1]
include::cases/cases-api-get-tags.asciidoc[leveloffset=+1]
//UPDATE
include::cases/cases-api-update.asciidoc[leveloffset=+1]
Expand Down
60 changes: 60 additions & 0 deletions docs/api/cases/cases-api-get-reporters.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[[cases-api-get-reporters]]
== Get reporters API
++++
<titleabbrev>Get reporters</titleabbrev>
++++

Returns information about the users who opened cases.

=== Request

`GET <kibana host>:<port>/api/cases/reporters`

`GET <kibana host>:<port>/s/api/cases/reporters`

=== Prerequisite

You must have `read` privileges for the *Cases* feature in the *Management*,
*{observability}*, or *Security* section of the
<<kibana-feature-privileges,{kib} feature privileges>>, depending on the
`owner` of the cases you're seeking.

=== Query parameters

`owner`::
(Optional, string or array of strings) A filter to limit the retrieved reporters
to a specific set of applications. If this parameter is omitted, the response
will contain all reporters from cases that the user has access to read.

==== Response code

`200`::
Indicates a successful call.

==== Example

Returns all case reporters:

[source,sh]
--------------------------------------------------
GET api/cases/reporters
--------------------------------------------------
// KIBANA

The API returns a JSON object with the retrieved reporters. For example:

[source,json]
--------------------------------------------------
[
{
"full_name": "Alan Hunley",
"email": "ahunley@imf.usa.gov",
"username": "ahunley"
},
{
"full_name": "Rat Hustler",
"email": "jrhustler@aol.com",
"username": "rhustler"
}
]
--------------------------------------------------
9 changes: 5 additions & 4 deletions docs/api/cases/cases-api-get-tags.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ default space is used.
=== Query parameters

`owner`::
(Optional, string) Specifies the set of applications to limit the retrieved
tags. If not specified, the response contains all tags that the user has access
to read.
(Optional, string or array of strings) Specifies the set of applications to
limit the retrieved tags. If not specified, the response contains all tags from
cases that the user has access to read.

==== Response code

Expand All @@ -51,7 +51,8 @@ GET api/cases/tags
--------------------------------------------------
// KIBANA

The API returns a JSON object with all tags for all cases. For example:
The API returns a JSON object with the names and email addresses of users who
opened cases. For example:

[source,json]
--------------------------------------------------
Expand Down
6 changes: 0 additions & 6 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,6 @@ using the CURL scripts in the scripts folder.
|Visualize geo data from Elasticsearch or 3rd party geo-services.
|{kib-repo}blob/{branch}/x-pack/plugins/metrics_entities/README.md[metricsEntities]
|This is the metrics and entities plugin where you add can add transforms for your project
and group those transforms into modules. You can also re-use existing transforms in your
newly created modules as well.
|{kib-repo}blob/{branch}/x-pack/plugins/ml/readme.md[ml]
|This plugin provides access to the machine learning features provided by
Elastic.
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ When `includeElasticMapsService` is turned off, only tile layer configured by <<
| Specifies the URL of a self hosted <<elastic-maps-server,{hosted-ems}>>

| [[tilemap-settings]] `map.tilemap.options.attribution:` {ess-icon}
| The map attribution string. Provide attributions in markdown and use '|' to delimit attributions, for example: `"[attribution 1](https://www.attribution1)|[attribution 2](https://www.attribution2)"`.
| The map attribution string. Provide attributions in markdown and use `\|` to delimit attributions, for example: `"[attribution 1](https://www.attribution1)\|[attribution 2](https://www.attribution2)"`.
*Default: `"© [Elastic Maps Service](https://www.elastic.co/elastic-maps-service)"`*

| [[tilemap-max-zoom]] `map.tilemap.options.maxZoom:` {ess-icon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ it('produces the right watch and ignore list', () => {
<absolute path>/x-pack/plugins/lists/server/scripts,
<absolute path>/x-pack/plugins/security_solution/scripts,
<absolute path>/x-pack/plugins/security_solution/server/lib/detection_engine/scripts,
<absolute path>/x-pack/plugins/metrics_entities/server/scripts,
<absolute path>/x-pack/plugins/uptime/e2e,
]
`);
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export function getServerWatchPaths({ pluginPaths, pluginScanDirs }: Options) {
fromRoot('x-pack/plugins/lists/server/scripts'),
fromRoot('x-pack/plugins/security_solution/scripts'),
fromRoot('x-pack/plugins/security_solution/server/lib/detection_engine/scripts'),
fromRoot('x-pack/plugins/metrics_entities/server/scripts'),
fromRoot('x-pack/plugins/uptime/e2e'),
];

Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
detectionsReq: `${SECURITY_SOLUTION_DOCS}detections-permissions-section.html`,
networkMap: `${SECURITY_SOLUTION_DOCS}conf-map-ui.html`,
troubleshootGaps: `${SECURITY_SOLUTION_DOCS}alerts-ui-monitor.html#troubleshoot-gaps`,
ruleApiOverview: `${SECURITY_SOLUTION_DOCS}rule-api-overview.html`,
},
securitySolution: {
trustedApps: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/trusted-apps-ov.html`,
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export interface DocLinks {
readonly detectionsReq: string;
readonly networkMap: string;
readonly troubleshootGaps: string;
readonly ruleApiOverview: string;
};
readonly securitySolution: {
readonly trustedApps: string;
Expand Down
21 changes: 20 additions & 1 deletion packages/kbn-optimizer/src/common/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { Bundle, BundleSpec, parseBundles } from './bundle';
import { Hashes } from './hashes';
import { parseDllManifest } from './dll_manifest';

jest.mock('fs');

Expand All @@ -31,13 +32,31 @@ it('creates cache keys', () => {
].sort(() => (Math.random() > 0.5 ? 1 : -1));

const hashes = new Hashes(new Map(hashEntries));
const dllManifest = parseDllManifest({
name: 'manifest-name',
content: {
'./some-foo.ts': {
id: 1,
buildMeta: {
a: 'b',
},
unknownField: 'hi',
},
},
});
const dllRefKeys = ['./some-foo.ts'];

expect(bundle.createCacheKey(['/foo/bar/a', '/foo/bar/c'], hashes)).toMatchInlineSnapshot(`
expect(bundle.createCacheKey(['/foo/bar/a', '/foo/bar/c'], hashes, dllManifest, dllRefKeys))
.toMatchInlineSnapshot(`
Object {
"checksums": Object {
"/foo/bar/a": "123",
"/foo/bar/c": "789",
},
"dllName": "manifest-name",
"dllRefs": Object {
"./some-foo.ts": "1:ku/53aRMuAA+4TmQeCWA/w:GtuPW9agF2yecW0xAIHtUQ",
},
"spec": Object {
"banner": undefined,
"contextDir": "/foo/bar",
Expand Down
12 changes: 10 additions & 2 deletions packages/kbn-optimizer/src/common/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { UnknownVals } from './ts_helpers';
import { omit } from './obj_helpers';
import { includes } from './array_helpers';
import type { Hashes } from './hashes';
import { ParsedDllManifest } from './dll_manifest';

const VALID_BUNDLE_TYPES = ['plugin' as const, 'entry' as const];

Expand Down Expand Up @@ -88,12 +89,19 @@ export class Bundle {

/**
* Calculate the cache key for this bundle based from current
* mtime values.
* state determined by looking at files on disk.
*/
createCacheKey(paths: string[], hashes: Hashes): unknown {
createCacheKey(
paths: string[],
hashes: Hashes,
dllManifest: ParsedDllManifest,
dllRefKeys: string[]
): unknown {
return {
spec: omit(this.toSpec(), ['pageLoadAssetSizeLimit']),
checksums: Object.fromEntries(paths.map((p) => [p, hashes.getCached(p)] as const)),
dllName: dllManifest.name,
dllRefs: Object.fromEntries(dllRefKeys.map((k) => [k, dllManifest.content[k]] as const)),
};
}

Expand Down
Loading

0 comments on commit 2b30281

Please sign in to comment.