Skip to content

github_cli v0.6.2 broken via github_api faraday dependency version issue #39

Description

@danieldjewell

Hello!

A default install (done through gem install github_cli - which installs v0.6.2) appears to be broken because of changes in the https://github.com/lostisland/faraday library. The version of faraday installed is 0.16.2. This results in the following error when running gcli:

Fatal error has occurred. wrong number of arguments (given 3, expected 1)ArgumentError: wrong number of arguments (given 3, expected 1)
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/faraday-0.16.2/lib/faraday/utils.rb:15:in `build_nested_query'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_api-0.18.2/lib/github_api/ext/faraday.rb:16:in `to_query'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/faraday-0.16.2/lib/faraday/connection.rb:539:in `build_exclusive_url'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/faraday-0.16.2/lib/faraday/rack_builder.rb:205:in `build_env'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/faraday-0.16.2/lib/faraday/rack_builder.rb:153:in `build_response'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/faraday-0.16.2/lib/faraday/connection.rb:504:in `run_request'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/faraday-0.16.2/lib/faraday/connection.rb:207:in `get'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_api-0.18.2/lib/github_api/request.rb:69:in `call'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_api-0.18.2/lib/github_api/request/verbs.rb:23:in `get_request'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_api-0.18.2/lib/github_api/client/repos.rb:149:in `list'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_api-0.18.2/lib/github_api/api.rb:250:in `block in execute'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_api-0.18.2/lib/github_api/api.rb:237:in `run_callbacks'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_api-0.18.2/lib/github_api/api.rb:249:in `execute'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_api-0.18.2/lib/github_api/api.rb:209:in `block in method_added'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/apis/repository.rb:11:in `block in all'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/api.rb:64:in `block in output'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/dsl.rb:19:in `on_error'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/api.rb:63:in `output'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/apis/repository.rb:10:in `all'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/commands/repositories.rb:33:in `list'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/command.rb:27:in `run'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/invocation.rb:120:in `invoke_command'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor.rb:363:in `dispatch'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/invocation.rb:109:in `invoke'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor.rb:232:in `block in subcommand'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/command.rb:27:in `run'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/invocation.rb:120:in `invoke_command'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor.rb:363:in `dispatch'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/base.rb:438:in `start'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/bin/gcli:9:in `block in <top (required)>'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/lib/github_cli/dsl.rb:19:in `on_error'
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/github_cli-0.6.2/bin/gcli:9:in `<top (required)>'
/data/data/com.termux/files/usr/bin/gcli:23:in `load'
/data/data/com.termux/files/usr/bin/gcli:23:in `<main>

This same thing happens on a non-termux system too:

Fatal error has occurred. wrong number of arguments (given 3, expected 1)ArgumentError: wrong number of arguments (given 3, expected 1)
/var/lib/gems/2.5.0/gems/faraday-0.16.2/lib/faraday/utils.rb:15:in `build_nested_query'
/var/lib/gems/2.5.0/gems/github_api-0.18.2/lib/github_api/ext/faraday.rb:16:in `to_query'
/var/lib/gems/2.5.0/gems/faraday-0.16.2/lib/faraday/connection.rb:539:in `build_exclusive_url'
/var/lib/gems/2.5.0/gems/faraday-0.16.2/lib/faraday/rack_builder.rb:205:in `build_env'
/var/lib/gems/2.5.0/gems/faraday-0.16.2/lib/faraday/rack_builder.rb:153:in `build_response'
/var/lib/gems/2.5.0/gems/faraday-0.16.2/lib/faraday/connection.rb:504:in `run_request'
/var/lib/gems/2.5.0/gems/faraday-0.16.2/lib/faraday/connection.rb:207:in `get'
/var/lib/gems/2.5.0/gems/github_api-0.18.2/lib/github_api/request.rb:69:in `call'
/var/lib/gems/2.5.0/gems/github_api-0.18.2/lib/github_api/request/verbs.rb:23:in `get_request'
/var/lib/gems/2.5.0/gems/github_api-0.18.2/lib/github_api/client/repos.rb:149:in `list'
/var/lib/gems/2.5.0/gems/github_api-0.18.2/lib/github_api/api.rb:250:in `block in execute'
/var/lib/gems/2.5.0/gems/github_api-0.18.2/lib/github_api/api.rb:237:in `run_callbacks'
/var/lib/gems/2.5.0/gems/github_api-0.18.2/lib/github_api/api.rb:249:in `execute'
/var/lib/gems/2.5.0/gems/github_api-0.18.2/lib/github_api/api.rb:209:in `block in method_added'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/apis/repository.rb:11:in `block in all'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/api.rb:64:in `block in output'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/dsl.rb:19:in `on_error'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/api.rb:63:in `output'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/apis/repository.rb:10:in `all'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/commands/repositories.rb:33:in `list'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/command.rb:27:in `run'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/invocation.rb:120:in `invoke_command'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor.rb:363:in `dispatch'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/invocation.rb:109:in `invoke'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor.rb:232:in `block in subcommand'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/command.rb:27:in `run'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/invocation.rb:120:in `invoke_command'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor.rb:363:in `dispatch'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/vendor/thor/base.rb:438:in `start'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/bin/gcli:9:in `block in <top (required)>'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/lib/github_cli/dsl.rb:19:in `on_error'
/var/lib/gems/2.5.0/gems/github_cli-0.6.2/bin/gcli:9:in `<top (required)>'
/usr/local/bin/gcli:23:in `load'
/usr/local/bin/gcli:23:in `<main>'

The issue appars to be related to other past issues/PRs in github_api: piotrmurach/github#146, piotrmurach/github#147, piotrmurach/github#148, piotrmurach/github#316, piotrmurach/github#340.

I am unsure if commit piotrmurach/github@1558f21 started this behavior or where it started.

I can confirm that forcing faraday = 0.8.0 (and/or restoring the version constraint to be lower than 0.10, see below) restores github_cli to working status (although I haven't been able to test 100%).

I fully admit that Ruby is not my strongest programming language in the slightest - however, I am confused about others describing conflicts with different versions of faraday as I now have two different faraday gems installed (0.16.2 - latest; and 0.8.0) and things seem (?) to be working fine.

Restoring L22 in github_api.gemspec to include a restriction on the maximum version of faraday does fix the problem. I'm unsure as to what exact changes to github_api/github_cli would need to be made in order to accomodate these changes.

https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/github_api.gemspec#L22

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions