registry changes ready for 0.1.2 sys release

This commit is contained in:
Keagan McClelland
2020-02-19 03:22:31 +00:00
parent 76766e5f94
commit 0a74f88171
7 changed files with 28 additions and 85 deletions

View File

@@ -7,6 +7,7 @@ module Handler.Version where
import Startlude
import Control.Monad.Trans.Maybe
import qualified Data.HashMap.Strict as HM
import Data.String.Interpolate.IsString
import Network.HTTP.Types
import Yesod.Core
@@ -44,9 +45,9 @@ getVersionWSpec rootDir ext = do
pure $ liftA2 AppVersionRes av (pure Nothing)
meshCompanionCompatibility :: AppVersion -> Handler AppVersion
meshCompanionCompatibility (AppVersion (0,1,0,_)) = pure $ AppVersion (1,0,0,0)
meshCompanionCompatibility (AppVersion (0,1,1,_)) = pure $ AppVersion (1,0,0,0)
meshCompanionCompatibility (AppVersion (0,1,2,_)) = pure $ AppVersion (1,1,0,0)
meshCompanionCompatibility other = do
$logError [i|MESH DEPLOYMENT "#{other}" HAS NO COMPATIBILITY ENTRY! FIX IMMEDIATELY|]
sendResponseStatus status500 ("Internal Server Error" :: Text)
meshCompanionCompatibility av = getsYesod appCompatibilityMap >>= \hm -> do
case HM.lookup av hm of
Nothing -> do
$logError [i|MESH DEPLOYMENT "#{av}" HAS NO COMPATIBILITY ENTRY! FIX IMMEDIATELY|]
sendResponseStatus status500 ("Internal Server Error" :: Text)
Just x -> pure x