Jira (PUP-10176) puppet parser validate should be configurable to fail on warnings

6 views
Skip to first unread message

Benjamin Fischer (JIRA)

unread,
Dec 16, 2019, 10:35:04 AM12/16/19
to puppe...@googlegroups.com
Benjamin Fischer created an issue
 
Puppet / Improvement PUP-10176
puppet parser validate should be configurable to fail on warnings
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: Compiler
Created: 2019/12/16 7:34 AM
Priority: Low Low
Reporter: Benjamin Fischer

Puppet Version: 6.0.10
Puppet Server Version: 6.0.5
OS Name/Version: RHEL 7.7 and Windows 10

We use the "puppet parser validate" command to automatically check all manifests before git check-in for correct syntax.

Lately I see a lot of errors in our puppetserver logs because code with bad escaped double quoted strings has been checked in:

Puppet Unrecognized escape sequence '\1' (...)

The "Puppet Unrecognized escape sequence" is only a warning and does not make the validator fail.

Desired Behavior:

I would like to be able to configure the validator to return an error code when the validations throws warnings. That way I can refuse the check-in of code that throws parser warnings.

Actual Behavior:

The parser prints the warning but the command exits with an exit code of zero to signal that the syntax of the manifest file is fine.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Dec 16, 2019, 11:45:03 AM12/16/19
to puppe...@googlegroups.com
Henrik Lindberg commented on Improvement PUP-10176
 
Re: puppet parser validate should be configurable to fail on warnings

This could be made an option in parser validate, but it would need a way to relay this information to deep inside the lexer where it currently calls lex_warning for a couple of problematic lexical constructs.

Not sure if it is a good idea to tighten the rules for those warnings (unrecognized escape) and make them errors when using strict mode (would require a major release). Also not sure if this is best implemented by having a general setting that turns all warnings into errors, or if they are still warnings but result in non 0 exit - and if so only for parser validate.

Henrik Lindberg (JIRA)

unread,
Dec 16, 2019, 11:46:03 AM12/16/19
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Dec 16, 2019, 11:46:04 AM12/16/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages