Skip to content

Commit

Permalink
feat(pipeline): added feature flag for pipeline when mj stage child (…
Browse files Browse the repository at this point in the history
…backport #9914) (#9920)

* feat(pipeline): added feature flag for pipeline when mj stage child (#9914)

* feat(pipeline): added feature flag for pipeline when mj stage child

* fix(pipeline): added verification for sub pipe data

* added guard verification for undefined data

Co-authored-by: Fernando Freire <fernando.freire@armory.io>
(cherry picked from commit 4b6fd53)

# Conflicts:
#	packages/core/src/pipeline/executions/execution/ExecutionMarker.tsx

* fix(backport/changes): resolved merge conflicts (#9922)

Co-authored-by: Oscar Michel Herrera <oscarmichelh@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mergify[bot] and OscarMichelH authored Dec 6, 2022
1 parent 4c52558 commit f889c71
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions halconfig/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var defaultMetricsStore = '{%canary.defaultMetricsStore%}';
var defaultMetricsAccountName = '{%canary.defaultMetricsAccount%}';
var defaultStorageAccountName = '{%canary.defaultStorageAccount%}';
var fiatEnabled = '{%features.fiat%}' === 'true';
var manualJudgmentParentPipelineEnabled = '{%features.manualJudgmentParentPipeline%}' === 'true';
var mineCanaryEnabled = '{%features.mineCanary%}' === 'true';
var pipelineTemplatesEnabled = '{%features.pipelineTemplates%}' === 'true';
var reduxLoggerEnabled = '{%canary.reduxLogger%}' === 'true';
Expand Down
2 changes: 2 additions & 0 deletions packages/app/src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ 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 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 @@ -117,6 +118,7 @@ window.spinnakerSettings = {
mdGitIntegration: mdGitIntegrationEnabled,
managedServiceAccounts: managedServiceAccountsEnabled,
managedResources: managedResourcesEnabled,
manualJudgmentParentPipeline: manualJudgmentParentPipelineEnabled,
notifications: false,
pagerDuty: false,
pipelineTemplates: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { OrchestratedItemRunningTime } from './OrchestratedItemRunningTime';
import type { Application } from '../../../application/application.model';
import { SETTINGS } from '../../../config/settings';
import { ExecutionBarLabel } from '../../config/stages/common/ExecutionBarLabel';
import type { IExecution, IExecutionStageSummary } from '../../../domain';
import type { IExecution, IExecutionStageSummary, IStage } from '../../../domain';
import { logger } from '../../../utils';
import { duration } from '../../../utils/timeFormatters';

Expand Down Expand Up @@ -94,7 +94,25 @@ export class ExecutionMarker extends React.Component<IExecutionMarkerProps, IExe

public render() {
const { stage, application, execution, active, previousStageActive, width } = this.props;
const stageType = (stage.activeStageType || stage.type).toLowerCase(); // support groups
let stageType = (stage.activeStageType || stage.type).toLowerCase(); // support groups
if (SETTINGS.feature.manualJudgmentParentPipeline) {
stage.stages.forEach((childStage: IStage) => {
if (
childStage.type == 'pipeline' &&
application.executions != undefined &&
application.executions.data != undefined
) {
const childPipeline = application.executions.data.find((p: any) => p.id === childStage.context.executionId);
if (childPipeline != undefined) {
childPipeline.stages.forEach((stageToCheck: IStage) => {
if (stageToCheck.type == 'manualJudgment' && stageToCheck.status == 'RUNNING') {
stageType = 'manualjudgment';
}
});
}
}
});
}
const pipelineStatus = this.stageStatus(stage.status.toLowerCase());
const markerClassName = [
stage.type !== 'group' ? 'clickable' : '',
Expand Down

0 comments on commit f889c71

Please sign in to comment.