From 3b8b22aaf8ae66457212fa617718f73f0e675349 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 3 Feb 2023 11:13:51 -0500 Subject: [PATCH] fix(timeout): Added feature flag for rollback timeout ui input. (backport #9937) (#9940) * fix(timeout): Added feature flag for rollback timeout ui input. (#9937) * fix(timeout): Added feature flag for rollback timeout ui input. * fix(timeout): Added feature flag for rollback timeout ui input. (cherry picked from commit e239be3dbf63dacca84de25901eec708353d3490) # Conflicts: # packages/amazon/src/pipeline/stages/rollbackCluster/rollbackClusterStage.html * fix(timeout): Added feature flag for rollback timeout ui input. (#9942) --------- Co-authored-by: DanielaS12 <111055962+DanielaS12@users.noreply.github.com> --- halconfig/settings.js | 2 ++ .../stages/rollbackCluster/awsRollbackClusterStage.js | 4 +++- .../stages/rollbackCluster/rollbackClusterStage.html | 11 +++++++++++ packages/app/src/settings.js | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/halconfig/settings.js b/halconfig/settings.js index c91a282f308..039ea00f95c 100644 --- a/halconfig/settings.js +++ b/halconfig/settings.js @@ -18,6 +18,7 @@ var mineCanaryEnabled = '{%features.mineCanary%}' === 'true'; var pipelineTemplatesEnabled = '{%features.pipelineTemplates%}' === 'true'; var reduxLoggerEnabled = '{%canary.reduxLogger%}' === 'true'; var showAllConfigsEnabled = '{%canary.showAllCanaryConfigs%}' === 'true'; +var dynamicRollbackTimeoutEnabled = '{%feature.dynamicRollbackTimeout%}' === 'true'; var slack = { botName: '{%notifications.slack.botName%}', enabled: '{%notifications.slack.enabled%}' === 'true', @@ -116,6 +117,7 @@ window.spinnakerSettings = { fiatEnabled: fiatEnabled, pipelineTemplates: pipelineTemplatesEnabled, roscoMode: true, + dynamicRollbackTimeout: dynamicRollbackTimeoutEnabled, }, gateUrl: gateHost, notifications: { diff --git a/packages/amazon/src/pipeline/stages/rollbackCluster/awsRollbackClusterStage.js b/packages/amazon/src/pipeline/stages/rollbackCluster/awsRollbackClusterStage.js index d28ebc21b31..f6dd1c3ff77 100644 --- a/packages/amazon/src/pipeline/stages/rollbackCluster/awsRollbackClusterStage.js +++ b/packages/amazon/src/pipeline/stages/rollbackCluster/awsRollbackClusterStage.js @@ -2,7 +2,7 @@ import { module } from 'angular'; -import { AccountService, Registry } from '@spinnaker/core'; +import { AccountService, Registry, SETTINGS } from '@spinnaker/core'; export const AMAZON_PIPELINE_STAGES_ROLLBACKCLUSTER_AWSROLLBACKCLUSTERSTAGE = 'spinnaker.amazon.pipeline.stage.rollbackClusterStage'; @@ -60,5 +60,7 @@ module(AMAZON_PIPELINE_STAGES_ROLLBACKCLUSTER_AWSROLLBACKCLUSTERSTAGE, []) if (!stage.regions.length && $scope.application.defaultRegions.aws) { stage.regions.push($scope.application.defaultRegions.aws); } + + $scope.viewState.dynamicRollbackTimeout = SETTINGS.feature.dynamicRollbackTimeout; }, ]); diff --git a/packages/amazon/src/pipeline/stages/rollbackCluster/rollbackClusterStage.html b/packages/amazon/src/pipeline/stages/rollbackCluster/rollbackClusterStage.html index cbd2cc8a890..2d25e4ea341 100644 --- a/packages/amazon/src/pipeline/stages/rollbackCluster/rollbackClusterStage.html +++ b/packages/amazon/src/pipeline/stages/rollbackCluster/rollbackClusterStage.html @@ -28,5 +28,16 @@ /> percent of instances are healthy. +
+ Rollback Timeout is + + minutes. +
diff --git a/packages/app/src/settings.js b/packages/app/src/settings.js index 82018571e8a..8eef00571af 100644 --- a/packages/app/src/settings.js +++ b/packages/app/src/settings.js @@ -63,6 +63,7 @@ const k8sRawResourcesEnabled = import.meta.env.VITE_K8S_RAW_RESOURCES_ENABLED === 'true' || process.env.K8S_RAW_RESOURCES_ENABLED === 'true' || false; +const dynamicRollbackTimeoutEnabled = import.meta.env.DYNAMIC_ROLLBACK_TIMEOUT_ENABLED === 'true' || false; window.spinnakerSettings = { authEnabled: authEnabled, @@ -119,6 +120,7 @@ window.spinnakerSettings = { managedServiceAccounts: managedServiceAccountsEnabled, managedResources: managedResourcesEnabled, manualJudgmentParentPipeline: manualJudgmentParentPipelineEnabled, + dynamicRollbackTimeout: dynamicRollbackTimeoutEnabled, notifications: false, pagerDuty: false, pipelineTemplates: false,