Should we namespace our facts?

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

@Trevor Vaughan 

Approver

 

Contributors

@Chris Tessmer @Dylan Cochran (Unlicensed) @Judith Johnson @Liz Nemsick @Shark Bruhaha @Jeanne Greulich @Kendall Moore @Steven Pritchard 

Informed

 

Due date

Apr 30, 2019

Outcome

Option 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:

 

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 simp_ prefix would make transitioning ownership of a module to another organization awkward.

Easy to understand

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

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 $::fact_name format

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

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

@Kendall Moore

@Brandon Riden (Unlicensed)

 

@Shark Bruhaha

@Judith Johnson

@Trevor Vaughan

@Former user (Deleted)

@Chris Tessmer

@Liz Nemsick

 

Action items

Outcome

Comments