Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-1266

PDK validate fails when example manifests have been created

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.9.1
    • Component/s: None
    • Template:
    • Acceptance Criteria:
      Hide

      pdk validate succeeds manifest checking task when smoke tests not containing syntax errors are present in the examples dir (and there are no other manifest syntax errors)

      Show
      pdk validate succeeds manifest checking task when smoke tests not containing syntax errors are present in the examples dir (and there are no other manifest syntax errors)
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Fixes a problem with `pdk validate` where it would produce false syntax errors for modules that contain example usage manifests in the `examples` directory, only if the module is located Puppet's configured `modulepath` (e.g. `/etc/puppetlabs/puppet/code/modules`)
      Show
      Fixes a problem with `pdk validate` where it would produce false syntax errors for modules that contain example usage manifests in the `examples` directory, only if the module is located Puppet's configured `modulepath` (e.g. `/etc/puppetlabs/puppet/code/modules`)
    • QA Risk Assessment:
      Needs Assessment

      Description

      Since PE 6.0.0 we've found that pdk validate (also puppet parser) fails in validating a module if smoke tests exist in ..modules/<modname>/examples/ even though that examples directory is still created with 'pdk new module'

      ie

      [root@1903nix0 review]# pdk validate
      pdk (INFO): Running all available validators...
      pdk (INFO): Using Ruby 2.5.1
      pdk (INFO): Using Puppet 6.0.2
      [✔] Checking metadata syntax (metadata.json tasks/*.json).
      [✔] Checking module metadata style (metadata.json).
      [✖] Checking Puppet manifest syntax (*/*.pp).
      [✔] Checking Ruby code style (*/*.rb).
      Error: puppet-syntax: this location (file: /opt/puppetlabs/puppet/modules/review/examples/init.pp, line: 1, column: 1): Could not parse for environment production: This Function Call is unacceptable as a top level construct
      info: task-name: ./: Target does not contain any files to validate (tasks/*/).
      info: task-metadata-lint: ./: Target does not contain any files to validate (tasks/*.json)

      Syntax checking improvements in PUP-4242 seem to have ignored this testing use case. Can we fix this so that the validator won't fail when smoke tests are being used in the customary/default fashion (examples dir)?

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  tim.sharpe Tim Sharpe
                  Reporter:
                  rosalind.benoit Rosalind Benoit
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: