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

Deprecate Symbol#<=> monkey patch

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.5.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Story Points:
      2
    • Sprint:
      Client 2016-03-23
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Comparing symbols to strings (or other types) in Ruby code is deprecated. This functionality was provided by a monkey patch in a ruby dependency that Puppet no longer requires.

      Description

      We restored the Symbol#<=> monkey patch in PUP-5962 because our version behaves differently from ruby 1.9.3 and up:

      Puppet:

      irb(main):005:0> :a <=> 'a'
      => 0
      

      Ruby:

      irb(main):003:0> :a <=> 'a'
      => nil
      

      This ticket is to deprecate puppet's behavior when comparing against non-Symbols. Ideally this could be done when strict mode is enabled and Symbol#<=>(other) is called, but other is not a Symbol.

      There could be performance implications of adding that check, and it may uncover other parts of puppet that rely on the deprecated behavior, like http://projects.puppetlabs.com/issues/5466. Those will need to be fixed also.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                josh Josh Cooper
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support