Skip to content

Commit

Permalink
Update test matrix with new stackage lts and nightly
Browse files Browse the repository at this point in the history
We now explictly test ghc 9.10.1 with the stackage nightly.

Also updates some of the ci gated warning flags and small amounts of
code to be compliant with the additional warnings.
  • Loading branch information
telser committed Dec 18, 2024
1 parent a998108 commit 96d388c
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 12 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
"stack-lts-19.33-ghc-9.0.2.yaml",
"stack-lts-20.26-ghc-9.2.8.yaml",
"stack-lts-21.22-ghc-9.4.8.yaml",
"stack-nightly-2024-10-22-ghc-9.8.3.yaml",
"stack-lts-22.28-ghc-9.6.6.yaml",
"stack-nightly-2024-12-17-ghc-9.10.1.yaml",
"stack.yaml"]

include:
Expand Down Expand Up @@ -180,6 +181,11 @@ jobs:
docker compose build -q
- name: Build with cabal and latest ghc+deps
# When a new ghc version is released, we might not be able to build all the dependencies for
# a little while. So we need to allow failure here. It is a very unfortunate situation that
# github does not give us a better UX for this as the closest thing to a required check is
# not configured here, but seemingly only through the api/webui for "branch protection"
continue-on-error: true
run: |
set -e
Expand Down
6 changes: 4 additions & 2 deletions orville-postgresql/orville-postgresql.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ license: MIT
license-file: LICENSE
build-type: Simple
tested-with:
GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.6, GHC == 9.8.3, GHC == 9.10.1
GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.6, GHC == 9.8.4, GHC == 9.10.1
extra-source-files:
CHANGELOG.md

Expand Down Expand Up @@ -192,7 +192,9 @@ library
, uuid >=1.3.15 && <1.4
default-language: Haskell2010
if flag(ci)
ghc-options: -Wall -Werror -Wcompat -Widentities -Wincomplete-uni-patterns -Wincomplete-patterns -Wincomplete-record-updates -Wmissing-local-signatures -Wmissing-export-lists -Wmissing-import-lists -Wnoncanonical-monad-instances -Wredundant-constraints -Wpartial-fields -Wmissed-specialisations -Wno-implicit-prelude -Wno-safe -Wno-unsafe
ghc-options: -Wall -Werror -Wcompat -Widentities -Wincomplete-uni-patterns -Wincomplete-patterns -Wincomplete-record-updates -Wmissing-local-signatures -Wmissing-export-lists -Wmissing-import-lists -Wmonomorphism-restriction -Wnoncanonical-monad-instances -Wpartial-fields -Wredundant-constraints -Wmissed-specialisations -Wno-implicit-prelude -Wno-safe -Wno-unsafe
if impl (ghc >= 9.8)
ghc-options: -Wterm-variable-capture
else
ghc-options: -Wall -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates

Expand Down
18 changes: 16 additions & 2 deletions orville-postgresql/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ maintainer: [email protected]
license: MIT
license-file: LICENSE
git: [email protected]:flipstone/orville.git
tested-with: GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.6, GHC == 9.8.3, GHC == 9.10.1
tested-with: GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.6, GHC == 9.8.4, GHC == 9.10.1

extra-source-files:
- CHANGELOG.md
Expand Down Expand Up @@ -145,13 +145,27 @@ library:
- -Wmissing-local-signatures
- -Wmissing-export-lists
- -Wmissing-import-lists
- -Wmonomorphism-restriction
- -Wnoncanonical-monad-instances
- -Wredundant-constraints
- -Wpartial-fields
- -Wredundant-constraints
- -Wmissed-specialisations
- -Wno-implicit-prelude
- -Wno-safe
- -Wno-unsafe
when:
- condition: impl (ghc >= 9.2)
ghc-options:
- -Woperator-whitespace
- -Wredundant-bang-patterns
when:
- condition: impl (ghc >= 9.4)
ghc-options:
- -Wredundant-strictness-flags
when:
- condition: impl (ghc >= 9.8)
ghc-options:
- -Wterm-variable-capture
else:
ghc-options:
- -Wall
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ withTransaction action =
callback =
OrvilleState.orvilleTransactionCallback state

beginTransaction :: Monad.MonadOrville m => m ()
beginTransaction = do
liftIO $ do
let
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ aggregateExpression function mbAggOption parameters mbOrderByClause mbFilter =
aggregateStarExpression :: FunctionName -> Maybe Filter.FilterExpr -> ValueExpression.ValueExpression
aggregateStarExpression function mbFilter =
let
parameters :: [ValueExpression.ValueExpression]
parameters = pure . RawSql.unsafeFromRawSql $ RawSql.fromString "*"
filtering =
case mbFilter of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ accquireTransactionLock options =

go $ attempts + 1

attemptLockAcquisition :: m Bool
attemptLockAcquisition = do
tryLockResults <-
Exec.executeAndDecode Exec.OtherQuery (tryLockExpr lockId) lockedMarshaller
Expand Down
4 changes: 2 additions & 2 deletions orville-postgresql/src/Orville/PostgreSQL/Plan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -748,15 +748,15 @@ chainMaybe ::
Plan scope a (Maybe b) ->
Plan scope b (Maybe c) ->
Plan scope a (Maybe c)
chainMaybe a b =
chainMaybe aPlan bPlan =
let
optionalInput ::
Plan scope a (Maybe b) ->
Plan scope (Maybe a) (Maybe b)
optionalInput =
fmap join . planMaybe
in
Chain a (optionalInput b)
Chain aPlan (optionalInput bPlan)

{- |
'assert' allows you to make an assertion about a plan's result that will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ byFieldTuple fieldDefA fieldDefB =
<$> Marshall.marshallField (fst . accessor) fieldDefA
<*> Marshall.marshallField (snd . accessor) fieldDefB

packAll :: NonEmpty (String, String) -> NonEmpty (T.Text, T.Text)
packAll =
fmap (\(a, b) -> (T.pack a, T.pack b))
in
Expand Down
1 change: 1 addition & 0 deletions orville-postgresql/src/Orville/PostgreSQL/Raw/PgTime.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ utcTime = do
let
offsetSeconds :: Int
offsetSeconds = (second + minute * 60 + hour * 3600) * if sign == '+' then (-1) else 1
offsetNominalDiffTime :: Time.NominalDiffTime
offsetNominalDiffTime = fromIntegral offsetSeconds
diffTime = Time.timeOfDayToTime (Time.localTimeOfDay lt)
utcTimeWithoutOffset = Time.UTCTime (Time.localDay lt) diffTime
Expand Down
5 changes: 5 additions & 0 deletions orville-postgresql/stack-lts-22.28-ghc-9.6.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
resolver: lts-22.28
packages:
- .
allow-different-user: true
12 changes: 12 additions & 0 deletions orville-postgresql/stack-lts-22.28-ghc-9.6.6.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files

packages: []
snapshots:
- completed:
sha256: 87da71cb0ae9ee1ea1bf51a8eb9812f39f779be76abc0a3c926defd8afda05d1
size: 719139
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/28.yaml
original: lts-22.28
2 changes: 1 addition & 1 deletion orville-postgresql/stack.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
resolver: lts-22.39
resolver: lts-23.0
packages:
- .
allow-different-user: true
8 changes: 4 additions & 4 deletions orville-postgresql/stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
packages: []
snapshots:
- completed:
sha256: 6c5aeace2ca5ecde793a9e0acfaa730ec8f384aa2f6183a2a252f5f9ec55d623
size: 720039
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/39.yaml
original: lts-22.39
sha256: 9444fadfa30b67a93080254d53872478c087592ad64443e47c546cdcd13149ae
size: 678857
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/0.yaml
original: lts-23.0

0 comments on commit 96d388c

Please sign in to comment.