Refactor puppet modules properties#212
Conversation
ekohl
left a comment
There was a problem hiding this comment.
Some minor things inline but I like this abstraction. Cleans up a lot.
Of course some bikeshedding: should it be PuppetModule? I know it's used outside of Puppet and nothing inherently ties modulesync to Puppet modules. Perhaps ManagedModule is a better name and in line with managed_modules.yml.
4438fc3 to
a80f0da
Compare
Any thoughts on this part? |
Yes, ATM it should be About |
ekohl
left a comment
There was a problem hiding this comment.
Looks like a good refactor. 2 more small items, but otherwise 👍
This commit introduces a new class PuppetModule in order to simplify properties computation. This new class: - allows a single `name`, `namespace` and the working directory computation - introduces the `given_name` property, which is the name the user puts in its configuration file - adds the capability a have a longer `namespace` (e.g. puppet/modules) This commit also exposes the options through ModuleSync.options instead of passing it to almost any methods. As `name` and `namespace` can be confusing in code, so they have been renamed to `repository_name` and `repository_namespace`. This commit only introduces minor changes on the output of `msync`: some single quotes have been added as delimiters for relevant dynamic part of the messages; and the use of `given_name` (i.e. user-provided name) when relevant (e.g. "Syncing 'voxpupuli/puppet-module'").
Please note that previous commit introduced some offences that will be fixed in upcomming commits (some are already available in voxpupuli#206
a80f0da to
900b02c
Compare
ekohl
left a comment
There was a problem hiding this comment.
Thanks! Let's get this in to allow more.
|
Ready to merge? |
|
I shouldn't forget to press the big green button. Kind of important ;) |
This commit introduces a new class PuppetModule in order to simplify properties computation.
This new class:
name,namespaceand the working directory computationgiven_nameproperty, which is the name the user puts inits configuration file
namespace(e.g. puppet/modules)This commit also exposes the options through ModuleSync.options instead
of passing it to almost any methods.
As
nameandnamespacecan be confusing in code, so they have beenrenamed to
repository_nameandrepository_namespace.This commit only introduces minor changes on the output of
msync: somesingle quotes have been added as delimiters for relevant dynamic part of
the messages; and the use of
given_name(i.e. user-provided name) whenrelevant (e.g. "Syncing 'voxpupuli/puppet-module'").