Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular loading warnings #251

Closed
DougEdey opened this issue Dec 29, 2020 · 0 comments · Fixed by #253
Closed

Circular loading warnings #251

DougEdey opened this issue Dec 29, 2020 · 0 comments · Fixed by #253
Labels
kind/bug Bug related issue

Comments

@DougEdey
Copy link

Describe the bug

When running with this gem under Ruby 2.7.2, there's a large number of (loud) warnings about circular dependency loading

I'm following the documentation from this repo and I have require 'dogapi' in my gem initialization code.

Example
/opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72: warning: /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72: warning: loading in progress, circular require considered harmful - /Users/dougedey/.gem/ruby/2.7.2/gems/dogapi-1.44.0/lib/dogapi.rb
	from ./sample_script:3:in  `<main>'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:156:in  `require'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:168:in  `rescue in require'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:168:in  `require'
	from /Users/dougedey/.gem/ruby/2.7.2/gems/dogapi-1.44.0/lib/dogapi.rb:6:in  `<top (required)>'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in  `require'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in  `require'
	from /Users/dougedey/.gem/ruby/2.7.2/gems/dogapi-1.44.0/lib/dogapi/facade.rb:7:in  `<top (required)>'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in  `require'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in  `require'
	from /Users/dougedey/.gem/ruby/2.7.2/gems/dogapi-1.44.0/lib/dogapi/v2.rb:5:in  `<top (required)>'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in  `require'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in  `require'
	from /Users/dougedey/.gem/ruby/2.7.2/gems/dogapi-1.44.0/lib/dogapi/v2/dashboard_list.rb:5:in  `<top (required)>'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in  `require'
	from /opt/rubies/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in  `require'

While I do understand this is a warning, I don't want to suppress warnings in my application as I want to ensure I don't miss out on warnings that indicate potential issues.

To Reproduce

Run the following script:

#!/usr/bin/env ruby
$VERBOSE = true
require 'dogapi'

Expected behavior

DogApi should not produce warnings when used in the recommended way

Environment and Versions (please complete the following information):
Ruby 2.7.2 (ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19])
Dogapi 1.44.0

Additional context

I poked around locally at fixing this, and I don't think that the require 'dogapi' lines are needed at all when following the documentation (I removed then with bundle open dopgapi and saw no adverse effects to my tests)

@DougEdey DougEdey added the kind/bug Bug related issue label Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bug related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant