puppetlabs/puppet — pull request #3214 by joshcooper (2014-10-17 23:26:15+00:00)
Title: (PUP-3130) Remove hidden `_timestamp` fact

Puppet generates a timestamp when a Puppet::Node::Facts object is
created. During PSON serialization (from agent to master), the timestamp
is serialized separately from the hash of fact values.

Previously, when the master deserialized the facts from JSON, it would
convert the timestamp to a hidden fact named `_timestamp`, inline with
the normal facts. As a result, there was a `_timestamp` variable
available in top-scope.

The `_timestamp` fact was added in 5aa4440 circa 2007. It was
originally called `_puppet_timestamp`, and then renamed to `_timestamp`
in a6fe700.

This commit modifies the Fact object so that it no longer adds a
`_timestamp` fact during deserialization. Note the timestamp is still
available, via the `Facts#timestamp` method, it's just not a fact.

This commit also removes the magic behavior of stripping facts with
leading underscores. This improves performance because we no longer
duplicate the values hash, or apply a regex to every fact key.

It also preserves behavior of the compiler, added in fb5f859, which
updates the facts timestamp prior to saving them.