Closed ghost closed 7 years ago
This does seem like a bug. Have you tried with a compatible version of ruby such as 2.3.1?
For stdlib it should have an upper bound on the range, this is not the same as pinning to one specific version.
suggest
{"name":"puppetlabs/stdlib", "version_requirement": ">= 4.12.0 < 6.0.0"},
since stdlib 5 will also support Puppet 3 and 4
https://github.com/puppetlabs/puppetlabs-stdlib#version-compatibility
I had just come across that in the official Puppet docs...D'oh! Makes sense though. I've added the upper bound and it's no longer complaining.
I'm going to try this with 2.3.1 just for my own sanity, see if the behavior is any different.
Same issue with Ruby 2.3.1:
root@testhost:[~/modulename] # rake lint_metadata
Warning: Dependency puppetlabs/stdlib has an open ended dependency version requirement >= 4.12.0
root@testhost:[~/modulename] # rbenv version
2.3.1 (set by /app/.rbenv/version)
root@testhost:[~/modulename] # ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
root@testhost:[~/modulename] # gem list metadata-json-lint
*** LOCAL GEMS ***
metadata-json-lint (1.1.0)
I fully expect this to be an environment issue and not necessarily something wrong with metadata-json-lint, puppetlabs_spec_helper or even bundle/rake :disappointed:
+1
I was able to reproduce. Also does not work from the command line.
$ metadata-json-lint --no-strict-dependencies
Warning: Dependency puppetlabs/stdlib has an open ended dependency version requirement >= 4.6.0
The strict-dependencies
option elevates the Warning to an Error. Setting it to false still displays the warning, though. For example, in tests/rake_multiple_json_options/Rakefile
, options.strict_license = false
is set, and that generates the output:
$ be rake metadata_lint_multi
Warning: License identifier invalid_license is not in the SPDX list: http://spdx.org/licenses/
Changing that to true elevates it to an error:
$ be rake metadata_lint_multi
Warning: License identifier invalid_license is not in the SPDX list: http://spdx.org/licenses/
Errors found in metadata_license.json
I think there are some issues with the default Rake tasks that comes with puppetlabs_spec_helper and via puppet module generate
. For some reason, when metadata linter was "failing", all subsequent tasks were not executing. I thought it had something to do with metadata's complaint.
I did not see the Errors found
message in my outputs so I guess this issue can be closed as expected behavior of metadata-json-lint gem. Thanks!
Not sure if this is a puppetlabs_spec_helper problem or an issue with this gem. I'm using the boilerplate Rakefile from
puppet module generate
in version 4.7.1 Ruby env, gem versions and Rakefile below:Rakefile
When I run
rake validate
,rake metadata_lint
or the overriden task aboverake lint_metadata
, it runs and complains about an open-ended version requirement....which is by design as I don't want to pin my module to a specific puppetlabs/stdlib version (just the one I wrote it for).metadata.json
Any idea what I might be doing wrong here? It seems like spec_helper includes standard tasks that are overwritting my desired configured one :(