Looking for feedback for upcoming postgresql cookbook changes


#1

Hey everyone! I’m in the midst of doing a fair bit of reconstruction work on the cookbook which is slated for the 7.x release. The things it will do are:

  • Chef 13.8+ compatibility. Since Chef 14 comes out in April and Chef 12 will be EOL at the end of April, it is time to move everything up.
  • Drastically alter the way the cookbook works under the covers. For the longest time it was dependent on the pg gem which was no picnic to install into the Chef Omnibus and thus it has temporarily been removed from this upcoming release until there is a cleaner/better/testable solution. Now it is a series of shell outs to the postgres toolchain to directly manipulate systems.
  • Re-factors the very extensive attributes away from the cookbook entirely. For a very long time this cookbook used the library cookbook anti-pattern that is attributes. Since you can technically have multiple versions of postgresql installed on a given system, the current way it is setup does not allow for you to manage all of those clusters. Going forward, the first (small) step to supporting clusters is to specify a version number. Not only does this correspond to package installs, but it also refers to the cluster name as well which on most systems is named after the PG_VERSION that is present in those folders. A future refactor can take the postgres cluster scheme into better account. If you have a solid use case for this too, please open an issue so we can examine it and see how we can update the resources to account for it.
  • Creates a lot more testing to verify correctness. There are now integration tests to cover all of the resources sometimes multiple times. This will slow down the overall test suite speed, but I’ll trade test coverage for CI speed every day.
  • Simplifies the library helpers and removes them from the global namespace. Forcing the postgres global helpers upon everyone is not a very nice thing to do so there will be examples and documentation on how to do this better in your wrapper cookbook.

Whew, yes this is one hell of a rewrite that needed to happen for the future maintainability of this cookbook. So, what I’d also like feedback on is how we roll this out to everyone using this cookbook. My idea for now is to cut a branch off the most recent 6 series release called 6.x then make a new patch version which adds a lot of Chef::Log.warn's everywhere and some lengthy deprecation and migration documentation in the README. We can also leverage this branch to backport any more changes to make it Chef 13 compatible to buy users a bit more time to migrate up to the newer cookbook.

If you want, you can also post feedback to the Github Issue