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

Update thor dependency #124

Merged
merged 1 commit into from
Aug 10, 2020
Merged

Update thor dependency #124

merged 1 commit into from
Aug 10, 2020

Conversation

f1337
Copy link
Contributor

@f1337 f1337 commented Aug 4, 2020

Thor 1.0 is out, and we're using it with Pact on https://github.com/department-of-veterans-affairs/vets-api.

But we're having to maintain a fork to do so. This PR bumps the Thor dependency with a < 2.0 max, imitating recent versions of Railties.

Feedback is welcome. Thank you!

@bethesque
Copy link
Member

Thanks for the PR. Just had a quick look at the CHANGELOG.md for 1.0.0, and it has the following:

Deprecate relying on default exit_on_failure?. In preparation to make Thor commands exit when there is a failure we are deprecating defining a command without defining what behavior is expected when there is a failure.
To fix the deprecation you need to define a class method called exit_on_failure? returning false if you want the current behavior or true if you want the new behavior.

Could you please add the following to the commands, and make sure there is no deprecation warning?:

def exit_on_failure?
  false
end

Personally I think it should exit on failure, it's just that I'm not sure about any unforeseen side effects, and don't want to put that burden of testing on you!

@f1337
Copy link
Contributor Author

f1337 commented Aug 5, 2020

@bethesque Done! Please let me know if there's any other changes you'd like me to make. 😸

Once this PR looks good to you, I will happily apply the same changes to the pact-ruby PR.

Thank you!

@@ -9,6 +9,7 @@
module Pact
module MockService
class CLI < Thor
include ThorDeprecationGuard
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using include means the exit_on_failure? method will be an instance method, rather than a class one ("you need to define a class method called exit_on_failure?"). extend should do the trick.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd just prefer to duplicate the code than have a module though. The method is a normal method to define in < 1.0 Thor anyway. I've used it in other places, just not these classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Please let me know if there are any other changes you'd like to see? Thank you!

Co-authored-by: Lindsey Hattamer <[email protected]>
@bethesque bethesque merged commit 54b3f85 into pact-foundation:master Aug 10, 2020
@bethesque
Copy link
Member

Thank you kindly.

themichaelyan pushed a commit to animoto/pact-mock_service that referenced this pull request Feb 4, 2022
* feat: allow mock service host to be configured

pact-foundation/pact-ruby#186

* chore(release): version 3.0.0

* fix: add missing host argument to server spawn

fixes: pact-foundation#102

* chore(release): version 3.0.1

* Improve logging robustness

Do not pretty print a JSON object when serialization or serialization fail, for details see pact-foundation#103.

* Update interaction_replay.rb

* Initial version of the unit test

* Move the test to appropriate context

* Update interaction_replay_spec.rb

* Update interaction_replay_spec.rb

* Update interaction_replay_spec.rb

* Update interaction_replay_spec.rb

* Update interaction_replay.rb

* Update interaction_replay_spec.rb

* Update interaction_replay_spec.rb

* feat: pact-stub-service log level cli opt

* chore(release): version 3.1.0

* chore(release): version 3.1.1

* feat(skip writing to pact): Use writable_interactions when writing to pact file

* Add test for #as_json

* Add feature spec

* Bump pact-support dependency

* Fix tests

* chore(release): version 3.2.0

* CI: Add 2.7 to travis ci

* fix: remove apparently unused require for thwait

* chore(release): version 3.2.1

* feat: log a warning when too many interactions are set on the mock service at once

* chore(release): version 3.3.0

* fix: put metadata on the correct decorator

* chore(release): version 3.3.1

* chore: remove jruby until somebody shows they're actually using it

* chore(release): version 3.4.0

* feat: add token, username and password options to stub service (pact-foundation#118)

Co-authored-by: Beth Skurrie <[email protected]>

* chore(release): version 3.5.0

* docs: document that you can set the broker token via an env var

[ci-skip]

* chore: separate test and deploy stages

* chore: update .travis.yml

[ci-skip]

* chore: update .travis.yml

* test: add expectations to make sure metadata: nil isn't stored in the pact (pact-foundation#119)

* feat: add 'Access-Control-Allow-Headers' = true to cors response headers (pact-foundation#121)

* chore(release): version 3.6.0

* fix:  fix Ruby 2.7 kwargs warning (pact-foundation#122)

* chore(release): version 3.6.1

* fix: update thor dependency (pact-foundation#124)

Co-authored-by: Lindsey Hattamer <[email protected]>

Co-authored-by: Lindsey Hattamer <[email protected]>

* chore: add github workflow for gem release

* chore: disable tests as they're not running properly on github workflow

* chore(release): version 3.6.2

* feat: do not require files until command is executing

* chore: update release workflow [ci-skip]

* feat: use Pact::Query.parse_string to parse query string

* chore(deps): update rake

* docs: update travis badge

* chore(release): version 3.7.0

* feat: include interaction diffs in verification response

cc: @TimothyJones

* chore: add tests to github actions

* chore: allow workflow dispatch to release

* chore(release): version 3.8.0

* chore: tests are hanging. try a subset

* chore: try rspec

* chore: disabling tests, they hang

* chore: create issue template

* feat: pass host into WEBrick options to allow configuration (pact-foundation#128)

Co-authored-by: Matthew Hall <[email protected]>

* chore(release): version 3.9.0

* chore: handle http 2

* fix: check for nil body rather than falsey body when determining how to render mocked response
Fixes: pact-foundation#99

* chore(release): version 3.9.1

Co-authored-by: Beth Skurrie <[email protected]>
Co-authored-by: Alexander Bolshakov <[email protected]>
Co-authored-by: YOU54F <[email protected]>
Co-authored-by: Beth Skurrie <[email protected]>
Co-authored-by: Simon Nizov <[email protected]>
Co-authored-by: Chavez <[email protected]>
Co-authored-by: Chavez <[email protected]>
Co-authored-by: Matt Fellows <[email protected]>
Co-authored-by: vandemark <[email protected]>
Co-authored-by: Bartek Bułat <[email protected]>
Co-authored-by: Michael R. Fleet <[email protected]>
Co-authored-by: Lindsey Hattamer <[email protected]>
Co-authored-by: mhall58 <[email protected]>
Co-authored-by: Matthew Hall <[email protected]>
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.

2 participants