Skip to content

Commit

Permalink
feat(evaluateVariables stage) Made fetch exec history on evaluateVari…
Browse files Browse the repository at this point in the history
…ables stage configurable (#10143)

* feat(evaluateVariables stage): Made fetch exec history on evaluateVariables stage configurable

* feat(evaluateVariables stage): fixed prettier violation

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
wooseung-sim and mergify[bot] authored Sep 12, 2024
1 parent 77dd8bf commit 08b95df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/app/src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ window.spinnakerSettings = {
defaultManifest: 'spinnaker.yml',
manifestBasePath: '.spinnaker',
},
maxFetchHistoryOnEvaluateVariables: 100,
maxPipelineAgeDays: 14,
newApplicationDefaults: {
chaosMonkey: false,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/config/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export interface ISpinnakerSettings {
manifestBasePath: string;
urls?: Partial<IManagedDeliveryURLs>;
};
maxFetchHistoryOnEvaluateVariables?: number;
maxPipelineAgeDays: number;
newApplicationDefaults: INewApplicationDefaults;
notifications: INotificationSettings;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
}),
[],
[],
);
Expand Down

0 comments on commit 08b95df

Please sign in to comment.