Closed rmestrum closed 6 years ago
I'm not sure if that's a bug here or in librarian-puppet. https://puppet.com/docs/puppet/5.1/modules_metadata.html#version-specifiers-in-module-metadata doesn't mention spacing at all so that's not very useful. This gem uses semantic_puppet which is also used by puppet internally so I'd consider it the defacto spec. Since that allows it I'm leaning to considering it a bug in librarian-puppet instead.
That said, I'd welcome a PR that warns about this.
@rmestrum Obviously you're using a test module, but have you found that in a real life module on the forge? The concern (among others) with metadata json lint is to make sure that valid json is uploaded that can be used with the forge when someone makes a forge API call to download a module and receive the dependency information properly.
@rnelson0 it could also be an internal module that's consumed from git.
It is indeed a private module that we use and it's consumed from git. The code I provided is only for clarification.
I've seen that there's a new version of librarian-puppet. I give that one a try.
I've tracked the root cause to the the librarianp gem (https://github.com/voxpupuli/librarian/blob/librarianp/lib/librarian/dependency.rb#L128)
The regexp in this method takes only 1 space. So it't not an issue in the metadata-json-lint gem. Closing this issue.
A version_requirement of a dependency that is illegal formed is not detected.
Between the lower and upper bound of the version requirement are 2 spaces. When running metadata-json-lint no errors are displayed. So this gem approves the metadata.json file.
When running librarian-puppet the following error occurs:
/usr/share/rubygems/rubygems/requirement.rb:101:in `parse': Illformed requirement [">=2.5.3 < 3.0.0"] (Gem::Requirement::BadRequirementError)