Users writing modules can run into this and end up thrashing around trying to understand why it's not working. Anything that makes writing modules more accessible/less confusing to users is a good thing.

Given that the initial attempts at this included a significant performance impact, perhaps there is a middle ground of having a flag that tells puppet whether to rely on the dependencies entry in metadata.json or instead go for "slow mode", perhaps as a new metadata.json entry, where it scans the environment for functions.

Users writing modules can run into this and end up thrashing around trying to understand why it's not working. Anything that makes writing modules more accessible/less confusing to users is a good thing.
Given that the initial attempts at this included a significant performance impact, perhaps there is a middle ground of having a flag that tells puppet whether to rely on the dependencies entry in metadata.json or instead go for "slow mode", perhaps as a new metadata.json entry, where it scans the environment for functions.

Release Notes:

New Feature

Release Notes Summary:

It is no longer required to have a dependency listed in a module's metadata.json on another module (b) in order to use functions or data types from module b.

QA Risk Assessment:

Automate

Description

The Problem

See PUP-6952 and PUP-6953 for backgound but essentially, puppet can't find puppet 4.x functions in other modules unless they are declared as a dependency of the module trying to use the function.

OR if the module just doesn't declare any dependencies.

The Change

The behavior of finding functions should not be dependent on the modules dependencies as defined in metadata.json for the module.

We should search the entire modulepath for a function and not just in the declared dependencies.

We can retain some of the optimization by searching in declared dependencies first and then if not found extend the search to all modules. This makes the optimization opt-in and not required.

Attachments

Issue Links

blocks

PDK-956pdk should not enforce an empty array for dependencies if no dependencies are given

Accepted

PUP-6953Puppet should give a more direct error when it can't find a 4.x function because of a missing module dependency