Don't consider pending deployments archived (#42)

* Don't consider pending deployments archived

* unpack deployment info
This commit is contained in:
iko 2021-03-29 10:12:56 +03:00
parent ffbcfaf0bb
commit 92ee8d3df4

View File

@ -173,7 +173,11 @@ data DeploymentFullInfo = DeploymentFullInfo
deriving (FromJSON, ToJSON) via Snake DeploymentFullInfo
isDeploymentArchived :: DeploymentFullInfo -> Bool
isDeploymentArchived = isArchivedStatus . recordedStatus . getField @"status"
isDeploymentArchived DeploymentFullInfo {status = s} = case s of
DeploymentNotPending s -> isArchivedStatus s
-- if the deployment is currently undergoing some process,
-- then it is not considered archived
DeploymentPending _ -> False
data DeploymentUpdate = DeploymentUpdate
{ newTag :: DeploymentTag