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

PUP-121 (relative namespacing) was never fully resolved in 3.x future parser

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 3.8.1
    • Fix Version/s: PUP 3.8.7, PUP 4.4.0
    • Component/s: Language
    • Labels:
      None
    • Template:
    • Story Points:
      2
    • Sprint:
      Language 2016-02-24
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      THIS NOTE ONLY APPLIES TO 3.8.7 RELEASE.

      One part of the "relative namespacing" feature was not removed when using future parser. When a class was declared with the resource like expression the references to classes where still interpreted as being relative. This is now fixed and should help with migration to 4.x as the 3.x future parser will now also use absolute naming in these cases.
      Show
      THIS NOTE ONLY APPLIES TO 3.8.7 RELEASE. One part of the "relative namespacing" feature was not removed when using future parser. When a class was declared with the resource like expression the references to classes where still interpreted as being relative. This is now fixed and should help with migration to 4.x as the 3.x future parser will now also use absolute naming in these cases.

      Description

      PUP-121 was about removing relative lookup of class names, and it was marked as resolved in Puppet 3.7.0 (with future parser enabled). It was never actually resolved at all in the 3 series, although it's fixed in 4.0. This is a significant language difference, which seems to have the potential to cause problems for upgraders.

      The following two manifests prove that this was never resolved:

      class foo::thing {
        notify {"from foo::thing":}
      }
       
      class thing {
        notify {"from ::thing":}
      }
       
      class foo {
        class {'thing':}
      }
       
      include foo
      

      The above should notify "from ::thing," but in Puppet 3.8 it will notify "from foo::thing" instead.

      class bar::other {
        class {'other':}
      }
       
      class other {
        notify {"from ::other":}
      }
       
      include bar::other
      

      The above should compile cleanly and notify "from ::other," but in Puppet 3.8 it will fail with a duplicate declaration error.

      Furthermore, PUP-121 says that the tests in spec/integration/parser/future_compiler_spec.rb, under "when resolving class references" are supposed to prove this is fixed, but they actually seem to have nothing to do with the problem described in PUP-121 (i.e. "include 'thing' can include something other than the one class named 'thing'"). If we don't have any real tests that check for this misbehavior, we need some.

      UPDATE


      We should add the tests in this ticket to 3.x and make them work for parser=future.
      Then merge that to stable and make the tests standard and ensure runtime works as expected - fix the issues. Then merge to master.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  nick.fagerlund Nicholas Fagerlund
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: