[Backport] (PUP-12026) Change non-literal type check to deprecation warning #9307
+28
−33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the ILLEGAL_NONLITERAL_PARAMETER_TYPE issue was under control of the
strict
setting. Sincestrict
defaults toerror
,puppet parser validate
logged an error message and exited non-zero for non-literal types such asInteger[0, 60*24]
In order to gradually phase out non-literal parameter types, this commit changes the issue to be a deprecation. When parsing and validating puppet code a warning is now logged, regardless of
strict
, and it exits with 0:As a result of this change, the ClassInfoService error does not include locator information in the error hash:
But the location information is included in the deprecation warning logged on the server.
All language deprecation warnings can already be disabled via the
disable_warnings=deprecations
setting. In a future major release, the non-literal type issue will be converted to an error.This pattern follows how we handled the most recent language checks:
ILLEGAL_DEFINITION_LOCATION: see 6e7835b, 44c4ea0 and 81e61de
ILLEGAL_TOP_CONSTRUCT_LOCATION: see 5661509 and 81e61de
(cherry picked from commit 86a8c14)