Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into move-index-patter…
Browse files Browse the repository at this point in the history
…ns-to-new-plugins-2
  • Loading branch information
Avinar-24 committed Nov 21, 2019
2 parents 10f3d6f + db401e4 commit c226101
Show file tree
Hide file tree
Showing 169 changed files with 4,362 additions and 3,217 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ library 'kibana-pipeline-library'
kibanaLibrary.load()

stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a little bit
timeout(time: 180, unit: 'MINUTES') {
timeout(time: 120, unit: 'MINUTES') {
timestamps {
ansiColor('xterm') {
catchError {
Expand Down
7 changes: 5 additions & 2 deletions docs/developer/add-data-guide.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ Each tutorial contains three sets of instructions:

[float]
=== Creating a new tutorial
// TODO: update path to where the directory must be created on the new platform
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/master/src/legacy/core_plugins/kibana/server/tutorials[tutorials directory].
2. In the new directory, create a file called `index.js` that exports a function.
The function must return a JavaScript object that conforms to the link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/common/tutorials/tutorial_schema.js[tutorial schema].
3. Register the tutorial in link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/server/tutorials/register.js[register.js] by calling `server.registerTutorial(myFuncImportedFromIndexJs)`.
The function must return a JavaScript object that conforms to the link:https://github.com/elastic/kibana/blob/master/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts[tutorial schema].
// TODO: update path to where the tutorial must be registered on the new platform
3. Register the tutorial in link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/server/tutorials/register.js[register.js] by calling `server.newPlatform.setup.plugins.home.tutorials.registerTutorial(myFuncImportedFromIndexJs)`.
// TODO: update path to where the image assets must be added on the new platform
4. Add image assets to the link:https://github.com/elastic/kibana/tree/master/src/legacy/core_plugins/kibana/public/home/tutorial_resources[tutorial_resources directory].
5. Run Kibana locally to preview the tutorial.
6. Create a PR and go through the review process to get the changes approved.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) &gt; [appName](./kibana-plugin-public.chromehelpextension.appname.md)

## ChromeHelpExtension.appName property

Provide your plugin's name to create a header for separation

<b>Signature:</b>

```typescript
appName: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) &gt; [content](./kibana-plugin-public.chromehelpextension.content.md)

## ChromeHelpExtension.content property

Custom content to occur below the list of links

<b>Signature:</b>

```typescript
content?: (element: HTMLDivElement) => () => void;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) &gt; [links](./kibana-plugin-public.chromehelpextension.links.md)

## ChromeHelpExtension.links property

Creates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button

<b>Signature:</b>

```typescript
links?: ChromeHelpExtensionMenuLink[];
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md)

## ChromeHelpExtension type
## ChromeHelpExtension interface


<b>Signature:</b>

```typescript
export declare type ChromeHelpExtension = (element: HTMLDivElement) => () => void;
export interface ChromeHelpExtension
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [appName](./kibana-plugin-public.chromehelpextension.appname.md) | <code>string</code> | Provide your plugin's name to create a header for separation |
| [content](./kibana-plugin-public.chromehelpextension.content.md) | <code>(element: HTMLDivElement) =&gt; () =&gt; void</code> | Custom content to occur below the list of links |
| [links](./kibana-plugin-public.chromehelpextension.links.md) | <code>ChromeHelpExtensionMenuLink[]</code> | Creates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button |

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtensionMenuCustomLink](./kibana-plugin-public.chromehelpextensionmenucustomlink.md)

## ChromeHelpExtensionMenuCustomLink type


<b>Signature:</b>

```typescript
export declare type ChromeHelpExtensionMenuCustomLink = EuiButtonEmptyProps & {
linkType: 'custom';
content: React.ReactNode;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtensionMenuDiscussLink](./kibana-plugin-public.chromehelpextensionmenudiscusslink.md)

## ChromeHelpExtensionMenuDiscussLink type


<b>Signature:</b>

```typescript
export declare type ChromeHelpExtensionMenuDiscussLink = EuiButtonEmptyProps & {
linkType: 'discuss';
href: string;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtensionMenuDocumentationLink](./kibana-plugin-public.chromehelpextensionmenudocumentationlink.md)

## ChromeHelpExtensionMenuDocumentationLink type


<b>Signature:</b>

```typescript
export declare type ChromeHelpExtensionMenuDocumentationLink = EuiButtonEmptyProps & {
linkType: 'documentation';
href: string;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtensionMenuGitHubLink](./kibana-plugin-public.chromehelpextensionmenugithublink.md)

## ChromeHelpExtensionMenuGitHubLink type


<b>Signature:</b>

```typescript
export declare type ChromeHelpExtensionMenuGitHubLink = EuiButtonEmptyProps & {
linkType: 'github';
labels: string[];
title?: string;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtensionMenuLink](./kibana-plugin-public.chromehelpextensionmenulink.md)

## ChromeHelpExtensionMenuLink type


<b>Signature:</b>

```typescript
export declare type ChromeHelpExtensionMenuLink = ExclusiveUnion<ChromeHelpExtensionMenuGitHubLink, ExclusiveUnion<ChromeHelpExtensionMenuDiscussLink, ExclusiveUnion<ChromeHelpExtensionMenuDocumentationLink, ChromeHelpExtensionMenuCustomLink>>>;
```
7 changes: 6 additions & 1 deletion docs/development/core/public/kibana-plugin-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [ChromeBadge](./kibana-plugin-public.chromebadge.md) | |
| [ChromeBrand](./kibana-plugin-public.chromebrand.md) | |
| [ChromeDocTitle](./kibana-plugin-public.chromedoctitle.md) | APIs for accessing and updating the document title. |
| [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) | |
| [ChromeNavControl](./kibana-plugin-public.chromenavcontrol.md) | |
| [ChromeNavControls](./kibana-plugin-public.chromenavcontrols.md) | [APIs](./kibana-plugin-public.chromenavcontrols.md) for registering new controls to be displayed in the navigation bar. |
| [ChromeNavLink](./kibana-plugin-public.chromenavlink.md) | |
Expand Down Expand Up @@ -98,7 +99,11 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| --- | --- |
| [AppUnmount](./kibana-plugin-public.appunmount.md) | A function called when an application should be unmounted from the page. This function should be synchronous. |
| [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) | |
| [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) | |
| [ChromeHelpExtensionMenuCustomLink](./kibana-plugin-public.chromehelpextensionmenucustomlink.md) | |
| [ChromeHelpExtensionMenuDiscussLink](./kibana-plugin-public.chromehelpextensionmenudiscusslink.md) | |
| [ChromeHelpExtensionMenuDocumentationLink](./kibana-plugin-public.chromehelpextensionmenudocumentationlink.md) | |
| [ChromeHelpExtensionMenuGitHubLink](./kibana-plugin-public.chromehelpextensionmenugithublink.md) | |
| [ChromeHelpExtensionMenuLink](./kibana-plugin-public.chromehelpextensionmenulink.md) | |
| [ChromeNavLinkUpdateableFields](./kibana-plugin-public.chromenavlinkupdateablefields.md) | |
| [HandlerContextType](./kibana-plugin-public.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-public.handlerfunction.md) to represent the type of the context. |
| [HandlerFunction](./kibana-plugin-public.handlerfunction.md) | A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-public.icontextcontainer.md) |
Expand Down
4 changes: 2 additions & 2 deletions docs/management/managing-fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include::field-formatters/url-formatter.asciidoc[]

Date fields support the `Date`, `Url`, and `String` formatters.

The `Date` formatter enables you to choose the display format of date stamps using the http://moment.js[moment.js]
The `Date` formatter enables you to choose the display format of date stamps using the https://momentjs.com/[moment.js]
standard format definitions.

include::field-formatters/string-formatter.asciidoc[]
Expand Down Expand Up @@ -65,7 +65,7 @@ the https://adamwdraper.github.io/Numeral-js/[numeral.js] standard format defini
Scripted fields compute data on the fly from the data in your Elasticsearch indices. Scripted field data is shown on
the Discover tab as part of the document data, and you can use scripted fields in your visualizations.
Scripted field values are computed at query time so they aren't indexed and cannot be searched using Kibana's default
query language. However they can be queried using Kibana's new <<kuery-query, experimental query language>>. Scripted
query language. However they can be queried using Kibana's new <<kuery-query, experimental query language>>. Scripted
fields are also supported in the filter bar.

WARNING: Computing data on the fly with scripted fields can be very resource intensive and can have a direct impact on
Expand Down
6 changes: 3 additions & 3 deletions docs/setup/install/brew.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ and data directory are stored in the following locations.
| Type | Description | Default Location | Setting
| home
| Kibana home directory or `$KIBANA_HOME`
| /usr/local/var/homebrew/linked/kibana
| /usr/local/var/homebrew/linked/kibana-full
d|

| bin
| Binary scripts including `kibana` to start a node
and `kibana-plugin` to install plugins
| /usr/local/var/homebrew/linked/kibana/bin
| /usr/local/var/homebrew/linked/kibana-full/bin
d|

| conf
Expand All @@ -59,7 +59,7 @@ and data directory are stored in the following locations.

| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
| /usr/local/var/homebrew/linked/kibana/plugins
| /usr/local/var/homebrew/linked/kibana-full/plugins
d|

|=======================================================================
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"@elastic/charts": "^14.0.0",
"@elastic/datemath": "5.0.2",
"@elastic/ems-client": "1.0.5",
"@elastic/eui": "14.9.0",
"@elastic/eui": "16.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.3.3",
Expand All @@ -132,7 +132,7 @@
"@types/recompose": "^0.30.5",
"JSONStream": "1.3.5",
"abortcontroller-polyfill": "^1.3.0",
"angular": "^1.7.8",
"angular": "^1.7.9",
"angular-aria": "^1.7.8",
"angular-elastic": "^2.5.1",
"angular-recursion": "^1.0.5",
Expand Down
60 changes: 59 additions & 1 deletion packages/kbn-es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,62 @@ Cloned location of elasticsearch repository, used when running from source

Type: `String`

Location where snapshots are cached
Location where snapshots are cached

## Snapshot Pinning

Sometimes we need to pin snapshots for a specific version. We'd really like to get this automated, but until that is completed here are the steps to take to build, upload, and switch to pinned snapshots for a branch.

To use these steps you'll need to setup the google-cloud-sdk, which can be installed on macOS with `brew cask install google-cloud-sdk`. Login with the CLI and you'll have access to the `gsutil` to do efficient/parallel uploads to GCS from the command line.

1. Clone the elasticsearch repo somewhere
2. Checkout the branch you want to build
3. Run the following to delete old distributables

```
find distribution/archives -type f \( -name 'elasticsearch-*-*.tar.gz' -o -name 'elasticsearch-*-*.zip' \) -not -path *no-jdk* -exec rm {} \;
```

4. Build the new artifacts

```
./gradlew -p distribution/archives assemble --parallel
```

4. Copy new artifacts to your `~/Downloads/tmp-artifacts`

```
rm -rf ~/Downloads/tmp-artifacts
mkdir ~/Downloads/tmp-artifacts
find distribution/archives -type f \( -name 'elasticsearch-*-*.tar.gz' -o -name 'elasticsearch-*-*.zip' \) -not -path *no-jdk* -exec cp {} ~/Downloads/tmp-artifacts \;
```

5. Calculate shasums of the uploads

```
cd ~/Downloads/tmp-artifacts
find * -exec bash -c "shasum -a 512 {} > {}.sha512" \;
```

6. Check that the files in `~/Downloads/tmp-artifacts` look reasonable
7. Upload the files to GCS

```
gsutil -m rsync . gs://kibana-ci-tmp-artifacts/
```

8. Once the artifacts are uploaded, modify `packages/kbn-es/src/custom_snapshots.js` in a PR to use a URL formatted like:

```
// force use of manually created snapshots until ReindexPutMappings fix
if (!process.env.KBN_ES_SNAPSHOT_URL && !process.argv.some(isVersionFlag)) {
// return undefined;
return 'https://storage.googleapis.com/kibana-ci-tmp-artifacts/{name}-{version}-{os}-x86_64.{ext}';
}
```

For 6.8, the format of the url should look like:

```
'https://storage.googleapis.com/kibana-ci-tmp-artifacts/{name}-{version}.{ext}';
```
17 changes: 10 additions & 7 deletions src/core/public/chrome/chrome_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,17 +418,20 @@ describe('start', () => {
.pipe(toArray())
.toPromise();

chrome.setHelpExtension(() => () => undefined);
chrome.setHelpExtension({ appName: 'App name', content: () => () => undefined });
chrome.setHelpExtension(undefined);
service.stop();

await expect(promise).resolves.toMatchInlineSnapshot(`
Array [
undefined,
[Function],
undefined,
]
`);
Array [
undefined,
Object {
"appName": "App name",
"content": [Function],
},
undefined,
]
`);
});
});
});
Expand Down
16 changes: 15 additions & 1 deletion src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { NavControlsService, ChromeNavControls } from './nav_controls';
import { DocTitleService, ChromeDocTitle } from './doc_title';
import { LoadingIndicator, HeaderWrapper as Header } from './ui';
import { DocLinksStart } from '../doc_links';
import { ChromeHelpExtensionMenuLink } from './ui/header/header_help_menu';

export { ChromeNavControls, ChromeRecentlyAccessed, ChromeDocTitle };

Expand All @@ -58,7 +59,20 @@ export interface ChromeBrand {
export type ChromeBreadcrumb = EuiBreadcrumb;

/** @public */
export type ChromeHelpExtension = (element: HTMLDivElement) => () => void;
export interface ChromeHelpExtension {
/**
* Provide your plugin's name to create a header for separation
*/
appName: string;
/**
* Creates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button
*/
links?: ChromeHelpExtensionMenuLink[];
/**
* Custom content to occur below the list of links
*/
content?: (element: HTMLDivElement) => () => void;
}

interface ConstructorParams {
browserSupportsCsp: boolean;
Expand Down
7 changes: 7 additions & 0 deletions src/core/public/chrome/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export {
ChromeBrand,
ChromeHelpExtension,
} from './chrome_service';
export {
ChromeHelpExtensionMenuLink,
ChromeHelpExtensionMenuCustomLink,
ChromeHelpExtensionMenuDiscussLink,
ChromeHelpExtensionMenuDocumentationLink,
ChromeHelpExtensionMenuGitHubLink,
} from './ui/header/header_help_menu';
export { ChromeNavLink, ChromeNavLinks, ChromeNavLinkUpdateableFields } from './nav_links';
export { ChromeRecentlyAccessed, ChromeRecentlyAccessedHistoryItem } from './recently_accessed';
export { ChromeNavControl, ChromeNavControls } from './nav_controls';
Expand Down
Loading

0 comments on commit c226101

Please sign in to comment.