Skip to content

Commit

Permalink
Merge branch 'master' into changing-shared-module-setup-function-para…
Browse files Browse the repository at this point in the history
…meters
  • Loading branch information
elasticmachine authored Jul 2, 2020
2 parents bef6949 + d3c35c7 commit 4a064df
Show file tree
Hide file tree
Showing 295 changed files with 7,622 additions and 3,280 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
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
19 changes: 19 additions & 0 deletions docs/settings/reporting-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,25 @@ When `xpack.reporting.capture.browser.type` is set to `chromium` (default) you c
large exports from causing performance and storage issues.
Defaults to `10485760` (10mB).

| `xpack.reporting.csv.scroll.size`
| Number of documents retrieved from {es} for each scroll iteration during a CSV
export.
Defaults to `500`.

| `xpack.reporting.csv.scroll.duration`
| Amount of time allowed before {kib} cleans the scroll context during a CSV export.
Defaults to `30s`.

| `xpack.reporting.csv.checkForFormulas`
| Enables a check that warns you when there's a potential formula involved in the output (=, -, +, and @ chars).
See OWASP: https://www.owasp.org/index.php/CSV_Injection
Defaults to `true`.

| `xpack.reporting.csv.enablePanelActionDownload`
| Enables CSV export from a saved search on a dashboard. This action is available in the dashboard
panel menu for the saved search.
Defaults to `true`.

|===

[float]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,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;
}
4 changes: 4 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
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const env = {
ES_HOST: 'https://super:changeme@some.fake.host:9243',
NODE_ENV: 'integration_test',
COVERAGE_INGESTION_KIBANA_ROOT: '/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana',
FETCHED_PREVIOUS: 'FAKE_PREVIOUS_SHA',
};

describe('Ingesting coverage', () => {
Expand Down Expand Up @@ -68,31 +69,64 @@ describe('Ingesting coverage', () => {
expect(folderStructure.test(actualUrl)).ok();
});
});

describe(`vcsInfo`, () => {
let stdOutWithVcsInfo = '';
describe(`without a commit msg in the vcs info file`, () => {
let vcsInfo;
const args = [
'scripts/ingest_coverage.js',
'--verbose',
'--vcsInfoPath',
'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO_missing_commit_msg.txt',
'--path',
];

beforeAll(async () => {
const args = [
'scripts/ingest_coverage.js',
'--verbose',
'--vcsInfoPath',
'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO_missing_commit_msg.txt',
'--path',
];
const opts = [...args, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
vcsInfo = stdout;
stdOutWithVcsInfo = stdout;
});

it(`should be an obj w/o a commit msg`, () => {
const commitMsgRE = /"commitMsg"/;
expect(commitMsgRE.test(vcsInfo)).to.not.be.ok();
expect(commitMsgRE.test(stdOutWithVcsInfo)).to.not.be.ok();
});
});
describe(`including previous sha`, () => {
let stdOutWithPrevious = '';
beforeAll(async () => {
const opts = [...verboseArgs, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
stdOutWithPrevious = stdout;
});

it(`should have a vcsCompareUrl`, () => {
const previousCompareUrlRe = /vcsCompareUrl.+\s*.*https.+compare\/FAKE_PREVIOUS_SHA\.\.\.f07b34f6206/;
expect(previousCompareUrlRe.test(stdOutWithPrevious)).to.be.ok();
});
});
describe(`with a commit msg in the vcs info file`, () => {
beforeAll(async () => {
const args = [
'scripts/ingest_coverage.js',
'--verbose',
'--vcsInfoPath',
'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt',
'--path',
];
const opts = [...args, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
stdOutWithVcsInfo = stdout;
});

it(`should be an obj w/ a commit msg`, () => {
const commitMsgRE = /commitMsg/;
expect(commitMsgRE.test(stdOutWithVcsInfo)).to.be.ok();
});
});
});
describe(`team assignment`, () => {
let shouldNotHavePipelineOut = '';
let shouldIndeedHavePipelineOut = '';

const args = [
'scripts/ingest_coverage.js',
'--verbose',
Expand All @@ -101,26 +135,30 @@ describe('Ingesting coverage', () => {
'--path',
];

it(`should not occur when going to the totals index`, async () => {
const teamAssignRE = /"pipeline":/;
const shouldNotHavePipelineOut = await prokJustTotalOrNot(true, args);
const teamAssignRE = /pipeline:/;

beforeAll(async () => {
const summaryPath = 'jest-combined/coverage-summary-just-total.json';
const resolved = resolve(MOCKS_DIR, summaryPath);
const opts = [...args, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
shouldNotHavePipelineOut = stdout;
});
beforeAll(async () => {
const summaryPath = 'jest-combined/coverage-summary-manual-mix.json';
const resolved = resolve(MOCKS_DIR, summaryPath);
const opts = [...args, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
shouldIndeedHavePipelineOut = stdout;
});

it(`should not occur when going to the totals index`, () => {
const actual = teamAssignRE.test(shouldNotHavePipelineOut);
expect(actual).to.not.be.ok();
});
it(`should indeed occur when going to the coverage index`, async () => {
const shouldIndeedHavePipelineOut = await prokJustTotalOrNot(false, args);
const onlyForTestingRe = /ingest-pipe=>team_assignment/;
const actual = onlyForTestingRe.test(shouldIndeedHavePipelineOut);
it(`should indeed occur when going to the coverage index`, () => {
const actual = /ingest-pipe=>team_assignment/.test(shouldIndeedHavePipelineOut);
expect(actual).to.be.ok();
});
});
});
async function prokJustTotalOrNot(isTotal, args) {
const justTotalPath = 'jest-combined/coverage-summary-just-total.json';
const notJustTotalPath = 'jest-combined/coverage-summary-manual-mix.json';

const resolved = resolve(MOCKS_DIR, isTotal ? justTotalPath : notJustTotalPath);
const opts = [...args, resolved];
const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env });
return stdout;
}
Loading

0 comments on commit 4a064df

Please sign in to comment.