Skip to content
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

Remove deprecated validate_* #66

Closed
wants to merge 4 commits into from
Closed

Conversation

ralfbosz
Copy link

This is the same as #65 but now
using datatypes instead of the
validate_legacy function.

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

This is the same as voxpupuli#65 but now
using datatypes instead of the
validate_legacy function.
@ggabijaa
Copy link

ggabijaa commented Dec 12, 2023

you could also update has_key function in config.pp file @ralfbosz

@kenyon kenyon changed the title Remove depricated validate_* Remove deprecated validate_* Dec 12, 2023
The has_key function is deprecated,
using an internal Puppet function
instead.
@ralfbosz
Copy link
Author

you could also update has_key function in config.pp file @ralfbosz

Missed that one, fixed it.

Copy link
Member

@smortex smortex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I detailed some minor issues with the data types. I have no experience with this module and maybe adding more validation to the various Hash would be great, but it is a good start, thanks for this effort!

$download_url = undef,
$install_dir = $winlogbeat::params::install_dir,
$tmp_dir = $winlogbeat::params::tmp_dir,
Optional[String] $major_version = undef,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty string is probably not acceptable?

Suggested change
Optional[String] $major_version = undef,
Optional[String[1]] $major_version = undef,

As a rule of thumb, String without a minimum length is a smell, and if '' is a valid value, prefer String[0] to make it explicit that an empty string is okay.

I will not report this for other occurrences in this file.

Comment on lines +31 to +32
String $package_ensure = $winlogbeat::params::package_ensure,
String $service_ensure = $winlogbeat::params::service_ensure,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stdlib has some helpers:

Suggested change
String $package_ensure = $winlogbeat::params::package_ensure,
String $service_ensure = $winlogbeat::params::service_ensure,
Stdlib::Ensure::Package $package_ensure = $winlogbeat::params::package_ensure,
Stdlib::Ensure::Service $service_ensure = $winlogbeat::params::service_ensure,

String $service_ensure = $winlogbeat::params::service_ensure,
Boolean $service_enable = $winlogbeat::params::service_enable,
Optional[String] $service_provider = $winlogbeat::params::service_provider,
String $registry_file = $winlogbeat::params::registry_file,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a Stdlib::Windowspath more suitable?

Comment on lines +43 to +44
String $install_dir = $winlogbeat::params::install_dir,
String $tmp_dir = $winlogbeat::params::tmp_dir,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a Stdlib::Windowspath more suitable?

$metrics = undef,
Boolean $use_generic_template = $winlogbeat::params::use_generic_template,
Stdlib::Fqdn $beat_name = $winlogbeat::params::beat_name,
Array $tags = $winlogbeat::params::tags,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's always good if we can qualify this more precisely, e.g. Array[String[1]] for an array of non-emty strings.

manifests/init.pp Show resolved Hide resolved
@zilchms
Copy link
Contributor

zilchms commented Feb 4, 2024

superseded by #68
Hey @ralfbosz, thanks for your contribution. I decided to merge your PR and #67 into one PR and fix the changerequests there altogether. I needed these changes for #62 . Thanks for your contribution nonetheless!

@zilchms zilchms closed this Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants