Jira (PUP-8059) rake validate fails on modules with plans

3 views
Skip to first unread message

Gene Liverman (JIRA)

unread,
Oct 16, 2017, 12:56:03 PM10/16/17
to puppe...@googlegroups.com
Gene Liverman created an issue
 
Puppet / Bug PUP-8059
rake validate fails on modules with plans
Issue Type: Bug Bug
Affects Versions: PUP 5.3.2
Assignee: Unassigned
Created: 2017/10/16 9:55 AM
Environment:

Bunder-based environment used by Travis CI

Priority: Normal Normal
Reporter: Gene Liverman

puppetlabs_spec_helper provides a task named validate that now fails on modules containing plans. I have traced the calls this makes down and it seems that, in the end, each .pp file in a project that is not excluded manually via PuppetSyntax.exclude_paths is passed to puppet parser validate via the code below:

def validate_manifest(file)
  Puppet[:parser] = 'future' if PuppetSyntax.future_parser and Puppet.version.to_i < 4
  Puppet[:app_management] = true if PuppetSyntax.app_management && (Puppet::Util::Package.versioncmp(Puppet.version, '4.3.0') >= 0 && Puppet.version.to_i < 5)
  Puppet::Face[:parser, :current].validate(file)
end

The result of this is that existing module authors like myself who have added plans to their modules now have failing test with valid code. Natrually, I could work around this by adding the entire plans directory to my list of excluded paths but, seeing as these are proper .pp files, this feels wrong.

Here is the full trace of how rake validate gets to these manifests:

  1. puppetlabs_spec_helper defines a validate task here that calls the syntax task.
  2. the syntax task is part of puppet-syntax and calls syntax:manifests here
  3. the syntax:manifests task is defined here. It calls the check method of PuppetSyntax::Manifests on all found manifests here.
  4. The check method calls the validate_manifest method on each file here.
  5. The validate_manifest method is defined here and passes each file to puppet parser validate via the code block above.
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Oct 17, 2017, 6:09:08 PM10/17/17
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-8059
 
Re: rake validate fails on modules with plans

The plan files needs to be validated with --tasks turned on. I think it is important that also plans gets validated. So the level above what is shown in the ticket needs to handle regular manifests differently from the .pp files under ./plans.

Gene Liverman (JIRA)

unread,
Oct 17, 2017, 9:52:03 PM10/17/17
to puppe...@googlegroups.com
Gene Liverman commented on Bug PUP-8059

Ideally the parser would just recognize the keyword plan and not need
--tasks passed to it but instead adapt accordingly.

On Tue, Oct 17, 2017 at 3:10 PM Henrik Lindberg (JIRA) <

Gene Liverman
Sr. Site Reliability Engineer
gene.l...@puppet.com

Henrik Lindberg (JIRA)

unread,
Oct 18, 2017, 10:16:04 AM10/18/17
to puppe...@googlegroups.com

Gene Liverman Sorry, that is not possible as it means that plan would need to be a keyword, and that in turn requires a major puppet version as it is not backwards compatible.

Henrik Lindberg (JIRA)

unread,
Oct 19, 2017, 7:16:12 AM10/19/17
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
 
Change By: Henrik Lindberg
Team: Puppet Developer Experience

Gene Liverman (JIRA)

unread,
Oct 26, 2017, 7:24:14 PM10/26/17
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Mar 5, 2020, 1:41:02 AM3/5/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8059

Module validation has been moved to the pdk, so I'm going to close this. Please reopen or move to the pdk project if this is still an issue.

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages