Skip to content

Commit 2930486

Browse files
committed
chore: migrate dependency resolution to Policyfile
1 parent abb7d3f commit 2930486

9 files changed

Lines changed: 33 additions & 22 deletions

File tree

.github/copilot-instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
### Essential Commands (strict order)
2929
```bash
30-
berks install # Install dependencies (always first)
30+
chef install Policyfile.rb # Install dependencies (always first)
3131
cookstyle # Ruby/Chef linting
3232
yamllint . # YAML linting
3333
markdownlint-cli2 '**/*.md' # Markdown linting
@@ -42,7 +42,7 @@ chef exec rspec # Unit tests (ChefSpec)
4242
- **Full CI Runtime:** 30+ minutes for complete matrix
4343

4444
### Common Issues and Solutions
45-
- **Always run `berks install` first** - most failures are dependency-related
45+
- **Always run `chef install Policyfile.rb` first** - most failures are dependency-related
4646
- **Docker must be running** for kitchen tests
4747
- **Chef Workstation required** - no workarounds, no alternatives
4848
- **Test data bags needed** (optional for some cookbooks) in `test/integration/data_bags/` for convergence
@@ -88,7 +88,7 @@ These instructions are validated for Sous Chefs cookbooks. **Do not search for b
8888

8989
**Error Resolution Checklist:**
9090
1. Verify Chef Workstation installation
91-
2. Confirm `berks install` completed successfully
91+
2. Confirm `chef install Policyfile.rb` completed successfully
9292
3. Ensure Docker is running for integration tests
9393
4. Check for missing test data dependencies
9494

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
- name: Install Cinc Workstation
2222
uses: sous-chefs/.github/.github/actions/install-workstation@8.0.4
2323
- name: Install cookbooks
24-
run: berks install
24+
run: chef install Policyfile.rb

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ doc/
3737
rdoc
3838

3939
# chef infra stuff
40-
Berksfile.lock
4140
.kitchen
4241
kitchen.local.yml
4342
vendor/

LIMITATIONS.md renamed to AGENTS.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
# Docker Cookbook Limitations
1+
# AGENTS.md
2+
3+
## Cookbook Purpose
4+
5+
Provides docker_service, docker_image, and docker_container resources
6+
7+
## Agent Findings
8+
9+
* This cookbook is in an incremental modernization pass. Preserve existing public recipes and attributes unless a later full migration is explicitly selected.
10+
* Dependency management should use `Policyfile.rb`; do not reintroduce Berkshelf.
11+
12+
## Known Limitations
213

314
## Supported Platforms
415

Berksfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

Policyfile.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# frozen_string_literal: true
2+
3+
name 'docker'
4+
5+
run_list 'recipe[test::default]'
6+
7+
cookbook 'docker', path: '.'
8+
cookbook 'test', path: './test/cookbooks/test'
9+
10+
Dir.children('./test/cookbooks/test/recipes').grep(/\.rb\z/).sort.each do |recipe|
11+
recipe_name = File.basename(recipe, '.rb')
12+
13+
named_run_list recipe_name.to_sym, 'test::' + recipe_name
14+
end

chefignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ test/*
8585

8686
# Berkshelf #
8787
#############
88-
Berksfile
89-
Berksfile.lock
9088
cookbooks/*
9189
tmp
9290

resources/container.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def coerce_tmpfs(v)
223223
when Hash, nil
224224
v
225225
when Array
226-
v.each_with_object({}) { |path, h| h[path] = '' }
226+
v.to_h { |path| [path, ''] }
227227
end
228228
end
229229

@@ -307,9 +307,7 @@ def coerce_exposed_ports(v)
307307
else
308308
x = Array(v).map { |a| parse_port(a) }
309309
x.flatten!
310-
x.each_with_object({}) do |y, h|
311-
h[y['container_port']] = {}
312-
end
310+
x.to_h { |y| [y['container_port'], {}] }
313311
end
314312
end
315313

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require 'chefspec'
4-
require 'chefspec/berkshelf'
4+
require 'chefspec/policyfile'
55

66
class RSpecHelper
77
class << self

0 commit comments

Comments
 (0)