Skip to content

Commit

Permalink
Merge branch 'master' into saved-objects/scoped-client-with-extra-types
Browse files Browse the repository at this point in the history
* master: (33 commits)
  [Saved Objects] adds support for including hidden types in saved objects client (elastic#66879)
  [Discover] Deangularize timechart header (elastic#66532)
  [Discover] Improve and unskip a11y context view test (elastic#66959)
  [SIEM] Refactor Timeline.timelineType draft to Timeline.status draft (elastic#66864)
  docs: update RUM documentation link (elastic#67042)
  [QA] fixup coverage ingestion tests. (elastic#66905)
  [Metrics UI] Add support for multiple groupings to Metrics Explorer (and Alerts) (elastic#66503)
  [Metrics UI] Add sorting for name and value to Inventory View (elastic#66644)
  [Metrics UI] Change Metric Threshold Alert charts to use bar charts (elastic#66672)
  [Uptime] Use React.lazy for alert type registration (elastic#66829)
  [Reporting] Consolidate API Integration Test configs (elastic#66637)
  Allow histogram fields in average and sum aggregations (elastic#66891)
  Fix saved object share link (elastic#66771)
  move role reset into the top level after clause (elastic#66971)
  Automate the labels for any PRs affecting files for the Ingest Management team (elastic#67022)
  [SIEMDPOINT] Move endpoint to siem (elastic#66907)
  server.uuid so is not used (elastic#66963)
  Revert "[ci/stats] fix git metadata collection (elastic#66840)"
  [Uptime] Unmount uptime app properly (elastic#66950)
  [Visualize] Bar chart: Show missing values on chart setting (elastic#66375)
  ...
  • Loading branch information
gmmorris committed May 20, 2020
2 parents ff9d788 + dfa22d1 commit 244da07
Show file tree
Hide file tree
Showing 491 changed files with 6,688 additions and 31,724 deletions.
5 changes: 4 additions & 1 deletion .github/paths-labeller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
- "src/plugins/bfetch/**/*.*"
- "Team:apm":
- "x-pack/plugins/apm/**/*.*"
- "x-pack/plugins/apm/**/*.*"
- "Team:Ingest Management":
- "x-pack/plugins/ingest_manager/**/*.*"
- "x-pack/test/api_integration/apis/fleet/**/*.*"
- "x-pack/test/epm_api_integration/**/*.*"
- "Team:uptime":
- "x-pack/plugins/uptime/**/*.*"
1 change: 0 additions & 1 deletion examples/alerting_example/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "alertingExample",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["alerting_example"],
"server": true,
"ui": true,
"requiredPlugins": ["triggers_actions_ui", "charts", "data", "alerting", "actions"],
Expand Down
1 change: 0 additions & 1 deletion examples/bfetch_explorer/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "bfetchExplorer",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["bfetch_explorer"],
"server": true,
"ui": true,
"requiredPlugins": ["bfetch"],
Expand Down
1 change: 0 additions & 1 deletion examples/demo_search/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "demoSearch",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["demoSearch"],
"server": true,
"ui": true,
"requiredPlugins": ["data"],
Expand Down
1 change: 0 additions & 1 deletion examples/embeddable_examples/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "embeddableExamples",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["embeddable_examples"],
"server": true,
"ui": true,
"requiredPlugins": ["embeddable"],
Expand Down
1 change: 0 additions & 1 deletion examples/embeddable_explorer/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "embeddableExplorer",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["embeddable_explorer"],
"server": false,
"ui": true,
"requiredPlugins": ["uiActions", "inspector", "embeddable", "embeddableExamples"],
Expand Down
1 change: 0 additions & 1 deletion examples/search_explorer/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "searchExplorer",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["search_explorer"],
"server": false,
"ui": true,
"requiredPlugins": ["data", "demoSearch"],
Expand Down
1 change: 0 additions & 1 deletion examples/state_containers_examples/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "stateContainersExamples",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["state_containers_examples"],
"server": true,
"ui": true,
"requiredPlugins": ["navigation", "data"],
Expand Down
1 change: 0 additions & 1 deletion examples/ui_action_examples/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "uiActionsExamples",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["ui_actions_examples"],
"server": false,
"ui": true,
"requiredPlugins": ["uiActions"],
Expand Down
1 change: 0 additions & 1 deletion examples/ui_actions_explorer/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "uiActionsExplorer",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["ui_actions_explorer"],
"server": false,
"ui": true,
"requiredPlugins": ["uiActions", "uiActionsExamples"],
Expand Down
1 change: 0 additions & 1 deletion examples/url_generators_examples/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "urlGeneratorsExamples",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["url_generators_examples"],
"server": false,
"ui": true,
"requiredPlugins": ["share"],
Expand Down
1 change: 0 additions & 1 deletion examples/url_generators_explorer/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"id": "urlGeneratorsExplorer",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["url_generators_explorer"],
"server": false,
"ui": true,
"requiredPlugins": ["share", "urlGeneratorsExamples"],
Expand Down
11 changes: 0 additions & 11 deletions src/core/server/core_app/core_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,6 @@ export class CoreApp {
router.get({ path: '/core', validate: false }, async (context, req, res) =>
res.ok({ body: { version: '0.0.1' } })
);

coreSetup.savedObjects.registerType({
name: 'server',
hidden: false,
namespaceType: 'single',
mappings: {
properties: {
uuid: { type: 'keyword' },
},
},
});
}
private registerStaticDirs(coreSetup: InternalCoreSetup) {
coreSetup.http.registerStaticDir('/ui/{path*}', Path.resolve(__dirname, './assets'));
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 } from '../transforms';
import { ciRunUrl, coveredFilePath, itemizeVcs } from '../transforms';

describe(`Transform fn`, () => {
describe(`ciRunUrl`, () => {
Expand All @@ -31,4 +31,32 @@ describe(`Transform fn`, () => {
expect(ciRunUrl({ a: 'a' })).not.to.have.property('ciRunUrl');
});
});
describe(`coveredFilePath`, () => {
it(`should remove the jenkins workspace path`, () => {
const obj = {
staticSiteUrl:
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js',
COVERAGE_INGESTION_KIBANA_ROOT:
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana',
};
expect(coveredFilePath(obj)).to.have.property(
'coveredFilePath',
'x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js'
);
});
});
describe(`itemizeVcs`, () => {
it(`should return a sha url`, () => {
const vcsInfo = [
'origin/ingest-code-coverage',
'f07b34f6206',
`Tre' Seymour`,
`Lorem :) ipsum Tre' λ dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`,
];
expect(itemizeVcs(vcsInfo)({}).vcs).to.have.property(
'vcsUrl',
`https://github.com/elastic/kibana/commit/${vcsInfo[1]}`
);
});
});
});
1 change: 0 additions & 1 deletion src/dev/code_coverage/ingest_coverage/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
* under the License.
*/

export const STATIC_SITE_URL_PROP_NAME = 'staticSiteUrl';
export const COVERAGE_INDEX = process.env.COVERAGE_INDEX || 'kibana_code_coverage';
export const TOTALS_INDEX = process.env.TOTALS_INDEX || `kibana_total_code_coverage`;
5 changes: 1 addition & 4 deletions src/dev/code_coverage/ingest_coverage/ingest.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const { Client } = require('@elastic/elasticsearch');
import { createFailError } from '@kbn/dev-utils';
import chalk from 'chalk';
import { green, always } from './utils';
import { green, always, pretty } from './utils';
import { fromNullable } from './either';
import { COVERAGE_INDEX, TOTALS_INDEX } from './constants';

Expand Down Expand Up @@ -98,6 +98,3 @@ function color(whichColor) {
return chalk[whichColor].bgWhiteBright(x);
};
}
function pretty(x) {
return JSON.stringify(x, null, 2);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
* under the License.
*/

import expect from '@kbn/expect';
import { spawn } from 'child_process';
import { resolve } from 'path';
import { green, always } from '../utils';

import { STATIC_SITE_URL_PROP_NAME, COVERAGE_INDEX } from '../constants';

const ROOT_DIR = resolve(__dirname, '../../../../..');
const MOCKS_DIR = resolve(__dirname, './mocks');
const staticSiteUrlRegexes = {
Expand All @@ -40,110 +37,43 @@ const env = {
NODE_ENV: 'integration_test',
COVERAGE_INGESTION_KIBANA_ROOT: '/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana',
};
const includesSiteUrlPredicate = x => x.includes(STATIC_SITE_URL_PROP_NAME);
const includesSiteUrlPredicate = x => x.includes('staticSiteUrl');
const siteUrlLines = specificLinesOnly(includesSiteUrlPredicate);
const splitByNewLine = x => x.split('\n');
const siteUrlsSplitByNewLine = siteUrlLines(splitByNewLine);
const siteUrlsSplitByNewLineWithoutBlanks = siteUrlsSplitByNewLine(notBlankLines);

describe('Ingesting Coverage to Cluster', () => {
const verboseArgs = [
'scripts/ingest_coverage.js',
'--verbose',
'--vcsInfoPath',
'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt',
'--path',
];

const noTotalsPath = 'jest-combined/coverage-summary-NO-total.json';
const verboseArgs = [
'scripts/ingest_coverage.js',
'--verbose',
'--vcsInfoPath',
'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt',
'--path',
];

describe('Ingesting coverage', () => {
const bothIndexesPath = 'jest-combined/coverage-summary-manual-mix.json';

describe('with NODE_ENV set to "integration_test"', () => {
describe(`and debug || verbose turned on`, () => {
describe(`to the [${COVERAGE_INDEX}] index`, () => {
const mutableCoverageIndexChunks = [];

beforeAll(done => {
const ingestAndMutateAsync = ingestAndMutate(done);
const ingestAndMutateAsyncWithPath = ingestAndMutateAsync(noTotalsPath);
const verboseIngestAndMutateAsyncWithPath = ingestAndMutateAsyncWithPath(verboseArgs);
verboseIngestAndMutateAsyncWithPath(mutableCoverageIndexChunks);
});

it(
'should result in every posted item having a site url that meets all regex assertions',
always(
siteUrlsSplitByNewLineWithoutBlanks(mutableCoverageIndexChunks).forEach(
expectAllRegexesToPass({
...staticSiteUrlRegexes,
endsInDotJsDotHtml: /.js.html$/,
})
)
)
);
});
describe(`to both indexes in the same push`, () => {
const mutableBothIndexesChunks = [];

beforeAll(done => {
const ingestAndMutateAsync = ingestAndMutate(done);
const ingestAndMutateAsyncWithPath = ingestAndMutateAsync(bothIndexesPath);
const verboseIngestAndMutateAsyncWithPath = ingestAndMutateAsyncWithPath(verboseArgs);
verboseIngestAndMutateAsyncWithPath(mutableBothIndexesChunks);
});
describe(`to the coverage index`, () => {
const mutableCoverageIndexChunks = [];

it(
'should result in every posted item having a site url that meets all regex assertions',
always(
siteUrlsSplitByNewLineWithoutBlanks(mutableBothIndexesChunks).forEach(
expectAllRegexesToPass(staticSiteUrlRegexes)
)
)
);

it('should result in the "just logging" message being present in the log', () => {
expect(mutableBothIndexesChunks.some(x => x.includes('Just Logging'))).to.be(true);
});
it('should result in the "actually sending" message NOT being present in the log', () => {
expect(mutableBothIndexesChunks.every(x => !x.includes('Actually sending...'))).to.be(
true
);
});
describe(`with provided vcs info file`, () => {
const filterZero = xs => included => xs.filter(x => x.includes(included))[0];
const filteredWith = filterZero(mutableBothIndexesChunks);
it('should have a vcs block', () => {
const vcs = 'vcs';
const portion = filteredWith(vcs);
expect(portion).to.contain(vcs);
});
it(`should have a branch`, () => {
const branch = `"branch":`;
const portion = filteredWith(branch);
expect(portion).to.contain(branch);
expect(portion).to.contain(`"origin/ingest-code-coverage"`);
});
it(`should have a sha`, () => {
const sha = `"sha":`;
const portion = filteredWith(sha);
expect(portion).to.contain(sha);
expect(portion).to.contain(`"f07b34f6206"`);
});
it(`should have an author`, () => {
const author = `"author":`;
const portion = filteredWith(author);
expect(portion).to.contain(author);
expect(portion).to.contain(`"Tre' Seymour"`);
});
it(`should have a commit msg, truncated`, () => {
const commitMsg = `"commitMsg":`;
const portion = filteredWith(commitMsg);
expect(portion).to.contain(commitMsg);
expect(portion).to.contain(`"Lorem :) ipsum Tre' λ dolor sit amet, consectetur ..."`);
});
});
});
beforeAll(done => {
const ingestAndMutateAsync = ingestAndMutate(done);
const ingestAndMutateAsyncWithPath = ingestAndMutateAsync(bothIndexesPath);
const verboseIngestAndMutateAsyncWithPath = ingestAndMutateAsyncWithPath(verboseArgs);
verboseIngestAndMutateAsyncWithPath(mutableCoverageIndexChunks);
});

it(
'should result in every posted item having a site url that meets all regex assertions',
always(
siteUrlsSplitByNewLineWithoutBlanks(mutableCoverageIndexChunks).forEach(
expectAllRegexesToPass({
...staticSiteUrlRegexes,
endsInDotJsDotHtml: /.js.html$/,
})
)
)
);
});
});

Expand Down
Loading

0 comments on commit 244da07

Please sign in to comment.