pact-foundation / pact-ruby-standalone

A standalone pact command line executable using the ruby pact implementation and Travelling Ruby
https://pact.io
MIT License
42 stars 33 forks source link

syntax error, unexpected '.' with pact-1.88.84 #72

Closed MarkConway94 closed 2 years ago

MarkConway94 commented 2 years ago

Pre issue-raising checklist

I have already (please mark the applicable with an x):

Software versions

Expected behaviour

can-i-deploy and publish commands work as expected.

Actual behaviour

Hi, starting today Friday 6th May, we are getting the following error after downloading the pact-ruby-standalone and running either the publish command or the can-i-deploy command. We noticed that in your latest release notes there also seems to be a bug with the loading of these two commands' examples which may relate to our issue. The error we are seeing is:

➜  bin git:(main) ✗ ./pact-broker can-i-deploy --dry-run --pacticipant=MyApp --version=1.0.0 --to=INT --broker-base-url="http://pactbroker.myapp.com"
/Users/me/myapp/services/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/broker.rb:8:in `require': /Users/me/myapp/services/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:51: syntax error, unexpected '.' (SyntaxError)
                branch_name: options.branch&.strip,
                                             ^
/Users/me/myapp/services/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:52: syntax error, unexpected '.'
                tags: options.tag&.collect(&:strip)
                                   ^
/Users/me/myapp/services/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:53: syntax error, unexpected '}', expecting keyword_end
    from /Users/me/myapp/services/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/broker.rb:8:in `<top (required)>'
    from /Users/me/myapp/services/pact/lib/app/pact-broker.rb:1:in `require'
    from /Users/me/myapp/services/pact/lib/app/pact-broker.rb:1:in `<main>'

I downloaded the version before the latest one, pact-1.88.83, and that works fine

Steps to reproduce

Download pact-rubt-standalone and run the publish or can-i-deploy step

Relevent log files

Please ensure you set logging to DEBUG and attach any relevant log files here (or link from a gist).

YOU54F commented 2 years ago

Hi @MarkConway94 thanks for the report.

We are just in the middle of doing some work to support some commands for Pactflow so apologies for the inconvenience, we certainly didn't mean to break anyones workflow!

Will get this addressed as soon as possible, thanks for suggesting a workaround for users.

I downloaded the version before the latest one, pact-1.88.83, and that works fine

YOU54F commented 2 years ago

Hey,

This is fixed now

**curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.85/pact-1.88.84-osx.tar.gz
tar xzf pact-1.88.84-osx.tar.gz
cd pact/bin
./pact-broker can-i-deploy

Result:

/Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/broker.rb:8:in `require': /Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:51: syntax error, unexpected '.' (SyntaxError)
                branch_name: options.branch&.strip,
                                             ^
/Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:52: syntax error, unexpected '.'
                tags: options.tag&.collect(&:strip)
                                   ^
/Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:53: syntax error, unexpected '}', expecting keyword_end
        from /Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/broker.rb:8:in `<top (required)>'
        from /Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/app/pact-broker.rb:1:in `require'
        from /Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/app/pact-broker.rb:1:in `<main>

Post

curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.85/pact-1.88.85-osx.tar.gz
tar xzf pact-1.88.85-osx.tar.gz
cd pact/bin
./pact-broker can-i-deploy

Result

No value provided for required options '--pacticipant'
MarkConway94 commented 2 years ago

Nice one, thanks YOU54F

YOU54F commented 2 years ago

No worries mate, huge thanks to @aushm