Skip to content

refactor: modernize elasticsearch cookbook#833

Open
damacus wants to merge 7 commits intomainfrom
refactor/modernize-cookbook
Open

refactor: modernize elasticsearch cookbook#833
damacus wants to merge 7 commits intomainfrom
refactor/modernize-cookbook

Conversation

@damacus
Copy link
Member

@damacus damacus commented Mar 14, 2026

Summary

Modernize the elasticsearch cookbook to comply with chef-custom-resources skill requirements and current best practices.

Changes

Resources & Libraries

  • Add frozen_string_literal: true to all resources, partials, and libraries
  • Add provides declarations to all custom resources
  • Fix bug in install_repository remove action (use major_version for repository name)

ChefSpec Tests

  • Rewrite all specs using modern step_into pattern with inline recipe blocks
  • Add install_repository_spec.rb and install_package_spec.rb
  • Update spec_helper.rb with current platforms and simplified helpers
  • 35 examples, 0 failures

Kitchen & CI

  • Add default suite with test::default recipe
  • Remove EOL debian-11, add current platform versions (almalinux-10, centos-stream-10, debian-13, rockylinux-10)
  • Align platforms across kitchen.yml, kitchen.dokken.yml, kitchen.global.yml, and CI workflow
  • Move test cookbook to standard test/cookbooks/test/ location

Documentation

  • Add actions tables and missing properties to service.md, user.md, plugin.md
  • Create LIMITATIONS.md with platform/architecture support matrix

Testing

  • chef exec rspec: 35 examples, 0 failures
  • kitchen test default-ubuntu-2204: 4 controls, 13 tests, 0 failures
  • kitchen test repository-almalinux-9: 4 controls, 14 tests, 0 failures

- Remove EOL platforms: ubuntu-2004 (EOL 2025-05-31), debian-11 (EOL 2024-08-14)
- Add supported platforms: almalinux-10, amazonlinux-2023, centos-stream-10, debian-12, debian-13, rockylinux-10
- Update actions/checkout from v5 to v6
- Update Renovate config to extend github>damacus/renovate-config
- Add Renovate dispatch workflow for manual runs

Signed-off-by: Dan Webb <dan.webb@damacus.io>
…resources

- Add frozen_string_literal: true to all resources, partials, and libraries

- Add provides declarations to all custom resources

- Fix bug in install_repository remove action using major_version for repo name
- Rewrite all specs using modern step_into pattern with inline recipe blocks

- Add install_repository_spec.rb and install_package_spec.rb

- Update spec_helper.rb with current platforms and simplified helpers
- Add default suite with test::default recipe

- Remove EOL debian-11, add current platform versions

- Align platforms across kitchen.yml, kitchen.dokken.yml, kitchen.global.yml, and CI

- Move test cookbook to standard test/cookbooks/test/ location
- Add actions tables and missing properties to service.md, user.md, plugin.md

- Create LIMITATIONS.md with platform/architecture support matrix

- Remove stale .gitkeep from documentation/
- Debian 13: Elastic 7.x GPG key uses SHA1, rejected since 2026-02-01

- Amazon Linux 2023: Dokken image missing systemd-sysv-install

- Document both issues in LIMITATIONS.md
@damacus damacus requested a review from a team as a code owner March 14, 2026 21:17
- Ubuntu 20.04 reached EOL on 2025-05-31 per endoflife.date

- Checked all platforms: remaining are all active per endoflife.date
@github-actions
Copy link

Slowest examples

Top 10 slowest examples (1.21 seconds, 44.1% of total time)
Example Description Time in seconds
spec/service_spec.rb:36 elasticsearch_service with restart policy is expected to start service "elasticsearch" 0.23369
spec/install_spec.rb:15 elasticsearch_install type repository (default) is expected to install elasticsearch_install_repository "ElasticSearch 7.17.9" 0.18076
spec/install_package_spec.rb:17 elasticsearch_install_package action :install on debian is expected to create remote_file "/tmp/d20260314-2379-glvhcb/elasticsearch-7.17.9-amd64.deb" 0.13564
spec/install_repository_spec.rb:73 elasticsearch_install_repository action :remove on rhel is expected to remove package "elasticsearch" 0.11825
spec/service_spec.rb:35 elasticsearch_service with restart policy is expected to enable service "elasticsearch" 0.0948
spec/user_spec.rb:30 elasticsearch_user action :create with custom properties is expected to create group "esgroup" 0.09283
spec/install_repository_spec.rb:45 elasticsearch_install_repository action :install with repository actions disabled is expected to install package "elasticsearch" 0.09131
spec/install_spec.rb:50 elasticsearch_install action :remove with repository type is expected to remove elasticsearch_install_repository "ElasticSearch 7.17.9" 0.08998
spec/install_repository_spec.rb:17 elasticsearch_install_repository action :install on debian is expected to add apt_repository "elastic-7.x" 0.08996
spec/install_package_spec.rb:32 elasticsearch_install_package action :install on rhel is expected to install package "elasticsearch-7.17.9-x86_64.rpm" 0.08934

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.

1 participant