Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
tchoutri committed Apr 4, 2023
2 parents 080229a + 59953da commit da39d54
Show file tree
Hide file tree
Showing 25 changed files with 3,490 additions and 844 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Extract the tested GHC versions
id: set-matrix
run: |
wget https://github.com/Kleidukos/get-tested/releases/download/v0.1.3.0/get-tested-0.1.3.0-linux-amd64 -O get-tested
wget https://github.com/Kleidukos/get-tested/releases/download/v0.1.4.0/get-tested-0.1.4.0-linux-amd64 -O get-tested
chmod +x get-tested
./get-tested --ubuntu *.cabal >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
cache: 'yarn'
cache-dependency-path: assets/yarn.lock

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: assets/yarn.lock

- name: Configure environment
run: |
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 1.0.12 -- 2023-04-04

* Limit the display of versions on package pages ([#358](https://github.com/flora-pm/flora-server/pull/361))
* Speed-up package(s) import using bounded concurrency ([#360](https://github.com/flora-pm/flora-server/pull/360))
* Fix the display of latest viable version when viewing a deprecated release ([fd96294](https://github.com/flora-pm/flora-server/commit/fd962942d8b029083b0d883167bfff2913bf18fd))

## 1.0.11 -- 2023-03-26

* Tweak the mobile view dropdown & search ([#358](https://github.com/flora-pm/flora-server/pull/358))
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ clean: ## Remove the cabal build artifacts
@cabal clean

assets-deps: ## Install the dependencies of the frontend
@cd assets/ && yarn
@cd assets/ && yarn install --immutable --immutable-cache --check-cache

build-assets: assets-deps ## Build the web assets
@cd assets/ && yarn build
Expand Down Expand Up @@ -67,10 +67,9 @@ watch-server: soufflé ## Start flora-server in ghcid
lint: ## Run the code linter (HLint)
@find app test src -name "*.hs" | xargs -P $(PROCS) -I {} hlint --refactor-options="-i" --refactor {}

style: ## Run the code formatters (stylish-haskell, cabal-fmt, nixfmt, prettier, stylelint)
style: ## Run the code formatters (stylish-haskell, cabal-fmt, prettier, stylelint)
@find app test src -name '*.hs' | xargs -P $(PROCS) -I {} fourmolu -q -i {}
@cabal-fmt -i flora.cabal
@nixfmt *.nix
@cd assets ; yarn prettier --write css
@cd assets ; yarn stylelint --fix css

Expand Down
9 changes: 6 additions & 3 deletions app/cli/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import DesignSystem (generateComponents)
import Effectful
import Effectful.Fail
import Effectful.PostgreSQL.Transact.Effect
import Effectful.Reader.Static (Reader, runReader)
import Flora.Model.User.Query qualified as Query
import GHC.Generics (Generic)
import Log.Backend.StandardOutput qualified as Log
import Optics.Core
import Options.Applicative

import Flora.Environment
import Flora.Environment.Config (PoolConfig (..))
import Flora.Import.Categories (importCategories)
import Flora.Import.Package.Bulk (importAllFilesInRelativeDirectory)
import Flora.Model.User
Expand Down Expand Up @@ -50,7 +52,8 @@ main = do
result <- execParser (parseOptions `withInfo` "CLI tool for flora-server")
env <- getFloraEnv & runFailIO & runEff
runEff
. runDB (env ^. #pool)
. runReader env.dbConfig
. runDB env.pool
. runFailIO
$ runOptions result

Expand Down Expand Up @@ -89,7 +92,7 @@ parseGenDesignSystem = pure GenDesignSystemComponents
parseImportPackages :: Parser Command
parseImportPackages = ImportPackages <$> argument str (metavar "PATH")

runOptions :: (DB :> es, Fail :> es, IOE :> es) => Options -> Eff es ()
runOptions :: (Reader PoolConfig :> es, DB :> es, Fail :> es, IOE :> es) => Options -> Eff es ()
runOptions (Options (Provision Categories)) = importCategories
runOptions (Options (Provision TestPackages)) = importFolderOfCabalFiles "./test/fixtures/Cabal/"
runOptions (Options (CreateUser opts)) = do
Expand All @@ -111,7 +114,7 @@ runOptions (Options (CreateUser opts)) = do
runOptions (Options GenDesignSystemComponents) = generateComponents
runOptions (Options (ImportPackages path)) = importFolderOfCabalFiles path

importFolderOfCabalFiles :: (DB :> es, IOE :> es) => FilePath -> Eff es ()
importFolderOfCabalFiles :: (Reader PoolConfig :> es, DB :> es, IOE :> es) => FilePath -> Eff es ()
importFolderOfCabalFiles path = Log.withStdOutLogger $ \appLogger -> do
user <- fromJust <$> Query.getUserByUsername "hackage-user"
importAllFilesInRelativeDirectory appLogger (user ^. #userId) path True
Expand Down
Loading

0 comments on commit da39d54

Please sign in to comment.