Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
tchoutri committed Nov 7, 2024
2 parents 0744d8e + d252de2 commit 062c480
Show file tree
Hide file tree
Showing 14 changed files with 294 additions and 261 deletions.
17 changes: 15 additions & 2 deletions app/cli/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Main where
import Codec.Compression.GZip qualified as GZip
import Data.ByteString.Lazy.Char8 qualified as BS
import Data.Maybe
import Data.Poolboy (poolboySettingsWith)
import Data.Text (Text)
import Data.Text qualified as Text
import Data.Text.Display (display)
Expand All @@ -14,7 +15,7 @@ import Effectful.FileSystem
import Effectful.Log (Log, runLog)
import Effectful.PostgreSQL.Transact.Effect
import Effectful.Time (Time, runTime)
import GHC.Conc (getNumCapabilities)
import GHC.Conc
import GHC.Generics (Generic)
import Log qualified
import Log.Backend.StandardOutput qualified as Log
Expand All @@ -23,12 +24,16 @@ import Options.Applicative
import Sel.Hashing.Password qualified as Sel
import System.FilePath ((</>))

import Data.Set (Set)
import Effectful.Poolboy
import Effectful.State.Static.Shared (State)
import Effectful.State.Static.Shared qualified as State
import Flora.Environment
import Flora.Import.Categories (importCategories)
import Flora.Import.Package.Bulk (importAllFilesInRelativeDirectory, importFromIndex)
import Flora.Model.BlobIndex.Update qualified as Update
import Flora.Model.BlobStore.API
import Flora.Model.Package (PackageName)
import Flora.Model.Package (Namespace, PackageName)
import Flora.Model.PackageIndex.Query qualified as Query
import Flora.Model.PackageIndex.Types
import Flora.Model.PackageIndex.Update qualified as Update
Expand Down Expand Up @@ -71,10 +76,12 @@ main = Log.withStdOutLogger $ \logger -> do
capabilities <- getNumCapabilities
env <- getFloraEnv & runFailIO & runEff
runEff
. State.evalState (mempty @(Set (Namespace, PackageName, Version)))
. withUnliftStrategy (ConcUnlift Ephemeral Unlimited)
. runDB env.pool
. runFailIO
. runTime
. runPoolboy (poolboySettingsWith capabilities)
. ( case env.features.blobStoreImpl of
Just (BlobStoreFS fp) -> runBlobStoreFS fp
_ -> runBlobStorePure
Expand Down Expand Up @@ -160,6 +167,8 @@ runOptions
, Fail :> es
, IOE :> es
, BlobStoreAPI :> es
, State (Set (Namespace, PackageName, Version)) :> es
, Poolboy :> es
)
=> Options
-> Eff es ()
Expand Down Expand Up @@ -198,8 +207,10 @@ importFolderOfCabalFiles
:: ( FileSystem :> es
, Time :> es
, Log :> es
, Poolboy :> es
, DB :> es
, IOE :> es
, State (Set (Namespace, PackageName, Version)) :> es
)
=> FilePath
-> Text
Expand All @@ -215,8 +226,10 @@ importFolderOfCabalFiles path repository = do
importIndex
:: ( Time :> es
, Log :> es
, Poolboy :> es
, DB :> es
, IOE :> es
, State (Set (Namespace, PackageName, Version)) :> es
)
=> FilePath
-> Text
Expand Down
5 changes: 0 additions & 5 deletions changelog.d/783

This file was deleted.

16 changes: 15 additions & 1 deletion flora.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ library
Flora.Model.User
Flora.Model.User.Query
Flora.Model.User.Update
Flora.Publish
Flora.QRCode
Flora.Search
Flora.Tracing
Expand Down Expand Up @@ -160,6 +159,7 @@ library
, directory
, effectful
, effectful-core
, effectful-plugin
, envparse
, filepath
, http-api-data
Expand Down Expand Up @@ -203,6 +203,8 @@ library
, vector
, zlib

ghc-options: -fplugin=Effectful.Plugin

library flora-web
import: common-extensions
import: common-ghc-options
Expand Down Expand Up @@ -296,6 +298,7 @@ library flora-web
, deriving-aeson
, effectful
, effectful-core
, effectful-plugin
, extra
, flora
, flora-jobs
Expand Down Expand Up @@ -348,6 +351,8 @@ library flora-web
, xml-conduit
, xml-conduit-writer

ghc-options: -fplugin=Effectful.Plugin

library flora-jobs
import: common-extensions
import: common-ghc-options
Expand All @@ -372,6 +377,7 @@ library flora-jobs
, containers
, effectful
, effectful-core
, effectful-plugin
, flora
, http-client
, http-media
Expand All @@ -395,6 +401,8 @@ library flora-jobs
, typed-process-effectful
, vector

ghc-options: -fplugin=Effectful.Plugin

executable flora-server
import: common-extensions
import: common-ghc-options
Expand Down Expand Up @@ -428,8 +436,10 @@ executable flora-cli
, base
, bytestring
, Cabal-syntax
, containers
, effectful
, effectful-core
, effectful-plugin
, envparse
, filepath
, flora
Expand All @@ -441,6 +451,7 @@ executable flora-cli
, optics-core
, optparse-applicative
, pg-transact-effectful
, poolboy
, PyF
, sel
, text
Expand All @@ -466,6 +477,7 @@ test-suite flora-test
, containers
, effectful
, effectful-core
, effectful-plugin
, exceptions
, filepath
, flora
Expand All @@ -479,6 +491,7 @@ test-suite flora-test
, pg-entity
, pg-transact
, pg-transact-effectful
, poolboy
, postgresql-migration
, postgresql-simple
, resource-pool
Expand All @@ -496,6 +509,7 @@ test-suite flora-test
, vector-algorithms
, zlib

ghc-options: -fplugin=Effectful.Plugin
other-modules:
Flora.BlobSpec
Flora.CabalSpec
Expand Down
Loading

0 comments on commit 062c480

Please sign in to comment.