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

Specifying multiple groups within the Gemfile fails to produce a graph. #7

Open
daveshah opened this issue Feb 14, 2020 · 5 comments
Open

Comments

@daveshah
Copy link

daveshah commented Feb 14, 2020

When attempting to generate a dependency graph at the end of 2.1 in the CBRA book, running cobradeps -g component_diagram . succeeded (in that no errors were shown) but the resulting graph was empty.
I decided to re-run with the text option to determine if this was a problem with graphviz, but this produced the following (also, an empty dependency list):

➜  sportsball git:(master): cobradeps -t component_diagram .
APP


DEPENDENCIES


 ALL PARTS

After visiting this repo and combing through the README, I decided to modify my Gemfile to see if changing the way this dependency is specified would produce different results.

If I modify my Gemfile so that I specify the component dependency this way:
gem 'app_component', path: 'components/app_component', group: :direct
cobradeps succeeds in producing a graph (and the text output works as well).

This works independently of me adding Bundler.require(:direct, *Rails.groups) to my application.rb (I opted to remove this since this seemed to be the case).

If I modify my Gemfile so that I specify the component dependency this way:
gem 'app_component', path: 'components/app_component', group: [:default, :direct]
cobradeps silently fails (as outlined initially).

I'm currently seeing this issue on Bundler version 2.0.2 and cobradeps version 0.4.1.

@shageman
Copy link
Owner

shageman commented Feb 15, 2020 via email

@daveshah
Copy link
Author

Here's the Gemfile in it's entirety (with the component statement @ the very bottom):

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.5'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.2', '>= 6.0.2.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'app_component', path: 'components/app_component', group: [:default, :direct]

@shageman
Copy link
Owner

shageman commented Feb 15, 2020 via email

@daveshah
Copy link
Author

but would be happy to accept a pull request if you see a solution.

Glad to hear! I ended up forking this earlier today to see where the problem was. I started down the path of a small refactor to get a unit test around this. (Then the kiddos woke up so I probably won't get back to this until later this evening 🤣 )

I'll post what I have a bit later on 👍

@drwl
Copy link

drwl commented Jul 30, 2020

@daveshah I'm running into this as well. Any chance you're able to post what you've got so far?

drwl added a commit to drwl/rails6-cbra that referenced this issue Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants