Skip to content

Support both puppet and openvox gem names #67

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ekohl
Copy link
Contributor

@ekohl ekohl commented May 21, 2025

This uses the filename to determine the gem name. This allows users to choose:

gem 'puppet', github: 'OpenVoxProject/puppet'

Or use the new openvox gem:

gem 'openvox', github: 'OpenVoxProject/puppet'

At some point they can start to diverge and make puppet more of a transitional gem that only depends on openvox.

Currently untested, but this allows for discussion.

bastelfreak
bastelfreak previously approved these changes May 23, 2025
@bastelfreak
Copy link
Contributor

works fine:

# for gemspec in puppet.gemspec openvox.gemspec; do gem build --strict --verbose $gemspec; done
  Successfully built RubyGem
  Name: puppet
  Version: 8.18.1
  File: puppet-8.18.1.gem
  Successfully built RubyGem
  Name: openvox
  Version: 8.18.1
  File: openvox-8.18.1.gem

@bastelfreak
Copy link
Contributor

@ekohl should we merge this, and afterwards I update the release action to publish the puppet gem also to the github registry?

@bastelfreak
Copy link
Contributor

mhm

$ bundle install --path .vendor --with development:release:test

[!] There was an error parsing `Gemfile`: There are multiple gemspecs at /home/bastelfreak/code/openvox/puppet. Please use the :name option to specify which one should be used. Bundler cannot continue.

 #  from /home/bastelfreak/code/openvox/puppet/Gemfile:3
 #  -------------------------------------------
 #
 >  gemspec
 #
 #  -------------------------------------------

@bastelfreak
Copy link
Contributor

Does it maybe make more sense to move the second gemspec into another directory? Then we don't need to always specificy the gemspec we're using.

@bastelfreak
Copy link
Contributor

Ah it's not that complicated:

diff --git a/Gemfile b/Gemfile
index 5fa0ec958f..828a132282 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
 source ENV['GEM_SOURCE'] || "https://rubygems.org"

-gemspec
+gemspec name: 'openvox'

 def location_for(place, fake_version = nil)
   if place.is_a?(String) && place =~ /^((?:git[:@]|https:)[^#]*)#(.*)/

This tells bundler/Gemfile to use the openvox.gemspec

With that, bundle works:

$ bundle install --path .vendor --with development:release:test
Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
Using openvox 8.18.1 (was 8.17.0) from source at `.` and installing its executables
Bundle complete! 39 Gemfile dependencies, 110 gems now installed.
Bundled gems are installed into `./.vendor`

@bastelfreak
Copy link
Contributor

I tested it with one of our modules and that doesn't work:

diff --git a/Gemfile b/Gemfile
index ea079b0..5b29f61 100644
--- a/Gemfile
+++ b/Gemfile
@@ -27,6 +27,7 @@ gem 'rake', :require => false
 gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]

 puppetversion = ENV['PUPPET_GEM_VERSION'] || [">= 7.24", "< 9"]
-gem 'puppet', puppetversion, :require => false, :groups => [:test]
+#gem 'puppet', puppetversion, :require => false, :groups => [:test]
+gem 'puppet', github: 'ekohl/puppet', branch: 'add-legacy-gemspec'

 # vim: syntax=ruby
$ bundle update
Fetching https://github.com/ekohl/puppet.git
Fetching gem metadata from https://rubygems.org/.......
Could not find gem 'puppet' in https://github.com/ekohl/puppet.git (at add-legacy-gemspec@bc5056b).

I assume we wirst need to publish them gem

@ekohl
Copy link
Contributor Author

ekohl commented May 26, 2025

I assume we wirst need to publish them gem

It works locally with path and an existing checkout. Publishing shouldn't be needed either.

I'm not sure why this fails now.

@ekohl
Copy link
Contributor Author

ekohl commented May 26, 2025

Spoke too soon: https://bundler.io/guides/git.html says there's glob so you can use:

gem 'puppet', :github => 'ekohl/puppet', :branch => 'add-legacy-gemspec', :glob => 'puppet.gemspec'

@bastelfreak
Copy link
Contributor

Publishing shouldn't be needed either.

yes we don't have to. But I think it would be nice for users from a convenience point of view.

This uses the filename to determine the gem name. This allows users to
choose:

	gem 'puppet', github: 'OpenVoxProject/puppet'

Or use the new openvox gem

	gem 'openvox', github: 'OpenVoxProject/puppet'

At some point they can start to diverge and make puppet more of a
transitional gem that only depends on openvox.
@ekohl ekohl force-pushed the add-legacy-gemspec branch from c456087 to 24e290c Compare May 28, 2025 16:59
@ekohl
Copy link
Contributor Author

ekohl commented Jun 2, 2025

After further thinking and testing I think it's easier if the Vox ecosystem switches completely. Some open PRs to do so:

I think there are a few gems:

Then there is rspec-puppet which needs to be switched over. Probably also by forking to rspec-openvox.

Once we've done that we also need to audit the server because some tooling there also pulls in the puppet gem.

@bastelfreak
Copy link
Contributor

I agree. Switching over is easier.

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.

2 participants