Skip to content

Commit

Permalink
Merge branch 'master' into new-search-layout
Browse files Browse the repository at this point in the history
* master: (33 commits)
  [easy] Exclude __examples__ from coverage (elastic#45556)
  [DOCS] Update CCR links (elastic#44012)
  Use unique junit report filenames again (elastic#45897)
  [ftr/savedObjects] add simple saved object api client to ftr s… (elastic#45856)
  New visualization editor Lens (elastic#36437)
  Sort using unix timestamp value (elastic#43162)
  [APM] Use POST instead of implicit GET (elastic#45903)
  [Canvas] Converting workpad header components to typescript and adding i18n (elastic#45274)
  skip flaky test (elastic#45884)
  set IS_PIPELINE_JOB in intake jobs (elastic#45850)
  [Uptime] Fix/issue 48 integration popup closes after refresh (elastic#45759)
  [Logs UI] Support zoom by brushing in the log rate chart (elastic#45879)
  [DOCS] Changes name to host (elastic#45798)
  [ML] Add population job wizard test (elastic#45765)
  [skip-ci][Maps][File upload] Geojson indexing and styling docs (elastic#41394)
  remove setTimeoue for state change (elastic#45853)
  [Graph] Restructure folders and add readme (elastic#45782)
  [ML] Enhance job id error message (elastic#45349)
  [SIEM] Do not update state component when they did unmount (elastic#45847)
  [i18n] sync from 7.4 latest translations (elastic#45823)
  ...
  • Loading branch information
rylnd committed Sep 17, 2019
2 parents 2086eac + f6be95a commit f27d4c8
Show file tree
Hide file tree
Showing 673 changed files with 42,319 additions and 11,719 deletions.
2 changes: 1 addition & 1 deletion .ci/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ JOB:
# - x-pack-visualRegression

# `~` is yaml for `null`
exclude: ~
exclude: ~
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,16 @@ module.exports = {
},
},

/**
* Lens overrides
*/
{
files: ['x-pack/legacy/plugins/lens/**/*.ts', 'x-pack/legacy/plugins/lens/**/*.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
},
},

/**
* disable jsx-a11y for kbn-ui-framework
*/
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Identify which groups will be pinged by changes to different parts of the codebase.
# For more info, see https://help.github.com/articles/about-codeowners/

# App
/x-pack/legacy/plugins/lens/ @elastic/kibana-app

# App Architecture
/src/plugins/data/ @elastic/kibana-app-arch
/src/plugins/kibana_utils/ @elastic/kibana-app-arch
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def getPostBuildWorker(name, closure) {
"TEST_KIBANA_URL=http://elastic:changeme@localhost:${kibanaPort}",
"TEST_ES_URL=http://elastic:changeme@localhost:${esPort}",
"TEST_ES_TRANSPORT_PORT=${esTransportPort}",
"IS_PIPELINE_JOB=1",
]) {
closure()
}
Expand Down Expand Up @@ -168,6 +167,7 @@ def jobRunner(label, closure) {

withEnv([
"CI=true",
"IS_PIPELINE_JOB=1",
"HOME=${env.JENKINS_HOME}",
"PR_SOURCE_BRANCH=${env.ghprbSourceBranch ?: ''}",
"PR_TARGET_BRANCH=${env.ghprbTargetBranch ?: ''}",
Expand Down
6 changes: 3 additions & 3 deletions docs/management/managing-remote-clusters.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ can be used to provide remote backups for disaster recovery or for geo-proximite

Before using these features, you should be familiar with the following concepts:

* {stack-ov}/xpack-ccr.html[{ccr-cap}]
* {ref}/xpack-ccr.html[{ccr-cap}]
* {ref}/modules-cross-cluster-search.html[{ccs-cap}]
* {stack-ov}/cross-cluster-configuring.html[Cross-cluster security requirements]

Expand Down Expand Up @@ -55,8 +55,8 @@ a given remote cluster, and monitor whether the replication is active.

Before you use these features, you should be familiar with the following concepts:

* {stack-ov}/ccr-requirements.html[Requirements for leader indices]
* {stack-ov}/ccr-auto-follow.html[Automatically following indices]
* {ref}/ccr-requirements.html[Requirements for leader indices]
* {ref}/ccr-auto-follow.html[Automatically following indices]

To get started, go to *Management > Elasticsearch > {ccr-cap}*.

Expand Down
43 changes: 43 additions & 0 deletions docs/maps/geojson-upload.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[role="xpack"]
[[geojson-upload]]
== Upload GeoJSON data
*Elastic Maps* makes it easy to import geospatial data into the Elastic Stack.
Using the *GeoJSON Upload* feature, you can drag and drop your point and shape
data files directly into {es}, and then use them as layers
in the map. You can also use the GeoJSON data in the broader Kibana ecosystem,
for example, in visualizations and Canvas workpads.
[float]
=== Why GeoJSON?
GeoJSON is an open-standard file format for storing geospatial vector data.
Although many vector data formats are available in the GIS community,
GeoJSON is the most commonly used and flexible option.
[float]

=== Upload a GeoJSON file
Follow the instructions below to upload a GeoJSON data file, or try the
<<indexing-geojson-data-tutorial, end-to-end integrated example>>.

. Open *Elastic Maps*, and then click *Add layer*.
. Click *Upload GeoJSON vector file*.
+
[role="screenshot"]
image::maps/images/fu_gs_select_source_file_upload.png[]

. Use the file chooser to select a valid GeoJSON file. The file will load
a preview of the data on the map.
. Use the default *Index type* of {ref}/geo-point.html[geo_point] for point data,
or override it and select {ref}/geo-shape.html[geo_shape].
All other shapes will default to a type of `geo_shape`.
. Leave the default *Index name* and *Index pattern* names (the name of the uploaded
file minus its extension). You might need to change the index name if it is invalid.
. Click *Import file*.
+
Upon completing the indexing process and creating the associated index pattern,
the Elasticsearch responses are shown on the *Layer add panel* and the indexed data
appears on the map. The geospatial data on the map
should be identical to the locally-previewed data, but now it's indexed data from Elasticsearch.

. To continue adding data to the map, click *Add layer* in the lower
right-hand corner.
. In *Layer settings*, adjust any settings or <<maps-vector-style-properties, properties>> as needed.
. Click *Save & close*.
Binary file added docs/maps/images/fu_gs_final_map.png
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/maps/images/fu_gs_flight_paths.png
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/maps/images/fu_gs_lightning_intensity.png
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/maps/images/fu_gs_new_england_map.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.
2 changes: 2 additions & 0 deletions docs/maps/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ include::vector-layer.asciidoc[]
include::maps-aggregations.asciidoc[]
include::search.asciidoc[]
include::connect-to-ems.asciidoc[]
include::geojson-upload.asciidoc[]
include::indexing-geojson-data-tutorial.asciidoc[]
include::trouble-shooting.asciidoc[]
142 changes: 142 additions & 0 deletions docs/maps/indexing-geojson-data-tutorial.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
[role="xpack"]
[[indexing-geojson-data-tutorial]]
== Indexing GeoJSON data tutorial

In this tutorial, you'll build a customized map that shows the flight path between
two airports, and the lightning hot spots on that route. You'll learn to:

* Import GeoJSON files into Kibana
* Index the files in {es}
* Display the data in a multi-layer map

[float]
=== Before you begin

This tutorial requires you to download the following GeoJSON sample data files.
These files are good examples of the types
of vector data that you can upload to Kibana and index in
Elasticsearch for display in *Elastic Maps*.

* https://raw.githubusercontent.com/elastic/examples/master/Maps/Getting%20Started%20Examples/geojson_upload_and_styling/logan_international_airport.geojson[Logan International Airport]
* https://raw.githubusercontent.com/elastic/examples/master/Maps/Getting%20Started%20Examples/geojson_upload_and_styling/bangor_international_airport.geojson[Bangor International Airport]
* https://raw.githubusercontent.com/elastic/examples/master/Maps/Getting%20Started%20Examples/geojson_upload_and_styling/lightning_detected.geojson[Lightning detected]
* https://raw.githubusercontent.com/elastic/examples/master/Maps/Getting%20Started%20Examples/geojson_upload_and_styling/original_flight_path.geojson[Original flight path]
* https://raw.githubusercontent.com/elastic/examples/master/Maps/Getting%20Started%20Examples/geojson_upload_and_styling/modified_flight_path.geojson[Modified flight path]

The data represents two real airports, two fictitious flight routes, and
fictitious lightning reports. You don't need to use all of
these files. Feel free to work with as many files as you'd like, or use valid GeoJSON
files of your own.

[float]
[role="xpack"]
=== Create and set up a map

. <<maps-create, Create a new map>>.
. Zoom in on the New England area in the northeast United States.
+
You're adding flight paths to this area, and this
sets up the map for a good view of the data.
+
[role="screenshot"]
image::maps/images/fu_gs_new_england_map.png[]

[float]
[[upload-and-index-geojson-file]]
=== Upload and index GeoJSON files
For each GeoJSON file you downloaded, complete the following steps:

. Below the map legend, click *Add layer*.
. From the list of layer types, click *Upload GeoJSON vector file*.
. Using the File Picker, upload the GeoJSON file.
+
Depending on the geometry type of your features, this will
auto-populate *Index type* with either {ref}/geo-point.html[geo_point] or
{ref}/geo-shape.html[geo_shape] and *Index name* with
`<file name>`.

. Click *Import file* in the lower right.
+
You'll see activity as the GeoJSON Upload utility creates a new index
and index pattern for the data set. When the process is complete, you should
receive messages that the creation of the new index and index pattern
were successful.

. Click *Add layer* in the bottom right.

. In *Layer settings*, adjust settings and <<maps-vector-style-properties, properties>> as needed.
. Click *Save & close*.
. Once you've added all of the sample files,
<<maps-save, save your map>>.
+
At this point, you could consider the map complete,
but there are a few additions and tweaks that you can make to tell a
better story with your data.
+
[role="screenshot"]
image::maps/images/fu_gs_flight_paths.png[]

[float]
=== Add a heatmap aggregation layer

Looking at the `Lightning detected` layer, it's clear where lightning has
struck. What's less clear, is if there have been more lightning
strikes in some areas than others, in other words, where the lightning
hot spots are. An advantage of having indexed
{ref}/geo-point.html[geo_point] data for the
lightning strikes is that you can perform aggregations on the data.

. Below the map legend, click *Add layer*.
. From the list of layer types, click *Grid aggregation*.
+
Because you indexed `lightning_detected.geojson` using the index name and
pattern `lightning_detected`, that data is available as a {ref}/geo-point.html[geo_point]
aggregation.

. Select `lightning_detected`.
. Click *Show as* and select `heat map`.
. Click *Add layer* to add the heat map layer
"Lightning intensity".
+
The remaining default settings are good, but there are a couple of
settings that you might want to change.

. Under *Source settings* > *Grid resolution*, select from the different heat map resolutions.
+
The default "Coarse" looks
good, but feel free to select a different resolution.

. Play around with the *Layer Style* >
*Color range* setting.
+
Again the default looks good, but feel free to choose a
different color range.

. When you're finished modifying settings, click *Save & close*.
+
With your new lightning heat map layer, your map should look
like this:
+
[role="screenshot"]
image::maps/images/fu_gs_lightning_intensity.png[]


[float]
=== Organize the layers

Consider ways you might improve the appearance of the final map.
Small changes in how and when layers are shown can help tell a
better story with your data. Here are a few final tweaks
you might make:

* Update layer names
* Adjust styles for each layer
* Adjust the layer order
* Decide which layers to show at different zoom levels

When you've finished, again be sure to <<maps-save, save your work >>.

Your final map might look like this:

[role="screenshot"]
image::maps/images/fu_gs_final_map.png[]
2 changes: 1 addition & 1 deletion docs/settings/reporting-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The port for accessing Kibana, if different from the `server.port` value.
The protocol for accessing Kibana, typically `http` or `https`.

`xpack.reporting.kibanaServer.hostname`::
The hostname for accessing Kibana, if different from the `server.name` value.
The hostname for accessing {kib}, if different from the `server.host` value.

NOTE: Configuring the `xpack.reporting.kibanaServer` settings to point to a
proxy host requires that the Kibana server has network access to the proxy.
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ which is proxied through the Kibana server.
`interpreter.enableInVisualize`:: *Default: true* Enables use of interpreter in
Visualize.

`kibana.defaultAppId:`:: *Default: "discover"* The default application to load.
`kibana.defaultAppId:`:: *Default: "home"* The default application to load.

`kibana.index:`:: *Default: ".kibana"* Kibana uses an index in Elasticsearch to
store saved searches, visualizations and dashboards. Kibana creates a new index
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@
"dependencies": {
"@babel/core": "^7.5.5",
"@babel/register": "^7.5.5",
"@elastic/charts": "^11.1.1",
"@elastic/charts": "^12.0.2",
"@elastic/datemath": "5.0.2",
"@elastic/eui": "13.8.1",
"@elastic/eui": "14.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.3.3",
Expand Down Expand Up @@ -322,6 +322,7 @@
"@types/lru-cache": "^5.1.0",
"@types/markdown-it": "^0.0.7",
"@types/minimatch": "^2.0.29",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "^5.2.7",
"@types/moment-timezone": "^0.5.8",
"@types/mustache": "^0.8.31",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-interpreter/src/common/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

export { Registry } from './lib/registry';

export { fromExpression, toExpression, Ast } from './lib/ast';
export { fromExpression, toExpression, Ast, ExpressionFunctionAST } from './lib/ast';
15 changes: 14 additions & 1 deletion packages/kbn-interpreter/src/common/lib/ast.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,20 @@
* under the License.
*/

export type Ast = unknown;
export type ExpressionArgAST = string | boolean | number | Ast;

export interface ExpressionFunctionAST {
type: 'function';
function: string;
arguments: {
[key: string]: ExpressionArgAST[];
};
}

export interface Ast {
type: 'expression';
chain: ExpressionFunctionAST[];
}

export declare function fromExpression(expression: string): Ast;
export declare function toExpression(astObj: Ast, type?: string): string;
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ describe('dev/mocha/junit report generation', () => {
await new Promise(resolve => mocha.run(resolve));
const report = await fcb(cb =>
parseString(
readFileSync(resolve(PROJECT_DIR, 'target/junit', process.env.JOB || '.', 'TEST-test.xml')),
readFileSync(
resolve(
PROJECT_DIR,
'target/junit',
process.env.JOB || '.',
`TEST-${process.env.JOB ? process.env.JOB + '-' : ''}test.xml`
)
),
cb
)
);
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/src/mocha/junit_report_generation.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function setupJUnitReportGeneration(runner, options = {}) {
rootDirectory,
'target/junit',
process.env.JOB || '.',
`TEST-${reportName}.xml`
`TEST-${process.env.JOB ? process.env.JOB + '-' : ''}${reportName}.xml`
);

const reportXML = builder.end({
Expand Down
11 changes: 8 additions & 3 deletions packages/kbn-test/types/ftr.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import { ToolingLog } from '@kbn/dev-utils';
import { Config, Lifecycle } from '../src/functional_test_runner/lib';

export { Lifecycle, Config };

interface AsyncInstance<T> {
/**
* Services that are initialized async are not ready before the tests execute, so you might need
Expand All @@ -36,14 +38,17 @@ interface AsyncInstance<T> {
*/
type MaybeAsyncInstance<T> = T extends Promise<infer X> ? AsyncInstance<X> & X : T;

/**
* Covert a Provider type to the instance type it provides
*/
export type ProvidedType<T extends (...args: any[]) => any> = MaybeAsyncInstance<ReturnType<T>>;

/**
* Convert a map of providers to a map of the instance types they provide, also converting
* promise types into the async instances that other providers will receive.
*/
type ProvidedTypeMap<T extends {}> = {
[K in keyof T]: T[K] extends (...args: any[]) => any
? MaybeAsyncInstance<ReturnType<T[K]>>
: unknown;
[K in keyof T]: T[K] extends (...args: any[]) => any ? ProvidedType<T[K]> : unknown;
};

export interface GenericFtrProviderContext<
Expand Down
Loading

0 comments on commit f27d4c8

Please sign in to comment.