[PUP-7017] Use newer puppetlabs_spec_helper that does metadata-json-lint as part of validation Created: 2016/12/14  Updated: 2017/06/28  Resolved: 2017/06/23

Status: Closed
Project: Puppet
Component/s: PMT
Affects Version/s: None
Fix Version/s: PUP 5.0.0

Type: Improvement Priority: Normal
Reporter: garrett honeycutt Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PUP-7694 metadata.json created with `puppet mo... Accepted
Template:
Team: Agent
Sprint: Agent 2017-06-28
Release Notes: New Feature
Release Notes Summary: Puppet Module Tool’s gem dependencies are updated to use puppetlabs_spec_helper 1.2.0 or later (which will run `metadata-json-lint` as part of the `validate` rake task).
QA Risk Assessment: Manual

 Description   

As of puppetlabs_spec_helper 1.2.0, metadata-json-lint no longer needs to be a separate rake task as it is part of the validate task. The generated skeleton for a puppet module should reflect this.



 Comments   
Comment by garrett honeycutt [ 2016/12/14 ]

PR - https://github.com/puppetlabs/puppet/pull/5438

Comment by garrett honeycutt [ 2017/05/15 ]

This is a very minor change and already widely adopted in the community. Could this please be merged?

Comment by Glenn Sarti [ 2017/06/20 ]

Merged into master at;
https://github.com/puppetlabs/puppet/commit/bb247c15c47f1b920cf1c8fcb43960d1960d816d

Comment by John Duarte [ 2017/06/23 ]

Using puppet-agent at SHA de8df49 containing puppet at SHA 3e66932 on Centos 7 x86_64, this passes manual validation.

The lint validation of the metadata.json file successfully takes place when performing a rake validate task.

NOTE: Currently, this validation produces an ERROR when the metadata.json file is generated with the --skip-interview option. This has been filed as a separate issue in PUP-7694

Output of validation session

[root@rd6vm0wayc4sdfm ~]# puppet --version
5.0.0
[root@rd6vm0wayc4sdfm ~]# cat /opt/puppetlabs/puppet/VERSION
4.99.0.301.gde8df49
[root@rd6vm0wayc4sdfm ~]# /opt/puppetlabs/puppet/bin/gem install bundler
Fetching: bundler-1.15.1.gem (100%)
Successfully installed bundler-1.15.1
Parsing documentation for bundler-1.15.1
Installing ri documentation for bundler-1.15.1
Done installing documentation for bundler after 5 seconds
1 gem installed
[root@rd6vm0wayc4sdfm ~]# puppet module generate --skip-interview foo-bar
 
Notice: Generating module at /root/bar...
Notice: Populating templates...
Finished; module generated in bar.
bar/Gemfile
bar/Rakefile
bar/examples
bar/examples/init.pp
bar/manifests
bar/manifests/init.pp
bar/spec
bar/spec/classes
bar/spec/classes/init_spec.rb
bar/spec/spec_helper.rb
bar/README.md
bar/metadata.json
[root@rd6vm0wayc4sdfm ~]# cd bar/
[root@rd6vm0wayc4sdfm bar]# /opt/puppetlabs/puppet/bin/bundle install
...
Bundle complete! 7 Gemfile dependencies, 36 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
[root@rd6vm0wayc4sdfm bar]# /opt/puppetlabs/puppet/bin/rake validate
---> syntax:manifests
---> syntax:templates
---> syntax:hiera:yaml
(WARN) dependencies: Dependency puppetlabs-stdlib has an open ended dependency version requirement >= 1.0.0
(ERROR) required_fields: Required field 'summary' not found in metadata.json.
Errors found in metadata.json

Generated at Mon Dec 16 01:45:23 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.