Onceover show Puppetfile - Add versionomy support for DSC module version format #328
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.
Addresses the issue of #324 and includes error handling from #325.
When checking comparing version numbers of current and latest modules, the DSC modules have extra characters which are unhandled by the standard version format in Versionomy.
Summary:
The DSC modules on Puppet forge use a version number that is currently unsupported by the standard version format in Versionomy.
When Versionomy parses the version format
8.5.0-0-2
, the-2
suffix is considered extra_character which results in stderr. This PR proposes using a custom format to add support for the fieldpatchlevel_minor
via the delimiter-
.The standard version format supports [major, minor, tiny, patchlevel] [8, 5, 0, 0] (e.g. 8.5.0-0)
The proposed custom_format supports [major, minor, tiny, patchlevel, patchlevel_minor] [8, 5, 0, 0, 2] (e.g. 8.5.0-0-2)
The custom format uses
-
as the delimiter for the patchlevel_minor field. Additional support could be added later for.
or other varieties. Simply updating the regex_delimiter from (-) to (-|.) will add this support.This PR also includes the error handling from PR #325 to handle and flag any other version exceptions that may be unsupported by Versionomy default formats.
Testing:
The sample puppetfile and
onceover show puppetfile
output demonstrates the benefits of the custom_format and error handling.onceover update puppetfile
can now auto correct the badly formatted versionsOutput: onceover show puppetfile
puppetforge_format
the modules patchlevel_minor is correctly checked assessedAfter
onceover update puppetfile
All modules have been updated to the latest version, all poorly formed versions have been replaced.