mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
parent
97c8e0e0cd
commit
c5f682cbbc
14 changed files with 2682 additions and 2182 deletions
96
Jenkinsfile
vendored
96
Jenkinsfile
vendored
|
@ -4,54 +4,56 @@ library 'kibana-pipeline-library'
|
|||
kibanaLibrary.load()
|
||||
|
||||
kibanaPipeline(timeoutMinutes: 135, checkPrChanges: true) {
|
||||
githubPr.withDefaultPrComments {
|
||||
catchError {
|
||||
retryable.enable()
|
||||
parallel([
|
||||
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
|
||||
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
|
||||
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
|
||||
// 'oss-firefoxSmoke': kibanaPipeline.functionalTestProcess('kibana-firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh'),
|
||||
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
|
||||
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
|
||||
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
|
||||
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
|
||||
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
|
||||
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
|
||||
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
|
||||
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
|
||||
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
|
||||
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
|
||||
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
|
||||
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
|
||||
'oss-accessibility': kibanaPipeline.functionalTestProcess('kibana-accessibility', './test/scripts/jenkins_accessibility.sh'),
|
||||
// 'oss-visualRegression': kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh'),
|
||||
]),
|
||||
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
|
||||
// 'xpack-firefoxSmoke': kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh'),
|
||||
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
|
||||
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
|
||||
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
|
||||
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
|
||||
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
|
||||
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
|
||||
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
|
||||
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
|
||||
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
|
||||
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
|
||||
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
|
||||
'xpack-siemCypress': { processNumber ->
|
||||
whenChanged(['x-pack/legacy/plugins/siem/', 'x-pack/test/siem_cypress/']) {
|
||||
kibanaPipeline.functionalTestProcess('xpack-siemCypress', './test/scripts/jenkins_siem_cypress.sh')(processNumber)
|
||||
}
|
||||
},
|
||||
ciStats.trackBuild {
|
||||
githubPr.withDefaultPrComments {
|
||||
catchError {
|
||||
retryable.enable()
|
||||
parallel([
|
||||
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
|
||||
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
|
||||
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
|
||||
// 'oss-firefoxSmoke': kibanaPipeline.functionalTestProcess('kibana-firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh'),
|
||||
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
|
||||
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
|
||||
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
|
||||
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
|
||||
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
|
||||
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
|
||||
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
|
||||
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
|
||||
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
|
||||
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
|
||||
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
|
||||
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
|
||||
'oss-accessibility': kibanaPipeline.functionalTestProcess('kibana-accessibility', './test/scripts/jenkins_accessibility.sh'),
|
||||
// 'oss-visualRegression': kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh'),
|
||||
]),
|
||||
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
|
||||
// 'xpack-firefoxSmoke': kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh'),
|
||||
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
|
||||
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
|
||||
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
|
||||
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
|
||||
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
|
||||
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
|
||||
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
|
||||
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
|
||||
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
|
||||
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
|
||||
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
|
||||
'xpack-siemCypress': { processNumber ->
|
||||
whenChanged(['x-pack/legacy/plugins/siem/', 'x-pack/test/siem_cypress/']) {
|
||||
kibanaPipeline.functionalTestProcess('xpack-siemCypress', './test/scripts/jenkins_siem_cypress.sh')(processNumber)
|
||||
}
|
||||
},
|
||||
|
||||
// 'xpack-visualRegression': kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh'),
|
||||
]),
|
||||
])
|
||||
// 'xpack-visualRegression': kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh'),
|
||||
]),
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
retryable.printFlakyFailures()
|
||||
kibanaPipeline.sendMail()
|
||||
retryable.printFlakyFailures()
|
||||
kibanaPipeline.sendMail()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"kbn:watch": "yarn build --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.19.0",
|
||||
"chalk": "^2.4.2",
|
||||
"dedent": "^0.7.0",
|
||||
"execa": "^4.0.0",
|
||||
|
|
23
packages/kbn-dev-utils/src/ci_stats_reporter/README.md
Normal file
23
packages/kbn-dev-utils/src/ci_stats_reporter/README.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Kibana CI Stats reporter
|
||||
|
||||
We're working on building a new service, the Kibana CI Stats service, which will collect information about CI runs and metrics produced while testing Kibana, and then provide tools for reporting on those metrics in specific PRs and overall as a way to spot trends.
|
||||
|
||||
### `CiStatsReporter`
|
||||
|
||||
This class integrates with the `ciStats.trackBuild {}` Jenkins Pipeline function, consuming the `KIBANA_CI_STATS_CONFIG` variable produced by that wrapper, and then allowing test code to report stats to the service.
|
||||
|
||||
To create an instance of the reporter, import the class and call `CiStatsReporter.fromEnv(log)` (passing it a tooling log).
|
||||
|
||||
#### `CiStatsReporter#metric(name: string, subName: string, value: number)`
|
||||
|
||||
Use this method to record metrics in the Kibana CI Stats service.
|
||||
|
||||
Example:
|
||||
|
||||
```ts
|
||||
import { CiStatsReporter, ToolingLog } from '@kbn/dev-utils';
|
||||
|
||||
const log = new ToolingLog(...);
|
||||
const reporter = CiStatsReporter.fromEnv(log)
|
||||
reporter.metric('Build speed', specificBuildName, timeToRunBuild)
|
||||
```
|
|
@ -0,0 +1,153 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { inspect } from 'util';
|
||||
|
||||
import Axios from 'axios';
|
||||
|
||||
import { ToolingLog } from '../tooling_log';
|
||||
|
||||
interface Config {
|
||||
apiUrl: string;
|
||||
apiToken: string;
|
||||
buildId: string;
|
||||
}
|
||||
|
||||
function parseConfig(log: ToolingLog) {
|
||||
const configJson = process.env.KIBANA_CI_STATS_CONFIG;
|
||||
if (!configJson) {
|
||||
log.debug('KIBANA_CI_STATS_CONFIG environment variable not found, disabling CiStatsReporter');
|
||||
return;
|
||||
}
|
||||
|
||||
let config: unknown;
|
||||
try {
|
||||
config = JSON.parse(configJson);
|
||||
} catch (_) {
|
||||
// handled below
|
||||
}
|
||||
|
||||
if (typeof config === 'object' && config !== null) {
|
||||
return validateConfig(log, config as { [k in keyof Config]: unknown });
|
||||
}
|
||||
|
||||
log.warning('KIBANA_CI_STATS_CONFIG is invalid, stats will not be reported');
|
||||
return;
|
||||
}
|
||||
|
||||
function validateConfig(log: ToolingLog, config: { [k in keyof Config]: unknown }) {
|
||||
const validApiUrl = typeof config.apiUrl === 'string' && config.apiUrl.length !== 0;
|
||||
if (!validApiUrl) {
|
||||
log.warning('KIBANA_CI_STATS_CONFIG is missing a valid api url, stats will not be reported');
|
||||
return;
|
||||
}
|
||||
|
||||
const validApiToken = typeof config.apiToken === 'string' && config.apiToken.length !== 0;
|
||||
if (!validApiToken) {
|
||||
log.warning('KIBANA_CI_STATS_CONFIG is missing a valid api token, stats will not be reported');
|
||||
return;
|
||||
}
|
||||
|
||||
const validId = typeof config.buildId === 'string' && config.buildId.length !== 0;
|
||||
if (!validId) {
|
||||
log.warning('KIBANA_CI_STATS_CONFIG is missing a valid build id, stats will not be reported');
|
||||
return;
|
||||
}
|
||||
|
||||
return config as Config;
|
||||
}
|
||||
|
||||
export class CiStatsReporter {
|
||||
static fromEnv(log: ToolingLog) {
|
||||
return new CiStatsReporter(parseConfig(log), log);
|
||||
}
|
||||
|
||||
constructor(private config: Config | undefined, private log: ToolingLog) {}
|
||||
|
||||
isEnabled() {
|
||||
return !!this.config;
|
||||
}
|
||||
|
||||
async metric(name: string, subName: string, value: number) {
|
||||
if (!this.config) {
|
||||
return;
|
||||
}
|
||||
|
||||
let attempt = 0;
|
||||
const maxAttempts = 5;
|
||||
|
||||
while (true) {
|
||||
attempt += 1;
|
||||
|
||||
try {
|
||||
await Axios.request({
|
||||
method: 'POST',
|
||||
url: '/metric',
|
||||
baseURL: this.config.apiUrl,
|
||||
params: {
|
||||
buildId: this.config.buildId,
|
||||
},
|
||||
headers: {
|
||||
Authorization: `token ${this.config.apiToken}`,
|
||||
},
|
||||
data: {
|
||||
name,
|
||||
subName,
|
||||
value,
|
||||
},
|
||||
});
|
||||
|
||||
return;
|
||||
} catch (error) {
|
||||
if (!error?.request) {
|
||||
// not an axios error, must be a usage error that we should notify user about
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (error?.response && error.response.status !== 502) {
|
||||
// error response from service was received so warn the user and move on
|
||||
this.log.warning(
|
||||
`error recording metric [status=${error.response.status}] [resp=${inspect(
|
||||
error.response.data
|
||||
)}] [${name}/${subName}=${value}]`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (attempt === maxAttempts) {
|
||||
this.log.warning(
|
||||
`failed to reach kibana-ci-stats service too many times, unable to record metric [${name}/${subName}=${value}]`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// we failed to reach the backend and we have remaining attempts, lets retry after a short delay
|
||||
const reason = error?.response?.status
|
||||
? `${error.response.status} response`
|
||||
: 'no response';
|
||||
|
||||
this.log.warning(
|
||||
`failed to reach kibana-ci-stats service [reason=${reason}], retrying in ${attempt} seconds`
|
||||
);
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, attempt * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
20
packages/kbn-dev-utils/src/ci_stats_reporter/index.ts
Normal file
20
packages/kbn-dev-utils/src/ci_stats_reporter/index.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './ci_stats_reporter';
|
|
@ -37,3 +37,4 @@ export { run, createFailError, createFlagError, combineErrors, isFailError, Flag
|
|||
export { REPO_ROOT } from './repo_root';
|
||||
export { KbnClient } from './kbn_client';
|
||||
export * from './axios';
|
||||
export * from './ci_stats_reporter';
|
||||
|
|
|
@ -21,10 +21,11 @@ import 'source-map-support/register';
|
|||
|
||||
import Path from 'path';
|
||||
|
||||
import { run, REPO_ROOT, createFlagError } from '@kbn/dev-utils';
|
||||
import { run, REPO_ROOT, createFlagError, createFailError, CiStatsReporter } from '@kbn/dev-utils';
|
||||
|
||||
import { logOptimizerState } from './log_optimizer_state';
|
||||
import { OptimizerConfig } from './optimizer';
|
||||
import { reportOptimizerStats } from './report_optimizer_stats';
|
||||
import { runOptimizer } from './run_optimizer';
|
||||
|
||||
run(
|
||||
|
@ -76,6 +77,11 @@ run(
|
|||
throw createFlagError('expected --scan-dir to be a string');
|
||||
}
|
||||
|
||||
const reportStatsName = flags['report-stats'];
|
||||
if (reportStatsName !== undefined && typeof reportStatsName !== 'string') {
|
||||
throw createFlagError('expected --report-stats to be a string');
|
||||
}
|
||||
|
||||
const config = OptimizerConfig.create({
|
||||
repoRoot: REPO_ROOT,
|
||||
watch,
|
||||
|
@ -89,14 +95,24 @@ run(
|
|||
inspectWorkers,
|
||||
});
|
||||
|
||||
await runOptimizer(config)
|
||||
.pipe(logOptimizerState(log, config))
|
||||
.toPromise();
|
||||
let update$ = runOptimizer(config);
|
||||
|
||||
if (reportStatsName) {
|
||||
const reporter = CiStatsReporter.fromEnv(log);
|
||||
|
||||
if (!reporter.isEnabled()) {
|
||||
throw createFailError('Unable to initialize CiStatsReporter from env');
|
||||
}
|
||||
|
||||
update$ = update$.pipe(reportOptimizerStats(reporter, reportStatsName));
|
||||
}
|
||||
|
||||
await update$.pipe(logOptimizerState(log, config)).toPromise();
|
||||
},
|
||||
{
|
||||
flags: {
|
||||
boolean: ['watch', 'oss', 'examples', 'dist', 'cache', 'profile', 'inspect-workers'],
|
||||
string: ['workers', 'scan-dir'],
|
||||
string: ['workers', 'scan-dir', 'report-stats'],
|
||||
default: {
|
||||
examples: true,
|
||||
cache: true,
|
||||
|
@ -112,6 +128,7 @@ run(
|
|||
--dist create bundles that are suitable for inclusion in the Kibana distributable
|
||||
--scan-dir add a directory to the list of directories scanned for plugins (specify as many times as necessary)
|
||||
--no-inspect-workers when inspecting the parent process, don't inspect the workers
|
||||
--report-stats=[name] attempt to report stats about this execution of the build to the kibana-ci-stats service using this name
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -21,3 +21,4 @@ export { OptimizerConfig } from './optimizer';
|
|||
export * from './run_optimizer';
|
||||
export * from './log_optimizer_state';
|
||||
export * from './common/disallowed_syntax_plugin';
|
||||
export * from './report_optimizer_stats';
|
||||
|
|
|
@ -17,20 +17,20 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import * as Rx from 'rxjs';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { createFailError } from '@kbn/dev-utils';
|
||||
|
||||
import { pipeClosure, Update } from '../common';
|
||||
import { pipeClosure } from '../common';
|
||||
import { OptimizerUpdate$ } from '../run_optimizer';
|
||||
|
||||
import { OptimizerState } from './optimizer_state';
|
||||
import { OptimizerConfig } from './optimizer_config';
|
||||
|
||||
export function handleOptimizerCompletion(config: OptimizerConfig) {
|
||||
return pipeClosure((source$: Rx.Observable<Update<any, OptimizerState>>) => {
|
||||
return pipeClosure((update$: OptimizerUpdate$) => {
|
||||
let prevState: OptimizerState | undefined;
|
||||
|
||||
return source$.pipe(
|
||||
return update$.pipe(
|
||||
tap({
|
||||
next: update => {
|
||||
prevState = update.state;
|
||||
|
|
46
packages/kbn-optimizer/src/report_optimizer_stats.ts
Normal file
46
packages/kbn-optimizer/src/report_optimizer_stats.ts
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { materialize, mergeMap, dematerialize } from 'rxjs/operators';
|
||||
import { CiStatsReporter } from '@kbn/dev-utils';
|
||||
|
||||
import { OptimizerUpdate$ } from './run_optimizer';
|
||||
import { OptimizerState } from './optimizer';
|
||||
import { pipeClosure } from './common';
|
||||
|
||||
export function reportOptimizerStats(reporter: CiStatsReporter, name: string) {
|
||||
return pipeClosure((update$: OptimizerUpdate$) => {
|
||||
let lastState: OptimizerState | undefined;
|
||||
return update$.pipe(
|
||||
materialize(),
|
||||
mergeMap(async n => {
|
||||
if (n.kind === 'N' && n.value?.state) {
|
||||
lastState = n.value?.state;
|
||||
}
|
||||
|
||||
if (n.kind === 'C' && lastState) {
|
||||
await reporter.metric('@kbn/optimizer build time', name, lastState.durSec);
|
||||
}
|
||||
|
||||
return n;
|
||||
}),
|
||||
dematerialize()
|
||||
);
|
||||
});
|
||||
}
|
4442
packages/kbn-pm/dist/index.js
vendored
4442
packages/kbn-pm/dist/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -17,7 +17,13 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { runOptimizer, OptimizerConfig, logOptimizerState } from '@kbn/optimizer';
|
||||
import { CiStatsReporter } from '@kbn/dev-utils';
|
||||
import {
|
||||
runOptimizer,
|
||||
OptimizerConfig,
|
||||
logOptimizerState,
|
||||
reportOptimizerStats,
|
||||
} from '@kbn/optimizer';
|
||||
|
||||
export const BuildKibanaPlatformPluginsTask = {
|
||||
description: 'Building distributable versions of Kibana platform plugins',
|
||||
|
@ -31,8 +37,14 @@ export const BuildKibanaPlatformPluginsTask = {
|
|||
dist: true,
|
||||
});
|
||||
|
||||
const reporter = CiStatsReporter.fromEnv(log);
|
||||
const reportStatsName = build.isOss() ? 'oss distributable' : 'default distributable';
|
||||
|
||||
await runOptimizer(optimizerConfig)
|
||||
.pipe(logOptimizerState(log, optimizerConfig))
|
||||
.pipe(
|
||||
reportOptimizerStats(reporter, reportStatsName),
|
||||
logOptimizerState(log, optimizerConfig)
|
||||
)
|
||||
.toPromise();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -57,6 +57,26 @@ def base(Map params, Closure closure) {
|
|||
// Try to clone from Github up to 8 times, waiting 15 secs between attempts
|
||||
retryWithDelay(8, 15) {
|
||||
scmVars = checkout scm
|
||||
|
||||
def mergeBase
|
||||
if (env.ghprbTargetBranch) {
|
||||
sh(
|
||||
script: "cd kibana && git fetch origin ${env.ghprbTargetBranch}",
|
||||
label: "update reference to target branch 'origin/${env.ghprbTargetBranch}'"
|
||||
)
|
||||
mergeBase = sh(
|
||||
script: "cd kibana && git merge-base HEAD FETCH_HEAD",
|
||||
label: "determining merge point with target branch 'origin/${env.ghprbTargetBranch}'",
|
||||
returnStdout: true
|
||||
).trim()
|
||||
}
|
||||
|
||||
ciStats.reportGitInfo(
|
||||
env.ghprbSourceBranch ?: scmVars.GIT_LOCAL_BRANCH ?: scmVars.GIT_BRANCH,
|
||||
scmVars.GIT_COMMIT,
|
||||
env.ghprbTargetBranch,
|
||||
mergeBase
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -8038,15 +8038,7 @@ axios@^0.18.0:
|
|||
follow-redirects "1.5.10"
|
||||
is-buffer "^2.0.2"
|
||||
|
||||
axios@^0.19.0:
|
||||
version "0.19.0"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.0.tgz#8e09bff3d9122e133f7b8101c8fbdd00ed3d2ab8"
|
||||
integrity sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==
|
||||
dependencies:
|
||||
follow-redirects "1.5.10"
|
||||
is-buffer "^2.0.2"
|
||||
|
||||
axios@^0.19.2:
|
||||
axios@^0.19.0, axios@^0.19.2:
|
||||
version "0.19.2"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
|
||||
integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue