chef / chef/chef-cli

multiple default_sources should have a configurable priority for automatic preferred_for behavior

Open
#42 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Aspect: UX Triage: Confirmed Triage: Feature Request Type: Design Proposal Type: Enhancement
Dominant language
Ruby
Stars
18
Forks
23
Avg merge
5d 17h
Merged PRs (30d)
1

Description

The default behavior should not change, but users really want to be able to say "use all my :chef_repo cookbooks first, then use :supermarket second, and i don't want to tell you that my version of build-essentials should always take priority"

Right now that looks something like:

default_source :chef_repo, “./cookbooks” do |s|
  s.preferred_for *(Dir.entries(‘./cookbooks’) - [‘.’, ‘..’] & self.run_list.map {|c| c.split(‘::’).first})
end

The new DSL code should behave the same way so that if the :chef_repo takes priority over :supermaket then the presence of a build-essential-0.0.1 cookbook in the :chef_repo would take precedence over any version of build-essential in supermarket and there would be no crazy merging of actual versions -- presence of any version in a higher priority repo would knock out all versions in a lower priority repo.

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 locating the DSL implementation for default_source and preferred_for, then trace how cookbook versions are selected across multiple sources. Preserve the current behavior by default, while making source priority configurable so that any cookbook in a higher-priority source excludes all versions from lower-priority sources. Add or update coverage for the chef_repo-before-supermarket example described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.