Skip to content

Commit

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

* 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 <[email protected]>
(cherry picked from commit 4b6fd53)

Co-authored-by: Oscar Michel Herrera <[email protected]>
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 ab3cb6e commit 30cb2e2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 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
28 changes: 17 additions & 11 deletions packages/core/src/pipeline/executions/execution/ExecutionMarker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,24 @@ export class ExecutionMarker extends React.Component<IExecutionMarkerProps, IExe
public render() {
const { stage, application, execution, active, previousStageActive, width } = this.props;
let stageType = (stage.activeStageType || stage.type).toLowerCase(); // support groups
stage.stages.forEach((childStage: IStage) => {
if (childStage.type == 'pipeline') {
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';
}
});
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 30cb2e2

Please sign in to comment.