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

Fix inconsistent Regexp to String conversion in StringConverter

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.9.4
    • Fix Version/s: PUP 4.10.1
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDE 2017-04-19
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Fix the default string format (the '%s' format) so that
      a formatted regexp results in a string that isn't delimited with
      slashes.

      The reason for the change is that the slashes are language specific, and
      as such, should be produced using the '%p' format (which they already
      are). The '%s' format should produce a language agnostic representation
      that is suitable to pass to the Regexp constructor.
      Show
      Fix the default string format (the '%s' format) so that a formatted regexp results in a string that isn't delimited with slashes. The reason for the change is that the slashes are language specific, and as such, should be produced using the '%p' format (which they already are). The '%s' format should produce a language agnostic representation that is suitable to pass to the Regexp constructor.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      covered by unit tests

      Description

      The StringConverter currently converts a Regexp to a string that starts and end with a slash by default. This is inconsistent with how a Regexp is created from a string. The constructor does not expect the slashes.

      The default format (denoted by '%s') should produce a string without the slash delimiters. The alternate format (denoted with '%#s') should remain as is, and produce a string that is quoted.

      The output with slash delimiters can be still be achieved (as before) using the '%p' format.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support