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

rm gem name from external gemfile #2

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

QWYNG
Copy link
Contributor

@QWYNG QWYNG commented Oct 11, 2022

Hi! thank you for great gem!
I tried to work on this issue, but when I specified devise as the downstream dependency codebase for omniauth, I got the following error.

config/external.yaml in omniauth

devise:
  url: https://github.com/heartcombo/devise.git
  command: bundle exec rake test
≻ bundle exec bake test:external
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Cloning into 'external/devise'...
remote: Enumerating objects: 367, done.
remote: Counting objects: 100% (367/367), done.
remote: Compressing objects: 100% (307/307), done.
remote: Total 367 (delta 32), reused 146 (delta 20), pack-reused 0
Receiving objects: 100% (367/367), 226.55 KiB | 6.12 MiB/s, done.
Resolving deltas: 100% (32/32), done.
Your Gemfile lists the gem omniauth (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once.
While it's not a problem now, it could cause errors if you change the version of one of them later.

[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice coming from different sources.
You specified that omniauth (>= 0) should come from an unspecified source and source at `../..`
. Bundler cannot continue.

 #  from /Users/qwyng/omniauth/external/devise/Gemfile:42
 #  -------------------------------------------
 #  # Added by external testing:
 >  gem "omniauth", path: '../../'
 #  -------------------------------------------

[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice coming from different sources.
You specified that omniauth (>= 0) should come from an unspecified source and source at `../..`
. Bundler cannot continue.

 #  from /Users/qwyng/omniauth/external/devise/Gemfile:42
 #  -------------------------------------------
 #  # Added by external testing:
 >  gem "omniauth", path: '../../'
 #  -------------------------------------------
External tests devise failed!

Generated external/devise/Gemfile

# frozen_string_literal: true

source "https://rubygems.org"

gemspec

gem "rails", "~> 7.0.0"
gem "omniauth"
gem "omniauth-oauth2"
gem "rdoc"

gem "rails-controller-testing", github: "rails/rails-controller-testing"

gem "responders", "~> 3.0"

group :test do
  gem "nokogiri", "< 1.13"
  gem "omniauth-facebook"
  gem "omniauth-openid"
  gem "rexml"
  gem "timecop"
  gem "webrat", "0.7.3", require: false
  gem "mocha", "~> 1.1", require: false
end

platforms :ruby do
  gem "sqlite3", "~> 1.4"
end

# platforms :jruby do
#   gem "activerecord-jdbc-adapter"
#   gem "activerecord-jdbcsqlite3-adapter"
#   gem "jruby-openssl"
# end

# TODO:
# group :mongoid do
#   gem "mongoid", "~> 4.0.0"
# end

# Added by external testing:
gem "omniauth", path: '../../'

This PR adds a process to remove potentially duplicate Gemfile lines.
Gemfile generated as a result of testing with omniauth with this process added is as follows.

# frozen_string_literal: true

source "https://rubygems.org"

gemspec

gem "rails", "~> 7.0.0"
gem "omniauth-oauth2"
gem "rdoc"

gem "rails-controller-testing", github: "rails/rails-controller-testing"

gem "responders", "~> 3.0"

group :test do
  gem "nokogiri", "< 1.13"
  gem "omniauth-facebook"
  gem "omniauth-openid"
  gem "rexml"
  gem "timecop"
  gem "webrat", "0.7.3", require: false
  gem "mocha", "~> 1.1", require: false
end

platforms :ruby do
  gem "sqlite3", "~> 1.4"
end

# platforms :jruby do
#   gem "activerecord-jdbc-adapter"
#   gem "activerecord-jdbcsqlite3-adapter"
#   gem "jruby-openssl"
# end

# TODO:
# group :mongoid do
#   gem "mongoid", "~> 4.0.0"
# end

# Added by external testing:
gem "omniauth", path: '../../'

@ioquatix
Copy link
Owner

I'm generally okay with this, but I'm a little concerned it's fragile. However, it's not critical it breaks.

@ioquatix ioquatix merged commit ea4089e into ioquatix:main Oct 12, 2022
@QWYNG
Copy link
Contributor Author

QWYNG commented Oct 12, 2022

@ioquatix
Thanks for the merge. and
Thank you for changing it to a better code.
However, does the c8deb63 change overwrite the command variable in bake/test/external.rb:87?

@ioquatix
Copy link
Owner

Ohhh yeah it does, haha, totally missed it. Let me fix it. Thanks for checking it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants