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

Commit

Permalink
EVG-20704: Save patch trigger aliases with new success status (#2121)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad authored Nov 2, 2023
1 parent 43015ea commit dff7d57
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ export const getFormSchema = (
},
{
type: "string" as "string",
title:
PatchTriggerAliasStatus[PatchStatus.LegacySucceeded],
enum: [PatchStatus.LegacySucceeded],
title: PatchTriggerAliasStatus[PatchStatus.Success],
enum: [PatchStatus.Success],
},
{
type: "string" as "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const repoForm: PatchAliasesFormState = {
{
alias: "alias1",
childProjectIdentifier: "spruce",
status: "succeeded",
status: "success",
displayTitle: "alias1",
parentAsModule: "",
isGithubTriggerAlias: true,
Expand Down Expand Up @@ -124,7 +124,7 @@ const repoResult: Pick<RepoSettingsInput, "projectRef" | "aliases"> = {
variantRegex: ".*",
},
],
status: "succeeded",
status: "success",
parentAsModule: "",
},
],
Expand Down
10 changes: 5 additions & 5 deletions src/pages/projectSettings/tabs/PatchAliasesTab/transformers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ProjectSettingsTabRoutes } from "constants/routes";
import { PatchStatus } from "types/patch";
import { FormToGqlFunction, GqlToFormFunction } from "../types";
import { alias as aliasUtils, ProjectType } from "../utils";
import { TaskSpecifier } from "./types";
Expand All @@ -7,12 +8,11 @@ const { sortAliases, transformAliases } = aliasUtils;

type Tab = ProjectSettingsTabRoutes.PatchAliases;

// Ensure that the front end can ingest patch trigger alias status filters that use either "success" or "succeeded".
// For now, use "succeeded" for either.
// TODO EVG-20704: Save patch trigger aliases with "success" instead of "succeeded".
// Ensure that the front end can ingest patch trigger alias status filters that use either "success" or "succeeded" and convert them to "success".
// TODO EVG-20032: Remove conversion.
const migrateSuccessStatus = (status: string) => {
if (status === "success") {
return "succeeded";
if (status === PatchStatus.LegacySucceeded) {
return PatchStatus.Success;
}
return status ?? "";
};
Expand Down
1 change: 1 addition & 0 deletions src/types/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export enum PatchStatus {
Created = "created",
Failed = "failed",
Started = "started",
// TODO EVG-20032: Remove legacy status
LegacySucceeded = "succeeded",
Success = "success",
Aborted = "aborted",
Expand Down

0 comments on commit dff7d57

Please sign in to comment.