Should we namespace our facts?
Add your comments directly to the page. Include links to any relevant research, data, or feedback.
Background
As users begin to mix more publicly available modules into SIMP systems, we run the risk of fact conflicts where the first one that gets loaded wins. This is quite likely to cause unexpected consequences in both our code and the code of other people.
Our legacy facts can't be deprecated until SIMP 7 since they are so widely used but, if we decide to namespace, then we should migrate all of our core components as quickly as possible.
Relevant data
This question was posted to the #puppet-dev chat room and was met with general approval with the suggestion that one of the options in the table below be used.
An additional option of <author_name>_<fact_name>
was presented but discounted as unable to be migrated to a new module maintainer without causing widespread issues and so is not listed.
Options considered
Option 0: | Option 1: | Option 2: | Option 3: | |
---|---|---|---|---|
Description | simp_<fact_name> | <modulename>_<fact_name> (single_underscore) | <modulename>__<fact_name> (double underscore) | <module_name>-<fact_name> |
Pros and cons | Easy to understand The hard-coded | Easy to understand May run into issues if | Minimizes risk of conflicts with any system fact value Kind of strange syntactically (but not incorrect) | VERY unlikely to conflict with anything The hyphen is a non-idiomatic character for fact names Facts using this can't be accessed in classic Facter and Puppet (via Puppet recommends not making facts that are not valid puppet variable names since the behavior will be non-deterministic. |
Estimated cost | SMALL | SMALL | SMALL | SMALL |
Votes | 2 | 0 | 6 | 0 |
Vote Summary |