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

Only show validators that are available in the given PDK Context

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.18.0
    • Component/s: None
    • Template:
    • Team:
      Puppet Developer Experience
    • Release Notes:
      New Feature
    • Release Notes Summary:
      PDK is now aware of what validators are applicable from the context it is being run from
    • QA Risk Assessment:
      Needs Assessment

      Description

      Now that validators are context-aware, they currently output an empty target list if they're in an invalid context. e.g. validating environment.conf (Control Repo only) when in a Puppet Module. However in the PDK this generates spurious messages e.g.

      In the example below I have made it so that ONLY the puppet-environment-conf is valid. Notice that the the UI (Spinners) shows that only the puppet-environment-conf validator is run, however note that the puppet-syntax, lint and epp validators complain about "no files to validate"

      C:\Source\it-pe-environments [update-puppetfile-for-windows ≡ +0 ~2 -0 !]> ruby bin\pdk validate puppet
      pdk (INFO): Using Ruby 2.5.1
      pdk (INFO): Using Puppet 6.13.0
      + [X] Running puppet validators ...
      |__ [X] Checking Puppet Environment settings (environment.conf).
      info: puppet-syntax: ./: Target does not contain any files to validate (["site/*/**/*.pp"]).
      info: puppet-lint: ./: Target does not contain any files to validate (["site/*/**/*.pp"]).
      info: puppet-epp: ./: Target does not contain any files to validate (["site/*/**/*.epp"]).
      error: puppet-environment-conf: environment.conf: Invalid setting 'foo'
      error: puppet-environment-conf: environment.conf: Invalid section 'something'
      

      This ticket will track the work to change the PDK behaviour so that validators that are not valid in the given context do not even appear in the logs. So the example above should turn into:

      C:\Source\it-pe-environments [update-puppetfile-for-windows ≡ +0 ~2 -0 !]> ruby bin\pdk validate puppet
      pdk (INFO): Using Ruby 2.5.1
      pdk (INFO): Using Puppet 6.13.0
      + [X] Running puppet validators ...
      |__ [X] Checking Puppet Environment settings (environment.conf).                                                                                                            
      error: puppet-environment-conf: environment.conf: Invalid setting 'foo'
      error: puppet-environment-conf: environment.conf: Invalid section 'something'
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              glenn.sarti Glenn Sarti
              Reporter:
              glenn.sarti Glenn Sarti
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support