Skip to main content

Chef Cookbook

@reethikarr/chef-cookbookv2026.10.22.3· MIT· 9d agoBEHAVIORSWORKFLOWSACCEPTED WARNINGS
01README

Test-first Chef cookbook change flow: Test Kitchen red/green workflows, semver bump and CHANGELOG, bchef policy lockfiles, and a gated GitLab merge request.

02Behaviors1
@reethikarr/chef-cookbookv2026.10.22.3chef_cookbook.ts

Global Arguments

ArgumentTypeDescription
cookbookPathstringAbsolute path to the cookbook checkout (contains metadata.rb and .kitchen.yml)
suite?stringTest Kitchen instance regex, e.g. 'default-ubuntu-2204' or 'all'
fn converge()
kitchen converge against the prod-like instance(s)
fn verify()
kitchen verify (InSpec/Cinc Auditor integration tests)
fn destroy()
kitchen destroy the EC2 test instance(s)
fn lockPolicy()
Regenerate the lockfiles in the cookbook's policies/ directory with `bchef policy regenerate` (run from cookbookPath). bchef is a shell alias for `chef exec bchef`, so it is invoked that way here.
fn release(level: enum, changes: array, changelogFile?: string)
Bump the semver version in metadata.rb and prepend a CHANGELOG entry
ArgumentTypeDescription
levelenum
changesarrayChangelog bullet points
changelogFile?string
fn commit(branch: string, message: string)
Create a branch and commit all cookbook changes
ArgumentTypeDescription
branchstring
messagestring
fn push(branch: string)
Push the release branch to origin. The merge request itself is opened by the gitlab model (@webframp/gitlab create_merge_request), which needs the branch to exist on the remote.
ArgumentTypeDescription
branchstring

Resources

run(infinite)— Result of a kitchen/chef command
release(infinite)— Version bump and changelog entry applied to the cookbook
03Workflows2
@reethikarr/chef-redf477cf06-ac3d-4241-beec-13e77966aded

RED phase of cookbook TDD. Converges the prod-like EC2 instance (defined by the cookbook's .kitchen.yml) on the UNCHANGED cookbook, then runs the new InSpec test and asserts it FAILS. A passing test here means the test proves nothing. The instance is left running so @reethikarr/chef-green can reuse it.

baselineConverge the existing cookbook onto the prod-like instance
1.converge
2.baseline-converges
expect-failureThe new test must fail before the change is written
1.verify
2.test-fails
@reethikarr/chef-green929729e2-e9f5-494f-8838-b34b0300ad7a

GREEN phase and release. Converges the changed cookbook, asserts the InSpec tests now pass, bumps the semver version and CHANGELOG, regenerates the lockfiles in policies/, commits, then WAITS for human approval before pushing and opening the merge request. The test instance is destroyed whether or not earlier jobs passed.

proveConverge the change and require every test to pass
1.converge
2.converges
3.verify
4.tests-pass
releaseVersion, changelog, lockfile, commit. Only after green.
1.bump-and-changelog
2.lock-policy
3.lock-ok
4.commit
gateHuman reviews the diff before anything is pushed
1.approve-mr
publishOutward-facing; only reachable after approval
1.push
2.open-mrgitlab.create_merge_request
cleanupDestroy the EC2 test instance regardless of outcome
1.destroy
04Previous Versions2
2026.10.22.2MIT(was none)
2026.10.22.1
05Stats
B
86 / 100
Downloads
5
Archive size
8.2 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository0/2missing

07Platforms
08Labels