pronto icon indicating copy to clipboard operation
pronto copied to clipboard

Issue with CircleCI integration

Open ananth99 opened this issue 7 years ago • 10 comments

Pronto fails to run in CircleCI after build completes. Running on Rails 4.2.9 and Ruby 2.4.0

circle.yml

test:
  override:
    - bundle exec rake test:all
  post:
    - if [[ ! -z $CI_PULL_REQUEST ]] ; then bundle exec pronto run -f github_pr -c origin/master ; fi

stacktrace after running pronto command

bundler: failed to load command: pronto (/home/ubuntu/app/vendor/bundle/ruby/2.4.0/bin/pronto)
Rugged::OdbError: object not found - no match for id (f61b491d0dbd5b3c13ad529587a06939fa1f54bc)
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/git/repository.rb:52:in `new'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/git/repository.rb:52:in `blame'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/git/patch.rb:17:in `blame'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/git/line.rb:45:in `blame'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/git/line.rb:20:in `commit_sha'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/message.rb:18:in `initialize'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-rubocop-0.9.0/lib/pronto/rubocop.rb:49:in `new'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-rubocop-0.9.0/lib/pronto/rubocop.rb:49:in `new_message'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-rubocop-0.9.0/lib/pronto/rubocop.rb:41:in `block (2 levels) in inspect'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-rubocop-0.9.0/lib/pronto/rubocop.rb:41:in `map'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-rubocop-0.9.0/lib/pronto/rubocop.rb:41:in `block in inspect'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-rubocop-0.9.0/lib/pronto/rubocop.rb:38:in `map'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-rubocop-0.9.0/lib/pronto/rubocop.rb:38:in `inspect'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-rubocop-0.9.0/lib/pronto/rubocop.rb:18:in `block in run'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-rubocop-0.9.0/lib/pronto/rubocop.rb:18:in `map'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-rubocop-0.9.0/lib/pronto/rubocop.rb:18:in `run'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/runners.rb:20:in `block in run'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/runners.rb:13:in `each'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/runners.rb:13:in `run'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto.rb:64:in `run'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/cli.rb:61:in `block in run'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/cli.rb:60:in `chdir'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/lib/pronto/cli.rb:60:in `run'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/gems/pronto-0.9.5/bin/pronto:6:in `<top (required)>'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/bin/pronto:23:in `load'
  /home/ubuntu/app/vendor/bundle/ruby/2.4.0/bin/pronto:23:in `<top (required)>'

ananth99 avatar Sep 22 '17 12:09 ananth99

@ananth99 could you tell us anymore about your setup? Unfortunately I don't use CircleCI so I have no experience with it ☹️

doomspork avatar Sep 22 '17 15:09 doomspork

We have a manifest file called circle.yml which runs the pronto command if it's a Pull Request after the test suite finishes.

The manifest file contains all the machine configs(ruby version, message queue, redis config) etc.. This link tells you how CircleCI preps the test environment.

Weird thing is I did not run into this issue in my dev setup. :(

ananth99 avatar Sep 24 '17 19:09 ananth99

@ananth99 I had a similar error and the following https://github.com/prontolabs/pronto/issues/103 resolved it for me. Give it a try.

javierjulio avatar Oct 02 '17 15:10 javierjulio

@javierjulio Thanks! I'll try it out and close this issue if it works.

ananth99 avatar Oct 03 '17 14:10 ananth99

@ananth99 hey, did it work? 😀

mmozuras avatar Oct 15 '17 20:10 mmozuras

Hi, I'm using this to solve this issue:

test:
  pre:
    - "[[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow"
    - bundle exec pronto run -f github_pr github_status -c origin/master

schweigert avatar Jan 08 '18 19:01 schweigert

This is CircleCI related only from my experience. I also used a similar approach to make it work since default pronto run -c origin/master doesn't work there. This issue could be closed IMHO.

giedriusr avatar Jan 18 '18 11:01 giedriusr

Yeah I agree with @giedriusr ; unless @ananth99 has any further issues this appears like a resolved issue to me 😄

Schwad avatar Jan 18 '18 15:01 Schwad

A few days ago I had this problem. I solved using the new var PRONTO_PULL_REQUEST_ID to pass the PR id.

export PRONTO_PULL_REQUEST_ID=${TRAVIS_PULL_REQUEST} && bundle exec pronto run -f github_pr -c origin/${TRAVIS_BRANCH}

schweigert avatar Jan 18 '18 16:01 schweigert

Hi, I'm using this to solve this issue:

test:
  pre:
    - "[[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow"
    - bundle exec pronto run -f github_pr github_status -c origin/master

I tried this, but it doesn't work. I'm still getting a bundler: failed to load command: pronto.

This is what it looks like in our CircleCI yml:

      - run:
          name: Rubocop Linter
          command: |
            [[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow
            PRONTO_PULL_REQUEST_ID=${CIRCLE_PULL_REQUEST} bundle exec pronto run -f github github_status github_pr -c origin/master

jdq22 avatar Jul 31 '19 17:07 jdq22