rjbs/Dist-Zilla

[PkgVersion] add generation of tests that checks module version [rt.cpan.org #72602]

Opened this issue · 0 comments

rjbs commented

https://rt.cpan.org/Ticket/Display.html?id=72602

It would be safer if PkgVersion would generate a release test that would
check that the version in each module is really the version that was
expected, to check that PkgVersion did its job before the release.
A suggested implementation would be to compare the versions in
Changes/META.{json,yml}/*.pm. 
I think it is really important to not make this added test as a separate
plugin that would have to be explicitely loaded by the user but instead
to include it for every PkgVersion usage: every code generator must have
its safeguard.


My use case for this wish is that I've been able to generate a broken
release due to PkgVersion (and maybe multiple calls to it, due to
running multiple builds from Dist::Zilla::Shell):
https://metacpan.org/source/DOLMEN/Dist-Zilla-Plugin-Version-FromSubversion-1.000002/lib/Dist/Zilla/Plugin/Version/FromSubversion.pm
In this package there is 3 PkgVersion-generated blocks, with 2 different
versions. As the CPAN toolchain usually uses the first $VERSION line
from a package while Perl takes the last line, there is a mismatch
between what the tools will use and what Perl will see at runtime.

-- 
Olivier Mengué - http://perlresume.org/DOLMEN