Chef 13 Upgrade: `knife-cookbook-doc` gem upgrade

As part of an upgrade from Chef 12 to Chef 13, this is one of the posts in which I've been detailing the issues I've encountered, and how I've resolved them .

I use the gem knife-cookbook-doc to autogenerate documentation from my Chef cookbooks. It allows me to ensure that documentation is kept right next to source files, which promotes changing of documentation at the same time as code, as well as make it easier to keep updated as it’s a task that can be automated.

However, when upgrading to Chef 13, I found that my’s dependencies section had:

* #<Logger:0x0000000004397548> () (Recommended but not required)
* #<Logger:0x0000000004397548> () (Suggested but not required)
* Conflicts with #<Logger:0x0000000004397548> ()

Digging into the code, I found this was triggered by the recommendations, suggestions and conflicting methods, which read from the corresponding recommends, suggests and conflicts fields within the cookbook’s metadata. As those fields no longer existed, a Logger was returned, instead of the valid metadata.

I raised a PR which was merged within a few hours and released as v0.25.0, and can be installed with:

chef gem install knife-cookbook-doc -v 0.25.0

Written by Jamie Tanna on 07 March 2018, and last updated on 30 April 2018.