Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump http-client #1138

Merged
merged 3 commits into from Jun 18, 2020
Merged

Bump http-client #1138

merged 3 commits into from Jun 18, 2020

Conversation

arianvp
Copy link
Contributor

@arianvp arianvp commented Jun 17, 2020

Still some issues. The bump breaks hspec-wai but I would've expect this break to show up as a version bound conflict. Is this stack being weird?

[nix-shell:~/Projects/wire/wire-server]$ stack build
warning: attempt to call something which is not a function but a set, at (string):1:2; will use bash from your environment
galley-0.83.0: unregistering (missing dependencies: zauth)
sodium-crypto-sign-0.1.2: unregistering (local file changes: /nix/store/c1zpndaxjvdzgygz8kzlbz3k53bmnh01-ghc-8.6.5/lib/ghc-8.6.5/include/ghcversion.h /nix/sto...)
zauth-0.10.3: unregistering (missing dependencies: sodium-crypto-sign)
sodium-crypto-sign      > build (lib)
sodium-crypto-sign      > Preprocessing library for sodium-crypto-sign-0.1.2..
sodium-crypto-sign      > Building library for sodium-crypto-sign-0.1.2..
sodium-crypto-sign      > copy/register
sodium-crypto-sign      > Installing library in /home/arian/Projects/wire/wire-server/.stack-work/install/x86_64-linux-nix/0206a7923d0180ed19934bae4360b93c888fb7feebbfafa1df0803cfedfcf5a8/8.6.5/lib/x86_64-linux-ghc-8.6.5/sodium-crypto-sign-0.1.2-FB53I3qGvx2yMlqYcAL3w
sodium-crypto-sign      > Registering library for sodium-crypto-sign-0.1.2..
zauth                   > build (lib + exe)
zauth                   > Preprocessing library for zauth-0.10.3..
zauth                   > Building library for zauth-0.10.3..
zauth                   > [1 of 4] Compiling Data.ZAuth.Token [flags changed]
zauth                   > [2 of 4] Compiling Data.ZAuth.Creation [flags changed]
zauth                   > [3 of 4] Compiling Data.ZAuth.Validation [flags changed]
zauth                   > Preprocessing executable 'zauth' for zauth-0.10.3..
zauth                   > Building executable 'zauth' for zauth-0.10.3..
zauth                   > Linking .stack-work/dist/x86_64-linux-nix/Cabal-2.4.0.1/build/zauth/zauth ...
zauth                   > copy/register
zauth                   > Installing library in /home/arian/Projects/wire/wire-server/.stack-work/install/x86_64-linux-nix/0206a7923d0180ed19934bae4360b93c888fb7feebbfafa1df0803cfedfcf5a8/8.6.5/lib/x86_64-linux-ghc-8.6.5/zauth-0.10.3-KiPnQyXqgVW6hnmpbacbJ4
zauth                   > Installing executable zauth in /home/arian/Projects/wire/wire-server/.stack-work/install/x86_64-linux-nix/0206a7923d0180ed19934bae4360b93c888fb7feebbfafa1df0803cfedfcf5a8/8.6.5/bin
zauth                   > Registering library for zauth-0.10.3..
brig                    > build (lib + internal-lib + exe)
spar                    > build (lib + exe)
galley                  > build (lib + exe)
spar                    > Preprocessing library for spar-0.1..
spar                    > Building library for spar-0.1..
galley                  > Preprocessing executable 'galley-migrate-data' for galley-0.83.0..
galley                  > Building executable 'galley-migrate-data' for galley-0.83.0..
brig                    > Preprocessing executable 'brig-schema' for brig-1.35.0..
brig                    > Building executable 'brig-schema' for brig-1.35.0..
galley                  > Preprocessing library for galley-0.83.0..
galley                  > Building library for galley-0.83.0..
brig                    > Preprocessing library for brig-1.35.0..
brig                    > Building library for brig-1.35.0..
spar                    > Preprocessing executable 'spar-schema' for spar-0.1..
spar                    > Building executable 'spar-schema' for spar-0.1..
galley                  > Preprocessing executable 'galley-schema' for galley-0.83.0..
galley                  > Building executable 'galley-schema' for galley-0.83.0..
spar                    > Preprocessing executable 'spar-integration' for spar-0.1..
spar                    > Building executable 'spar-integration' for spar-0.1..
spar                    > [13 of 14] Compiling Test.Spar.APISpec
galley                  > Preprocessing executable 'galley-integration' for galley-0.83.0..
galley                  > Building executable 'galley-integration' for galley-0.83.0..
brig                    > Preprocessing library 'brig-index-lib' for brig-1.35.0..
brig                    > Building library 'brig-index-lib' for brig-1.35.0..
spar                    >       
spar                    > /home/arian/Projects/wire/wire-server/services/spar/test-integration/Test/Spar/APISpec.hs:513:7: error:
spar                    >     • Could not deduce (Eq ResponseLBS)
spar                    >         arising from a use of ‘shouldRespondWith’
spar                    >       from the context: HasCallStack
spar                    >         bound by the type signature for:
spar                    >                    testGetPutDelete :: HasCallStack =>
spar                    >                                        (SparReq
spar                    >                                         -> Maybe UserId
spar                    >                                         -> IdPId
spar                    >                                         -> IdPMetadataInfo
spar                    >                                         -> Http ResponseLBS)
spar                    >                                        -> SpecWith TestEnv
spar                    >         at test-integration/Test/Spar/APISpec.hs:507:1-129
spar                    >       There are instances for similar types:
spar                    >         instance Eq Data.Swagger.Internal.Response
spar                    >           -- Defined in ‘Data.Swagger.Internal’
spar                    >         instance Eq payload => Eq (SAML.Response payload)
spar                    >           -- Defined in ‘SAML2.WebSSO.Types’
spar                    >     • In a stmt of a 'do' block:
spar                    >         whichone (env ^. teSpar) Nothing (IdPId UUID.nil) idpmeta
spar                    >           `shouldRespondWith` checkErr (== 404) "not-found"
spar                    >       In the second argument of ‘($)’, namely
spar                    >         ‘do env <- ask
spar                    >             (_, _, _, (idpmeta, _)) <- registerTestIdPWithMeta
spar                    >             whichone (env ^. teSpar) Nothing (IdPId UUID.nil) idpmeta
spar                    >               `shouldRespondWith` checkErr (== 404) "not-found"’
spar                    >       In a stmt of a 'do' block:
spar                    >         it "responds with 'not found'"
spar                    >           $ do env <- ask
spar                    >                (_, _, _, (idpmeta, _)) <- registerTestIdPWithMeta
spar                    >                whichone (env ^. teSpar) Nothing (IdPId UUID.nil) idpmeta
spar                    >                  `shouldRespondWith` checkErr (== 404) "not-found"
spar                    >     | 
spar                    > 513 |       whichone (env ^. teSpar) Nothing (IdPId UUID.nil) idpmeta
spar                    >     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
spar                    >       
spar                    > /home/arian/Projects/wire/wire-server/services/spar/test-integration/Test/Spar/APISpec.hs:762:13: error:
spar                    >     • Could not deduce (Eq ResponseLBS)
spar                    >         arising from a use of ‘shouldRespondWith’
spar                    >       from the context: HasCallStack
spar                    >         bound by the type signature for:
spar                    >                    initidp :: HasCallStack =>
spar                    >                               TestSpar (IdP, SignPrivCreds, SignPrivCreds)
spar                    >         at test-integration/Test/Spar/APISpec.hs:756:11-81
spar                    >       There are instances for similar types:
spar                    >         instance Eq Data.Swagger.Internal.Response
spar                    >           -- Defined in ‘Data.Swagger.Internal’
spar                    >         instance Eq payload => Eq (SAML.Response payload)
spar                    >           -- Defined in ‘SAML2.WebSSO.Types’
spar                    >     • In a stmt of a 'do' block:
spar                    >         callIdpUpdate'
spar                    >           (env ^. teSpar)
spar                    >           (Just owner)
spar                    >           (idp ^. idpId)
spar                    >           (IdPMetadataValue (cs $ SAML.encode idpmeta') undefined)
spar                    >           `shouldRespondWith` ((== 200) . statusCode)
spar                    >       In the expression:
spar                    >         do env <- ask
spar                    >            (owner, _, idp,
spar                    >             (IdPMetadataValue _ idpmeta,
spar                    >              oldPrivKey)) <- registerTestIdPWithMeta
spar                    >            (SampleIdP _ newPrivKey _ sampleIdPCert2) <- makeSampleIdPMetadata
spar                    >            let idpmeta'
spar                    >                  = idpmeta & edCertAuthnResponse .~ (sampleIdPCert2 :| ...)
spar                    >            ....
spar                    >       In an equation for ‘initidp’:
spar                    >           initidp
spar                    >             = do env <- ask
spar                    >                  (owner, _, idp,
spar                    >                   (IdPMetadataValue _ idpmeta,
spar                    >                    oldPrivKey)) <- registerTestIdPWithMeta
spar                    >                  (SampleIdP _ newPrivKey _ sampleIdPCert2) <- makeSampleIdPMetadata
spar                    >                  ....
spar                    >     | 
spar                    > 762 |             callIdpUpdate' (env ^. teSpar) (Just owner) (idp ^. idpId) (IdPMetadataValue (cs $ SAML.encode idpmeta') undefined)
spar                    >     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
spar                    >       
spar                    > /home/arian/Projects/wire/wire-server/services/spar/test-integration/Test/Spar/APISpec.hs:1143:7: error:
spar                    >     • No instance for (Eq ResponseLBS)
spar                    >         arising from a use of ‘shouldRespondWith’
spar                    >       There are instances for similar types:
spar                    >         instance Eq Data.Swagger.Internal.Response
spar                    >           -- Defined in ‘Data.Swagger.Internal’
spar                    >         instance Eq payload => Eq (SAML.Response payload)
spar                    >           -- Defined in ‘SAML2.WebSSO.Types’
spar                    >     • In a stmt of a 'do' block:
spar                    >         callSetDefaultSsoCode (env ^. teSpar) nonExisting
spar                    >           `shouldRespondWith` \ resp -> statusCode resp == 404
spar                    >       In the second argument of ‘($)’, namely
spar                    >         ‘do env <- ask
spar                    >             (_userid, _teamid, _idp) <- registerTestIdP
spar                    >             nonExisting <- IdPId <$> liftIO UUID.nextRandom
spar                    >             callSetDefaultSsoCode (env ^. teSpar) nonExisting
spar                    >               `shouldRespondWith` \ resp -> statusCode resp == 404’
spar                    >       In a stmt of a 'do' block:
spar                    >         it "does not allow setting non-existing SSO code"
spar                    >           $ do env <- ask
spar                    >                (_userid, _teamid, _idp) <- registerTestIdP
spar                    >                nonExisting <- IdPId <$> liftIO UUID.nextRandom
spar                    >                callSetDefaultSsoCode (env ^. teSpar) nonExisting
spar                    >                  `shouldRespondWith` \ resp -> statusCode resp == 404
spar                    >      |
spar                    > 1143 |       callSetDefaultSsoCode (env ^. teSpar) nonExisting
spar                    >      |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
spar                    >       
galley                  > Preprocessing executable 'galley' for galley-0.83.0..
galley                  > Building executable 'galley' for galley-0.83.0..
brig                    > Preprocessing executable 'brig-index' for brig-1.35.0..
brig                    > Building executable 'brig-index' for brig-1.35.0..
galley                  > copy/register
galley                  > Installing executable galley-migrate-data in /home/arian/Projects/wire/wire-server/.stack-work/install/x86_64-linux-nix/0206a7923d0180ed19934bae4360b93c888fb7feebbfafa1df0803cfedfcf5a8/8.6.5/bin
galley                  > Installing library in /home/arian/Projects/wire/wire-server/.stack-work/install/x86_64-linux-nix/0206a7923d0180ed19934bae4360b93c888fb7feebbfafa1df0803cfedfcf5a8/8.6.5/lib/x86_64-linux-ghc-8.6.5/galley-0.83.0-FGmtibPG7ZxDQfdRT9X6SJ
galley                  > Installing executable galley-schema in /home/arian/Projects/wire/wire-server/.stack-work/install/x86_64-linux-nix/0206a7923d0180ed19934bae4360b93c888fb7feebbfafa1df0803cfedfcf5a8/8.6.5/bin
galley                  > Installing executable galley-integration in /home/arian/Projects/wire/wire-server/.stack-work/install/x86_64-linux-nix/0206a7923d0180ed19934bae4360b93c888fb7feebbfafa1df0803cfedfcf5a8/8.6.5/bin
brig                    > Preprocessing executable 'brig-integration' for brig-1.35.0..
brig                    > Building executable 'brig-integration' for brig-1.35.0..
galley                  > Installing executable galley in /home/arian/Projects/wire/wire-server/.stack-work/install/x86_64-linux-nix/0206a7923d0180ed19934bae4360b93c888fb7feebbfafa1df0803cfedfcf5a8/8.6.5/bin
brig                    > [11 of 24] Compiling API.User.Auth
galley                  > Registering library for galley-0.83.0..
brig                    > 
brig                    > /home/arian/Projects/wire/wire-server/services/brig/test/integration/API/User/Auth.hs:606:12: error:
brig                    >     • No instance for (Eq Http.Cookie)
brig                    >         arising from a use of ‘assertEqual’
brig                    >       There are instances for similar types:
brig                    >         instance Eq a => Eq (Auth.Cookie a)
brig                    >           -- Defined in ‘Wire.API.User.Auth’
brig                    >     • In the second argument of ‘($)’, namely
brig                    >         ‘assertEqual "cookie" c' (decodeCookie _rs)’
brig                    >       In a stmt of a 'do' block:
brig                    >         liftIO $ assertEqual "cookie" c' (decodeCookie _rs)
brig                    >       In the expression:
brig                    >         do u <- randomUser b
brig                    >            let renewAge = Opts.setUserCookieRenewAge $ Opts.optSettings config
brig                    >            let minAge = fromIntegral $ renewAge * 1000000 + 1
brig                    >                Just email = userEmail u
brig                    >            _rs <- login
brig                    >                     b (emailLogin email defPassword (Just "nexus1")) PersistentCookie
brig                    >                     <!! const 200 === statusCode
brig                    >            ....
brig                    >     |
brig                    > 606 |   liftIO $ assertEqual "cookie" c' (decodeCookie _rs)
brig                    >     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
brig                    > 
                  
--  While building package brig-1.35.0 using:
      /home/arian/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-2.4.0.1 build lib:brig lib:brig-index-lib exe:brig exe:brig-index exe:brig-integration exe:brig-schema --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package spar-0.1 using:
      /home/arian/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-2.4.0.1 build lib:spar exe:spar exe:spar-integration exe:spar-schema --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
Progress 5/6

@mheinzel
Copy link
Contributor

The bump breaks hspec-wai but I would've expect this break to show up as a version bound conflict

I don't see any issues with hspec-wai, just spar tests. Am I missing something?

Also, we don't run into version bound issues because of allow-newer:

WARNING: Ignoring servant-client's bounds on http-client (>=0.5.13.1 && <0.7); using http-client-0.7.0.
Reason: allow-newer enabled.

WARNING: Ignoring amazonka-core's bounds on http-client (>=0.4 && <0.7); using http-client-0.7.0.
Reason: allow-newer enabled.

WARNING: Ignoring amazonka's bounds on http-client (>=0.4 && <0.7); using http-client-0.7.0.
Reason: allow-newer enabled.

@fisx
Copy link
Contributor

fisx commented Jun 18, 2020

ResponseLBS doesn't have Eq any more, because it contains Cookies. That's a good thing, though. The instance was even more dubious than the Cookie instance, since it also contains IO ByteString somewhere for streaming the body.

@fisx
Copy link
Contributor

fisx commented Jun 18, 2020

Luckily, the Eq instance was bogus. I'll push a small commit in a minute, hope that's ok.

@fisx
Copy link
Contributor

fisx commented Jun 18, 2020

more commits coming up!

(as a rule of thumb, replace (==) with equalCookie, and if that fails, decide whether it should really be equivCookie.

@fisx
Copy link
Contributor

fisx commented Jun 18, 2020

I'm only a little confident about 2063d73: are we really ok that the cookie value changes between the two requests? I think so?

@fisx fisx marked this pull request as ready for review June 18, 2020 11:45
@fisx fisx changed the title WIP: Bump http-client Bump http-client Jun 18, 2020
@arianvp arianvp merged commit 42c0b67 into develop Jun 18, 2020
@arianvp arianvp deleted the bump-http-client branch June 18, 2020 12:27
@fisx fisx mentioned this pull request Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants