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

Fix issues with bad separation of concern between Array, Hash and Collection types

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.8.0
    • Fix Version/s: PUP 4.9.0
    • Component/s: None
    • Labels:
    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDS 2016-11-16, PDS 2016-11-30
    • Release Notes:
      Not Needed
    • Release Notes Summary:
      no user visible change
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      internals; refactoring

      Description

      This ticket is about Puppet Type internals and what's proposed here does not affect how the types are declared or represented.

      In the current implementation, the Collection type has both a size_type and an element_type attribute. This, despite the fact that only the size_type is present in the specification. The element_type cannot be declared as a parameter and it is also never included in the string representation of the type. The only reason for it being present in the Collection is to provide some common functionality shared between the Array element_type and the Hash value_type.

      The current design has several negative consequences.

      1. The code is unclean. It's hard to understand why and when the element_type is significant in the Collection type logic.
      2. It makes the Collection type carry an unnecessary attribute.
      3. It imposes the name element_type on the Hash type although the name there really should be value_type (to correspond with key_type).
      4. It has a negative impact on serialization of the Collection type since special logic must be added to understand that the element_type shouldn't be included. This must be fixed (hence the bug status rather than improvement in this ticket).

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                thomas.hallgren Thomas Hallgren
                QA Contact:
                Eric Thompson
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support