puppetlabs / r10k

Smarter Puppet deployment
Other
802 stars 355 forks source link

r10k::module::git: expose remote as getter #1380

Closed bastelfreak closed 2 months ago

bastelfreak commented 3 months ago

This allows us to access the remote property to figure out the git URI for a module:

$ bundle exec irb
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
irb(main):001:0> require 'json'
=> true
irb(main):002:0> require 'r10k/module_loader/puppetfile'
=> true
irb(main):003:0> puppetfile = R10K::ModuleLoader::Puppetfile.new(basedir: '/home/bastelfreak/code/controlrepo/').load
=>
{:modules=>
...
irb(main):004:0> mod = puppetfile[:modules].map {|mod| mod if mod.class == R10K::Module::Git}.compact.first
=>
...
irb(main):005:0> mod.remote
=> "https://github.com/voxpupuli/puppet-borg"
irb(main):006:0>

cherry-picked 22da06bd1411bc9bed339ecc5a1b6262f6093a8b from https://github.com/puppetlabs/r10k/pull/1379

bastelfreak commented 3 months ago

@justinstoller can you also merge this? I cherry-picked the commit from #1379 .

justinstoller commented 2 months ago

Sure thing.

bastelfreak commented 2 months ago

@justinstoller any chance you can do a new 3.x release?

justinstoller commented 2 months ago

Yeah, I just need to enable automation on the 3.x branch first: https://github.com/puppetlabs/r10k/pull/1389

justinstoller commented 1 month ago

That took a bit of shenanigans but it's finally up https://rubygems.org/gems/r10k/versions/3.16.2 !