Draft
Conversation
smortex
reviewed
Dec 23, 2021
81df1fb to
e9ef7f8
Compare
* Introduces type aliases for (most) variables to do some error checking. * Fix examples given by the unit test helper to match expected values.
Member
|
What about tests for the types? |
Member
Author
Good idea, I'll write up a couple tomorrow. |
ghoneycutt
reviewed
Jan 3, 2022
| String $service_name = $bareos::client_service_name, | ||
| String $service_ensure = $bareos::service_ensure, | ||
| Boolean $service_enable = $bareos::service_enable, | ||
| String $config_dir = "${bareos::config_dir}/bareos-fd.d" |
Member
There was a problem hiding this comment.
You probably want Stdlib::Absolutepath if this will also be an absolute path.
ghoneycutt
reviewed
Jan 3, 2022
| Boolean $manage_package = $bareos::manage_package, | ||
| Variant[String, Array[String]] $package_name = $bareos::client_package_name, | ||
| String $package_ensure = $bareos::package_ensure, | ||
| String $service_name = $bareos::client_service_name, |
Member
There was a problem hiding this comment.
You probably want String[1] unless the code specifically is meant to handle empty strings ''
ghoneycutt
reviewed
Jan 3, 2022
| # @summary Size definition | ||
| # @author Tobias @towo Wolter <tobias.wolter+voxpupuli@b1-systems.de> | ||
| # @see https://docs.bareos.org/Configuration/CustomizingTheConfiguration.html#datatypesize | ||
| type Bareos::Size = Pattern[/(?i:^(\d+(\.\d+)?)\W*(k|kb|m|mb|g|gb)$)/] |
Member
There was a problem hiding this comment.
These regular expressions should have comments that explain what they are attempting to match.
Member
There was a problem hiding this comment.
And for this you can borrow some tests in the bacula module 😉 :
https://github.com/xaque208/puppet-bacula/blob/master/spec/type_aliases/size_spec.rb
Member
|
@towo can you please rebase? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request (PR) description
Introduces type aliases for all the classes.
Will remove type checking from the provider.
This Pull Request (PR) fixes the following issues
n/a