-
Notifications
You must be signed in to change notification settings - Fork 104
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
(PDK-388, PDK-392) Add README, CHANGELOG, and puppet requirement to module generation #232
Conversation
Acceptance tests will fail until https://github.com/puppetlabs/pdk-module-template/pull/24 is merged. |
lib/pdk/module/templatedir.rb
Outdated
@@ -34,7 +34,7 @@ class TemplateDir | |||
# @raise [ArgumentError] (see #validate_module_template!) | |||
# | |||
# @api public | |||
def initialize(path_or_url) | |||
def initialize(path_or_url, userdata = {}) |
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.
Can we change this variable name to module_metadata
to be a bit more descriptive?
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.
Also needs a yardoc entry
lib/pdk/module/templatedir.rb
Outdated
@@ -221,6 +223,7 @@ def config_for(dest_path) | |||
if File.file?(config_path) && File.readable?(config_path) | |||
begin | |||
@config = YAML.safe_load(File.read(config_path), [], [], true) | |||
@config.merge!('global' => { 'userdata' => @userdata }) |
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.
Rather than merging this into the @config
hash (which i'm planning to eventually deprecate), it would be cleaner (imho) to add this as the module_metadata
key in the file_config
hash, and then access it in the templates as module_metadata['version']
etc.
@@ -27,5 +27,15 @@ | |||
'operatingsystemrelease' => ['8'])) | |||
end | |||
end | |||
|
|||
describe file('foo/README.md') do |
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.
These new examples are dependent on the module template providing these files. I think it's more valuable to have these examples, with the risk of pdk-module-template breaking them; than to not have them 👍
(fixup) Fixes unit tests for new module generator
New updates require: https://github.com/puppetlabs/pdk-module-template/pull/27 to pass tests. |
Coveralls informs how many new lines of code are causing a coverage drop (in this case, 2 lines in lib/pdk/module/templatedir.rb ) : https://coveralls.io/builds/12769685 @bmjen we should at least have unit tests that satisfy coveralls. |
@james-stocks There is a ticket open to address defaulting to using the templates in the package. This should improve the pdk->pdk-module-template dependency a bit, however we do need to enact some structure on the pdk-module-template to aid in making sure compatibility isn't a problem. We'll need to start versioning the pdk-module-template repo and add version ranges in pdk to prevent breakage. |
-Adds a puppet requirement to metadata.json
-Adds generating a skeleton README.md when generating new module
-Adds generating a skeleton CHANGELOG.md when generating new module
Requires https://github.com/puppetlabs/pdk-module-template/pull/24