Skip to content

Commit b0765b1

Browse files
committed
chore: migrate to Policyfile
1 parent 9ad5350 commit b0765b1

13 files changed

Lines changed: 182 additions & 39 deletions

.github/copilot-instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
- `libraries/` - Library helpers to assist with the cookbook. May contain multiple files depending on complexity of the cookbook.
1919
- `templates/` - ERB templates that may be used in the cookbook
2020
- `files/` - files that may be used in the cookbook
21-
- `metadata.rb`, `Berksfile` - Cookbook metadata and dependencies
21+
- `metadata.rb`, `Policyfile.rb` - Cookbook metadata and dependencies
2222

2323
## Build and Test System
2424

2525
### Environment Setup
26-
**MANDATORY:** Install Chef Workstation first - provides chef, berks, cookstyle, kitchen tools.
26+
**MANDATORY:** Install Chef Workstation first - provides chef, cookstyle, kitchen tools.
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 Chef
2222
uses: actionshub/chef-install@main
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
@@ -36,7 +36,6 @@ doc/
3636
rdoc
3737

3838
# chef infra stuff
39-
Berksfile.lock
4039
.kitchen
4140
kitchen.local.yml
4241
vendor/

LIMITATIONS.md renamed to AGENTS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Limitations
1+
# AGENTS.md
2+
3+
## Agent Guidance
4+
5+
This cookbook uses `Policyfile.rb` for dependency resolution. Run `chef install Policyfile.rb`
6+
after changing cookbook dependencies or test cookbook recipes, and keep Kitchen suites mapped to
7+
Policyfile named run lists.
28

39
## Package Availability
410

Berksfile

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

Policyfile.lock.json

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"revision_id": "fdd2c5203fbea00951d8183f0b6172dcadf8b1a7ce604a4f2e348c0cfd1f19d1",
3+
"name": "varnish",
4+
"run_list": [
5+
"recipe[test::default]"
6+
],
7+
"named_run_lists": {
8+
"default": [
9+
"recipe[test::default]"
10+
],
11+
"distro": [
12+
"recipe[test::distro]"
13+
],
14+
"full_stack": [
15+
"recipe[test::full_stack]"
16+
]
17+
},
18+
"included_policy_locks": [
19+
20+
],
21+
"cookbook_locks": {
22+
"test": {
23+
"version": "0.0.1",
24+
"identifier": "9f51b46453623e5e00569cfca8df877c3044c59d",
25+
"dotted_decimal_identifier": "44844356516143678.26459019811793119.148967455507869",
26+
"source": "test/cookbooks/test",
27+
"cache_key": null,
28+
"scm_info": {
29+
"scm": "git",
30+
"remote": null,
31+
"revision": "9ad5350b254332e6f7c8a02ab618b5546d4be096",
32+
"working_tree_clean": false,
33+
"published": true,
34+
"synchronized_remote_branches": [
35+
"origin/HEAD -> origin/main",
36+
"origin/main",
37+
"origin/renovate/actions"
38+
]
39+
},
40+
"source_options": {
41+
"path": "test/cookbooks/test"
42+
}
43+
},
44+
"varnish": {
45+
"version": "6.0.0",
46+
"identifier": "ac07b0c01fca0a67acabb916c3e14e0b9f162215",
47+
"dotted_decimal_identifier": "48422151713180170.29181776145859553.85811820634645",
48+
"source": ".",
49+
"cache_key": null,
50+
"scm_info": {
51+
"scm": "git",
52+
"remote": null,
53+
"revision": "9ad5350b254332e6f7c8a02ab618b5546d4be096",
54+
"working_tree_clean": false,
55+
"published": true,
56+
"synchronized_remote_branches": [
57+
"origin/HEAD -> origin/main",
58+
"origin/main",
59+
"origin/renovate/actions"
60+
]
61+
},
62+
"source_options": {
63+
"path": "."
64+
}
65+
},
66+
"yum": {
67+
"version": "8.0.0",
68+
"identifier": "a4f3da1691d5c1bcd08e339bed45d3babcbf420a",
69+
"dotted_decimal_identifier": "46430014187623873.53146604791393605.232798984028682",
70+
"cache_key": "yum-8.0.0-supermarket.chef.io",
71+
"origin": "https://supermarket.chef.io:443/api/v1/cookbooks/yum/versions/8.0.0/download",
72+
"source_options": {
73+
"artifactserver": "https://supermarket.chef.io:443/api/v1/cookbooks/yum/versions/8.0.0/download",
74+
"version": "8.0.0"
75+
}
76+
},
77+
"yum-epel": {
78+
"version": "5.0.9",
79+
"identifier": "e001464b1be96e91578d9f2eae7db84345d2c611",
80+
"dotted_decimal_identifier": "63051796202645870.40910137395687037.202599073760785",
81+
"cache_key": "yum-epel-5.0.9-supermarket.chef.io",
82+
"origin": "https://supermarket.chef.io:443/api/v1/cookbooks/yum-epel/versions/5.0.9/download",
83+
"source_options": {
84+
"artifactserver": "https://supermarket.chef.io:443/api/v1/cookbooks/yum-epel/versions/5.0.9/download",
85+
"version": "5.0.9"
86+
}
87+
}
88+
},
89+
"default_attributes": {
90+
91+
},
92+
"override_attributes": {
93+
94+
},
95+
"solution_dependencies": {
96+
"Policyfile": [
97+
[
98+
"test",
99+
">= 0.0.0"
100+
],
101+
[
102+
"varnish",
103+
">= 0.0.0"
104+
],
105+
[
106+
"yum",
107+
"= 8.0.0"
108+
],
109+
[
110+
"yum-epel",
111+
"= 5.0.9"
112+
]
113+
],
114+
"dependencies": {
115+
"test (0.0.1)": [
116+
[
117+
"varnish",
118+
">= 0.0.0"
119+
]
120+
],
121+
"varnish (6.0.0)": [
122+
[
123+
"yum",
124+
">= 7.2.0"
125+
],
126+
[
127+
"yum-epel",
128+
">= 0.0.0"
129+
]
130+
],
131+
"yum (8.0.0)": [
132+
133+
],
134+
"yum-epel (5.0.9)": [
135+
136+
]
137+
}
138+
}
139+
}

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 'varnish'
4+
default_source :supermarket
5+
6+
run_list 'test::default'
7+
8+
cookbook 'varnish', path: '.'
9+
cookbook 'test', path: './test/cookbooks/test'
10+
11+
Dir.children('./test/cookbooks/test/recipes').grep(/\.rb\z/).sort.each do |recipe|
12+
recipe_name = File.basename(recipe, '.rb')
13+
named_run_list recipe_name.to_sym, "test::#{recipe_name}"
14+
end

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Requires Chef Infra Client 15.3 and above.
1919

2020
### Platforms
2121

22-
See [LIMITATIONS.md](LIMITATIONS.md) for package availability and platform notes.
22+
See [AGENTS.md](AGENTS.md) for package availability and platform notes.
2323

2424
## Breaking Migration
2525

chefignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ test/*
8383
*/.hg/*
8484
*/.svn/*
8585

86-
# Berkshelf #
87-
#############
88-
Berksfile
89-
Berksfile.lock
90-
cookbooks/*
91-
tmp
92-
9386
# Bundler #
9487
###########
9588
vendor/*

kitchen.dokken.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ driver:
33
privileged: true
44
chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>
55

6-
transport: { name: dokken }
7-
provisioner: { name: dokken }
6+
transport:
7+
name: dokken
8+
9+
provisioner:
10+
name: dokken
11+
policyfile: Policyfile.rb
812

913
platforms:
1014
- name: almalinux-8

0 commit comments

Comments
 (0)