pact-foundation / pact-mock_service

Provides a mock service for use with Pact
https://pact.io
MIT License
73 stars 69 forks source link

Fix Rack 3 support #152

Closed pezholio closed 3 months ago

pezholio commented 3 months ago

Fixes https://github.com/pact-foundation/pact-mock_service/issues/151

As of Rack > 3.1.0, the previous fixes for Rack::Handler::WEBrick not being found have been removed. Additionally, rack.input is now optional, so we can't guarantee the body variable is there when reading the request in the mock service.

I've also updated the CI to run with both Rack 2.x.x and 3.x.x, so we can guarantee backwards compatibility. I imagine if we stopped support for Rack 2.x.x completely this would cause issues with dependencies for some users.

YOU54F commented 3 months ago

thanks for the pr @pezholio

i’m travelling at the minute and just about to jump on a plane but will look at this probably Monday unless i get some time at the weekend

pezholio commented 3 months ago

Cool, thanks! 👍

YOU54F commented 3 months ago

Thanks for adding tests to cover both rack 2.x and 3.x. I can confirm the issue only occurs in rack 3.1.x which is why it didn't crop up before as part of #146

YOU54F commented 3 months ago

yarggg I've gotta double revert, because I don't have a changelog message for release and I don't want to force push on the main branch.

YOU54F commented 3 months ago

Hey,

So I've got a couple of minor issues I think

1) dupe warns https://github.com/pact-foundation/pact-mock_service/pull/156 2) some version solving problems due to pact-provider-verifier still requiring Rack 2.x ( I think ), in our tools that package up the tools together (pact-ruby-cli & pact-ruby-standalone) https://github.com/pact-foundation/pact-provider-verifier/issues/116

I wonder if we need to relax the restriction on the latest gem to 2.x up to 4.x of Rack, without the use on an env var?

That would mean there is a dep on rackup 2.x though