Commit d7a70fd4 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch '238-dev-async-worker-tests' into 'dev'

Upgrade 'haskell-bee' version, also bump up versions of some packages

See merge request !377
parents b71620ea 810a6df4
Pipeline #7161 passed with stages
in 46 minutes and 33 seconds
......@@ -18,8 +18,8 @@ fi
# with the `sha256sum` result calculated on the `cabal.project` and
# `cabal.project.freeze`. This ensures the files stay deterministic so that CI
# cache can kick in.
expected_cabal_project_hash="2b63b5dc1e026a27dcce7cb90080802a3a81f6f968d5edf8f913b8f0fd1203eb"
expected_cabal_project_freeze_hash="0d9d3d92afcaf2a1fbda3fa393a0990f72fc2ec766473aeecd669f7a5d805466"
expected_cabal_project_hash="1abcdd99d5d50660e640be8a340c90331a84ef266d174c7ca6099c1c04ef65ea"
expected_cabal_project_freeze_hash="32310c4d4e7b4679dcb90dcfcd0d6d1b175dbf885a77ffddca16d422998a521c"
cabal --store-dir=$STORE_DIR v2-build --dry-run
......
......@@ -60,7 +60,6 @@ source-repository-package
type: git
location: https://github.com/chessai/eigen.git
tag: 1790fdf9138970dde0dbabf8b270698145a4a88c
-- tag: 8fff32a43df743c8c83428a86dd566a0936a4fba
source-repository-package
type: git
......@@ -154,13 +153,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/MercuryTechnologies/ekg-json.git
tag: 232db57d6ce0940fcc902adf30a9ed3f3561f21d
source-repository-package
type: git
location: https://github.com/robstewart57/rdf4h.git
tag: 4fd2edf30c141600ffad6d730cc4c1c08a6dbce4
location: https://github.com/haskell-github-trust/ekg-json
tag: bd0592818882f9cf34d2991d01f7dcb3d8bca309
-- FIXME(adn) Compat-shim while we wait for upstream to catch-up
source-repository-package
......@@ -168,11 +162,6 @@ source-repository-package
location: https://github.com/garganscript/nanomsg-haskell
tag: 5868db564d7d3c4568ccd11c852292b834d26c55
-- source-repository-package
-- type: git
-- location: https://github.com/jimenezrick/nng-haskell
-- tag: 31e52d7bc720e5fb9daf1c1e8bc1fd156d577af2
source-repository-package
type: git
location: https://github.com/adinapoli/http-reverse-proxy.git
......@@ -191,40 +180,24 @@ source-repository-package
source-repository-package
type: git
location: https://gitlab.iscpif.fr/gargantext/haskell-bee
tag: d3c0b658aae5dedce04f4f1605e4a6605efebd31
tag: 69b7388a62f2afb5cb5609beac96e8cb35e94478
subdir: haskell-bee/
haskell-bee-pgmq/
haskell-bee-tests/
source-repository-package
type: git
location: https://gitlab.iscpif.fr/gargantext/haskell-throttle
tag: 02f5ed9ee2d6cce45161addf945b88bc6adf9059
source-repository-package
type: git
location: https://github.com/glguy/toml-parser
tag: toml-parser-2.0.1.0
allow-newer:
accelerate-arithmetic:accelerate
, MissingH:base
allow-newer: MissingH:base
, accelerate-arithmetic:accelerate
, accelerate-utility:accelerate
, base:*
, crawlerHAL:servant
-- , crawlerISTEX:servant
-- , crawlerPubMed:servant
-- , crawlerPubMed:servant-client-core
, iso639:aeson
, iso639:text
, morpheus-graphql-app:text
, morpheus-graphql-client:text
, morpheus-graphql-code-gen-utils:text
, morpheus-graphql-code-gen:text
, morpheus-graphql-core:text
, morpheus-graphql-server:text
, morpheus-graphql-subscriptions:text
, morpheus-graphql:text
, servant-client:servant
, servant-client:servant-client-core
, servant-ekg:base
, servant-ekg:hashable
, servant-ekg:servant
......@@ -236,8 +209,8 @@ allow-newer:
, stemmer:base
allow-older: aeson:hashable
, crawlerHAL:servant-client
, haskell-bee:postgresql-libpq
, haskell-bee:stm
, haskell-bee-tests:stm
, haskell-throttle:time
, hsparql:rdf4h
......
......@@ -177,7 +177,6 @@ constraints: any.Boolean ==0.2.4,
any.eigen ==3.3.7.0,
any.either ==5.0.2,
any.ekg-core ==0.1.1.7,
any.ekg-json ==0.1.0.8,
any.enclosed-exceptions ==1.0.3,
any.entropy ==0.4.1.10,
entropy -donotgetentropy,
......@@ -340,14 +339,6 @@ constraints: any.Boolean ==0.2.4,
any.monad-time ==0.4.0.0,
any.mono-traversable ==1.0.17.0,
any.monoid-extras ==0.6.3,
any.morpheus-graphql ==0.24.3,
any.morpheus-graphql-app ==0.24.3,
any.morpheus-graphql-client ==0.24.3,
any.morpheus-graphql-code-gen ==0.24.3,
any.morpheus-graphql-code-gen-utils ==0.24.3,
any.morpheus-graphql-core ==0.24.3,
any.morpheus-graphql-server ==0.24.3,
any.morpheus-graphql-subscriptions ==0.24.3,
any.mtl ==2.2.2,
any.mtl-compat ==0.2.2,
mtl-compat -two-point-one -two-point-two,
......@@ -365,7 +356,6 @@ constraints: any.Boolean ==0.2.4,
any.newtype-generics ==0.6.2,
any.old-locale ==1.0.0.7,
any.old-time ==1.1.0.4,
any.opaleye ==0.9.7.0,
any.opaleye-textsearch ==0.2.0.0,
any.openalex ==0.1.0.0,
any.optics-core ==0.4.1.1,
......@@ -394,9 +384,7 @@ constraints: any.Boolean ==0.2.4,
any.polyparse ==1.13,
any.port-utils ==0.2.1.0,
any.postgres-options ==0.2.2.0,
any.postgresql-libpq ==0.9.5.0,
postgresql-libpq -use-pkg-config,
any.postgresql-simple ==0.6.5.1,
any.pretty ==1.1.3.6,
any.pretty-show ==1.10,
any.pretty-simple ==4.1.2.0,
......@@ -422,7 +410,6 @@ constraints: any.Boolean ==0.2.4,
any.random ==1.2.1.2,
any.random-shuffle ==0.0.4,
any.raw-strings-qq ==1.1,
any.rdf4h ==3.1.1,
any.recover-rtti ==0.4.3,
any.recv ==0.1.0,
any.reflection ==2.1.8,
......@@ -494,7 +481,6 @@ constraints: any.Boolean ==0.2.4,
splitmix -optimised-mixer,
any.statistics ==0.16.2.1,
any.stemmer ==0.5.2,
any.stm ==2.5.1.0,
any.stm-chans ==3.0.0.9,
any.stm-containers ==1.2.1,
any.stm-hamt ==1.2.1,
......@@ -586,7 +572,6 @@ constraints: any.Boolean ==0.2.4,
any.validity ==0.12.1.0,
any.vault ==0.3.1.5,
vault +useghc,
any.vector ==0.12.3.1,
vector +boundschecks -internalchecks -unsafechecks -wall,
any.vector-algorithms ==0.9.0.2,
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
......
package gargantext
ghc-options: -fwrite-ide-info
ghc-options: -fwrite-ide-info -Wunused-packages
package gargantext-admin
ghc-options: -O0
......
......@@ -528,6 +528,7 @@ library
, gargantext-prelude
, graphviz ^>= 2999.20.1.0
, haskell-bee
, haskell-bee-pgmq
, haskell-igraph ^>= 0.10.4
, haskell-pgmq >= 0.1.0.0 && < 0.2
, haskell-throttle
......@@ -553,15 +554,15 @@ library
, mime-mail >= 0.5.1
, monad-control ^>= 1.0.3.1
, monad-logger ^>= 0.3.36
, morpheus-graphql >= 0.24.3 && < 0.25
, morpheus-graphql-app >= 0.24.3 && < 0.25
, morpheus-graphql-server >= 0.24.3 && < 0.25
, morpheus-graphql-subscriptions >= 0.24.3 && < 0.25
, morpheus-graphql >= 0.24.3 && < 0.28.1
, morpheus-graphql-app >= 0.24.3 && < 0.28.1
, morpheus-graphql-server >= 0.24.3 && < 0.28.1
, morpheus-graphql-subscriptions >= 0.24.3 && < 0.28.1
, mtl ^>= 2.2.2
, nanomsg-haskell >= 0.2.4 && < 0.3
, network >= 3.1.4.0
, network-uri ^>= 2.6.4.1
, opaleye ^>= 0.9.6.1
, opaleye >= 0.9.6.1 && <= 0.10.3.1
, opaleye-textsearch >= 0.2.0.0
, openalex
, openapi3 >= 3.2.3
......@@ -569,14 +570,14 @@ library
, parsec ^>= 3.1.16.1
, patches-class ^>= 0.1.0.1
, patches-map ^>= 0.1.0.1
, postgresql-simple ^>= 0.6.4
, postgresql-simple >= 0.6.4 && <= 0.7.0.0
, process ^>= 1.6.18.0
, product-profunctors ^>= 0.11.0.3
, protolude ^>= 0.3.3
, quickcheck-instances ^>= 0.3.25.2
, rake ^>= 0.0.1
, random ^>= 1.2.1
, rdf4h ^>= 3.1.1
, rdf4h >= 5.1.0 && < 6
, regex
, replace-attoparsec ^>= 1.5.0.0
, resource-pool >= 0.4.0.0 && < 0.5
......@@ -625,7 +626,7 @@ library
, utf8-string ^>= 1.0.2
, uuid ^>= 1.3.15
, validity ^>= 0.12.0.2
, vector ^>= 0.12.3.0
, vector >= 0.12.3.0 && <= 0.13.1.0
, wai >= 3.2.4
, wai-cors ^>= 0.2.7
, wai-extra ^>= 3.1.8
......@@ -669,7 +670,6 @@ executable gargantext
, aeson-pretty
, async ^>= 2.2.4
, bytestring ^>= 0.11.5.3
, cassava ^>= 0.5.2.0
, containers ^>= 0.6.7
, cryptohash ^>= 0.11.9
, directory ^>= 1.3.7.1
......@@ -677,15 +677,10 @@ executable gargantext
, gargantext
, gargantext-prelude
, haskell-bee
, ini ^>= 0.4.1
, lens >= 5.2.2 && < 5.3
, MonadRandom ^>= 0.6
, monad-logger ^>= 0.3.36
, optparse-applicative
, optparse-generic ^>= 1.4.7
, parallel ^>= 3.2.2.0
, postgresql-simple ^>= 0.6.4
, protolude ^>= 0.3.3
, postgresql-simple >= 0.6.4 && <= 0.7.0.0
, servant >= 0.20.1 && < 0.21
, servant-auth
, servant-client-core >= 0.20 && < 0.21
......@@ -694,11 +689,9 @@ executable gargantext
, shelly
, split ^>= 0.2.3.4
, text ^>= 2.0.2
, time ^>= 1.12.2
, toml-parser >= 2.0.1.0 && < 3
, tree-diff
, unordered-containers ^>= 0.2.16.0
, vector ^>= 0.12.3.0
, vector >= 0.12.3.0 && <= 0.13.1.0
ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wmissing-signatures -Wunused-binds -Wunused-imports -Werror -freduction-depth=300 -fprint-potential-instances
common testDependencies
......@@ -706,35 +699,24 @@ common testDependencies
base >=4.7 && <5
, QuickCheck ^>= 2.14.2
, aeson ^>= 2.1.2.1
, aeson-pretty ^>= 0.8.9
, aeson-qq
, async ^>= 2.2.4
, boolexpr ^>= 0.3
, bytestring ^>= 0.11.5.3
, cache >= 0.1.3.0
, case-insensitive
, conduit ^>= 1.3.4.2
, containers ^>= 0.6.7
, crawlerArxiv
, cryptohash
, directory ^>= 1.3.7.1
, epo-api-client
, extra ^>= 1.7.9
, fast-logger ^>= 3.2.2
, filepath ^>= 1.4.2.2
, fmt
, gargantext
, gargantext-prelude
, generic-arbitrary >= 1.0.1 && < 2
, graphviz ^>= 2999.20.1.0
, haskell-bee
, hspec ^>= 2.11.1
, hspec-core
, hspec-expectations >= 0.8 && < 0.9
, hspec-expectations-lifted < 0.11
, hspec-wai
, hspec-wai-json
, http-api-data >= 0.5 && < 0.6
, http-client ^>= 0.7.14
-- important: 0.3.6.1 uses cryptonite, while > uses crypton
, http-client-tls == 0.3.6.1
......@@ -747,43 +729,25 @@ common testDependencies
, patches-class ^>= 0.1.0.1
, patches-map ^>= 0.1.0.1
, postgres-options >= 0.2 && < 0.3
, postgresql-simple >= 0.6.4 && < 0.7
, pretty ^>= 1.1.3.6
, process ^>= 1.6.18.0
, protolude ^>= 0.3.3
, postgresql-simple >= 0.6.4 && <= 0.7.0.0
, quickcheck-instances ^>= 0.3.25.2
, raw-strings-qq
, recover-rtti >= 0.4 && < 0.5
, resource-pool >= 0.4.0.0 && < 0.5
, safe-exceptions >= 0.1.7.4 && < 0.2
, servant-auth
, servant-auth
, servant-auth-client
, servant-client >= 0.20 && < 0.21
, servant-client-core >= 0.20 && < 0.21
, servant-server >= 0.18.3 && < 0.21
, servant-websockets >= 2.0.0 && < 2.1
, shelly >= 1.9 && < 2
, split
, stm >= 2.5.1.0 && < 2.6
, streaming-commons
, tasty >= 1.4.3 && < 1.6
, tasty-golden
, tasty-hspec
, tasty-hunit
, tasty-quickcheck
, tasty-smallcheck
, template-haskell ^>= 2.19.0.0
, text ^>= 2.0.2
, time ^>= 1.12.2
, tmp-postgres >= 1.34.1 && < 1.35
, tree-diff
, unicode-collation >= 0.1.3.5
, unliftio
, unordered-containers ^>= 0.2.16.0
, utf8-string ^>= 1.0.2
, validity ^>= 0.12.0.2
, vector ^>= 0.12.3.0
, wai
, wai-extra
, warp
......@@ -795,6 +759,23 @@ test-suite garg-test-tasty
, testDependencies
type: exitcode-stdio-1.0
main-is: drivers/tasty/Main.hs
build-depends:
aeson-pretty ^>= 0.8.9
, boolexpr ^>= 0.3
, conduit ^>= 1.3.4.2
, crawlerArxiv
, cryptohash
, directory ^>= 1.3.7.1
, graphviz ^>= 2999.20.1.0
, split
, tasty >= 1.4.3 && < 1.6
, tasty-golden
, tasty-hspec
, time ^>= 1.12.2
, unicode-collation >= 0.1.3.5
, unordered-containers ^>= 0.2.16.0
, utf8-string ^>= 1.0.2
, vector >= 0.12.3.0 && <= 0.13.1.0
other-modules:
CLI.Phylo.Common
Paths_gargantext
......@@ -857,6 +838,7 @@ test-suite garg-test-hspec
, testDependencies
type: exitcode-stdio-1.0
main-is: drivers/hspec/Main.hs
build-depends: process ^>= 1.6.18.0
other-modules:
Paths_gargantext
Test.API
......
......@@ -18,11 +18,12 @@ module Gargantext.API.Admin.Orchestrator.Types
where
import Data.Aeson (genericParseJSON, genericToJSON)
import Data.Morpheus.Types ( GQLType, typeOptions )
import Data.Morpheus.Types ( GQLType, VisitType(visitFieldNames) )
import Data.Swagger (ToSchema, URL, declareNamedSchema, defaultSchemaOptions, genericDeclareNamedSchemaUnrestricted)
import Gargantext.API.GraphQL.UnPrefix qualified as GQLU
-- import Gargantext.API.GraphQL.UnPrefix qualified as GQLU
import Gargantext.Core.Types (TODO(..))
import Gargantext.Core.Utils.Aeson (jsonOptions)
import Gargantext.Core.Utils.Prefix (dropPrefixT)
import Gargantext.Prelude
import Test.QuickCheck (elements)
import Test.QuickCheck.Arbitrary
......@@ -74,8 +75,9 @@ instance ToJSON ScraperEvent where
instance FromJSON ScraperEvent where
parseJSON = genericParseJSON $ jsonOptions "_scev_"
instance ToSchema ScraperEvent -- TODO _scev_ prefix
instance GQLType ScraperEvent where
typeOptions _ = GQLU.unPrefix "_scev_"
instance GQLType ScraperEvent
instance VisitType ScraperEvent where
visitFieldNames _ = dropPrefixT "_scev_"
data JobLog = JobLog
......@@ -102,6 +104,7 @@ instance ToJSON JobLog where
instance FromJSON JobLog where
parseJSON = genericParseJSON $ jsonOptions "_scst_"
instance ToSchema JobLog -- TODO _scst_ prefix
instance GQLType JobLog where
typeOptions _ = GQLU.unPrefix "_scst_"
instance GQLType JobLog
-- typeOptions _ = GQLU.unPrefix "_scst_"
instance VisitType JobLog where
visitFieldNames _ = dropPrefixT "_scst_"
......@@ -12,12 +12,12 @@ Portability : POSIX
module Gargantext.API.GraphQL.UnPrefix where
import Data.Morpheus.Types (GQLTypeOptions, fieldLabelModifier)
import Data.Text qualified as T
import Gargantext.Core.Utils.Prefix (unCapitalize, dropPrefix)
import Gargantext.Prelude
-- import Data.Morpheus.Types (GQLTypeOptions, fieldLabelModifier)
-- import Data.Text qualified as T
-- import Gargantext.Core.Utils.Prefix (unCapitalize, dropPrefix)
-- import Gargantext.Prelude
unPrefix :: T.Text -> GQLTypeOptions -> GQLTypeOptions
unPrefix prefix options = options { fieldLabelModifier = nflm }
where
nflm label = unCapitalize $ dropPrefix (T.unpack prefix) $ ( fieldLabelModifier options ) label
-- unPrefix :: T.Text -> GQLTypeOptions -> GQLTypeOptions
-- unPrefix prefix options = options { fieldLabelModifier = nflm }
-- where
-- nflm label = unCapitalize $ dropPrefix (T.unpack prefix) $ ( fieldLabelModifier options ) label
......@@ -15,7 +15,7 @@ Portability : POSIX
module Gargantext.API.GraphQL.UserInfo where
import Control.Lens
import Data.Morpheus.Types ( GQLType, description )
import Data.Morpheus.Types ( GQLType, VisitType(visitTypeDescription) )
import Data.Text qualified as T
import Gargantext.Database.Admin.Types.Hyperdata
( HyperdataUser(..)
......@@ -75,8 +75,9 @@ data UserInfo = UserInfo
, ui_cwDescription :: Maybe Text
}
deriving (Generic, Show)
instance GQLType UserInfo where
description = const $ Just "provides user info"
instance GQLType UserInfo
instance VisitType UserInfo where
visitTypeDescription _ = const $ Just "provides user info"
-- | Arguments to the "user info" query.
data UserInfoArgs
......
......@@ -19,6 +19,7 @@ module Gargantext.Core.Types.Individu
where
import Data.Aeson
import Data.Morpheus.Types (GQLType)
import Data.Swagger
import Data.Text (pack, reverse)
import Data.Text qualified as T
......@@ -45,6 +46,7 @@ type Username = Text
type HashPassword = Auth.PasswordHash Auth.Argon2
newtype GargPassword = GargPassword Text
deriving (Generic)
instance GQLType GargPassword
toGargPassword :: Text -> GargPassword
toGargPassword x = GargPassword x
......
......@@ -16,13 +16,14 @@ module Gargantext.Core.Utils.Prefix
( module Gargantext.Core.Utils.Prefix
) where
import Prelude
import Data.Aeson (Value, defaultOptions, parseJSON)
import Data.Aeson.TH (Options, fieldLabelModifier, omitNothingFields, sumEncoding, SumEncoding(UntaggedValue))
import Data.Aeson.Types (Parser)
import Data.Char (toLower)
import Data.Maybe (fromMaybe)
import Data.Swagger.SchemaOptions (SchemaOptions, fromAesonOptions)
import Data.Text qualified as T
import Prelude
import Text.Read (readMaybe)
......@@ -64,3 +65,6 @@ parseJSONFromString v = do
case readMaybe (numString :: String) of
Nothing -> fail $ "Invalid number for TransactionID: " ++ show v -- TODO error message too specific
Just n -> pure n
dropPrefixT :: T.Text -> T.Text -> T.Text
dropPrefixT prefix input = fromMaybe input (T.stripPrefix prefix input)
......@@ -19,10 +19,10 @@ Portability : POSIX
module Gargantext.Database.Admin.Types.Hyperdata.Contact
where
import Data.Morpheus.Types (GQLType(..))
import Data.Morpheus.Types (GQLType, VisitType(visitFieldNames))
import Data.Time.Segment (jour)
import Gargantext.API.GraphQL.UnPrefix qualified as GAGU
import Gargantext.Core.Text (HasText(..))
import Gargantext.Core.Utils.Prefix (dropPrefixT)
import Gargantext.Database.Admin.Types.Hyperdata.Prelude
import Gargantext.Prelude
import Gargantext.Utils.UTCTime ( NUTCTime(..) )
......@@ -37,8 +37,9 @@ data HyperdataContact =
, _hc_lastValidation :: Maybe Text -- TODO UTCTime
} deriving (Eq, Show, Generic)
instance GQLType HyperdataContact where
typeOptions _ = GAGU.unPrefix "_hc_"
instance GQLType HyperdataContact
instance VisitType HyperdataContact where
visitFieldNames _ = dropPrefixT "_hc_"
instance HasText HyperdataContact
where
......@@ -93,8 +94,9 @@ data ContactWho =
, _cw_description :: Maybe Text
} deriving (Eq, Show, Generic)
instance GQLType ContactWho where
typeOptions _ = GAGU.unPrefix "_cw_"
instance GQLType ContactWho
instance VisitType ContactWho where
visitFieldNames _ = dropPrefixT "_cw_"
type FirstName = Text
type LastName = Text
......@@ -127,8 +129,9 @@ data ContactWhere =
, _cw_exit :: Maybe NUTCTime
} deriving (Eq, Show, Generic)
instance GQLType ContactWhere where
typeOptions _ = GAGU.unPrefix "_cw_"
instance GQLType ContactWhere
instance VisitType ContactWhere where
visitFieldNames _ = dropPrefixT "_cw_"
defaultContactWhere :: ContactWhere
defaultContactWhere =
......@@ -149,8 +152,9 @@ data ContactTouch =
, _ct_url :: Maybe Text
} deriving (Eq, Show, Generic)
instance GQLType ContactTouch where
typeOptions _ = GAGU.unPrefix "_ct_"
instance GQLType ContactTouch
instance VisitType ContactTouch where
visitFieldNames _ = dropPrefixT "_ct_"
defaultContactTouch :: ContactTouch
defaultContactTouch =
......
......@@ -18,9 +18,9 @@ Portability : POSIX
module Gargantext.Database.Admin.Types.Hyperdata.User
where
import Data.Morpheus.Types (GQLType(typeOptions))
import qualified Gargantext.API.GraphQL.UnPrefix as GAGU
import Data.Morpheus.Types (GQLType, VisitType(visitFieldNames))
import Gargantext.Core (Lang(..))
import Gargantext.Core.Utils.Prefix (dropPrefixT)
import Gargantext.Database.Admin.Types.Hyperdata.Prelude
import Gargantext.Database.Admin.Types.Hyperdata.Contact
import Gargantext.Database.Admin.Types.Node (DocumentId)
......@@ -38,17 +38,20 @@ data HyperdataUser =
, _hu_epo_api_token :: !(Maybe Text)
} deriving (Eq, Show, Generic)
instance GQLType HyperdataUser where
typeOptions _ = GAGU.unPrefix "_hu_"
instance GQLType HyperdataUser
instance VisitType HyperdataUser where
visitFieldNames _ = dropPrefixT "_hu_"
data HyperdataPrivate =
HyperdataPrivate { _hpr_password :: !Text
, _hpr_lang :: !Lang
}
deriving (Eq, Show, Generic)
deriving (Eq, Show, Generic, GQLType)
instance GQLType HyperdataPrivate where
typeOptions _ = GAGU.unPrefix "_hpr_"
-- instance GQLType HyperdataPrivate where
-- typeOptions _ = GAGU.unPrefix "_hpr_"
instance VisitType HyperdataPrivate where
visitFieldNames _ = dropPrefixT "_hpr_"
data HyperdataPublic =
......@@ -57,8 +60,9 @@ data HyperdataPublic =
}
deriving (Eq, Show, Generic)
instance GQLType HyperdataPublic where
typeOptions _ = GAGU.unPrefix "_hpu_"
instance GQLType HyperdataPublic
instance VisitType HyperdataPublic where
visitFieldNames _ = dropPrefixT "_hpu_"
-- | Default
defaultHyperdataUser :: HyperdataUser
......
......@@ -32,7 +32,7 @@ module Gargantext.Database.Query.Join ( leftJoin2
import Control.Arrow ((>>>), returnA)
import Data.Profunctor.Product.Default ( Default )
import Gargantext.Prelude ( Applicative((<*>)), (<$>) )
import Opaleye hiding (keepWhen)
import Opaleye
import Opaleye.Internal.Join (NullMaker(..))
......
......@@ -41,10 +41,10 @@ insertContextNodeNgrams = insertContextNodeNgramsW
insertContextNodeNgramsW :: [ContextNodeNgramsWrite] -> DBCmd err Int
insertContextNodeNgramsW nnnw =
mkCmd $ \c -> fromIntegral <$> runInsert_ c insertNothing
mkCmd $ \c -> fromIntegral <$> runInsert c insertNothing
where
insertNothing = Insert { iTable = contextNodeNgramsTable
, iRows = nnnw
, iReturning = rCount
, iOnConflict = Just DoNothing
, iOnConflict = Just doNothing
}
......@@ -37,10 +37,10 @@ insertContextNodeNgrams2 = insertContextNodeNgrams2W
insertContextNodeNgrams2W :: [ContextNodeNgrams2Write] -> DBCmd err Int
insertContextNodeNgrams2W nnnw =
mkCmd $ \c -> fromIntegral <$> runInsert_ c insertNothing
mkCmd $ \c -> fromIntegral <$> runInsert c insertNothing
where
insertNothing = Insert { iTable = contextNodeNgrams2Table
, iRows = nnnw
, iReturning = rCount
, iOnConflict = (Just DoNothing)
, iOnConflict = (Just doNothing)
}
......@@ -130,7 +130,7 @@ selectNodesWith' parentId maybeNodeType = proc () -> do
deleteNode :: NodeId -> DBCmd err Int
deleteNode n = mkCmd $ \conn ->
fromIntegral <$> runDelete_ conn
fromIntegral <$> runDelete conn
(Delete nodeTable
(\(Node n_id _ _ _ _ _ _ _) -> n_id .== pgNodeId n)
rCount
......@@ -138,7 +138,7 @@ deleteNode n = mkCmd $ \conn ->
deleteNodes :: [NodeId] -> DBCmd err Int
deleteNodes ns = mkCmd $ \conn ->
fromIntegral <$> runDelete_ conn
fromIntegral <$> runDelete conn
(Delete nodeTable
(\(Node n_id _ _ _ _ _ _ _) -> in_ ((map pgNodeId ns)) n_id)
rCount
......@@ -380,7 +380,7 @@ node nodeType name hyperData parentId userId =
-------------------------------
insertNodesR :: [NodeWrite] -> DBCmd err [NodeId]
insertNodesR ns = mkCmd $ \conn ->
runInsert_ conn (Insert nodeTable ns (rReturning (\(Node i _ _ _ _ _ _ _) -> i)) Nothing)
runInsert conn (Insert nodeTable ns (rReturning (\(Node i _ _ _ _ _ _ _) -> i)) Nothing)
insertNodesWithParentR :: Maybe ParentId -> [NodeWrite] -> DBCmd err [NodeId]
insertNodesWithParentR pid ns = insertNodesR (set node_parent_id (pgNodeId <$> pid) <$> ns)
......
......@@ -31,7 +31,7 @@ updateHyperdata i h = do
mkCmd $ \c -> do
-- res <- withLogger () $ \ioLogger -> do
-- logMsg ioLogger DEBUG "[updateHyperdata] before runUpdate_"
res <- runUpdate_ c $ updateHyperdataQuery i h
res <- runUpdate c $ updateHyperdataQuery i h
-- logMsg ioLogger DEBUG $ "[updateHyperdata] after runUpdate_: " <> show res
pure res
-- withLogger () $ \ioLogger -> do
......
......@@ -299,8 +299,8 @@ getContextNgramsMatchingFTS contextId listId = do
OR contexts.search @@ plainto_tsquery('french', ngrams.terms)) |]
------------------------------------------------------------------------
insertNodeContext :: [NodeContext] -> DBCmd err Int
insertNodeContext ns = mkCmd $ \conn -> fromIntegral <$> (runInsert_ conn
$ Insert nodeContextTable ns' rCount (Just DoNothing))
insertNodeContext ns = mkCmd $ \conn -> fromIntegral <$> (runInsert conn
$ Insert nodeContextTable ns' rCount (Just doNothing))
where
ns' :: [NodeContextWrite]
ns' = map (\(NodeContext i n c x y)
......@@ -318,7 +318,7 @@ type Context_Id = NodeId
deleteNodeContext :: Node_Id -> Context_Id -> DBCmd err Int
deleteNodeContext n c = mkCmd $ \conn ->
fromIntegral <$> runDelete_ conn
fromIntegral <$> runDelete conn
(Delete nodeContextTable
(\(NodeContext _ n_id c_id _ _) -> n_id .== pgNodeId n
.&& c_id .== pgNodeId c
......
......@@ -127,8 +127,8 @@ getNodeNodeWith pId _ maybeNodeType = runOpaQuery query
-- the share being created is valid. Use the other functions like
-- 'shareNode', 'publishNode', or roll your own.
insertNodeNode :: [NodeNode] -> DBCmd err Int
insertNodeNode ns = mkCmd $ \conn -> fromIntegral <$> (runInsert_ conn
$ Insert nodeNodeTable ns' rCount (Just DoNothing))
insertNodeNode ns = mkCmd $ \conn -> fromIntegral <$> (runInsert conn
$ Insert nodeNodeTable ns' rCount (Just doNothing))
where
ns' :: [NodeNodeWrite]
ns' = map (\(NodeNode n1 n2 x y)
......@@ -146,7 +146,7 @@ type Node2_Id = NodeId
deleteNodeNode :: Node1_Id -> Node2_Id -> DBCmd err Int
deleteNodeNode n1 n2 = mkCmd $ \conn ->
fromIntegral <$> runDelete_ conn
fromIntegral <$> runDelete conn
(Delete nodeNodeTable
(\(NodeNode n1_id n2_id _ _) -> n1_id .== pgNodeId n1
.&& n2_id .== pgNodeId n2
......
......@@ -19,12 +19,12 @@ Functions to deal with users, database side.
module Gargantext.Database.Schema.User where
import Data.Morpheus.Types (GQLType(typeOptions))
import Data.Morpheus.Types (GQLType, VisitType(visitFieldNames))
import Data.Time (UTCTime)
import Database.PostgreSQL.Simple.FromField (FromField, fromField)
import Gargantext.API.GraphQL.UnPrefix qualified as GAGU
-- import Gargantext.API.GraphQL.UnPrefix qualified as GAGU
import Gargantext.Core.Types.Individu (GargPassword, toGargPassword)
import Gargantext.Core.Utils.Prefix (unPrefix)
import Gargantext.Core.Utils.Prefix (unPrefix, dropPrefixT)
import Gargantext.Database.Prelude (fromField')
import Gargantext.Prelude
......@@ -44,8 +44,9 @@ data UserLight = UserLight { userLight_id :: !UserId
, userLight_password :: !GargPassword
, userLight_forgot_password_uuid :: !(Maybe Text)
} deriving (Show, Generic)
instance GQLType UserLight where
typeOptions _ = GAGU.unPrefix "userLight_"
instance GQLType UserLight
instance VisitType UserLight where
visitFieldNames _ = dropPrefixT "userLight_"
toUserLight :: UserDB -> UserLight
toUserLight (UserDB { user_id
......
......@@ -50,6 +50,7 @@
- "hspec-core-2.11.9"
- "hspec-discover-2.11.9"
- "hspec-expectations-0.8.4"
- "html-entities-1.1.4.7"
- "http-accept-0.2"
- "http-api-data-0.5.1"
- "http-client-0.7.14"
......@@ -71,30 +72,36 @@
- "microlens-th-0.4.3.15"
- "mono-traversable-1.0.17.0"
- "monoid-extras-0.6.3"
- "morpheus-graphql-0.24.3"
- "morpheus-graphql-app-0.24.3"
- "morpheus-graphql-client-0.24.3"
- "morpheus-graphql-code-gen-0.24.3"
- "morpheus-graphql-code-gen-utils-0.24.3"
- "morpheus-graphql-core-0.24.3"
- "morpheus-graphql-server-0.24.3"
- "morpheus-graphql-subscriptions-0.24.3"
- "morpheus-graphql-0.28.0"
- "morpheus-graphql-app-0.28.0"
- "morpheus-graphql-client-0.28.1"
- "morpheus-graphql-code-gen-0.28.1"
- "morpheus-graphql-code-gen-utils-0.28.1"
- "morpheus-graphql-core-0.28.1"
- "morpheus-graphql-server-0.28.0"
- "morpheus-graphql-subscriptions-0.28.0"
- "mwc-random-0.15.1.0"
- "network-control-0.0.2"
- "opaleye-0.10.3.1"
- "ordered-containers-0.2.4"
- "os-string-2.0.6"
- "password-3.0.4.0"
- "postgres-options-0.2.2.0"
- "postgresql-libpq-0.10.2.0"
- "postgresql-libpq-configure-0.10.0.1"
- "postgresql-simple-0.7.0.0"
- "primitive-0.7.4.0"
- "primitive-extras-0.10.2"
- "primitive-unlifted-2.1.0.0"
- "protolude-0.3.4"
- "rake-0.0.1"
- "random-1.2.1.2"
- "recover-rtti-0.4.3"
- "random-strings-0.1.1.0"
- "rdf4h-5.1.0"
- "reflection-2.1.8"
- "resourcet-1.3.0"
- "safe-0.3.21"
- "selective-0.7.0.1"
- "servant-0.20.2"
- "servant-auth-0.4.2.0"
- "servant-auth-client-0.4.2.0"
......@@ -126,6 +133,7 @@
- "th-compat-0.1.5"
- "these-1.2.1"
- "time-compat-1.9.7"
- "toml-parser-2.0.1.0"
- "type-equality-1.0.1"
- "typed-process-0.2.12.0"
- "unicode-collation-0.1.3.6"
......@@ -137,8 +145,8 @@
- "uuid-1.3.16"
- "uuid-types-1.0.6"
- "validity-0.12.1.0"
- "vector-0.12.3.1"
- "vector-algorithms-0.9.0.2"
- "vector-stream-0.1.0.1"
- "wai-app-static-3.1.9"
- "wai-extra-3.1.15"
- "wai-logger-2.4.1"
......@@ -160,10 +168,6 @@
git: "https://github.com/AccelerateHS/accelerate.git"
subdirs:
- .
- commit: 232db57d6ce0940fcc902adf30a9ed3f3561f21d
git: "https://github.com/MercuryTechnologies/ekg-json.git"
subdirs:
- .
- commit: c90b7bc55b0e628d0b71ccee4e222833a19792f8
git: "https://github.com/adinapoli/http-reverse-proxy.git"
subdirs:
......@@ -212,12 +216,8 @@
git: "https://github.com/garganscript/nanomsg-haskell"
subdirs:
- .
- commit: 4a291783f4aa83548eac5009e16e8bdcb5ddc667
git: "https://github.com/glguy/toml-parser"
subdirs:
- .
- commit: 4fd2edf30c141600ffad6d730cc4c1c08a6dbce4
git: "https://github.com/robstewart57/rdf4h.git"
- commit: bd0592818882f9cf34d2991d01f7dcb3d8bca309
git: "https://github.com/haskell-github-trust/ekg-json"
subdirs:
- .
- commit: a3875fe652d3bb5acb522674c22c6c814c1b4ad0
......@@ -256,10 +256,18 @@
git: "https://gitlab.iscpif.fr/gargantext/gargantext-graph.git"
subdirs:
- .
- commit: d3c0b658aae5dedce04f4f1605e4a6605efebd31
- commit: 69b7388a62f2afb5cb5609beac96e8cb35e94478
git: "https://gitlab.iscpif.fr/gargantext/haskell-bee"
subdirs:
- .
- "haskell-bee-pgmq/"
- commit: 69b7388a62f2afb5cb5609beac96e8cb35e94478
git: "https://gitlab.iscpif.fr/gargantext/haskell-bee"
subdirs:
- "haskell-bee-tests/"
- commit: 69b7388a62f2afb5cb5609beac96e8cb35e94478
git: "https://gitlab.iscpif.fr/gargantext/haskell-bee"
subdirs:
- "haskell-bee/"
- commit: bb15d828d5ef36eeaa84cccb00598b585048c88e
git: "https://gitlab.iscpif.fr/gargantext/haskell-gargantext-prelude"
subdirs:
......@@ -466,13 +474,6 @@ flags:
http2:
devel: false
h2spec: false
hxt:
"network-uri": false
profile: false
"hxt-charproperties":
profile: false
"hxt-regex-xmlschema":
profile: false
"integer-logarithms":
"check-bounds": false
"integer-gmp": true
......@@ -688,6 +689,9 @@ flags:
httpbin: false
wuss:
pedantic: false
xeno:
libxml2: false
"whitespace-around-equals": false
yaml:
"no-examples": true
"no-exe": true
......
......@@ -27,7 +27,7 @@ tests = describe "Microservices proxy" $ do
writeFrameTests
writeFrameTests :: Spec
writeFrameTests = parallel $ aroundAll withBackendServerAndProxy $ beforeAllWith (\ctx@(testEnv, _, _) -> setupEnvironment testEnv >>= (const $ pure ctx)) $ do
writeFrameTests = sequential $ aroundAll withBackendServerAndProxy $ beforeAllWith (\ctx@(testEnv, _, _) -> setupEnvironment testEnv >>= (const $ pure ctx)) $ do
describe "Write Frame Reverse Proxy" $ do
it "should disallow unauthenticated requests" $ \(_testEnv, _serverPort, proxyPort) -> do
baseUrl <- parseBaseUrl "http://localhost"
......
......@@ -57,7 +57,7 @@ main = do
hSetBuffering stdout NoBuffering
-- TODO Ideally remove start/stop notifications and use
-- Test/API/Setup to initialize this in env
bracket startCoreNLPServer stopCoreNLPServer $ \_ -> hspec $ do
bracket startCoreNLPServer stopCoreNLPServer $ \_ -> hspec $ sequential $ do
API.tests
ReverseProxy.tests
DB.tests
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment