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

Add migration check of in-expression

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • PUP 3.8.0, PUP 4.1.0
    • None
    • None

    Description

      The 3.x in operator was not well specified and there were several undefined behaviors. This relates to (but is not limited to)

      • string / numeric automatic conversions
      • applying regular expressions to non string values causing auto conversion
      • confusion over comparisons between empty string / undef / (and internal nil values)
      • in operator not using case independent comparisons

      Code using the `in` operator should be reviewed by users and expectations matched against the now specified behavior.

      Add a MIGRATE4_REVIEW_IN_EXPRESSION with the text "Please review the expectations of using this in-expression against the 4.x specification (3.x. evaluation is undefined for many corner cases)".

      Add a method report_in_expression(o) to MigrationChecker and add a call to (always) report the in expression. Call the method from the evaluator's eval_InExpression.

      (Rationale: It is close to impossible to detect all the corner cases where the result will be different)

      (Add method stubs to the MigrationChecker in the puppet repository and the concrete methods to the implementation in the module created in PUP-4149).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              henrik.lindberg Henrik Lindberg
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support