@@ -562,10 +562,10 @@ updateDeploymentInfo ::
562562 (KatipContext m, MonadReader AppState m, MonadBaseControl IO m, MonadError ServerError m) =>
563563 DeploymentName ->
564564 m ()
565−updateDeploymentInfo dName = do
565+updateDeploymentInfo dName = katipAddContext (sl "deployment" dName) $ do
566566 DeploymentFullInfo {deployment = dep} <- getDeploymentS dName
567567 cfg <- getDeploymentConfig dep
568− (ec, out, err, _) <- katipAddContext (sl "deployemnt" dName) $ runCommandArgs infoCommand =<< infoCommandArgs cfg dep
568+ (ec, out, err, _) <- runCommandArgs infoCommand =<< infoCommandArgs cfg dep
569569 case ec of
570570 ExitSuccess -> case parseDeploymentMetadata (unStdout out) of
571571 Right dMeta -> upsertDeploymentMetadatum dName dMeta
@@ -593,9 +593,9 @@ createDeployment ::
593593 (KatipContext m, MonadBaseControl IO m, MonadReader AppState m, MonadError ServerError m) =>
594594 Deployment ->
595595 m (ExitCode, Stdout, Stderr, Duration)
596−createDeployment dep = do
596+createDeployment dep = katipAddContext (sl "deployment" (dep ^. #name)) $ do
597597 cfg <- getDeploymentConfig dep
598− res <- katipAddContext (sl "deployemnt" (dep ^. #name)) $ runCommandArgs creationCommand =<< createCommandArgs cfg dep
598+ res <- runCommandArgs creationCommand =<< createCommandArgs cfg dep
599599 logLocM InfoS $ "deployment created, deployment: " <> show' dep
600600 pure res
601601
@@ -750,7 +750,7 @@ transitionToStatus dName s = do
750750 notificationCmd <- asks notificationCommand
751751 for_ notificationCmd $ \nCmd ->
752752 runBgWorker . void $
753− katipAddContext (sl "deployemnt" dName) $
753+ katipAddContext (sl "deployment" dName) $
754754 runCommandArgs' nCmd
755755 =<< notificationCommandArgs dName oldS newS
756756 sendReloadEvent
@@ -805,12 +805,12 @@ anyPred preds x = any ($ x) preds
805805
806806-- | Handles the 'archive' request.
807807archiveH :: DeploymentName -> AppM CommandResponse
808−archiveH dName = do
808+archiveH dName = katipAddContext (sl "deployment" dName) $ do
809809 failIfGracefulShutdownActivated
810810 runDeploymentBgWorker (Just ArchivePending) dName (pure ()) $ \() -> do
811811 (view #deployment -> dep) <- getDeploymentS dName
812812 cfg <- getDeploymentConfig dep
813− (ec, out, err, elTime) <- katipAddContext (sl "deployemnt" dName) $ runCommandArgs archiveCommand =<< archiveCommandArgs cfg dep
813+ (ec, out, err, elTime) <- runCommandArgs archiveCommand =<< archiveCommandArgs cfg dep
814814 transitionToStatusS dName $
815815 TransitionArchivePending
816816 StatusTransitionProcessOutput
@@ -853,7 +853,7 @@ updateH dName dUpdate = do
853853 updateDeploymentInfo dName
854854 sendReloadEvent
855855 cfg <- getDeploymentConfig dep
856− (ec, out, err, elTime) <- katipAddContext (sl "deployemnt" dName) $ runCommandArgs updateCommand =<< updateCommandArgs cfg dep
856+ (ec, out, err, elTime) <- katipAddContext (sl "deployment" dName) $ runCommandArgs updateCommand =<< updateCommandArgs cfg dep
857857 logLocM DebugS $
858858 logStr $
859859 "deployment updated, name: "
@@ -907,10 +907,10 @@ projectNameH = asks projectName
907907
908908-- | Handles the 'status' request.
909909statusH :: DeploymentName -> AppM CurrentDeploymentStatus
910−statusH dName = do
910+statusH dName = katipAddContext (sl "deployment" dName) $ do
911911 (view #deployment -> dep) <- getDeploymentS dName
912912 cfg <- getDeploymentConfig dep
913− (ec, _, _, _) <- katipAddContext (sl "deployemnt" dName) $ runCommandArgs checkingCommand =<< checkCommandArgs cfg dep
913+ (ec, _, _, _) <- runCommandArgs checkingCommand =<< checkCommandArgs cfg dep
914914 pure . CurrentDeploymentStatus $
915915 case ec of
916916 ExitSuccess -> Ok
@@ -935,13 +935,10 @@ cleanupDeployment ::
935935 (KatipContext m, MonadBaseControl IO m, MonadReader AppState m, MonadError ServerError m) =>
936936 DeploymentName ->
937937 m ()
938−cleanupDeployment dName = do
938+cleanupDeployment dName = katipAddContext (sl "deployment" dName) $ do
939939 (view #deployment -> dep) <- getDeploymentS dName
940940 cfg <- getDeploymentConfig dep
941− (ec, out, err, elTime) <- katipAddContext (sl "deployemnt" dName) $ runCommandArgs cleanupCommand =<< cleanupCommandArgs cfg dep
942− katipAddContext (FilePayload "stdout" $ T.encodeUtf8 $ unStdout out) $
943− katipAddContext (FilePayload "stdout" $ T.encodeUtf8 $ unStderr err) $
944− logLocM DebugS "deployment destroyed"
941+ (ec, out, err, elTime) <- runCommandArgs cleanupCommand =<< cleanupCommandArgs cfg dep
945942 case ec of
946943 ExitSuccess -> do
947944 deleteDeploymentLogs dName
@@ -1001,7 +998,7 @@ deleteDeployment dName =
1001998
1002999-- | Handles the 'restore' request.
10031000restoreH :: DeploymentName -> AppM CommandResponse
1004−restoreH dName = do
1001+restoreH dName = katipAddContext (sl "deployment" dName) $ do
10051002 failIfGracefulShutdownActivated
10061003 dep <- getDeploymentS dName
10071004 failIfImageNotFound $ dep ^. #deployment
@@ -1010,7 +1007,7 @@ restoreH dName = do
10101007 (view #deployment -> dep') <- getDeploymentS dName
10111008 updateDeploymentInfo dName
10121009 cfg <- getDeploymentConfig dep'
1013− (ec, out, err, elTime) <- katipAddContext (sl "deployemnt" dName) $ runCommandArgs unarchiveCommand =<< unarchiveCommandArgs cfg dep'
1010+ (ec, out, err, elTime) <- runCommandArgs unarchiveCommand =<< unarchiveCommandArgs cfg dep'
10141011 transitionToStatusS dName $
10151012 TransitionRestore
10161013 StatusTransitionProcessOutput
@@ -1107,9 +1104,9 @@ upsertDeploymentMetadatum dName dMetadata =
11071104-- | Checks the existence of a deployment tag.
11081105-- Returns 404 'Tag not found' response if the deployment tag doesn't exist.
11091106failIfImageNotFound :: Deployment -> AppM ()
1110−failIfImageNotFound dep = do
1107+failIfImageNotFound dep = katipAddContext (sl "deployment" (dep ^. #name)) $ do
11111108 cfg <- getDeploymentConfig dep
1112− (ec, Stdout out, _, _) <- katipAddContext (sl "deployemnt" (dep ^. #name)) $ runCommandArgs configCheckingCommand =<< configCheckCommandArgs cfg dep
1109+ (ec, Stdout out, _, _) <- runCommandArgs configCheckingCommand =<< configCheckCommandArgs cfg dep
11131110 case ec of
11141111 ExitSuccess -> pure ()
11151112 ExitFailure _ ->
@@ -1151,14 +1148,14 @@ runStatusUpdater = do
11511148 Nothing -> do
11521149 logLocM ErrorS $ logStr $ "Couldn't find deployment: " <> unDeploymentName dName
11531150 pure Nothing
1154− Just (view #deployment -> dep) -> do
1151+ Just (view #deployment -> dep) -> katipAddContext (sl "deployment" (dep ^. #name)) $ do
11551152 cfg <- getDeploymentConfig dep
11561153 case dStatus of
11571154 ArchivePending -> do
1158− (ec, _, _, _) <- katipAddContext (sl "deployemnt" (dep ^. #name)) $ runCommandArgs archiveCheckingCommand =<< archiveCheckArgs cfg dep
1155+ (ec, _, _, _) <- runCommandArgs archiveCheckingCommand =<< archiveCheckArgs cfg dep
11591156 pure $ Just ec
11601157 _ -> do
1161− (ec, _, _, _) <- katipAddContext (sl "deployemnt" (dep ^. #name)) $ runCommandArgs checkingCommand =<< checkCommandArgs cfg dep
1158+ (ec, _, _, _) <- runCommandArgs checkingCommand =<< checkCommandArgs cfg dep
11621159 pure $ Just ec
11631160 pure $ mEc <&> \ec -> (dName, statusTransition ec dStatus ts timeout, dStatus)
11641161 updated <-