From 9042e0f0ad58727ee20e699a4ec1d976e918468e Mon Sep 17 00:00:00 2001 From: Josh Dover Date: Wed, 9 Sep 2020 16:23:42 -0600 Subject: [PATCH] Skip status updates on manual migrations in CI --- .../migrations/kibana/kibana_migrator.ts | 12 ++++++++++-- src/core/server/status/get_summary_status.ts | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/core/server/saved_objects/migrations/kibana/kibana_migrator.ts b/src/core/server/saved_objects/migrations/kibana/kibana_migrator.ts index b9f24a75c01d2..18a385c6994b8 100644 --- a/src/core/server/saved_objects/migrations/kibana/kibana_migrator.ts +++ b/src/core/server/saved_objects/migrations/kibana/kibana_migrator.ts @@ -120,9 +120,17 @@ export class KibanaMigrator { Array<{ status: string }> > { if (this.migrationResult === undefined || rerun) { - this.status$.next({ status: 'running' }); + // Reruns are only used by CI / EsArchiver. Publishing status updates on reruns results in slowing down CI + // unnecessarily, so we skip it in this case. + if (!rerun) { + this.status$.next({ status: 'running' }); + } + this.migrationResult = this.runMigrationsInternal().then((result) => { - this.status$.next({ status: 'completed', result }); + // Similar to above, don't publish status updates when rerunning in CI. + if (!rerun) { + this.status$.next({ status: 'completed', result }); + } return result; }); } diff --git a/src/core/server/status/get_summary_status.ts b/src/core/server/status/get_summary_status.ts index 456a2ed84ed58..8d97cdbd9b15b 100644 --- a/src/core/server/status/get_summary_status.ts +++ b/src/core/server/status/get_summary_status.ts @@ -52,7 +52,7 @@ export const getSummaryStatus = ( // TODO: include URL to status page detail: `See the status page for more information`, meta: { - affectedServices: Object.fromEntries([...highestStatuses]), + affectedServices: Object.fromEntries(highestStatuses), }, }; }