Jira (PUP-11347) `puppet parser validate` ignores plans

7 views
Skip to first unread message

Tim Meusel (Jira)

unread,
Nov 10, 2021, 7:22:03 AM11/10/21
to puppe...@googlegroups.com
Tim Meusel created an issue
 
Puppet / Bug PUP-11347
`puppet parser validate` ignores plans
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/11/10 4:21 AM
Priority: Normal Normal
Reporter: Tim Meusel

Hi,

there are multiple issues about puppet failing to validate plans in puppet DSL or the confusing --tasks option (that's undocumented): https://tickets.puppetlabs.com/browse/PUP-8059?jql=text%20~%20%22parser%20validate%20plan%22

  • `puppet parser validate` ignores plans
  • `puppet parser validate --tasks` validates plans
  • the `--tasks` option isn't documented

I think it's really confusing that tasks aren't validated by default. I tested that on puppet 6.25.0 and 7.12.1. Is there a reason for this? Also why enables the `--tasks` option validation for plans? shouldn't that be --plans?

  • from `puppet parser validate` I would expect to validate all code, manifests and plans
  • from the --tasks option I would expect to only validate tasks, not plans
  • `pdk validate` in pdk 2.2 doesn't use --tasks options. It says it validates */.pp, but it actually validates manifests/*/.pp

Since pdk is so commonly used, many people struggle to debug their plans/don't understand why they don't work, because the pass the pdk validation but have actual syntax errors.

I think the following improvements would be really helpful:

  • `puppet parser validate` should validate manifests and plans
  • the validate/syntax rake task from puppetlabs_spec_helper should validate plans as well

https://github.com/puppetlabs/puppetlabs_spec_helper/blob/main/lib/puppetlabs_spec_helper/rake_tasks.rb#L204-L222

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Nov 10, 2021, 1:01:02 PM11/10/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11347
 
Re: `puppet parser validate` ignores plans

There are a lot of points/concerns in the description so I'll try to break it down here:

I think it's really confusing that tasks aren't validated by default. I tested that on puppet 6.25.0 and 7.12.1. Is there a reason for this?

Also why enables the `--tasks` option validation for plans? shouldn't that be --plans?

This is because puppet tasks were implemented first and plans came later. If it would help reduce confusion, we could create a Puppet[:plans] setting that is an alias for Puppet[:tasks]. In other words, you could pass either --tasks or --plans, but we'd prefer and document --plans (similar to what we do for serverport & masterport).

from `puppet parser validate` I would expect to validate all code, manifests and plans... `puppet parser validate` should validate manifests and plans

This part is filed as PUP-9578, so please follow that ticket for updates.

the validate/syntax rake task from puppetlabs_spec_helper should validate plans as well.

Please file a PDK ticket for that. It seems like puppetlabs_spec_helper could detect if the plans directory exists and if so, enable tasks/plans and validate just manifests in that directory. /cc Ben Ford

Tim Meusel (Jira)

unread,
Feb 11, 2022, 4:03:02 AM2/11/22
to puppe...@googlegroups.com
Tim Meusel commented on Bug PUP-11347

> In other words, you could pass either --tasks or --plans, but we'd prefer and document --plans (similar to what we do for serverport & masterport).

I agree with you. I think that's a good way.

> Please file a PDK ticket for that.

This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Feb 11, 2022, 3:27:01 PM2/11/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Team: Phoenix
Reply all
Reply to author
Forward
0 new messages