Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9294

Raise Error when a legacy function illegally defines methods

    Details

    • Release Notes:
      New Feature
    • Release Notes Summary:
      Hide
      Function loading of legacy functions will now protect against illegal method definitions inside of loaded legacy functions. Such methods could lead to mysterious and hard to find problems as they could disrupt the operation of the entire system, and cause leakage between environments. A new setting `--func3x_check` can be set to `false` to turn of the checking and thus allowing the illegal construct to be loaded (with bad side effects) and the function to be used on a best effort basis. See https://puppet.com/docs/puppet/latest/functions_refactor_legacy.html for more information.
      Show
      Function loading of legacy functions will now protect against illegal method definitions inside of loaded legacy functions. Such methods could lead to mysterious and hard to find problems as they could disrupt the operation of the entire system, and cause leakage between environments. A new setting `--func3x_check` can be set to `false` to turn of the checking and thus allowing the illegal construct to be loaded (with bad side effects) and the function to be used on a best effort basis. See https://puppet.com/docs/puppet/latest/functions_refactor_legacy.html for more information.
    • QA Risk Assessment:
      Needs Assessment

      Description

      When a 3.x function .rb file contains calls to `def` they will end up in a place where they are not supposed to be. It is illegal to have such definitions (they used to work in 3.x because they ended up being methods on Object (i.e. it polluted every class in Ruby which is obviously horrible and unwanted).

      From 6.0.0, legacy functions are loaded by a new loader and it should catch these illegal definitions and raise an error instead of causing other hard to understand errors. (Currently the methods are defined, but in a place where the legacy function later cannot find and call them).

      In the rare case that 3.x functions with illegal constructs are used in such a way that the illegal constructs are only loaded but never called users that want to prevent errors from being raised by the new check can set --func3x_check to false.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                henrik.lindberg Henrik Lindberg
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support