Skip to content

Add Berkshelf commands #32

Description

@andrew

Version: git-pkgs/managers current main at 241e284.

Trying to build Chef cookbook dependency commands after registering the embedded definitions currently returns unknown manager: berks:

_, err := tr.BuildCommand("berks", "install", managers.CommandInput{})

Add a berks definition for Berkshelf. Detect Berksfile.lock as the lockfile and Berksfile as the manifest. Include definitions/berks.yaml, captured version and command help under references/berks, translator tests, and suitable version coverage as described in the new manager contribution guide.

The upstream CLI provides the needed command mappings:

  • berks install installs the Berksfile dependencies, while berks update [COOKBOOKS] updates all or selected locked cookbooks. Both accept --berksfile PATH.
  • berks list and berks outdated [COOKBOOKS] also accept a custom Berksfile and group filters. The command definitions document those arguments.
  • Use berks list --format json for resolve. It returns the resolved cookbook set and versions, but it does not include dependency edges. The JSON formatter also supports machine-readable outdated and list output.
  • Map vendor to berks vendor [PATH], including --delete and --berksfile. Berkshelf defaults the destination to berks-cookbooks; its vendor command accepts a custom directory.

Berkshelf has no frozen-install CLI flag. A trusted Berksfile.lock is used automatically during install; an untrusted lockfile can be resolved and rewritten. Add install, but do not declare install_frozen unless separate enforcement is added and tested. "Frozen" options elsewhere in the CLI apply to cookbook uploads, not dependency installation.

The upstream repository includes a small Berksfile example and its Berksfile.lock. Use equivalent local fixtures for detection and command tests.

Tests should cover default and custom Berksfile paths, install with and without a lockfile, JSON list and outdated output, all-cookbook and single-cookbook updates, and vendor's default path, custom path, and --delete flag. Include capability tests for install, list, outdated, update, resolve, vendor, and json_output, and prove that install_frozen is not declared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions