Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
EVG-20650 Add unscheduleDownstreamVersions to Spruce (#2020)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadjri authored Sep 6, 2023
1 parent 00ef22c commit b910281
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/SpruceForm/Widgets/LeafyGreenWidgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const LeafyGreenCheckBox: React.FC<SpruceWidgetProps> = ({
value,
}) => {
const {
bold,
customLabel,
"data-cy": dataCy,
description,
Expand All @@ -118,7 +119,7 @@ export const LeafyGreenCheckBox: React.FC<SpruceWidgetProps> = ({
return (
<ElementWrapper css={elementWrapperCSS}>
<Checkbox
bold={false}
bold={bold || false}
checked={value}
data-cy={dataCy}
description={description}
Expand Down
1 change: 1 addition & 0 deletions src/components/SpruceForm/Widgets/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface SpruceWidgetProps extends WidgetProps {
"aria-controls": string[];
"data-cy": string;
ariaLabelledBy: string;
bold: boolean;
customLabel: string;
description: string;
elementWrapperCSS: SerializedStyles;
Expand Down
2 changes: 2 additions & 0 deletions src/gql/fragments/projectSettings/projectTriggers.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fragment ProjectTriggersSettings on Project {
project
status
taskRegex
unscheduleDownstreamVersions
}
}

Expand All @@ -21,5 +22,6 @@ fragment RepoTriggersSettings on RepoRef {
project
status
taskRegex
unscheduleDownstreamVersions
}
}
11 changes: 11 additions & 0 deletions src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3629,6 +3629,7 @@ export type ProjectSettingsFieldsFragment = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -3827,6 +3828,7 @@ export type RepoSettingsFieldsFragment = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}>;
workstationConfig: {
__typename?: "RepoWorkstationConfig";
Expand Down Expand Up @@ -4217,6 +4219,7 @@ export type ProjectEventSettingsFragment = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -4316,6 +4319,7 @@ export type ProjectTriggersSettingsFragment = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
};

Expand All @@ -4331,6 +4335,7 @@ export type RepoTriggersSettingsFragment = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}>;
};

Expand Down Expand Up @@ -6591,6 +6596,7 @@ export type ProjectEventLogsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -6801,6 +6807,7 @@ export type ProjectEventLogsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -7026,6 +7033,7 @@ export type ProjectSettingsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -7275,6 +7283,7 @@ export type RepoEventLogsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -7485,6 +7494,7 @@ export type RepoEventLogsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -7700,6 +7710,7 @@ export type RepoSettingsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}>;
workstationConfig: {
__typename?: "RepoWorkstationConfig";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/distroSettings/tabs/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
const distroData: DistroQuery["distro"] = {
__typename: "Distro",
aliases: ["rhel71-power8", "rhel71-power8-build"],
arch: Arch.LinuxPpc_64Bit,
arch: Arch.Linux_64Bit,
authorizedKeysFile: "",
bootstrapSettings: {
clientDir: "/home/evg/client",
Expand Down
10 changes: 10 additions & 0 deletions src/pages/projectSettings/tabs/ProjectTriggersTab/getFormSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ export const getFormSchema = (
title: "Alias",
default: "",
},
unscheduleDownstreamVersions: {
type: "boolean" as "boolean",
title: "Unschedule Downstream Versions",
},
},
},
}
Expand Down Expand Up @@ -148,6 +152,12 @@ export const getFormSchema = (
"Patch alias to filter variants/tasks in this project.",
"ui:optional": true,
},
unscheduleDownstreamVersions: {
"ui:description":
"Downstream versions created by this trigger will be deactivated by default",
"ui:optional": true,
"ui:bold": true,
},
},
},
repoData: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const repoForm: ProjectTriggersFormState = {
project: "spruce",
status: "succeeded",
taskRegex: ".*",
unscheduleDownstreamVersions: true,
},
],
};
Expand All @@ -72,6 +73,7 @@ const repoResult: Pick<RepoSettingsInput, "projectRef"> = {
project: "spruce",
status: "succeeded",
taskRegex: ".*",
unscheduleDownstreamVersions: true,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const formToGql = (({ triggers, triggersOverride }, projectId) => ({
dateCutoff: trigger.dateCutoff,
configFile: trigger.configFile,
alias: trigger.alias,
unscheduleDownstreamVersions: trigger.unscheduleDownstreamVersions,
}))
: null,
},
Expand Down
1 change: 1 addition & 0 deletions src/pages/projectSettings/tabs/ProjectTriggersTab/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type FormTrigger = {
configFile: string;
alias: string;
displayTitle?: string;
unscheduleDownstreamVersions: boolean;
};

export type ProjectTriggersFormState = {
Expand Down
1 change: 1 addition & 0 deletions src/pages/projectSettings/tabs/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ const repoBase: RepoSettingsQuery["repoSettings"] = {
taskRegex: ".*",
configFile: ".evergreen.yml",
alias: "my-alias",
unscheduleDownstreamVersions: true,
},
],
periodicBuilds: [
Expand Down

0 comments on commit b910281

Please sign in to comment.