Deprecating redundant cookbook generators in ChefDK

Deprecating knife cookbook create and berks cookbook in favor of chef generate

​In the current ChefDK there are three separate cookbook generators, each with its own foibles and opinions. To make things easier, Chef is planning to reduce the number of included cookbook generators to one. We will be deprecating knife cookbook create and berks cookbook in favor of chef generate.

The chef generate command is completely customizable. Its behavior can be changed via a generator cookbook to exactly mimic the output of either knife cookbook create or berks cookbook, for those who may prefer the cookbook skeletons laid down by knife cookbook create or berks cookbook.

Proposed Timeline

  1. In the July ChefDK release, the knife cookbook create and berks cookbook commands will each print deprecation notices when invoked, but otherwise will continue to function as normal.
  2. In the August ChefDK, the knife cookbook create and berks cookbook commands will each print deprecation notices, will not generate cookbooks, and will return non-zero exit codes.
  3. In the October ChefDK, the knife cookbook create and berks cookbook commands will be removed entirely. Exit codes will continue to be non-zero.

UPDATE The berks init command will also be deprecated as part of this process, and will follow a similar change timeline as berks cookbook.

What questions can I answer for you?

–Charles

1 Like

What kind of stuff do we want to say about berks init and/or kitchen init? Those aren’t quiiiiite generators but they are in the same kind of direction. Maybe we should look at reducing each to be more restricted to just the minimal boilerplate files needed?

That’s a good question. I’m inclined toward extending chef generate to also cover these use cases, and deprecating those generators as well. What do people think?

I agree with that approach as well.

Works for me :slight_smile:

I agree with that approach well. Too may options are as bad or worse that too few especially when trying to bring new users up to speed.

Hey @coderanger, for kitchen init we’ll be making the default provisioner the shell provisioner as the plan is to pull the chef provisioners out into their own plugin (so they can ship on a separate schedule).

https://github.com/test-kitchen/test-kitchen/issues/913

chef generate could definitely cover setting up .kitchen.yml’s for chef projects and I think the current cookbook generator already does some of that.

1 Like

After further analysis, running chef generate cookbook on top of any existing cookbook already duplicates the functionality of berks init. Pretty sure we can add berks init to the deprecation schedule, without any additional feature adds to chef generate cookbook.

Because Kitchen has to cover non-Chef use cases, it makes sense to keep kitchen init around.