Should we namespace our facts?

Add your comments directly to the page. Include links to any relevant research, data, or feedback.

Status
DECIDED
Impact

MEDIUM

Driver
Approver
Contributors
Informed
Due date
OutcomeOption 2

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:
Descriptionsimp_<fact_name><modulename>_<fact_name> (single_underscore)<modulename>__<fact_name> (double underscore)<module_name>-<fact_name>
Pros and cons

(plus) Easy to understand

(minus) The hard-coded simp_ prefix would make transitioning ownership of a module to another organization awkward.

(plus) Easy to understand

(minus) May run into issues if <module_name> corresponds to a fact with an underscore

(plus) Minimizes risk of conflicts with any system fact value

(minus) Kind of strange syntactically (but not incorrect)

(plus) VERY unlikely to conflict with anything

(minus) The hyphen is a non-idiomatic character for fact names

(minus) Facts using this can't be accessed in classic $::fact_name format

(minus) Facter and Puppet (via $facts[]) accept this syntax , but there may be weird edge cases or tools that don't

(minus) Puppet recommends not making facts that are not valid puppet variable names since the behavior will be non-deterministic.

Estimated costSMALL
SMALL
SMALL
SMALL
Votes

2

0

6

0
Vote Summary

Kendall Moore

Brandon Riden (Unlicensed)


Shark Bruhaha

Judith Johnson

Trevor Vaughan

Former user (Deleted)

Chris Tessmer

Liz Nemsick


Action items

  •  

Outcome