Prevent the use of `node[]` syntax in gitlab.rb configuration file
When refactoring Prometheus cookbook and dependent recipes, in !2793 (merged), we caused issues with some customers that were using the node[] syntax, as per examples available in gitlab.rb.template.
@balasankarc has already cleaned up the affected examples in e3aa827a, but there are still some usage of node[] there.
We should clean-up those as well, and we should warn users that are still using (or that may start to use this syntax in the future).
We should evaluate some possible ways of adding warnings:
- Use refinements when loading gitlab.rb configuration code: https://blog.codeship.com/ruby-refinements/ to patch any use of
node[]to throw a warning, while use outside will not - Use
parserandastgems to lint thegitlab.rbfile looking for violations (similar to how rubocop works), and offer warnings/suggestions
We should document best practices in doc/development to prevent this from happening again.
Edited by Gabriel Mazetto