HomePhorge

(PUP-865) Allow BlockExpression to evaluate everything
83c0eff03996Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-865) Allow BlockExpression to evaluate everything

Previously BlockExpression would skip evaluating any AST nodes that
implement an instantiate method. The assumption was that instiate only
existed on Hostclass, Node, and Definition AST nodes and those same
classes also did not implement an evaluate method. With the introduction
of the PopsBridge::Program class, this entire house of assumption cards
came falling down, since it impelements both instantiate and evaluate.

The only thing that truly prevented BlockExpression from calling
evaluate was that the default evaluate implementation on Parser::AST
raised a Puppet::DevError to try to catch the case of evaluate not
being implemented for an AST class. Since Parser::AST is entirely
internal and missing an evaluate should show up very quickly in tests,
we can just as easily make evaluate a noop by default, which then
simplifies BlockExpression.

This change fixes the problem where the body of pp files were loaded,
but not evaluated when using the future evaluator and a directory of
manifest files. The problem was triggered by the BlockExpression logic
interacting with the PopsBridge::Program object and the structure
created by the Puppet::Pops::Parser::CodeMerger.

Details

Provenance
Andrew Parker <andy@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU8bab12e9c9e2: (Maint) Extract re-usable resource matcher
Branches
Unknown
Tags
Unknown

Event Timeline

Andrew Parker <andy@puppetlabs.com> committed rPU83c0eff03996: (PUP-865) Allow BlockExpression to evaluate everything (authored by Andrew Parker <andy@puppetlabs.com>).Feb 4 2014, 12:29 AM