Skip to content

Updating cookstyle and Ruby support - #444

Open
johnmccrae wants to merge 10 commits into
mainfrom
jfm/cookstyle_update
Open

johnmccrae wants to merge 10 commits into
mainfrom
jfm/cookstyle_update

Conversation

@johnmccrae

@johnmccrae johnmccrae commented Sep 30, 2026 •

Copy link
Copy Markdown

Description

This repo is a bit long on the tooth and has not been decently updated in a while. Here we update 2 things: 2) We removed chefstyle support and added in cookstyle support. 2) We ran "rake style" and updated syntax to match current style trends

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

Signed-off-by: John McCrae <john.mccrae@progress.com>
@johnmccrae
johnmccrae requested review from a team and jaymzh as code owners September 30, 2026 19:21
Comment thread spec/functional/mixlib/install/cli_spec.rb Fixed
Comment thread spec/functional/mixlib/install/cli_spec.rb Fixed
johnmccrae added a commit that referenced this pull request Sep 30, 2026
Address CodeQL findings on PR #444 flagging unescaped '.' before
'chef.io' in test regexes, which could unintentionally match
unexpected hostnames.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address CodeQL findings on PR #444 flagging unescaped '.' before
'chef.io' in test regexes, which could unintentionally match
unexpected hostnames.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>
The Gemfile and Rakefile were updated to use cookstyle (with
cookstyle's --chefstyle flag) in place of the chefstyle gem, but
.github/workflows/lint.yml still invoked 'bundle exec chefstyle',
which no longer exists as a dependency, causing CI failures
(bundler: command not found: chefstyle).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>
PR #444 raised the minimum supported Ruby to 3.1, which dropped
linting and test coverage for Ruby 2.7-3.0. Restore the minimum
supported version to 2.7:

- mixlib-install.gemspec: required_ruby_version >= 2.7
- .rubocop.yml: TargetRubyVersion 2.7
- .github/workflows/integration.yml, lint.yml: comment out (not
  remove) the Ruby 2.6 matrix entries, since 2.6 is still dropped,
  while keeping 2.7 and newer covered

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Ruby 2.6 compatibility is removed contrary to the project support contract, and the style task can silently succeed without running.

Review effort: Balanced
Findings: 1 High severity · 5 Medium severity · 1 Low severity

Open (7)
What changed in this PR

Updates lint tooling from Chefstyle to Cookstyle, raises the declared Ruby baseline, and applies resulting style corrections.

Changes:

  • Replaces Chefstyle with Cookstyle in dependencies, Rake tasks, and CI.
  • Changes the declared and tested minimum Ruby version from 2.6 to 2.7.
  • Modernizes Ruby syntax and test formatting without intended runtime behavior changes.
File Description
.github/​workflows/​integration.yml Updates integration-test Ruby matrix.
.github/​workflows/​lint.yml Uses Cookstyle and updates test matrix.
.rubocop.yml Targets Ruby 2.7 and updates a cop name.
Gemfile Replaces Chefstyle with Cookstyle.
Rakefile Reworks the style task for Cookstyle.
acceptance/​centos_install_checksum/​inspec/​verify.rb Modernizes regular-expression literals.
bin/​mixlib-install Modernizes library path resolution.
lib/​mixlib/​install.rb Avoids reloading tmpdir.
lib/​mixlib/​install/​backend/​base.rb Simplifies predicates and strings.
lib/​mixlib/​install/​backend/​package_router.rb Simplifies nested lookup and hash construction.
lib/​mixlib/​install/​generator/​bourne.rb Adds style-required spacing.
lib/​mixlib/​install/​options.rb Converts symbol arrays to %i literals.
lib/​mixlib/​install/​product.rb Modernizes literals and conditionals.
lib/​mixlib/​install/​script_generator.rb Avoids reloading CGI.
lib/​mixlib/​install/​util.rb Adjusts indentation.
mixlib-install.gemspec Raises required Ruby to 2.7.
spec/​functional/​mixlib/​install/​cli_spec.rb Modernizes regex and string syntax.
spec/​spec_helper.rb Modernizes path resolution.
spec/​unit/​mixlib/​install/​backend/​package_router_spec.rb Simplifies matchers and mapping.
spec/​unit/​mixlib/​install/​backend_spec.rb Uses a symbol-array literal.
spec/​unit/​mixlib/​install/​generator_spec.rb Modernizes regex literals.
spec/​unit/​mixlib/​install/​product_spec.rb Uses word-array literals.
spec/​unit/​mixlib/​install/​script_generator_spec.rb Simplifies regex literals.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread mixlib-install.gemspec Outdated
Comment thread .github/workflows/integration.yml Outdated
Comment thread .github/workflows/lint.yml Outdated
Comment thread .rubocop.yml Outdated
Comment thread Gemfile Outdated
Comment thread Rakefile
Comment thread Rakefile Outdated
johnmccrae and others added 6 commits September 30, 2026 14:40
…upport'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ion coverage'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…verage'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…Ruby 2.6'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…le for Ruby 2.7+'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>
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.

4 participants