Skip to content

feat: modernise cookbook structure and ChefSpec#602

Open
damacus wants to merge 7 commits intomainfrom
modernise-cookbook
Open

feat: modernise cookbook structure and ChefSpec#602
damacus wants to merge 7 commits intomainfrom
modernise-cookbook

Conversation

@damacus
Copy link
Member

@damacus damacus commented Mar 14, 2026

Summary

Modernises the cookbook structure, spec organisation, and CI configuration.

Changes

  • frozen_string_literal: Added # frozen_string_literal: true to all Ruby files
  • Resources: Added provides declarations to all custom resources
  • ChefSpec: Renamed spec/unit/recipes/spec/unit/resources/ to reflect resource-based testing
  • ChefSpec: Fixed almalinux/10 spec — platform not bundled in fauxhai gem; use almalinux/9 with node.automatic['platform_version'] = '10' override to test PCRE2 branch
  • metadata.rb: Expanded platform support (almalinux, rocky, oracle, fedora)
  • kitchen.yml: Added default suite, aligned platforms with kitchen.dokken.yml, switched provisioner to chef_infra
  • CI: Aligned matrix with kitchen platforms and suites, added missing platforms, removed duplicates
  • LIMITATIONS.md: Documents known constraints (package availability, source build deps, architecture)
  • Integration: Added default test suite with test recipe and InSpec profile

Testing

  • 29/29 ChefSpec examples pass, 0 failures, no fauxhai download warnings

- Add frozen_string_literal: true to all Ruby files

- Add provides declarations to all resources

- Rename spec/unit/recipes/ to spec/unit/resources/

- Fix almalinux/10 fauxhai spec (use platform override instead of unbundled platform)

- Expand metadata.rb platform support (almalinux, rocky, oracle, fedora)

- Add default kitchen suite with test recipe and InSpec profile

- Align CI matrix with kitchen platforms and suites

- Add LIMITATIONS.md documenting known constraints
@damacus damacus requested a review from a team as a code owner March 14, 2026 21:21
damacus added 2 commits March 14, 2026 21:25
- 3.2 is the current LTS branch (EOL 2030-04-01)

- Update source_version default: 2.8.5 -> 3.2.14

- Update source_checksum to match 3.2.14 tarball

- Update stub_command version refs in specs

- Update test recipe versions and checksums
…t protected files

- Revert chef_version to ENV || current

- Fix pid_one_command from YAML arrays to strings (fixes scan error)

- Remove hardcoded CHEF_VERSION from mise.toml

- Revert metadata.rb and CHANGELOG.md to main (protected files)
@damacus damacus force-pushed the modernise-cookbook branch from 357129b to 039214a Compare March 17, 2026 10:50
Source compilation recipes need apt_update on Debian/Ubuntu to ensure

fresh apt cache in Dokken containers.

Signed-off-by: Dan Webb <dan.webb@damacus.io>
@damacus damacus force-pushed the modernise-cookbook branch from 039214a to 0b6738a Compare March 17, 2026 10:55
OpenSSL 3.5.5 Makefile.in requires perl-Time-Piece module.

Use bare apt_update across all source test recipes.
@damacus damacus force-pushed the modernise-cookbook branch 2 times, most recently from 11c9d13 to ef363ec Compare March 17, 2026 14:33
- Remove source-24/source-26 from integration-amazonlinux CI matrix
- Use perl-core on EL8 (individual perl-* modules don't exist)
- Add perl-Time-Piece for OpenSSL 3.5.5 on EL9+
- Add perl and zlib1g-dev for Debian/Ubuntu
- Add perl and zlib-devel for openSUSE

Tested locally: almalinux-8, almalinux-9, debian-12

Signed-off-by: Dan Webb <dan.webb@damacus.io>
@damacus damacus force-pushed the modernise-cookbook branch from ef363ec to 6800126 Compare March 17, 2026 21:34
@github-actions
Copy link

Slowest examples

Top 10 slowest examples (1.26 seconds, 44.55% of total time)
Example Description Time in seconds
spec/unit/resources/global_spec.rb:28 haproxy_config_global create haproxy config global is expected to render file "/etc/haproxy/haproxy.cfg" 0.19747
spec/unit/resources/install_spec.rb:46 haproxy_install compile HAProxy on Debian 13 (uses PCRE2) is expected to install package "["libpcre2-dev", "libssl-dev", "zlib1g-dev", "libsystemd-dev"]" 0.15946
spec/unit/resources/install_spec.rb:74 haproxy_install compile HAProxy on AlmaLinux >= 10 (uses PCRE2) is expected to install package "["pcre2-devel", "openssl-devel", "zlib-devel", "systemd-devel", "tar"]" 0.159
spec/unit/resources/cache_spec.rb:47 haproxy_cache create a cache, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.14346
spec/unit/resources/fastcgi_spec.rb:65 haproxy_fastcgi create a fastcgi resource, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.12087
spec/unit/resources/listen_spec.rb:84 haproxy_listen extra options hash with disabled option is expected to render file "/etc/haproxy/haproxy.cfg" 0.10633
spec/unit/resources/mailer_spec.rb:50 haproxy_mailer create a mailer, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.10351
spec/unit/resources/defaults_spec.rb:28 haproxy_config_defaults create a cache, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.09227
spec/unit/resources/listen_spec.rb:107 haproxy_listen extra options http-request rule should be placed before use_backend rule is expected to render file "/etc/haproxy/haproxy.cfg" 0.0904
spec/unit/resources/peer_spec.rb:47 haproxy_peer create a peers section, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.08983

Copy link

@mvangoor mvangoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants