Skip to content

Cannot annotate pull request without Gemfile #57

Open
@orien

Description

@orien

Unwrappr has difficulty annotating pull requests when executed from a directory without a Gemfile:

$ gem install unwrappr
Successfully installed unwrappr-0.3.2
1 gem installed

$ unwrappr annotate-pull-request --repo orien/my-ruby-project --pr 30
Traceback (most recent call last):
	24: from /usr/local/opt/rbenv/versions/2.5.3/bin/unwrappr:23:in `<main>'
	23: from /usr/local/opt/rbenv/versions/2.5.3/bin/unwrappr:23:in `load'
	22: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/exe/unwrappr:11:in `<top (required)>'
	21: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/clamp-1.3.0/lib/clamp/command.rb:140:in `run'
	20: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/clamp-1.3.0/lib/clamp/command.rb:66:in `run'
	19: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/clamp-1.3.0/lib/clamp/subcommand/execution.rb:18:in `execute'
	18: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/clamp-1.3.0/lib/clamp/command.rb:66:in `run'
	17: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/cli.rb:35:in `execute'
	16: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/lock_file_annotator.rb:39:in `annotate_github_pull_request'
	15: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/lock_file_annotator.rb:56:in `annotate'
	14: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/github/pr_source.rb:19:in `each_file'
	13: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/github/pr_source.rb:19:in `each'
	12: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/github/pr_source.rb:20:in `block in each_file'
	11: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/lock_file_annotator.rb:57:in `block in annotate'
	10: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/lock_file_diff.rb:18:in `each_gem_change'
	 9: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/lock_file_diff.rb:33:in `version_changes'
	 8: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/lock_file_comparator.rb:10:in `perform'
	 7: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/unwrappr-0.3.2/lib/unwrappr/lock_file_comparator.rb:10:in `new'
	 6: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/lockfile_parser.rb:68:in `initialize'
	 5: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/lockfile_parser.rb:68:in `new'
	 4: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/source/rubygems.rb:24:in `initialize'
	 3: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/source/rubygems.rb:462:in `cache_path'
	 2: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler.rb:251:in `app_cache'
	 1: from /usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler.rb:233:in `root'
/usr/local/Cellar/rbenv/1.1.1/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler.rb:237:in `rescue in root': Could not locate Gemfile or .bundle/ directory (Bundler::GemfileNotFound)

$ echo $?
1

If I change to a directory containing a Gemfile (any Gemfile will do, even one unrelated to the PR being annotated):

$ cd ~/src/another-ruby-project

$unwrappr annotate-pull-request --repo orien/my-ruby-project --pr 30

$ echo $?
0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions