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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.9.4
    • Fix Version/s: PUP 4.10.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDE 2017-03-22, PDE 2017-04-05
    • Release Notes:
      Not Needed
    • Release Notes Summary:
      small internal optimization
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      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

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

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support