June CPAN PR Challenge: App::DPath

Having recovered a small slice of free time, I signed up for the CPAN Pull Request Challenge again and drew App::DPath.  I started by looking for things to do:

That gave me a couple things to work on.


  1.  Installed Strawberry Perl 5.22.0 64-bit on my Windows 7 desktop machine.
  2.  Forked the App::DPath github repo and cloned my repo onto my machine.
  3.  Installed the Dist::Zilla ecosystem so I can test the module.  Surprising Dist::Zilla works just fine under Strawberry Perl.  I was a bit worried.

Windows CPAN Testers Failures

First, I confirmed the error exists on my machine, then I went digging.  t/app_dpath.t includes a check function that builds a dpath command line invocation for each test case, but does not capture error output so I wasn't getting any feedback from the command invocation. I brute forced things by printing the built-up command string to stdout so I could see what the test was trying to run.  The test invocation includes a complex Data::DPath selector string and I thought maybe Windows was misinterpreting that string.  I confirmed this by running the test invocation manually using a simpler DPath selector successfully.

I suspecteda quoting problem, so I switched up how single and double quotes were used in t/app_dpath.t and quickly found a set of simple changes that allowed the tests to run successfully. I committed those changes on a branch, pushed it to github, then cloned and successsfully tested my changes on a linux box to make sure I didn't break break anything with my fix.  I created an issue on the github repo for the CPAN Testers failures, and a pull request to fix them.  One task down!

Remove use of convert_blessed_universally

I read the bug report, and the bug report it referenced.  Seemed like a good idea so I tackled it.  This one was very simple: Use JSON::MaybeXS in place of the call to use JSON -convert_blessed_universally and make sure the tests still pass.  Another issue created and pull request.  Task two down!

All in, a nice evenings work.

Iron Man Blogging

I've signed up, again, for the Perl Iron Man blogging challenge.  Hopefully this time around will go better.  I have the CPAN Pull Request challenge to motivate me!

January CPAN Pull Request Challenge

I'm taking part in NeilB's CPAN Pull Request challenge and received String::Random for my January task.  I quickly forked the repo on Github, cloned it into my local server, took a look at it, and felt immediately overwhelmed.  This is a well-written module that does exactly what the documentation asks for, so I wasn't sure where I could contribute.  After dithering for a few days, I asked on the pr-challenge mailing list and got very good advice from Neil and the author of String::Random, Shlomi Fish, himself.  I should definitely have introduced myself to Shlomi first thing after getting the assignment.  He was very approachable and helpful while I worked on his module.

I set myself two tasks:
  • Clean up output of perlcritic -1
  • Add a rand_gen parameter to the new method allowing the user to specify their own random number generator
Cleaning up perlcritic was mostly a matter of implementing most of the suggestions and ignoring, via a module-wide .perlcriticrc file, the policies I and/or Shlomi disagreed with.  Shlomi asked for small commits, so I worked down from perlcritic -5 to perlcritic -1, cleaning up all the instances of a policy at once and committing those changes.  This worked well and led to a series of discrete commits.

Adding the rand_gen functionality was straightforward.  I modified the new method to check for the parameter, save the subroutine in the String::Random object, then replaced all calls to rand with the saved subroutine.  I built tests using one of the existing test files as a template, added documentation, and committed the changes to my fork of String::Random.

I submitted my changes as two pull requests on Github, with the rand_gen PR depending on the perlcritic cleanup PR.  I'm not sure what the best way to handle that as these should have been orthogonal, but the formatting changes from the perlcritic PR made it difficult to get a clean PR for rand_gen.

Shlomi quickly accepted my PRs and the new version of String::Random is available.  I'd like to thank Shlomi Fish for his assistance and Neil for his advice helping me get started.