You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While looking to see if my dependencies are out of date today, I decided it would be a good idea to check the CHANGELOGS before I blindly update things. It occurred to me that this is probably available in the puppetforge API already (it is). So all we need to do is parse/print it.
Proposal
The r10k:dependencies should optionally attempt output a configurable number of changelog entries between the currently installed version and the newest available version.
Note: I am working on a patch already but I thought I'd solicit some feedback first.
Feedback Needed
Passing arguments or parameters to rake can be done in a few ways. There is precedent in ra10ke for using the "rake" way, but personally I dislike that way.
The options:
The "rake" way - rake r10k::dependencies[10] (these arguments are positional which means remembering what goes where and using square brackets on the commandline can be troublesome)
Environment variables - rake r10k::dependencies CHANGELOG=10
(in order to prevent environment variable name collisions I prefer prefixing variables with the project name or some sensible key, in this case 'RA10KE_' but that makes for unwieldy environment variable names)
ARGV - rake r10k::dependencies 10 (still positional but at least the brackets are gone)
Ruby OptionParser - rake r10k:dependencies --changelog=10 (this is nice, but not very "rake like")
The rake way does not work in my opinion. Additionally, all arguments will become strings so if booleans or numbers are created they will need to be casted in the code. I prefer the optionparser or ARGV.
I have opened #72 which changed a bunch of that code for the better.
Background
While looking to see if my dependencies are out of date today, I decided it would be a good idea to check the CHANGELOGS before I blindly update things. It occurred to me that this is probably available in the puppetforge API already (it is). So all we need to do is parse/print it.
Proposal
The
r10k:dependencies
should optionally attempt output a configurable number of changelog entries between the currently installed version and the newest available version.Note: I am working on a patch already but I thought I'd solicit some feedback first.
Feedback Needed
Passing arguments or parameters to rake can be done in a few ways. There is precedent in ra10ke for using the "rake" way, but personally I dislike that way.
The options:
rake r10k::dependencies[10]
(these arguments are positional which means remembering what goes where and using square brackets on the commandline can be troublesome)rake r10k::dependencies CHANGELOG=10
(in order to prevent environment variable name collisions I prefer prefixing variables with the project name or some sensible key, in this case 'RA10KE_' but that makes for unwieldy environment variable names)
rake r10k::dependencies 10
(still positional but at least the brackets are gone)rake r10k:dependencies --changelog=10
(this is nice, but not very "rake like")See 4 Ways to Pass Arguments to a Rake Task for a full discussion.
I personally prefer the environment variable option because it "feels like rake", it is used by make and it is more clear to me than the "rake way".
Thoughts?
The text was updated successfully, but these errors were encountered: