Skip to content

Commit

Permalink
feat: Add feature flag for multi block failure messages. (backport #1…
Browse files Browse the repository at this point in the history
…0061) (#10062)

* feat: Add feature flag for multi block failure messages. (#10061)

(cherry picked from commit 374f724)

# Conflicts:
#	packages/app/src/settings.js
#	packages/kubernetes/src/pipelines/stages/deployManifest/manifestStatus/DeployStatus.tsx

* fix: Fix conflicts

---------

Co-authored-by: armory-abedonik <[email protected]>
Co-authored-by: Ovidiu Popa <[email protected]>
  • Loading branch information
3 people authored Nov 23, 2023
1 parent 43436ee commit 0d188f1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
7 changes: 6 additions & 1 deletion packages/app/src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ const managedServiceAccountsEnabled =
process.env.MANAGED_SERVICE_ACCOUNTS_ENABLED === 'true';
const managedResourcesEnabled =
import.meta.env.VITE_MANAGED_RESOURCES_ENABLED === 'true' || process.env.MANAGED_RESOURCES_ENABLED === 'true';
const manualJudgmentParentPipelineEnabled = import.meta.env.MJ_PARENTPIPELINE_ENABLED === 'true' || false;
const manualJudgmentParentPipelineEnabled = import.meta.env.MJ_PARENTPIPELINE_ENABLED !== 'false';
const multiBlockFailureMessagesEnabled =
import.meta.env.MULTI_BLOCK_FAILURE_MESSAGES_ENABLED === 'true' ||
process.env.MULTI_BLOCK_FAILURE_MESSAGES_ENABLED === 'true' ||
false;
const onDemandClusterThreshold =
import.meta.env.VITE_ON_DEMAND_CLUSTER_THRESHOLD || process.env.ON_DEMAND_CLUSTER_THRESHOLD || '350';
const reduxLoggerEnabled = import.meta.env.VITE_REDUX_LOGGER === 'true' || process.env.REDUX_LOGGER === 'true';
Expand Down Expand Up @@ -122,6 +126,7 @@ window.spinnakerSettings = {
managedServiceAccounts: managedServiceAccountsEnabled,
managedResources: managedResourcesEnabled,
manualJudgmentParentPipeline: manualJudgmentParentPipelineEnabled,
multiBlockFailureMessages: multiBlockFailureMessagesEnabled,
dynamicRollbackTimeout: dynamicRollbackTimeoutEnabled,
notifications: false,
pagerDuty: false,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/config/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface IFeatures {
mdGitIntegration?: boolean;
managedServiceAccounts?: boolean;
managedResources?: boolean;
multiBlockFailureMessages?: boolean;
notifications?: boolean;
pagerDuty?: boolean;
pipelines?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { get } from 'lodash';
import React from 'react';

import type { IExecutionDetailsSectionProps, IManifest } from '@spinnaker/core';
import { CollapsibleElement, ExecutionDetailsSection, StageFailureMessage } from '@spinnaker/core';
import { CollapsibleElement, ExecutionDetailsSection, SETTINGS, StageFailureMessage } from '@spinnaker/core';

import { ManifestStatus } from './ManifestStatus';
import type { IStageManifest } from '../../../../manifest/manifest.service';
Expand Down Expand Up @@ -91,11 +91,15 @@ export class DeployStatus extends React.Component<IExecutionDetailsSectionProps,
return (
<div className="deploy-status">
<ExecutionDetailsSection name={sectionName} current={currentSection}>
{stage.failureMessages.map((failureMessage) => (
<CollapsibleElement key={failureMessage} maxHeight={150}>
<StageFailureMessage stage={stage} message={failureMessage} />
</CollapsibleElement>
))}
{SETTINGS.feature.multiBlockFailureMessages ? (
stage.failureMessages.map((failureMessage) => (
<CollapsibleElement key={failureMessage} maxHeight={150}>
<StageFailureMessage stage={stage} message={failureMessage} />
</CollapsibleElement>
))
) : (
<StageFailureMessage stage={stage} message={stage.failureMessage} />
)}
{!!manifests?.length && (
<div className="row">
<div className="col-md-12">
Expand Down

0 comments on commit 0d188f1

Please sign in to comment.