-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BREAKING: Drop puppet 3 support. Replace validate_* functions with Puppet 4 data type validations #264
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some lint check results which does not make sense.
manifests/artifactory.pp
Outdated
@@ -67,7 +67,9 @@ | |||
$file_path = $path | |||
} | |||
|
|||
validate_absolute_path($file_path) | |||
if $file_path !~ Stdlib::Compat::Absolute_path { | |||
fail("archive::artifactory[${name}]: \$name or \$archive_path must be an absolute path!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manifests/artifactory.pp:71:trailing_comma:WARNING:missing trailing comma after last element
manifests/go.pp
Outdated
@@ -26,7 +26,9 @@ | |||
$file_path = $path | |||
} | |||
|
|||
validate_absolute_path($file_path) | |||
if $file_path !~ Stdlib::Compat::Absolute_path { | |||
fail("archive::go[${name}]: \$name or \$archive_path must be an absolute path!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manifests/go.pp:30:trailing_comma:WARNING:missing trailing comma after last element
When using |
See: https://docs.puppet.com/puppet/4.9/lang_data_abstract.html#optional So it's still request to set a default value unless you want to have required parameters. We can discuss about non undef values for example |
@alexjfisher correct. But the ntp module used the already deprecated hiera v4 as demo. Data in modules is imho a task for the puppet 5 age. |
@jkroepke Good work opening the puppet-lint issue. Meanwhile, (and so we can get this merged), how about using control-comments to disable the check? You can also include why you've disabled the check.
|
@alexjfisher Done |
@alexjfisher I have no idea, how to use modern facts on the line like here:
How to modify it to use |
@alexjfisher Does it make sense to check failures like
If yes, I haven't the knowlage to adjust this test. Sorry. |
@jkroepke That test does need to be fixed, but it should be pretty simple. it { is_expected.to compile.and_raise_error(%r{parameter 'allow_insecure' expects a Boolean value, got String}) } |
@jkroepke That looks better. I don't understand why one of the combinations still failed. Very odd... Maybe something to do with the recently introduced parallel rspec?? |
and thanks for the rebase/squash! |
@jkroepke Other than squashing, did you make any other changes? Tests are all green this time. |
¯\_(ツ)_/¯ Now its fine. |
No, just a squash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I've asked on IRC if anyone else would like to review too. IMO, changes to puppet-archive probably deserve a bit more scrutiny than most other modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very good!
I would however consider reusing (and enriching) our Tea module
Optional[String] $extract_path = undef, | ||
Optional[String] $creates = undef, | ||
Optional[Boolean] $cleanup = undef, | ||
Optional[Stdlib::Compat::Absolute_path] $archive_path = undef, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about we use Tea::Absolutepath
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hum, why you want to add additional dependencies? The stdlib data types based on the tea types. Not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ::compat:: types are specifically designed to match the horror that was the validate_ function that went before. There is Stdlib::Absolutepath to do better path checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we should then, officially, deprecate Tea in favour for Stdlib… not that it was ever in widespread use to begin with…
…
i hope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve standards instead build a own world. That why i'm doing this PR. :)
I've reworded the PR title as it'll probably get used in the changelog when that's next updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hard work on this! I think we should specify puppetversion >= 4.6.1 rather than 4.4.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Added Puppet Data types for every parameter.
remove deprecated validate_* and is_* functions from stdlib.