HomePhorge

(PUP-3755) Make compile for a node use compiler's context for transform
0be9c1adaec3Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-3755) Make compile for a node use compiler's context for transform

Without this fix, the final step of compiling a catalog for a node will
transform the produced catalog to resource form in a context that is not
configured for the environment used to compule the catalog. This can
lead to a wide variety of problems since there is a high chans that
unrelated code gets loaded and this code may have errors, may cause side
effects and cause the catalog to silently contain a result different
from the intended.

The fix is simple - the compile method now accepts a block that it
yields the produced catalog to if the block is given in a call to
compile. This is then used instead of simply calling to_resource on the
produced result.

As a conseuence of the change mocking tests were failing. As it was
found that these tests were meaningless and testing nothing they were
removed.

Details

Event Timeline

Henrik Lindberg <henrik.lindberg@cloudsmith.com> committed rPU0be9c1adaec3: (PUP-3755) Make compile for a node use compiler's context for transform (authored by Henrik Lindberg <henrik.lindberg@cloudsmith.com>).Jan 17 2015, 12:47 AM