diff --git a/packages/app/src/settings.js b/packages/app/src/settings.js index 6736b825d60..8e63c28777e 100644 --- a/packages/app/src/settings.js +++ b/packages/app/src/settings.js @@ -148,6 +148,7 @@ window.spinnakerSettings = { defaultManifest: 'spinnaker.yml', manifestBasePath: '.spinnaker', }, + maxFetchHistoryOnEvaluateVariables: 100, maxPipelineAgeDays: 14, newApplicationDefaults: { chaosMonkey: false, diff --git a/packages/core/src/config/settings.ts b/packages/core/src/config/settings.ts index 733b8eaf2cf..8cfaea047ba 100644 --- a/packages/core/src/config/settings.ts +++ b/packages/core/src/config/settings.ts @@ -127,6 +127,7 @@ export interface ISpinnakerSettings { manifestBasePath: string; urls?: Partial; }; + maxFetchHistoryOnEvaluateVariables?: number; maxPipelineAgeDays: number; newApplicationDefaults: INewApplicationDefaults; notifications: INotificationSettings; @@ -175,6 +176,7 @@ SETTINGS.managedDelivery = SETTINGS.managedDelivery || { defaultManifest: 'spinnaker.yml', manifestBasePath: '.spinnaker', }; +SETTINGS.maxFetchHistoryOnEvaluateVariables = SETTINGS.maxFetchHistoryOnEvaluateVariables ?? 100; // A helper to make resetting settings to steady state after running tests easier const originalSettings: ISpinnakerSettings = cloneDeep(SETTINGS); diff --git a/packages/core/src/pipeline/config/stages/evaluateVariables/ExecutionAndStagePicker.tsx b/packages/core/src/pipeline/config/stages/evaluateVariables/ExecutionAndStagePicker.tsx index 60065fdbf11..fd722e9d954 100644 --- a/packages/core/src/pipeline/config/stages/evaluateVariables/ExecutionAndStagePicker.tsx +++ b/packages/core/src/pipeline/config/stages/evaluateVariables/ExecutionAndStagePicker.tsx @@ -2,6 +2,7 @@ import { isEqual, keyBy } from 'lodash'; import React from 'react'; import type { Option } from 'react-select'; +import { SETTINGS } from '../../../../config'; import type { IExecution, IPipeline, IStage } from '../../../../domain'; import type { IStageForSpelPreview } from '../../../../presentation'; import { FormField, ReactSelectInput, useData } from '../../../../presentation'; @@ -23,7 +24,10 @@ export function ExecutionAndStagePicker(props: IExecutionAndStagePickerProps) { const [showStageSelector, setShowStageSelector] = React.useState(false); const fetchExecutions = useData( - () => executionService.getExecutionsForConfigIds([pipeline.id], { limit: 100 }), + () => + executionService.getExecutionsForConfigIds([pipeline.id], { + limit: SETTINGS.maxFetchHistoryOnEvaluateVariables, + }), [], [], );