Apply suggestions from code review

Mostly removals of commented code.
This commit is contained in:
Keagan McClelland
2021-09-29 11:27:46 -06:00
parent b9664e7234
commit 55dfe2f7e5
4 changed files with 2 additions and 12 deletions

View File

@@ -343,7 +343,6 @@ getServiceDetails settings metadata maybeVersion pkg = do
packageMetadata <- case HM.lookup pkg metadata of
Nothing -> throwIO $ NotFoundE [i|#{pkg} not found.|]
Just m -> pure m
-- let (appsDir, appMgrDir) = ((</> "apps") . resourcesDir &&& staticBinDir) settings
let domain = registryHostname settings
version <- case maybeVersion of
Nothing -> do
@@ -352,8 +351,6 @@ getServiceDetails settings metadata maybeVersion pkg = do
[] -> throwIO $ NotFoundE $ "no latest version found for " <> show pkg
x : _ -> pure x
Just v -> pure v
-- let appDir = (<> "/") . (</> show version) . (</> show appId) $ appsDir
-- let appExt = Extension (show appId) :: Extension "s9pk"
manifest <- flip runReaderT settings $ (snd <$> getManifest pkg version) >>= \bs ->
runConduit $ bs .| CL.foldMap BS.fromStrict
case eitherDecode manifest of
@@ -393,13 +390,7 @@ mapDependencyMetadata domain metadata (appId, depInfo) = do
}
)
-- decodeInstructions :: (MonadUnliftIO m, MonadHandler m, MonadThrow m) => FilePath -> FilePath -> S9PK -> m Text
-- decodeInstructions appmgrPath depPath package = do
-- sourceInstructions appmgrPath depPath package (\bs -> sinkMem (bs .| CT.decode CT.utf8))
-- decodeLicense :: (MonadUnliftIO m, MonadThrow m, MonadHandler m) => FilePath -> FilePath -> S9PK -> m Text
-- decodeLicense appmgrPath depPath package =
-- sourceLicense appmgrPath depPath package (\bs -> sinkMem (bs .| CT.decode CT.utf8))
fetchAllAppVersions :: Key SApp -> HandlerFor RegistryCtx ([VersionInfo], ReleaseNotes)
fetchAllAppVersions appId = do

View File

@@ -65,6 +65,7 @@ readProcessInheritStderr a b c sink = do
$ System.Process.Typed.proc a b
withProcessTerm' pc $ \p -> sink (getStdout p)
where
-- We need this to deal with https://github.com/haskell/process/issues/215
withProcessTerm' :: (MonadUnliftIO m)
=> ProcessConfig stdin stdout stderr
-> (Process stdin stdout stderr -> m a)

View File

@@ -25,7 +25,7 @@ import System.FilePath ( (</>) )
import Yesod.Default.Config2 ( configSettingsYml )
import Control.Monad.Reader.Has ( Has(extract, update) )
import Lib.PkgRepository ( PkgRepo(PkgRepo, pkgRepoAppMgrBin, pkgRepoFileRoot) )
import Lib.PkgRepository ( PkgRepo(..) )
import Lib.Types.Emver
import Orphans.Emver ( )
-- | Runtime settings to configure this application. These settings can be

View File

@@ -133,6 +133,4 @@ spec = do
app <- runDBtest $ insert $ SApp time Nothing "Bitcoin Core" "bitcoin" "short desc" "long desc" "png"
_ <- runDBtest $ insert $ SVersion time Nothing app "0.19.0.0" "release notes 0.19.0.0" Any Any Nothing
_ <- runDBtest $ insert $ SVersion time Nothing app "0.20.0.0" "release notes 0.19.0.0" Any Any Nothing
-- res <- runDBtest $ getServiceVersionsWithReleaseNotes "bitcoin"
-- print res
print ()