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

Commit

Permalink
Save patch trigger aliases with new success status
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad committed Oct 23, 2023
1 parent 01c95ae commit 2635096
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 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
11 changes: 6 additions & 5 deletions src/pages/projectSettings/tabs/PatchAliasesTab/transformers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
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 +9,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 2635096

Please sign in to comment.