Skip to content

Commit bd5bbfc

Browse files
kibanamachineSpencerspalger
authored
[7.x] [dev-utils/ci-stats] support disabling ship errors (#90851) (#90885)
Co-authored-by: spalger <[email protected]> Co-authored-by: Spencer <[email protected]> Co-authored-by: spalger <[email protected]>
1 parent 7955e06 commit bd5bbfc

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

.ci/Jenkinsfile_security_cypress

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ kibanaPipeline(timeoutMinutes: 180) {
1010
) {
1111
catchError {
1212
withEnv([
13-
'CI_PARALLEL_PROCESS_NUMBER=1'
13+
'CI_PARALLEL_PROCESS_NUMBER=1',
14+
'IGNORE_SHIP_CI_STATS_ERROR=true',
1415
]) {
1516
def job = 'xpack-securityCypress'
1617

.ci/es-snapshots/Jenkinsfile_verify_es

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ kibanaPipeline(timeoutMinutes: 150) {
2626
message: "[${SNAPSHOT_VERSION}] ES Snapshot Verification Failure",
2727
) {
2828
retryable.enable(2)
29-
withEnv(["ES_SNAPSHOT_MANIFEST=${SNAPSHOT_MANIFEST}"]) {
29+
withEnv([
30+
"ES_SNAPSHOT_MANIFEST=${SNAPSHOT_MANIFEST}",
31+
'IGNORE_SHIP_CI_STATS_ERROR=true',
32+
]) {
3033
parallel([
3134
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
3235
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [

packages/kbn-dev-utils/src/ci_stats_reporter/ship_ci_stats_cli.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,18 @@ export function shipCiStatsCli() {
2222
throw createFlagError('expected --metrics to be a string');
2323
}
2424

25+
const maybeFail = (message: string) => {
26+
const error = createFailError(message);
27+
if (process.env.IGNORE_SHIP_CI_STATS_ERROR === 'true') {
28+
error.exitCode = 0;
29+
}
30+
return error;
31+
};
32+
2533
const reporter = CiStatsReporter.fromEnv(log);
2634

2735
if (!reporter.isEnabled()) {
28-
throw createFailError('unable to initilize the CI Stats reporter');
36+
throw maybeFail('unable to initilize the CI Stats reporter');
2937
}
3038

3139
for (const path of metricPaths) {
@@ -35,7 +43,7 @@ export function shipCiStatsCli() {
3543
if (await reporter.metrics(JSON.parse(json))) {
3644
log.success('shipped metrics from', path);
3745
} else {
38-
throw createFailError('failed to ship metrics');
46+
throw maybeFail('failed to ship metrics');
3947
}
4048
}
4149
},

0 commit comments

Comments
 (0)