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

Type aliases defined across multiple levels of modules

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.9.0
    • Fix Version/s: PUP 4.9.2
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      2
    • Sprint:
      PDE 2017-02-08
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      A loader delegation problem has been fixed that caused problems when a data type depended indirectly on data types not directly visible to the module, but being visible to the module of an intermediate type.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      covered by unit tests

      Description

      I have three modules; A, B and C.

      1. Module C defines some type aliases.
      2. Module B lists module C in `metadata.json` and defines some type aliases in terms of the ones in C, (`Variant`, `Array`, etc.).
      3. Module A lists module B in `metadata.json` and uses the type aliases defined in B for parameter types.

      When I try and use module A I get errors similar to:

      Class[A]: parameter 'myparam' references an unresolved type 'C::MyType'
      

      `myparam` is defined in the class of type 'B::SomeType'.

      The workaround is to also add module C to module A's `metadata.json` even though it is installed on the host by virtue of installing module B. I would argue it should just work without this as I'm not explicitly using any of C's resources; it's a dependency of B's and that module is free to change it's dependencies as it sees fit.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bodgit Matt Dainty
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support