@spinnaker/core 2025.4.1 → 2026.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { get, has } from 'lodash';
2
2
  import React from 'react';
3
3
  import type { Option } from 'react-select';
4
4
 
5
- import type { IExecution, IPipeline, IPipelineTrigger } from '../../../../domain';
5
+ import type { IExecution, IPipeline, IPipelineCommand, IPipelineTrigger } from '../../../../domain';
6
6
  import { ExecutionBuildTitle } from '../../../executionBuild/ExecutionBuildTitle';
7
7
  import type { ITriggerTemplateComponentProps } from '../../../manualExecution/TriggerTemplate';
8
8
  import { TetheredSelect } from '../../../../presentation/TetheredSelect';
@@ -51,8 +51,11 @@ export class PipelineTriggerTemplate extends React.Component<
51
51
  };
52
52
  }
53
53
 
54
- private initialize = () => {
55
- const { command } = this.props;
54
+ /**
55
+ * Fetches available executions for the source pipeline and sets up form state.
56
+ * @param command - Use when calling from componentWillReceiveProps to avoid stale props.
57
+ */
58
+ private initialize = (command: IPipelineCommand = this.props.command) => {
56
59
  command.triggerInvalid = true;
57
60
  const trigger = command.trigger as IPipelineTrigger;
58
61
 
@@ -77,9 +80,18 @@ export class PipelineTriggerTemplate extends React.Component<
77
80
  .then(this.executionLoadSuccess, this.executionLoadFailure);
78
81
  };
79
82
 
83
+ /**
84
+ * Only re-initialize when trigger.pipeline changes (user selects different source pipeline).
85
+ * Formik creates new command object references on every keystroke; comparing object
86
+ * references would reset the dropdown on any form field change.
87
+ */
80
88
  public componentWillReceiveProps(nextProps: ITriggerTemplateComponentProps) {
81
- if (nextProps.command !== this.props.command) {
82
- this.initialize();
89
+ const nextTrigger = nextProps.command.trigger as IPipelineTrigger;
90
+ const currentTrigger = this.props.command.trigger as IPipelineTrigger;
91
+
92
+ // Only re-initialize when the source pipeline actually changes
93
+ if (nextTrigger?.pipeline !== currentTrigger?.pipeline) {
94
+ this.initialize(nextProps.command);
83
95
  }
84
96
  }
85
97
 
@@ -9,6 +9,7 @@ import { MigrationTag } from './MigrationTag';
9
9
  import { AccountTag } from '../../../account';
10
10
  import type { Application } from '../../../application/application.model';
11
11
  import { CollapsibleSectionStateCache } from '../../../cache';
12
+ import { PipelineConfigService } from '../../config/services/PipelineConfigService';
12
13
  import { SETTINGS } from '../../../config/settings';
13
14
  import { PipelineTemplateReader, PipelineTemplateV2Service } from '../../config/templates';
14
15
  import type {
@@ -153,7 +154,9 @@ export class ExecutionGroup extends React.PureComponent<IExecutionGroupProps, IE
153
154
  .then((plan) => resolve(plan))
154
155
  .catch(() => resolve(config));
155
156
  } else {
156
- resolve(config);
157
+ PipelineConfigService.getPipelineForApplication(this.props.application.name, config.name)
158
+ .then((pipeline) => resolve(pipeline))
159
+ .catch(() => resolve(config));
157
160
  }
158
161
  }),
159
162
  )