Skip to content

Commit 1696299

Browse files
authored
fix(modernize): EOL platforms and update tooling (#857)
* chore: modernize EOL platforms and Chef version - Remove EOL platforms: debian-11, ubuntu-20.04 - Add new platforms: almalinux-10, centos-stream-10, debian-13, rockylinux-10 - Update Chef version requirement from 15.3 to 18.0 - Clean up commented exclusions in CI workflow * fix: Moderize tooling and workflows Signed-off-by: Dan Webb <dan.webb@damacus.io> * fix(docs) Fix markdown Signed-off-by: Dan Webb <dan.webb@damacus.io> --------- Signed-off-by: Dan Webb <dan.webb@damacus.io>
1 parent 6fe6903 commit 1696299

9 files changed

Lines changed: 145 additions & 30 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name: ci
88

99
jobs:
1010
lint-unit:
11-
uses: sous-chefs/.github/.github/workflows/lint-unit.yml@5.0.3
11+
uses: sous-chefs/.github/.github/workflows/lint-unit.yml@main
1212
permissions:
1313
actions: write
1414
checks: write
@@ -26,15 +26,18 @@ jobs:
2626
os:
2727
- almalinux-8
2828
- almalinux-9
29+
- almalinux-10
2930
- amazonlinux-2023
3031
- centos-stream-9
32+
- centos-stream-10
3133
- debian-12
3234
- debian-13
3335
- opensuse-leap-15
3436
- oraclelinux-8
3537
- oraclelinux-9
3638
- rockylinux-8
3739
- rockylinux-9
40+
- rockylinux-10
3841
- ubuntu-2204
3942
- ubuntu-2404
4043
suite:
@@ -48,7 +51,6 @@ jobs:
4851
- ssl
4952
- install-override
5053
exclude:
51-
# TODO: disabled due to https://github.com/chef/chef/pull/13691
5254
- os: amazonlinux-2023
5355
suite: mod-wsgi
5456
- os: ubuntu-2404
@@ -62,8 +64,6 @@ jobs:
6264
- os: debian-13
6365
suite: php
6466

65-
# - os: opensuse-leap-15
66-
# suite: mod-wsgi
6767
steps:
6868
- name: Check out code
6969
uses: actions/checkout@v5
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
---
2-
name: 'Prevent file change'
2+
name: "Prevent file change"
33

44
"on":
55
pull_request_target:
66
branches: [main]
77

88
jobs:
99
prevent-file-change:
10-
uses: sous-chefs/.github/.github/workflows/prevent-file-change.yml@5.0.3
10+
uses: sous-chefs/.github/.github/workflows/prevent-file-change.yml@main
1111
permissions:
1212
pull-requests: write
1313
secrets:
1414
token: ${{ secrets.GITHUB_TOKEN }}
15-
# with:
16-
# metadata_pattern: metadata.rb
17-
# metadata_trusted_authors: bmhughes,damacus,kitchen-porter,MarkGibbons,ramereth,Stromweld,xorima
18-
# workflow_pattern: .github/workflows
19-
# workflow_trusted_authors: bmhughes,damacus,kitchen-porter,MarkGibbons,ramereth,Stromweld,xorima
20-
# workflow_close_pr: true
21-
# workflow_allow_new_files: false

.markdownlint-cli2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ config:
77
maximum: 2
88
ignores:
99
- .github/copilot-instructions.md
10+
- .windsurf/**

.mise.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[env]
2+
_.path = "/opt/chef-workstation/bin"

.rubocop.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
---
2-
AllCops:
3-
Exclude:
4-
- 'Dangerfile'
1+
require:
2+
- cookstyle

.windsurf/workflows/kitchen-fix.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
description: Run all kitchen suites and fix failures iteratively
3+
auto_execution_mode: 3
4+
---
5+
6+
# Kitchen Test and Fix Workflow
7+
8+
This workflow runs all Test Kitchen suites, aggregates failures, and iteratively fixes common issues.
9+
10+
## Steps
11+
12+
### 1. Get Your Bearings
13+
14+
Run `kitchen list` to see all available test suites and their current state.
15+
16+
```bash
17+
chef exec kitchen list
18+
```
19+
20+
Review the output to understand:
21+
22+
- Which suites exist (installer-mysql, installer-postgresql, standalone-mysql, standalone-postgresql)
23+
- Which platforms are configured
24+
- Current state of any existing instances
25+
26+
### 2. Run Kitchen Tests
27+
28+
Run all kitchen tests in parallel with destroy on completion:
29+
30+
```bash
31+
# Run a single suite first to validate
32+
chef exec kitchen test installer-mysql-ubuntu-2404 --destroy=always
33+
34+
# Or run all tests (this takes a long time)
35+
chef exec kitchen test --concurrency=4 --destroy=always
36+
```
37+
38+
For faster iteration, test one platform per suite first:
39+
40+
```bash
41+
chef exec kitchen test installer-mysql-ubuntu-2404 --destroy=always
42+
chef exec kitchen test installer-postgresql-ubuntu-2404 --destroy=always
43+
chef exec kitchen test standalone-mysql-ubuntu-2404 --destroy=always
44+
chef exec kitchen test standalone-postgresql-ubuntu-2404 --destroy=always
45+
```
46+
47+
### 3. Aggregate Failures
48+
49+
When tests fail, collect and categorize the errors:
50+
51+
1. **Converge failures** - Recipe compilation or resource execution errors
52+
2. **Verify failures** - InSpec/Serverspec test failures
53+
3. **Platform-specific failures** - Issues only on certain OS families
54+
55+
For each failure, note:
56+
57+
- Suite name
58+
- Platform
59+
- Error message
60+
- Stack trace location
61+
62+
### 4. Apply Common Fixes
63+
64+
Address failures by category:
65+
66+
#### Converge Failures
67+
68+
- Check recipe syntax and resource availability
69+
- Verify cookbook dependencies in `metadata.rb` and `Berksfile`
70+
- Review attribute precedence issues
71+
- Check for deprecated Chef APIs
72+
73+
#### Verify Failures
74+
75+
- Review test expectations in `test/integration/*/serverspec/`
76+
- Ensure services are running and ports are listening
77+
- Check file permissions and ownership
78+
79+
#### Platform-Specific Failures
80+
81+
- Add platform conditionals where needed
82+
- Check package names differ between distros
83+
- Verify service names (systemd vs init)
84+
85+
### 5. Iterate
86+
87+
After applying fixes:
88+
89+
// turbo
90+
1. Re-run the failing tests:
91+
92+
```bash
93+
chef exec kitchen test <suite-platform> --destroy=always
94+
```
95+
96+
2. If new failures appear, return to step 3
97+
3. Continue until all tests pass
98+
99+
### 6. Verify All Suites Pass
100+
101+
Once individual fixes are applied, run the full test matrix:
102+
103+
```bash
104+
chef exec kitchen test --concurrency=4 --destroy=always
105+
```
106+
107+
### 7. Cleanup
108+
109+
Destroy any remaining kitchen instances:
110+
111+
// turbo
112+
```bash
113+
chef exec kitchen destroy
114+
```
115+
116+
## Common Issues Reference
117+
118+
| Error | Cause | Fix |
119+
|-----------------------|---------------------------------|---------------------------------|
120+
| `undefined method` | Missing cookbook dependency | Add to `metadata.rb` depends |
121+
| `package not found` | Wrong package name for platform | Use platform conditionals |
122+
| `service not running` | Service failed to start | Check logs, add retries |
123+
| `port not listening` | App not configured correctly | Review configuration templates |
124+
| `Chef::Platform.set` | Deprecated API in dependency | Update cookbook version or stub |

documentation/resource_apache2_conf.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Writes conf files to the `conf-available` folder, and passes enabled values to `
66

77
## Properties
88

9-
| Name | Type | Default | Description |
10-
| ----------------- | ------ | -------------------------------- | ---------------------------------------------------------------------------------- |
11-
| path | String | `"#{apache_dir}/conf-available"` | Path to the conf-available directory |
12-
| root_group | String | `node['root_group']` | Platform based default for the templates root group. |
13-
| template_cookbook | String | apache2 | Cookbook to source the template from. Override this to provide your own template. |
14-
| options | Hash | server_tokens: 'Prod', server_signature: 'On', trace_enable: 'Off', | Hash of key-value pairs to pass to the template (useful for overridden templates) |
9+
| Name | Type | Default | Description |
10+
|-------------------|--------|---------------------------------------------------------------------|------------------------------------------------------------------------------------|
11+
| path | String | `"#{apache_dir}/conf-available"` | Path to the conf-available directory |
12+
| root_group | String | `node['root_group']` | Platform based default for the templates root group. |
13+
| template_cookbook | String | apache2 | Cookbook to source the template from. Override this to provide your own template. |
14+
| options | Hash | server_tokens: 'Prod', server_signature: 'On', trace_enable: 'Off', | Hash of key-value pairs to pass to the template (useful for overridden templates) |
1515

1616
### Examples
1717

kitchen.dokken.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ platforms:
8282
image: dokken/rockylinux-10
8383
pid_one_command: /usr/lib/systemd/systemd
8484

85-
- name: ubuntu-20.04
86-
driver:
87-
image: dokken/ubuntu-20.04
88-
pid_one_command: /bin/systemd
89-
9085
- name: ubuntu-22.04
9186
driver:
9287
image: dokken/ubuntu-22.04

kitchen.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@ verifier:
1515
platforms:
1616
- name: almalinux-8
1717
- name: almalinux-9
18+
- name: almalinux-10
1819
- name: amazonlinux-2023
1920
- name: centos-stream-9
20-
- name: debian-11
21+
- name: centos-stream-10
2122
- name: debian-12
23+
- name: debian-13
2224
- name: fedora-latest
2325
- name: opensuse-leap-15
2426
- name: oraclelinux-8
2527
- name: oraclelinux-9
2628
- name: rockylinux-8
2729
- name: rockylinux-9
28-
- name: ubuntu-20.04
30+
- name: rockylinux-10
2931
- name: ubuntu-22.04
3032
- name: ubuntu-24.04
3133

0 commit comments

Comments
 (0)