[OpenStack-Infra] Openstack Infra's puppet manifests and Puppet style guide.
Jeremy Stanley
fungi at yuggoth.org
Thu Mar 24 13:38:28 UTC 2016
On 2016-03-24 13:42:58 +0300 (+0300), Andrey Nikitin wrote:
> By this message I want to start a discussion about using of the
> Puppet style guide [0] in the 'openstack-infra/puppet-*' projects.
> As you can see, I've created a lot of change-requests to the
> repositories some days ago. I started this work, because I saw,
> that those manifests have different styles of the code, therefore
> I wanted to refactor and make much better them. For example, some
> of them have unsorted and unstructured lists of variables, some of
> them have no docstrings in the body with description of used
> variables and so on. I suppose, that we can unify those manifests
> by following the puppet style guide, but opinions are divided.
I don't think opinions are especially divided about rules mandated
by the style guide, so much as other changes you were introducing
not mandated by the style guide (alphabetizing class parameters,
aligning = assignment operators, et cetera).
> My point of view is following: if we implement the style guide on
> puppet manifests, we will have unified and structured manifests
> with documentation for all classes. We can use it without
> alphabetically sorting of variables, of course.
>
> So, my questions to you are:
> 1. Should we follow the style guide or not?
> 2. What the recommendation we could implement on Openstack Infra manifests?
We've already stated in the past that for any modules besides
openstack_project (system-config), i.e. those we're publishing to
Puppetforge, we would follow rules mandated by the Puppet Style
Guide. I think things like making sure we declare required
parameters before optional ones, use docstrings for clarity, and so
on are fine. Just be aware that changes which refactor otherwise
syntactically and logically correct code will be low priority for
most of our reviewers and will likely have to be rebased many times
if they touch a lot of lines in a given file.
--
Jeremy Stanley
More information about the OpenStack-Infra
mailing list