voxpupuli / ra10ke

Rake tasks related to R10K and Puppetfile
https://rubygems.org/gems/ra10ke
MIT License
30 stars 24 forks source link

Add support for commit ref #67

Closed DLeich closed 2 years ago

DLeich commented 2 years ago

It appears that the validate task will consider modules defined with a pinned commit to be in a failure state, even if the commit actually exists. We have a couple scenarios where this is necessary due to modules being either partially stale, or further development is being worked on. Yes, this is not the most ideal situation, especially if a module is getting stale from active development. However, I believe this to be a desirable feature nonetheless to support pinning to a specific commit. Take the following module definitions from a Puppetfile for example:

mod 'gnupg',
  :git => 'https://github.com/dgolja/golja-gnupg.git',
  :commit => 'bb7bf1319ed63f0c4cdfd72582193a4efc0f1fae'
mod 'oradb',
  :git => 'https://github.com/biemond/biemond-oradb.git',
  :commit => 'afd79f1d95f1fada2cefa58584be2526319d22fe'

This results in the validate task in outputting:

😨  Not all modules in the Puppetfile are valid. 😨
NAME                | URL                                                | REF   | STATUS
--------------------|----------------------------------------------------|-------|-------
gnupg               | https://github.com/dgolja/golja-gnupg.git          |       | 😨     
oradb               | https://github.com/biemond/biemond-oradb.git       |       | 😨     

If there's a configuration I'm missing to better support this, please let me know.

DLeich commented 2 years ago

Huh. Now that I'm looking at the documentation for ra10ke again, it looks like you're using a :ref => for pinning to commits in the examples. It appears that passes the validate task, and actually works for r10k as well. I learned something new today. Leaving this issue open though in case anyone has thoughts about the usage of the commit parameter.

logicminds commented 2 years ago

Is commit a valid syntax for r10k? Can probably add support to the validate task if it does. @DLeich

Easy to add support: https://github.com/voxpupuli/ra10ke/blob/master/lib/ra10ke/validate.rb#L50

kenyon commented 2 years ago

Yes :commit is valid: https://github.com/puppetlabs/r10k/blob/main/doc/puppetfile.mkd#git