puppetlabs / puppetlabs/orchestrator_client-ruby

Faraday dependency causes unexpected Bundler behavior

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
2
Forks
9
Avg merge
1m
Merged PRs (30d)
1

Description

Describe the Bug

https://github.com/puppetlabs/orchestrator_client-ruby/commit/6f8661ee27271d8c19a2699d59b8ef3e7044f9bb allowed orchestrator_client to use Faraday >= 2 as a dependency. When orchestrator_client is installed alongside another gem (such as puppet_forge or vmfloaty) that depends on Faraday ~> 1, Bundler installs an unexpected version of Faraday (1.9.0).

This scenario is fairly common in Puppet modules as the default PDK template includes Litmus (which uses Bolt, which uses orchestrator_client) and puppet_forge (by way of dependency_checker), the latest version of which depends on Faraday ~> 1.3.

Faraday 1.9.0 has dependencies that use native extensions, which can cause issues in tests if the runner does not have the necessary libraries installed.

Expected Behavior

Until orchestrator_client 0.7.1 Bundler would install Faraday 1.10.4, the latest 1.y release.

Steps to Reproduce

Create a gemfile with orchestrator_client and a gem that does not permit faraday >= 2:

source "https://rubygems.org"

gem 'orchestrator_client'
gem 'puppet_forge'

Run bundle install. Bundler will install faraday 1.9.0 instead of the expected 1.10.4.

Additional Context

I opened an issue upstream with Bundler about this: https://github.com/rubygems/rubygems/issues/8286

One of the maintainers explained why Bundler behaves this way better than I could and outlines a potential fix.

This issue has affected several Puppet modules:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing commit 6f8661ee27271d8c19a2699d59b8ef3e7044f9bb and the gem dependency declarations, then reproduce the issue with the Gemfile containing orchestrator_client and puppet_forge. Done means Bundler selects Faraday 1.10.4 in this combination instead of 1.9.0, while preserving the supported dependency requirements.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.