Skip to content

Commit e62f9ec

Browse files
committed
chore: migrate dependency resolution to Policyfile
1 parent b5ea77b commit e62f9ec

14 files changed

Lines changed: 47 additions & 30 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 dependency resolution
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/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name: ci
99

1010
jobs:
1111
lint-unit:
12-
uses: sous-chefs/.github/.github/workflows/lint-unit.yml@8.0.1
12+
uses: sous-chefs/.github/.github/workflows/lint-unit.yml@8.0.4
1313
permissions:
1414
actions: write
1515
checks: write
@@ -39,7 +39,7 @@ jobs:
3939
- name: Check out code
4040
uses: actions/checkout@v7
4141
- name: Install Cinc Workstation
42-
uses: sous-chefs/.github/.github/actions/install-workstation@8.0.1
42+
uses: sous-chefs/.github/.github/actions/install-workstation@8.0.4
4343
- name: Dokken
4444
uses: actionshub/test-kitchen@main
4545
env:

.github/workflows/conventional-commits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ name: conventional-commits
1111

1212
jobs:
1313
conventional-commits:
14-
uses: sous-chefs/.github/.github/workflows/conventional-commits.yml@8.0.1
14+
uses: sous-chefs/.github/.github/workflows/conventional-commits.yml@8.0.4

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ jobs:
1919
- name: Check out code
2020
uses: actions/checkout@v7
2121
- name: Install Cinc Workstation
22-
uses: sous-chefs/.github/.github/actions/install-workstation@8.0.1
22+
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

.github/workflows/prevent-file-change.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
permissions:
1919
contents: read
2020
pull-requests: write
21-
uses: sous-chefs/.github/.github/workflows/prevent-file-change.yml@8.0.1
21+
uses: sous-chefs/.github/.github/workflows/prevent-file-change.yml@8.0.4
2222
secrets:
2323
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616

1717
jobs:
1818
release:
19-
uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@8.0.1
19+
uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@8.0.4
2020
secrets:
2121
token: ${{ secrets.PORTER_GITHUB_TOKEN }}
2222
supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }}

.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: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
# Limitations
1+
# AGENTS.md
2+
3+
## Cookbook Purpose
4+
5+
Provides custom resources for managing OSSEC HIDS packages and configuration
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
This cookbook currently installs OSSEC HIDS packages from the Atomicorp archive
415
paths used in the legacy cookbook, not from a first-party Chef workflow.

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 'ossec'
4+
5+
run_list 'test::default'
6+
7+
cookbook 'ossec', 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

0 commit comments

Comments
 (0)