Skip to content

Commit

Permalink
Merge branch 'master' into upgrade-lodash-4-final
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jul 2, 2020
2 parents ce56693 + 12460b4 commit b1b9502
Show file tree
Hide file tree
Showing 304 changed files with 7,674 additions and 3,295 deletions.
9 changes: 8 additions & 1 deletion .ci/Jenkinsfile_coverage
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,22 @@ kibanaPipeline(timeoutMinutes: 240) {
}

def handleIngestion(timestamp) {
def previousSha = handlePreviousSha()
kibanaPipeline.downloadCoverageArtifacts()
kibanaCoverage.prokLinks("### Process HTML Links")
kibanaCoverage.collectVcsInfo("### Collect VCS Info")
kibanaCoverage.generateReports("### Merge coverage reports")
kibanaCoverage.uploadCombinedReports()
kibanaCoverage.ingest(env.JOB_NAME, BUILD_NUMBER, BUILD_URL, timestamp, '### Ingest && Upload')
kibanaCoverage.ingest(env.JOB_NAME, BUILD_NUMBER, BUILD_URL, timestamp, previousSha, '### Ingest && Upload')
kibanaCoverage.uploadCoverageStaticSite(timestamp)
}

def handlePreviousSha() {
def previous = kibanaCoverage.downloadPrevious('### Download OLD Previous')
kibanaCoverage.uploadPrevious('### Upload NEW Previous')
return previous
}

def handleFail() {
def buildStatus = buildUtils.getBuildStatus()
if(params.NOTIFY_ON_FAILURE && buildStatus != 'SUCCESS' && buildStatus != 'ABORTED' && buildStatus != 'UNSTABLE') {
Expand Down
15 changes: 15 additions & 0 deletions .fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by FOSSA CLI (https://github.com/fossas/fossa-cli)
# Visit https://fossa.com to learn more

version: 2
cli:
server: https://app.fossa.com
fetcher: custom
project: kibana
analyze:
modules:
- name: kibana
type: nodejs
strategy: yarn.lock
target: .
path: .
2 changes: 1 addition & 1 deletion docs/api/using-api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ NOTE: The {kib} Console supports only Elasticsearch APIs. You are unable to inte
[float]
[[api-authentication]]
=== Authentication
{kib} supports token-based authentication with the same username and password that you use to log into the {kib} Console.
{kib} supports token-based authentication with the same username and password that you use to log into the {kib} Console. In a given HTTP tool, and when available, you can select to use its 'Basic Authentication' option, which is where the username and password are stored in order to be passed as part of the call.

[float]
[[api-calls]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) &gt; [doc\_values](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md)

## SavedObjectsComplexFieldMapping.doc\_values property

<b>Signature:</b>

```typescript
doc_values?: boolean;
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface SavedObjectsComplexFieldMapping

| Property | Type | Description |
| --- | --- | --- |
| [doc\_values](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md) | <code>boolean</code> | |
| [properties](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md) | <code>SavedObjectsMappingProperties</code> | |
| [type](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md) | <code>string</code> | |

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) &gt; [doc\_values](./kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md)

## SavedObjectsCoreFieldMapping.doc\_values property

<b>Signature:</b>

```typescript
doc_values?: boolean;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface SavedObjectsCoreFieldMapping

| Property | Type | Description |
| --- | --- | --- |
| [doc\_values](./kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md) | <code>boolean</code> | |
| [enabled](./kibana-plugin-core-server.savedobjectscorefieldmapping.enabled.md) | <code>boolean</code> | |
| [fields](./kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md) | <code>{</code><br/><code> [subfield: string]: {</code><br/><code> type: string;</code><br/><code> ignore_above?: number;</code><br/><code> };</code><br/><code> }</code> | |
| [index](./kibana-plugin-core-server.savedobjectscorefieldmapping.index.md) | <code>boolean</code> | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

## SavedObjectTypeRegistry.getAllTypes() method

Return all [types](./kibana-plugin-core-server.savedobjectstype.md) currently registered.
Return all [types](./kibana-plugin-core-server.savedobjectstype.md) currently registered, including the hidden ones.

To only get the visible types (which is the most common use case), use `getVisibleTypes` instead.

<b>Signature:</b>

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [SavedObjectTypeRegistry](./kibana-plugin-core-server.savedobjecttyperegistry.md) &gt; [getVisibleTypes](./kibana-plugin-core-server.savedobjecttyperegistry.getvisibletypes.md)

## SavedObjectTypeRegistry.getVisibleTypes() method

Returns all visible [types](./kibana-plugin-core-server.savedobjectstype.md)<!-- -->.

A visible type is a type that doesn't explicitly define `hidden=true` during registration.

<b>Signature:</b>

```typescript
getVisibleTypes(): SavedObjectsType[];
```
<b>Returns:</b>

`SavedObjectsType[]`

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ export declare class SavedObjectTypeRegistry

| Method | Modifiers | Description |
| --- | --- | --- |
| [getAllTypes()](./kibana-plugin-core-server.savedobjecttyperegistry.getalltypes.md) | | Return all [types](./kibana-plugin-core-server.savedobjectstype.md) currently registered. |
| [getAllTypes()](./kibana-plugin-core-server.savedobjecttyperegistry.getalltypes.md) | | Return all [types](./kibana-plugin-core-server.savedobjectstype.md) currently registered, including the hidden ones.<!-- -->To only get the visible types (which is the most common use case), use <code>getVisibleTypes</code> instead. |
| [getImportableAndExportableTypes()](./kibana-plugin-core-server.savedobjecttyperegistry.getimportableandexportabletypes.md) | | Return all [types](./kibana-plugin-core-server.savedobjectstype.md) currently registered that are importable/exportable. |
| [getIndex(type)](./kibana-plugin-core-server.savedobjecttyperegistry.getindex.md) | | Returns the <code>indexPattern</code> property for given type, or <code>undefined</code> if the type is not registered. |
| [getType(type)](./kibana-plugin-core-server.savedobjecttyperegistry.gettype.md) | | Return the [type](./kibana-plugin-core-server.savedobjectstype.md) definition for given type name. |
| [getVisibleTypes()](./kibana-plugin-core-server.savedobjecttyperegistry.getvisibletypes.md) | | Returns all visible [types](./kibana-plugin-core-server.savedobjectstype.md)<!-- -->.<!-- -->A visible type is a type that doesn't explicitly define <code>hidden=true</code> during registration. |
| [isHidden(type)](./kibana-plugin-core-server.savedobjecttyperegistry.ishidden.md) | | Returns the <code>hidden</code> property for given type, or <code>false</code> if the type is not registered. |
| [isImportableAndExportable(type)](./kibana-plugin-core-server.savedobjecttyperegistry.isimportableandexportable.md) | | Returns the <code>management.importableAndExportable</code> property for given type, or <code>false</code> if the type is not registered or does not define a management section. |
| [isMultiNamespace(type)](./kibana-plugin-core-server.savedobjecttyperegistry.ismultinamespace.md) | | Returns whether the type is multi-namespace (shareable); resolves to <code>false</code> if the type is not registered |
Expand Down
1 change: 1 addition & 0 deletions docs/plugins/known-plugins.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ This list of plugins is not guaranteed to work on your version of Kibana. Instea
* https://github.com/sbeyn/kibana-plugin-traffic-sg[Traffic] (sbeyn)
* https://github.com/PhaedrusTheGreek/transform_vis[Transform Visualization] (PhaedrusTheGreek)
* https://github.com/nyurik/kibana-vega-vis[Vega-based visualizations] (nyurik) - Support for user-defined graphs, external data sources, maps, images, and user-defined interactivity.
* https://github.com/Camichan/kbn_aframe[VR Graph Visualizations] (Camichan)

[float]
=== Other
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
"@babel/register": "^7.10.1",
"@elastic/apm-rum": "^5.2.0",
"@elastic/charts": "19.5.2",
"@elastic/charts": "19.6.3",
"@elastic/datemath": "5.0.3",
"@elastic/ems-client": "7.9.3",
"@elastic/eui": "24.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-shared-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"kbn:watch": "node scripts/build --dev --watch"
},
"dependencies": {
"@elastic/charts": "19.5.2",
"@elastic/charts": "19.6.3",
"@elastic/eui": "24.1.0",
"@elastic/numeral": "^2.5.0",
"@kbn/i18n": "1.0.0",
Expand Down
2 changes: 2 additions & 0 deletions src/core/server/saved_objects/mappings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export interface SavedObjectsCoreFieldMapping {
type: string;
null_value?: number | boolean | string;
index?: boolean;
doc_values?: boolean;
enabled?: boolean;
fields?: {
[subfield: string]: {
Expand All @@ -153,6 +154,7 @@ export interface SavedObjectsCoreFieldMapping {
* @public
*/
export interface SavedObjectsComplexFieldMapping {
doc_values?: boolean;
type?: string;
properties: SavedObjectsMappingProperties;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const createRegistryMock = (): jest.Mocked<
const mock = {
registerType: jest.fn(),
getType: jest.fn(),
getVisibleTypes: jest.fn(),
getAllTypes: jest.fn(),
getImportableAndExportableTypes: jest.fn(),
isNamespaceAgnostic: jest.fn(),
Expand All @@ -35,6 +36,7 @@ const createRegistryMock = (): jest.Mocked<
isImportableAndExportable: jest.fn(),
};

mock.getVisibleTypes.mockReturnValue([]);
mock.getAllTypes.mockReturnValue([]);
mock.getImportableAndExportableTypes.mockReturnValue([]);
mock.getIndex.mockReturnValue('.kibana-test');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,37 @@ describe('SavedObjectTypeRegistry', () => {
});
});

describe('#getVisibleTypes', () => {
it('returns only visible registered types', () => {
const typeA = createType({ name: 'typeA', hidden: false });
const typeB = createType({ name: 'typeB', hidden: true });
const typeC = createType({ name: 'typeC', hidden: false });
registry.registerType(typeA);
registry.registerType(typeB);
registry.registerType(typeC);

const registered = registry.getVisibleTypes();
expect(registered.length).toEqual(2);
expect(registered).toContainEqual(typeA);
expect(registered).toContainEqual(typeC);
});

it('does not mutate the registered types when altering the list', () => {
registry.registerType(createType({ name: 'typeA', hidden: false }));
registry.registerType(createType({ name: 'typeB', hidden: true }));
registry.registerType(createType({ name: 'typeC', hidden: false }));

const types = registry.getVisibleTypes();
types.splice(0, 2);

expect(registry.getVisibleTypes().length).toEqual(2);
});
});

describe('#getAllTypes', () => {
it('returns all registered types', () => {
const typeA = createType({ name: 'typeA' });
const typeB = createType({ name: 'typeB' });
const typeB = createType({ name: 'typeB', hidden: true });
const typeC = createType({ name: 'typeC' });
registry.registerType(typeA);
registry.registerType(typeB);
Expand Down
13 changes: 12 additions & 1 deletion src/core/server/saved_objects/saved_objects_type_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ export class SavedObjectTypeRegistry {
}

/**
* Return all {@link SavedObjectsType | types} currently registered.
* Returns all visible {@link SavedObjectsType | types}.
*
* A visible type is a type that doesn't explicitly define `hidden=true` during registration.
*/
public getVisibleTypes() {
return [...this.types.values()].filter((type) => !this.isHidden(type.name));
}

/**
* Return all {@link SavedObjectsType | types} currently registered, including the hidden ones.
*
* To only get the visible types (which is the most common use case), use `getVisibleTypes` instead.
*/
public getAllTypes() {
return [...this.types.values()];
Expand Down
5 changes: 5 additions & 0 deletions src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1978,6 +1978,8 @@ export interface SavedObjectsClientWrapperOptions {

// @public
export interface SavedObjectsComplexFieldMapping {
// (undocumented)
doc_values?: boolean;
// (undocumented)
properties: SavedObjectsMappingProperties;
// (undocumented)
Expand All @@ -1986,6 +1988,8 @@ export interface SavedObjectsComplexFieldMapping {

// @public
export interface SavedObjectsCoreFieldMapping {
// (undocumented)
doc_values?: boolean;
// (undocumented)
enabled?: boolean;
// (undocumented)
Expand Down Expand Up @@ -2468,6 +2472,7 @@ export class SavedObjectTypeRegistry {
getImportableAndExportableTypes(): SavedObjectsType[];
getIndex(type: string): string | undefined;
getType(type: string): SavedObjectsType | undefined;
getVisibleTypes(): SavedObjectsType[];
isHidden(type: string): boolean;
isImportableAndExportable(type: string): boolean;
isMultiNamespace(type: string): boolean;
Expand Down
20 changes: 10 additions & 10 deletions src/dev/code_coverage/ingest_coverage/__tests__/either.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,39 @@
* under the License.
*/

import { fromNullable, tryCatch, left, right } from '../either';
import * as Either from '../either';
import { noop } from '../utils';
import expect from '@kbn/expect';

const pluck = (x) => (obj) => obj[x];
const expectNull = (x) => expect(x).to.equal(null);
const attempt = (obj) => fromNullable(obj).map(pluck('detail'));
const attempt = (obj) => Either.fromNullable(obj).map(pluck('detail'));

describe(`either datatype functions`, () => {
describe(`helpers`, () => {
it(`'fromNullable' should be a fn`, () => {
expect(typeof fromNullable).to.be('function');
expect(typeof Either.fromNullable).to.be('function');
});
it(`'tryCatch' should be a fn`, () => {
expect(typeof tryCatch).to.be('function');
it(`' Either.tryCatch' should be a fn`, () => {
expect(typeof Either.tryCatch).to.be('function');
});
it(`'left' should be a fn`, () => {
expect(typeof left).to.be('function');
expect(typeof Either.left).to.be('function');
});
it(`'right' should be a fn`, () => {
expect(typeof right).to.be('function');
expect(typeof Either.right).to.be('function');
});
});
describe('tryCatch', () => {
describe(' Either.tryCatch', () => {
let sut = undefined;
it(`should return a 'Left' on error`, () => {
sut = tryCatch(() => {
sut = Either.tryCatch(() => {
throw new Error('blah');
});
expect(sut.inspect()).to.be('Left(Error: blah)');
});
it(`should return a 'Right' on successful execution`, () => {
sut = tryCatch(noop);
sut = Either.tryCatch(noop);
expect(sut.inspect()).to.be('Right(undefined)');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import expect from '@kbn/expect';
import { ciRunUrl, coveredFilePath, itemizeVcs } from '../transforms';
import { ciRunUrl, coveredFilePath, itemizeVcs, prokPrevious } from '../transforms';

describe(`Transform fn`, () => {
describe(`ciRunUrl`, () => {
Expand Down Expand Up @@ -61,6 +61,14 @@ describe(`Transform fn`, () => {
});
});
});
describe(`prokPrevious`, () => {
const comparePrefixF = () => 'https://github.com/elastic/kibana/compare';
process.env.FETCHED_PREVIOUS = 'A';
it(`should return a previous compare url`, () => {
const actual = prokPrevious(comparePrefixF)('B');
expect(actual).to.be(`https://github.com/elastic/kibana/compare/A...B`);
});
});
describe(`itemizeVcs`, () => {
it(`should return a sha url`, () => {
const vcsInfo = [
Expand Down
Loading

0 comments on commit b1b9502

Please sign in to comment.