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

You can't currently specify GEM_REPOS if the TEST_REPO doesn't already define the gem as a direct dependency. #36

Closed
jrafanie opened this issue Oct 22, 2019 · 6 comments · Fixed by #41

Comments

@jrafanie
Copy link
Member

Situation:

  • manageiq depends on manageiq-providers-azure
  • manageiq depends on memoist (0.15.0)
  • azure provider depends on azure-armrest
  • azure-armrest depends on memoist (0.15.0)

If I want to test cross repos with:
manageiq with memoist 0.16.0 dependency...
azure-armrest with memoist 0.16.0 dep.

It looks like any TEST_REPO that doesn't already specify azure-armrest as a gem can't override that gem. It assumes we need to do override_gem.

https://travis-ci.org/jrafanie/manageiq-cross_repo-tests/jobs/601518344#L311

Setting environment variables from .travis.yml
$ export GEM_REPOS=azure-armrest#386
$ export CORE_REPO=manageiq#19370
$ export TEST_REPO=manageiq-api
...
$ bundle exec manageiq-cross_repo
Fetching https://github.com/ManageIQ/manageiq-api/tarball/fbb9884f0666188ec925f5aaff88831a16f6bcaf
Fetching https://github.com/ManageIQ/manageiq/tarball/b5abb6e0843092822a5d77a76eba1fb623336dfc
Fetching https://github.com/ManageIQ/azure-armrest/tarball/a28277d722984416a782f940da907e7a5cb7f036
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using bundler 1.17.3
Fetching bundler-inject 1.1.0
Installing bundler-inject 1.1.0
Installed plugin bundler-inject
[!] There was an error parsing `overrides.rb`: Trying to override unknown gem "azure-armrest". Bundler cannot continue.
 #  from /home/travis/build/jrafanie/manageiq-cross_repo-tests/repos/ManageIQ/manageiq-api@fbb9884f0666188ec925f5aaff88831a16f6bcaf/spec/manageiq/bundler.d/overrides.rb:1
 #  -------------------------------------------
 >  override_gem "azure-armrest", :path => "/home/travis/build/jrafanie/manageiq-cross_repo-tests/repos/ManageIQ/azure-armrest@a28277d722984416a782f940da907e7a5cb7f036"
 #  -------------------------------------------
== Command ["bundle update --jobs=3"] failed in /home/travis/build/jrafanie/manageiq-cross_repo-tests/repos/ManageIQ/manageiq-api@fbb9884f0666188ec925f5aaff88831a16f6bcaf ==
Traceback (most recent call last):
	16: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/bin/ruby_executable_hooks:24:in `<main>'
	15: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/bin/ruby_executable_hooks:24:in `eval'
	14: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/bin/manageiq-cross_repo:23:in `<main>'
	13: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/bin/manageiq-cross_repo:23:in `load'
	12: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/gems/manageiq-cross_repo-0.1.0/exe/manageiq-cross_repo:90:in `<top (required)>'
	11: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/gems/manageiq-cross_repo-0.1.0/lib/manageiq/cross_repo.rb:11:in `run'
	10: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/gems/manageiq-cross_repo-0.1.0/lib/manageiq/cross_repo/runner.rb:26:in `run'
	 9: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/gems/manageiq-cross_repo-0.1.0/lib/manageiq/cross_repo/runner.rb:46:in `run_plugin'
	 8: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/gems/manageiq-cross_repo-0.1.0/lib/manageiq/cross_repo/runner.rb:53:in `with_test_env'
	 7: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/gems/manageiq-cross_repo-0.1.0/lib/manageiq/cross_repo/runner.rb:53:in `chdir'
	 6: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/gems/manageiq-cross_repo-0.1.0/lib/manageiq/cross_repo/runner.rb:54:in `block in with_test_env'
	 5: from /home/travis/.rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler.rb:313:in `with_clean_env'
	 4: from /home/travis/.rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler.rb:562:in `with_env'
	 3: from /home/travis/.rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler.rb:313:in `block in with_clean_env'
	 2: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/gems/manageiq-cross_repo-0.1.0/lib/manageiq/cross_repo/runner.rb:55:in `block (2 levels) in with_test_env'
	 1: from /home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/gems/manageiq-cross_repo-0.1.0/lib/manageiq/cross_repo/runner.rb:47:in `block in run_plugin'
/home/travis/build/jrafanie/manageiq-cross_repo-tests/vendor/bundle/ruby/2.5.0/gems/manageiq-cross_repo-0.1.0/lib/manageiq/cross_repo/runner.rb:61:in `system!': undefined method `exitstatus' for nil:NilClass (NoMethodError)

@Fryguy
Copy link
Member

Fryguy commented Oct 22, 2019

I wonder if this is a bug here or with bundler-inject. @jrafanie Can you do an override_gem in manageiq locally?

@Fryguy
Copy link
Member

Fryguy commented Oct 22, 2019

Oh I think I know what's going on...now that we made this a gem, the bundler context is part of the manageiq-cross_repo itself. I'll see what I can do with that.

@Fryguy
Copy link
Member

Fryguy commented Oct 22, 2019

Seems to be that bundler-inject can't support transient dependencies - ManageIQ/bundler-inject#11

For now we may have to use ensure_gem instead. @agrare Thoughts?

@agrare
Copy link
Member

agrare commented Oct 22, 2019

Yeah ensure_gem is how I've worked around this in the past, I'll test using it here as a general workaround

@agrare
Copy link
Member

agrare commented Oct 23, 2019

Yeah with ensure_gem this works exe/manageiq-cross_repo --test-repo=manageiq --gem-repos=vmware/rbvmomi@f04be01dd45d178b2422c385b7c24a3d52b52bd7,manageiq-providers-vmware, without it I get

[!] There was an error parsing `overrides.rb`: Trying to override unknown gem "rbvmomi". Bundler cannot continue.

 #  from /home/agrare/src/manageiq/manageiq-cross_repo/repos/ManageIQ/manageiq@b5c6cd2f8c96972f1b6b5bd5b816c9b9d5d899fc/bundler.d/overrides.rb:1
 #  -------------------------------------------
 >  override_gem "rbvmomi", :path => "/home/agrare/src/manageiq/manageiq-cross_repo/repos/vmware/rbvmomi@f04be01dd45d178b2422c385b7c24a3d52b52bd7"
 #  override_gem "manageiq-providers-vmware", :path => "/home/agrare/src/manageiq/manageiq-cross_repo/repos/ManageIQ/manageiq-providers-vmware@6fc69afa37704fd93b46b3ad490440697fb6a2a7"
 #  -------------------------------------------

@agrare
Copy link
Member

agrare commented Oct 23, 2019

And, you know, it actually overrides it which is a plus

PATH
  remote: /home/agrare/src/manageiq/manageiq-cross_repo/repos/ManageIQ/manageiq-providers-vmware@6fc69afa37704fd93b46b3ad490440697fb6a2a7
  specs:
    manageiq-providers-vmware (0.1.0)
      fog-vcloud-director (~> 0.3.0)
      rbvmomi (~> 2.0.0)
      vmware_web_service (~> 0.4.3)
      vsphere-automation-sdk (~> 0.2.1)

PATH
  remote: /home/agrare/src/manageiq/manageiq-cross_repo/repos/vmware/rbvmomi@f04be01dd45d178b2422c385b7c24a3d52b52bd7
  specs:
    rbvmomi (2.0.1)
      builder (~> 3.0) 
      json (>= 1.8) 
      nokogiri (~> 1.5) 
      optimist (~> 3.0)

agrare added a commit to agrare/manageiq-cross_repo that referenced this issue Oct 23, 2019
If a gem isn't directly referenced in the core-repo's gemfile it cannot
be overridden, ensure_gem has to be used.

Fixes ManageIQ#36
d-m-u pushed a commit to d-m-u/manageiq-cross_repo that referenced this issue Feb 3, 2020
If a gem isn't directly referenced in the core-repo's gemfile it cannot
be overridden, ensure_gem has to be used.

Fixes ManageIQ#36
kbrock pushed a commit to kbrock/manageiq-cross_repo that referenced this issue Jun 4, 2021
If a gem isn't directly referenced in the core-repo's gemfile it cannot
be overridden, ensure_gem has to be used.

Fixes ManageIQ#36
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 a pull request may close this issue.

3 participants