pronto
pronto copied to clipboard
Can pronto bitbucket_pr fallback to bitbucket if he can find PR
After I merge PR into develop branch auto run bitbucket pipelines return with this error:
pronto run -f bitbucket_pr -c origin/develop
than I see this error:
`
pronto run -f bitbucket_pr -c origin/develop
/usr/local/lib/ruby/2.3.0/ostruct.rb:96:in 'initialize': undefined method each_pair for ["type", "error"]:Array (NoMethodError)
Did you mean? each_slice
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/clients/bitbucket_client.rb:36:in 'new'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/clients/bitbucket_client.rb:36:in 'block in openstruct'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/clients/bitbucket_client.rb:36:in 'each'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/clients/bitbucket_client.rb:36:in 'map'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/clients/bitbucket_client.rb:36:in 'openstruct'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/clients/bitbucket_client.rb:20:in 'pull_comments'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/bitbucket.rb:5:in 'pull_comments'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/formatter/pull_request_formatter.rb:6:in 'existing_comments'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/formatter/git_formatter.rb:6:in 'format'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto.rb:67:in 'block in run'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto.rb:66:in 'each'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto.rb:66:in 'run'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/cli.rb:61:in 'block in run'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/cli.rb:60:in 'chdir'
from /usr/local/bundle/gems/pronto-0.9.1/lib/pronto/cli.rb:60:in 'run'
from /usr/local/bundle/gems/thor-0.19.4/lib/thor/command.rb:27:in 'run'
from /usr/local/bundle/gems/thor-0.19.4/lib/thor/invocation.rb:126:in 'invoke_command'
from /usr/local/bundle/gems/thor-0.19.4/lib/thor.rb:369:in 'dispatch'
from /usr/local/bundle/gems/thor-0.19.4/lib/thor/base.rb:444:in 'start'
from /usr/local/bundle/gems/pronto-0.9.1/bin/pronto:6:in '<top (required)>'
from /usr/local/bundle/bin/pronto:22:in 'load'
from /usr/local/bundle/bin/pronto:22:in '<main>'
`
@iggant thanks. I think that we should start by making the error nicer and clearer. But I've never before considered a fallback mechanism for runners. That's an interesting idea!
But do you have a solution for this error? I'm getting the same error.
Any solution for this error?
I ended up with this code: you create some executable file: pronto.sh inside put:
git fetch origin develop:refs/remotes/origin/develop
NODE_ENV=development pronto run -f bitbucket_pr -c origin/develop
if [ $? -gt 0 ]; then
NODE_ENV=development pronto run -f bitbucket -c origin/develop
fi
echo 'Pronto Complete'
I add a commit for fix it
https://github.com/run26kimo/pronto/commit/c16b1c3c78a3c3772d5a9e12e691817ab77f056b