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

Ensure that returned value from data provider is type checked only once.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • PUP 4.9.4
    • PUP 4.10.0
    • None
    • None
    • Puppet Developer Experience
    • 1
    • PDE 2017-03-22, PDE 2017-04-05
    • Not Needed
    • small internal optimization
    • No Action
    • covered by unit tests

    Description

      The values returned from a data provider are type checked by the lookup framework. Currently, this means that if the function that is backing the provider has a declared return type, then the value will be checked twice. This needs to change so that the lookup framework relies on the type check performed by the function when it is known to always check its returned value.

      We need a mechanism that checks if all dispatchers of a function are declared with a return type, and if so, checks that they are all assignable to the Puppet::LookupValue, or if it is a data_hash, to the type Hash[Puppet::LookupKey,Puppet::LookupValue]. If it isn't assignable, an error should be raised.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              thomas.hallgren Thomas Hallgren
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support