chef / chef/chef-cli

`chef generate generator` flow is quite broken

Open
#262 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Untriaged Type: Bug
Dominant language
Ruby
Stars
18
Forks
23
Avg merge
5d 17h
Merged PRs (30d)
1

Description

Version:

$ chef -v
Redirecting to cinc
Cinc Workstation version: 24.12.1073
Cinc Client version: 18.6.2
Cinc Auditor version: 5.22.65
Cinc CLI version: 5.6.16
Biome version: 1.6.821
Test Kitchen version: 3.6.0
Cookstyle version: 7.32.8

Environment:

Debian Linux sid

Scenario:

When you run chef generate generator, it tells you:

Add the following to your config file to enable it:
  chefcli.generator_cookbook "/tmp/f/code_generator"

But this syntax is actually invalid:

When loading '/home/phil/.cinc-workstation/config.toml',
the following error occurred:
  parse error on value "." (".")

OK, so first problem is that the tool gives you invalid syntax.

So, lets fix it to be as the docs recommend:

[chefcli]
generator_cookbook = "/tmp/f/code_generator"

That passes syntax checking, but it also doesn't seem to do anything. From here if you run:

chef generate cookbook test

it uses the internal cookbook, not the custom one. One must run:

chef generate cookbook test -f /tmp/f/code_generator

in order for it to take effect.

Steps to Reproduce:

See above.

Expected Result:

config is taken into account

Actual Result:

config is not taken into account.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing chef generate generator, the reported config parse error, and chef generate cookbook test with the documented [chefcli] setting. Trace how the generator cookbook setting is parsed and how cookbook generation selects its source; done means the emitted configuration is valid and the configured custom cookbook is used without -f.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.