poper icon indicating copy to clipboard operation
poper copied to clipboard

Poper fails with wrong argument type Rugged::Commit (expected Data) (TypeError)

Open TobiasBales opened this issue 5 years ago • 7 comments

Hey, I just stumbled across this gem and like it a lot. So I tried to get started with it (in combination with pronto). Sadly when running it manually (e.g. poper run HEAD~2 it fails with wrong argument type Rugged::Commit (expected Data) (TypeError)

Stack trace:

Traceback (most recent call last):
        12: from /Users/tobias/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'
        11: from /Users/tobias/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
        10: from /Users/tobias/.rvm/gems/ruby-2.6.3/bin/poper:23:in `<main>'
         9: from /Users/tobias/.rvm/gems/ruby-2.6.3/bin/poper:23:in `load'
         8: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/poper-0.2.3/bin/poper:6:in `<top (required)>'
         7: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
         6: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
         5: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
         4: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
         3: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/poper-0.2.3/lib/poper/cli.rb:19:in `run'
         2: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/poper-0.2.3/lib/poper/runner.rb:12:in `run'
         1: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/poper-0.2.3/lib/poper/runner.rb:35:in `commits'
/Users/tobias/.rvm/gems/ruby-2.6.3/gems/poper-0.2.3/lib/poper/runner.rb:35:in `push': wrong argument type Rugged::Commit (expected Data) (TypeError)

Versions: Ruby 2.6.3p62 rugged 0.99.0 poper 0.2.3

I noticed that there is a huge discrepancy between what poper expects in terms of rugged versions (~> 0.23, >= 0.23.0) vs 0.99.0 I have no idea what changed, given the not very high activity here at the moment I would be willing to have a look if that is wanted.

TobiasBales avatar Jul 09 '20 09:07 TobiasBales

@TobiasBales I'm also looking at this. Do you understand why bundle install will install rugged 0.99.0 when poper.gemspec contains the following line?

s.add_runtime_dependency('rugged', '~> 0.23', '>= 0.23.0') # line 23

To me, that says 0.23.0 <= RUGGED_VERSION < 0.24.0... and 0.99.0 is out of that range...

ulyssesrex avatar Aug 12 '20 18:08 ulyssesrex

I was getting that same error in the test suite with version 0.99.0. When I pin rugged to version 0.23.1, the errors go away.

s.add_runtime_dependency('rugged', '0.23.1') # line 23

ulyssesrex avatar Aug 12 '20 19:08 ulyssesrex

Looks like rugged 0.99.0 is incompatible with lib/poper/runner.rb.

When 'any_gem', '~> 0.23' is specified, the pessimistic operator will actually allow the final series of digits in the version string to climb as high as possible without bumping the major version.

Since rugged 0.99.0 is available, the 23 is incremented to 99.

ulyssesrex avatar Aug 12 '20 20:08 ulyssesrex

I have same issue

benner avatar Feb 02 '23 06:02 benner

We're on rugged 1.x. We could do with a relaxing of the pin on it too.

hlascelles avatar Mar 22 '23 10:03 hlascelles

I have the same problem, the PR we have open solves very well. Waiting for the merge.

diegobentes avatar May 12 '23 20:05 diegobentes

I created a gem called poper2 that solves this problem and that I will keep updated against bugs and improvements. Please open issues.

https://github.com/diegobentes/poper2

diegobentes avatar May 15 '23 21:05 diegobentes