Helping to clean CPAN: April 2016
… where I get out my virtual broom and sweep up cruft in my assigned distribution for this month’s edition of the CPAN Pull Request Challenge.
This month’s module: Net::Redmine
Net::Redmine is an API to communicate with and carry out operations on a Redmine server.
In this section I try to get a feeling for the state of the module, how up to date it is, how often people are contributing to it, how many other distributions are depending on it, how many bugs/issues it currently has, what the CPANTS kwalitee is, etc.
- last commit 10th Feb 2012 (https://github.com/gugod/net-redmine)
- latest release 10th Feb 2012 (https://metacpan.org/pod/Net::Redmine)
- 3 open issues in GitHub (one issue asks what one could do as part of CPAN PRC)
- 0 pull requests
- 1 open issue on RT (4 years old) (https://rt.cpan.org/Public/Dist/Display.html?Name=Net-Redmine)
- 1 reverse dependency via metacpan
- no test failures on cpantesters, but lots of “unknown”, “invalid” or “na” builds: http://matrix.cpantesters.org/?dist=Net-Redmine+0.09
- CPANTS report (http://cpants.cpanauthors.org/dist/Net-Redmine)
- core metrics: all ok
- extra metrics
- META.yml doesn’t declare Perl version
- experimental metrics
- META.yml doesn’t have a provides section
- build prereq doesn’t match usage
Initial inspection of the source code
After forking the repo and cloning a local copy, let’s have a look at the project to see what build system it uses, if the test suite works and the tests pass, if it could do with a Travis-CI config file (or if present, if it can be updated).
- uses Module::Install (which is deprecated) -> convert to EUMM?
- README is simple text. Convert README to markdown? Mention module purpose in README (which is only mentioned in module pod)?
- no Travis-CI config; add a .travis.yml?
Any::Moosewhich is deprecated in favour of
cpanm --installdeps .fails due to syntax error in
perl Makefile.PLfails with the same error
- this is a
Module::Installproblem and means that the
Module::Install::AuthorTestsmodule is missing
cpanm --installdeps .works
- … however
HTML::WikiConverter(a dependency of
HTML::WikiConverter::Markdown, which is required for
Net::Redmine) fails its tests:
- one problem with
HTML::WikiConverteris simply a pod coverage test:
- the other issue was:
- … which merely means that the test website no longer exists
- one could move on by simply using the
cpanm, or submit a patch to
HTML::WikiConverteris only a gitpan account on GitHub (and hasn’t seen a release since 2009) so
--notestlooks like the way to go in this case.
perl Makefile.PLruns to completion
- one warning:
Cannot determine perl version info from lib/Net/Redmine.pm
- one warning:
make testnow passes, however gives warnings:
- … which should be documented somewhere, because it’s not documented in the module, and …
Test::Perl::Criticshould be installed as well
cpanm Test::Spelling Test::Perl::Critic
- Now we have spelling and perlcritic test errors…
the warning message concerning
SD_REDMINE_RAILS_ROOTis incorrect; the correct environment variable is
need a redmine server to be installed and running. To get this going, follow the following steps:
- it turns out that the module requires at most Redmine version 1.4.7,
since it needs the
scripts/serverscripts, which are no longer avaiable from Redmine version 2.0.0
Looking at the code coverage can give an indication of code quality. If the project is well covered, this means most changes made in pull requests can be made with some confidence that any problems will be caught by the test suite. If the code coverage is low, then this is something that one could address as a pull request (or set of pull requests).
In EUMM and
Build::Module projects, one simply needs to install
Devel::Cover and run
Dist::Zilla projects, one needs to install the
Dist::Zilla::App::Command::cover plugin, after which the code coverage can
be checked via:
In this distribution (without
NET_REDMINE_RAILS_ROOT env setting), the
24.7% statement coverage; 21.8% total coverage
the coverage climbs to
40.0% statement coverage; 35.3% total coverage
which is still quite low and could do with improving.
Overview of the pull requests made
- fix spelling test error (https://github.com/gugod/net-redmine/pull/5)
I was a bit disappointed with my effort this month: only two pull requests and many, many things I still could have looked at. For instance I’d planned to do at least these things:
- declare minimum Perl version (perlver report 5.6.0 as min version)
- fix spelling and perlcritic test errors
- add a .travis.yml
SD_REDMINE_RAILS_ROOTenv var warning and document what var is used for
- document development installation instructions
I was especially disappointed since I’d wanted to try this module out at $work, since we use Redmine as a wiki and trouble ticket system. At the very least it would have been interesting to see how to use the module in a live environment. Unfortunately, due to time constraints the things on my TODO list just didn’t happen. Perhaps these ideas can be useful to someone else’s upcoming Pull Request Challenge assignment.