From 3b7fd4de6c7a4a4e4ff0b4188128c75924b05880 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 21:17:49 -0700 Subject: [PATCH 01/14] Require Ruby 3.1+ and modernize CI - Set required_ruby_version to ">= 3.1" in the gemspec - Standardize .rubocop.yml on cookstyle/chefstyle with TargetRubyVersion 3.1 (the standalone `chefstyle` gem no longer loads, which broke linting) - Run unit tests on every Ruby release from 3.1 to 4.0 and run cookstyle --chefstyle on Ruby 3.1 - Add the cookstyle bundler group where it was missing so `bundle exec cookstyle` resolves in CI - Apply cookstyle --chefstyle autocorrections - Drop dead linters (cane, tailor, finstyle, standalone chefstyle) that are superseded by cookstyle and fail on modern Ruby Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- .github/workflows/lint.yml | 9 +++++++++ .rubocop.yml | 12 ++++++++++++ Gemfile | 4 ++++ Rakefile | 12 +----------- busser-bash.gemspec | 3 +-- features/support/env.rb | 2 -- lib/busser/bash/version.rb | 3 +-- lib/busser/runner_plugin/bash.rb | 1 - 8 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..925ce2d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,9 @@ +--- +name: "Test" + +"on": + pull_request: + +jobs: + lint-unit: + uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main diff --git a/.rubocop.yml b/.rubocop.yml index ba6d558..c2bb712 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,15 @@ +--- +require: + - cookstyle/chefstyle + +AllCops: + TargetRubyVersion: 3.1 + Include: + - "**/*.rb" + Exclude: + - "vendor/**/*" + - "spec/**/*" + Style/ClassAndModuleChildren: Exclude: - lib/busser/runner_plugin/bash.rb diff --git a/Gemfile b/Gemfile index 8e427e4..8c88ada 100644 --- a/Gemfile +++ b/Gemfile @@ -8,3 +8,7 @@ group :guard do gem "guard-cane" gem "guard-rubocop" end + +group :cookstyle do + gem "cookstyle" +end diff --git a/Rakefile b/Rakefile index a56aa15..7bbf0b0 100644 --- a/Rakefile +++ b/Rakefile @@ -10,17 +10,7 @@ end desc "Run all test suites" task :test => [:features] -require "finstyle" -require "rubocop/rake_task" -RuboCop::RakeTask.new(:style) do |task| - task.options << "--display-cop-names" -end -require "cane/rake_task" -desc "Run cane to check quality metrics" -Cane::RakeTask.new do |cane| - cane.canefile = "./.cane" -end desc "Display LOC stats" task :stats do @@ -31,6 +21,6 @@ task :stats do end desc "Run all quality tasks" -task :quality => [:cane, :style, :stats] +task :quality => [:stats] task :default => [:test, :quality] diff --git a/busser-bash.gemspec b/busser-bash.gemspec index db372cf..15ec281 100644 --- a/busser-bash.gemspec +++ b/busser-bash.gemspec @@ -6,6 +6,7 @@ require "English" Gem::Specification.new do |gem| gem.name = "busser-bash" + gem.required_ruby_version = ">= 3.1" gem.version = Busser::Bash::VERSION gem.authors = ["Fletcher Nichol"] gem.email = ["fnichol@nichol.ca"] @@ -29,6 +30,4 @@ Gem::Specification.new do |gem| # style and complexity libraries are tightly version pinned as newer releases # may introduce new and undesirable style choices which would be immediately # enforced in CI - gem.add_development_dependency "cane", "3.0.0" - gem.add_development_dependency "finstyle", "1.5.0" end diff --git a/features/support/env.rb b/features/support/env.rb index c98de01..7acbcf0 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,5 +1,3 @@ -# -*- encoding: utf-8 -*- - require "aruba/cucumber" require "busser/cucumber" diff --git a/lib/busser/bash/version.rb b/lib/busser/bash/version.rb index 00bad16..178914b 100644 --- a/lib/busser/bash/version.rb +++ b/lib/busser/bash/version.rb @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # # Author:: Fletcher Nichol () # @@ -21,6 +20,6 @@ module Busser module Bash # Version string for the Bash Busser runner plugin - VERSION = "0.1.5.dev" + VERSION = "0.1.5.dev".freeze end end diff --git a/lib/busser/runner_plugin/bash.rb b/lib/busser/runner_plugin/bash.rb index f137891..f1889eb 100644 --- a/lib/busser/runner_plugin/bash.rb +++ b/lib/busser/runner_plugin/bash.rb @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # # Author:: Fletcher Nichol () # From 657167c3adccfebea6913bd560fdaddb7a23925f Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 21:37:18 -0700 Subject: [PATCH 02/14] Fix markdown and YAML lint failures - Add the standard .markdownlint.yaml / .yamllint configs where missing (repos without them fell back to strict defaults and failed CI) - Exclude CHANGELOG files from markdown-lint in the shared workflow, matching test-kitchen; generated changelogs cannot satisfy the rules and are rewritten on each release - Fix real YAML indentation (sequences must be indented under their key); verified the parsed YAML is unchanged - Remove dead .travis.yml / appveyor.yml configs, which were also the main yamllint offenders - README cleanup: drop obsolete heading anchors and dead travis-ci.org badges, modernize .png badge URLs, fix heading levels, add code-fence languages, repair broken lists, strip trailing whitespace Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- .github/dependabot.yml | 11 ++++++----- .markdownlint.yaml | 6 ++++++ .travis.yml | 34 ---------------------------------- .yamllint | 6 ++++++ README.md | 19 +++++++++---------- 5 files changed, 27 insertions(+), 49 deletions(-) create mode 100644 .markdownlint.yaml delete mode 100644 .travis.yml create mode 100644 .yamllint diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 452ebb3..b587f2b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,8 @@ +--- version: 2 updates: -- package-ecosystem: bundler - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 + - package-ecosystem: bundler + directory: / + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..9fd2375 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,6 @@ +--- +default: true +MD004: false +MD012: false +MD013: false +MD024: false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a83dd08..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: ruby - -rvm: - - 2.1 - - 2.0.0 - - 1.9.3 - - ruby-head - -env: - - RUBYGEMS_VERSION= - - RUBYGEMS_VERSION=2.2.2 - - RUBYGEMS_VERSION=2.1.11 - - RUBYGEMS_VERSION=2.0.14 - - RUBYGEMS_VERSION=1.8.29 - -bundler_args: --without guard - -before_install: - - if [ -n "$RUBYGEMS_VERSION" ]; then gem update --system $RUBYGEMS_VERSION; fi - - gem --version - -matrix: - exclude: - - rvm: 2.1 - env: RUBYGEMS_VERSION=1.8.29 - - rvm: 2.0.0 - env: RUBYGEMS_VERSION=1.8.29 - - rvm: ruby-head - env: RUBYGEMS_VERSION=1.8.29 - allow_failures: - - rvm: ruby-head - -notifications: - irc: "chat.freenode.net#kitchenci" diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..ecfdffb --- /dev/null +++ b/.yamllint @@ -0,0 +1,6 @@ +--- +extends: default +rules: + line-length: + max: 256 + level: warning diff --git a/README.md b/README.md index 1f4cf2b..d0219ea 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ -# Busser::RunnerPlugin::Bash +# Busser::RunnerPlugin::Bash -[![Gem Version](https://badge.fury.io/rb/busser-bash.png)](http://badge.fury.io/rb/busser-bash) -[![Build Status](https://travis-ci.org/test-kitchen/busser-bash.png?branch=master)](https://travis-ci.org/test-kitchen/busser-bash) -[![Code Climate](https://codeclimate.com/github/test-kitchen/busser-bash.png)](https://codeclimate.com/github/test-kitchen/busser-bash) +[![Gem Version](https://badge.fury.io/rb/busser-bash.svg)](http://badge.fury.io/rb/busser-bash) +[![Code Climate](https://codeclimate.com/github/test-kitchen/busser-bash.svg)](https://codeclimate.com/github/test-kitchen/busser-bash) A Busser runner plugin for testing bash scripts @@ -10,11 +9,11 @@ A Busser runner plugin for testing bash scripts This software project is no longer under active development as it has no active maintainers. The software may continue to work for some or all use cases, but issues filed in GitHub will most likely not be triaged. If a new maintainer is interested in working on this project please come chat with us in #test-kitchen on Chef Community Slack. -## Installation and Setup +## Installation and Setup Please read the Busser [plugin usage][plugin_usage] page for more details. -## Usage +## Usage Please put test files into [COOKBOOK]/test/integration/[SUITES]/bash/ @@ -28,11 +27,11 @@ Please put test files into [COOKBOOK]/test/integration/[SUITES]/bash/ The exit code of the script is used as indicator for failure or success. -### Note +### Note Globbing pattern to match files is `"bash/*_{test,spec}.{sh,bash}"`. -## Development +## Development * Source hosted at [GitHub][repo] * Report issues/questions/feature requests on [GitHub Issues][issues] @@ -47,11 +46,11 @@ example: 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request -## Authors +## Authors Created and maintained by [Fletcher Nichol][author] () -## License +## License Apache 2.0 (see [LICENSE][license]) From 40900877e98aeb853397510a3b514ea7e8e64da0 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 21:55:44 -0700 Subject: [PATCH 03/14] Drop the unused guard-rubocop dev dependency It pulls an old rubocop into resolution alongside cookstyle. Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile b/Gemfile index 8c88ada..9071c79 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,6 @@ gemspec group :guard do gem "guard-cucumber" gem "guard-cane" - gem "guard-rubocop" end group :cookstyle do From 79134e654d543f7bcb7d3c01970471f0132450d4 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 22:12:44 -0700 Subject: [PATCH 04/14] README and license cleanup - Remove Code Climate badges - Fix dead documentation links (docs.kitchen-ci.org and old downloads.chef.io/docs.chef.io paths are gone; ChefDK is superseded by Chef Workstation), and repoint chef/* GitHub links at test-kitchen/* - Replace the "enter-github-user" placeholder links left over from the gem template - Point LICENSE links at the branch and filename that actually exist - Normalize the gemspec license to the SPDX identifier "Apache-2.0" so it matches the shipped LICENSE file Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- README.md | 3 +-- busser-bash.gemspec | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d0219ea..1971130 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Busser::RunnerPlugin::Bash [![Gem Version](https://badge.fury.io/rb/busser-bash.svg)](http://badge.fury.io/rb/busser-bash) -[![Code Climate](https://codeclimate.com/github/test-kitchen/busser-bash.svg)](https://codeclimate.com/github/test-kitchen/busser-bash) A Busser runner plugin for testing bash scripts @@ -59,4 +58,4 @@ Apache 2.0 (see [LICENSE][license]) [issues]: https://github.com/fnichol/busser-bash/issues [license]: https://github.com/fnichol/busser-bash/blob/master/LICENSE [repo]: https://github.com/fnichol/busser-bash -[plugin_usage]: http://docs.kitchen-ci.org/busser/plugin-usage +[plugin_usage]: https://kitchen.ci/docs/verifiers/ diff --git a/busser-bash.gemspec b/busser-bash.gemspec index 15ec281..25a5da3 100644 --- a/busser-bash.gemspec +++ b/busser-bash.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |gem| gem.description = "A Busser runner plugin for testing bash scripts" gem.summary = gem.description gem.homepage = "https://github.com/test-kitchen/busser-bash" - gem.license = "Apache 2.0" + gem.license = "Apache-2.0" gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) gem.executables = [] From 04ca5e61d057258a4a0c0e1ed28d24bbeebc7357 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 22:14:54 -0700 Subject: [PATCH 05/14] Remove the remaining dead linting dependencies guard-cane pulls in cane, which calls File.exists? -- removed in Ruby 4.0 -- so it broke the test run on the new matrix. guard-rubocop and the pinned chefstyle group drag an old rubocop into resolution, which resolved cookstyle down to 7.x where "cookstyle --chefstyle" is not a valid option. Cookstyle supersedes all of these. Also drop the comment describing the version-pinned style libraries, since those dependencies are gone, and collapse the blank lines left behind. Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- Gemfile | 1 - Rakefile | 2 -- busser-bash.gemspec | 4 ---- 3 files changed, 7 deletions(-) diff --git a/Gemfile b/Gemfile index 9071c79..2410c9b 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,6 @@ gemspec group :guard do gem "guard-cucumber" - gem "guard-cane" end group :cookstyle do diff --git a/Rakefile b/Rakefile index 7bbf0b0..caf85c7 100644 --- a/Rakefile +++ b/Rakefile @@ -10,8 +10,6 @@ end desc "Run all test suites" task :test => [:features] - - desc "Display LOC stats" task :stats do puts "\n## Production Code Stats" diff --git a/busser-bash.gemspec b/busser-bash.gemspec index 25a5da3..2ce259c 100644 --- a/busser-bash.gemspec +++ b/busser-bash.gemspec @@ -26,8 +26,4 @@ Gem::Specification.new do |gem| gem.add_development_dependency "countloc" gem.add_development_dependency "rake" gem.add_development_dependency "simplecov" - - # style and complexity libraries are tightly version pinned as newer releases - # may introduce new and undesirable style choices which would be immediately - # enforced in CI end From 7ea9f0c2fcf3c3df83d7a8ffbc57dd4a8b2a01ef Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 22:28:58 -0700 Subject: [PATCH 06/14] Remove remaining dead linting config and add the gem version badge - Drop the chefstyle bundler group / dev dependency. chefstyle pins an old rubocop, which resolves cookstyle down to 7.x where "cookstyle --chefstyle" is not a valid option. Cookstyle supersedes it. - Remove .cane config files; cane is unmaintained and calls File.exists?, removed in Ruby 4.0 - Remove the bundler dev dependency; bundler ships with Ruby and pinning it only constrains resolution - Add the gem version badge to READMEs that were missing one Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- .cane | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .cane diff --git a/.cane b/.cane deleted file mode 100644 index e69de29..0000000 From 48d93b4dc31c9fe9f1ddf93df6d38862750f3d2c Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 22:47:08 -0700 Subject: [PATCH 07/14] Fix the test task and remove the last dead linting setup - Point Rakefiles at cookstyle/chefstyle instead of the standalone chefstyle gem, which no longer resolves; several required it unguarded, so rake aborted outright - Remove Guardfiles and guard-* dev dependencies (guard-kitchen keeps its own, since guard is what it integrates with) - Remove the last cane and .cane config remnants - Give repos that have tests but no test task one, so `rake test` works - kitchen-habitat: move fakefs from :development to :test; CI runs with BUNDLE_WITHOUT=development, so the spec could not load it Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- Gemfile | 4 ---- Guardfile | 26 -------------------------- 2 files changed, 30 deletions(-) delete mode 100644 Guardfile diff --git a/Gemfile b/Gemfile index 2410c9b..9edf640 100644 --- a/Gemfile +++ b/Gemfile @@ -3,10 +3,6 @@ source "https://rubygems.org" gemspec -group :guard do - gem "guard-cucumber" -end - group :cookstyle do gem "cookstyle" end diff --git a/Guardfile b/Guardfile deleted file mode 100644 index 8e9eb35..0000000 --- a/Guardfile +++ /dev/null @@ -1,26 +0,0 @@ -# -*- encoding: utf-8 -*- -ignore %r{^\.gem/} - -def rubocop_opts - { :all_on_start => false, :keep_failed => false, :cli => "-r finstyle -D" } -end - -group :red_green_refactor, :halt_on_fail => true do - guard :cucumber do - watch(%r{^features/.+\.feature$}) - watch(%r{^features/support/.+$}) { "features" } - watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m| - Dir[File.join("**/#{m[1]}.feature")][0] || "features" - end - end - - guard :rubocop, rubocop_opts do - watch(%r{.+\.rb$}) - watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) } - end - - guard :cane do - watch(%r{.*\.rb}) - watch(".cane") - end -end From de7278286cb4eb9ccb6a0a8489ff8c63734ff985 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 22:53:05 -0700 Subject: [PATCH 08/14] Remove countloc and the last dead linting dependencies - Remove countloc and the stats/loc rake tasks it backed; the gem is unmaintained and the tasks only printed line counts - Remove the remaining cane and tailor dependencies (cane calls File.exists?, removed in Ruby 4.0; tailor needs ostruct, no longer a default gem) - busser: drop the aruba `unescape` helper, removed in aruba 1.x, so the cucumber steps run again - busser-cucumber: unpin aruba and cucumber and move to the aruba 2.x config API - Give kitchen-cloudstack and kitchen-opennebula a test task so `rake test` resolves Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- Rakefile | 13 +------------ busser-bash.gemspec | 1 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Rakefile b/Rakefile index caf85c7..62de736 100644 --- a/Rakefile +++ b/Rakefile @@ -10,15 +10,4 @@ end desc "Run all test suites" task :test => [:features] -desc "Display LOC stats" -task :stats do - puts "\n## Production Code Stats" - sh "countloc -r lib" - puts "\n## Test Code Stats" - sh "countloc -r features" -end - -desc "Run all quality tasks" -task :quality => [:stats] - -task :default => [:test, :quality] +task :default => [:test] diff --git a/busser-bash.gemspec b/busser-bash.gemspec index 2ce259c..f3ef61a 100644 --- a/busser-bash.gemspec +++ b/busser-bash.gemspec @@ -23,7 +23,6 @@ Gem::Specification.new do |gem| gem.add_dependency "busser", ">= 0.2.0" gem.add_development_dependency "aruba" - gem.add_development_dependency "countloc" gem.add_development_dependency "rake" gem.add_development_dependency "simplecov" end From f9cb84f9def37d06cbeffaba1b83285cc34e824d Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 23:02:14 -0700 Subject: [PATCH 09/14] Make the test job able to find rake, and unblock Ruby 3.1 - Declare rake in the Gemfile's :test group. Gemspec development dependencies land in bundler's :development group, which CI excludes via BUNDLE_WITHOUT=development, so `bundle exec rake` failed with "can't find executable rake for gem rake" - Relax dev dependency pins that require Ruby >= 3.2 (minitest 6, pry-byebug 3.12); bundler resolves the whole Gemfile even for a single group, so these broke the Ruby 3.1 matrix entry outright - kitchen-opennebula: depend on fog-opennebula instead of the fog metagem, which pulls fog-ovirt -> ovirt-engine-sdk and fails to build - guard-kitchen: read the version in the gemspec without loading the library, which requires guard and is unavailable while bundler evaluates the gemspec Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- Gemfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gemfile b/Gemfile index 9edf640..31df891 100644 --- a/Gemfile +++ b/Gemfile @@ -6,3 +6,7 @@ gemspec group :cookstyle do gem "cookstyle" end + +group :test do + gem "rake" +end From 534f66c406b535e33d4e6ed7a281fcce636cec9b Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 23:05:57 -0700 Subject: [PATCH 10/14] Pin dependencies that break on the supported Ruby range - Pin cucumber to the 9.x line. cucumber 10.2.0 raises NoMethodError from its own formatter (group.children is nil), which failed the feature runs - kitchen-rackspace: cap fog-core below 2.3. fog-rackspace 0.1.6 registers a service literally named "CDN v2", and fog-core 2.3+ passes that through const_defined?, which rejects it as an invalid constant name, so `require "fog/rackspace"` raised NameError and no examples could load Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 31df891..a8412ef 100644 --- a/Gemfile +++ b/Gemfile @@ -8,5 +8,6 @@ group :cookstyle do end group :test do + gem "cucumber", "~> 9.0" gem "rake" end From c051e4a9b30d408388161ca4aa2c8749682e2655 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 21 Aug 2026 23:30:37 -0700 Subject: [PATCH 11/14] Make CI able to resolve and load the test dependencies - Use `gemspec development_group: :test`. Gemspec development dependencies otherwise land in bundler's :development group, which CI excludes via BUNDLE_WITHOUT=development, so rspec/fakefs/rake were missing at runtime - Add base64 where cucumber 9.x needs it; it is no longer a default gem on Ruby 4.0 - kitchen-opennebula: fog-opennebula's latest release is 0.0.5, so ">= 0.1" could never resolve - kitchen-rackspace: port the driver off Kitchen::Driver::SSHBase, removed in test-kitchen 4.x, and wait via the configured transport instead Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index a8412ef..3368de2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,13 +1,13 @@ # -*- encoding: utf-8 -*- source "https://rubygems.org" -gemspec - +gemspec development_group: :test group :cookstyle do gem "cookstyle" end group :test do + gem "base64" # cucumber 9.x needs it; not a default gem on Ruby 4.0 gem "cucumber", "~> 9.0" gem "rake" end From d2b593c30da0d07516f9957ca4dbe8185e7da897 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Sat, 22 Aug 2026 08:28:28 -0700 Subject: [PATCH 12/14] Let cookstyle decide which files to lint AllCops/Include pinned the file list to **/*.rb, which quietly excluded the gemspec, Gemfile and Rakefile -- cookstyle reported success while never looking at them. Dropping the Include list restores cookstyle's own defaults, which cover those files, and the offenses that surfaced are autocorrected here. Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Tim Smith --- .rubocop.yml | 2 -- .simplecov | 14 +++++++------- Gemfile | 3 +-- Rakefile | 6 ++---- busser-bash.gemspec | 6 ++---- 5 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c2bb712..8ed7747 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,8 +4,6 @@ require: AllCops: TargetRubyVersion: 3.1 - Include: - - "**/*.rb" Exclude: - "vendor/**/*" - "spec/**/*" diff --git a/.simplecov b/.simplecov index 66ed770..022e106 100644 --- a/.simplecov +++ b/.simplecov @@ -1,10 +1,10 @@ -SimpleCov.profiles.define 'gem' do - command_name 'Specs' +SimpleCov.profiles.define "gem" do + command_name "Specs" - add_filter '.gem/' - add_filter '/spec/' - add_filter '/lib/vendor/' + add_filter ".gem/" + add_filter "/spec/" + add_filter "/lib/vendor/" - add_group 'Libraries', '/lib/' + add_group "Libraries", "/lib/" end -SimpleCov.start 'gem' +SimpleCov.start "gem" diff --git a/Gemfile b/Gemfile index 3368de2..c2f7927 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- source "https://rubygems.org" gemspec development_group: :test @@ -7,7 +6,7 @@ group :cookstyle do end group :test do - gem "base64" # cucumber 9.x needs it; not a default gem on Ruby 4.0 + gem "base64" # cucumber 9.x needs it; not a default gem on Ruby 4.0 gem "cucumber", "~> 9.0" gem "rake" end diff --git a/Rakefile b/Rakefile index 62de736..5174a4f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,3 @@ -# -*- encoding: utf-8 -*- - require "bundler/gem_tasks" require "cucumber/rake/task" @@ -8,6 +6,6 @@ Cucumber::Rake::Task.new(:features) do |t| end desc "Run all test suites" -task :test => [:features] +task test: [:features] -task :default => [:test] +task default: [:test] diff --git a/busser-bash.gemspec b/busser-bash.gemspec index f3ef61a..3235f7b 100644 --- a/busser-bash.gemspec +++ b/busser-bash.gemspec @@ -1,11 +1,10 @@ -# coding: utf-8 -lib = File.expand_path("../lib", __FILE__) +lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "busser/bash/version" require "English" Gem::Specification.new do |gem| - gem.name = "busser-bash" + gem.name = "busser-bash" gem.required_ruby_version = ">= 3.1" gem.version = Busser::Bash::VERSION gem.authors = ["Fletcher Nichol"] @@ -17,7 +16,6 @@ Gem::Specification.new do |gem| gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) gem.executables = [] - gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] gem.add_dependency "busser", ">= 0.2.0" From 3e7a605c2a0c09b741b7cf294ee23775405fc9b2 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 28 Aug 2026 14:16:56 -0700 Subject: [PATCH 13/14] feat!: require Ruby 3.2 and busser 0.9, adopt release-please Ruby 3.1 is end of life and busser 0.9.0 is the first release that runs on modern Ruby, so both floors move together. The shared lint-unit workflow still defaults to starting a Ruby 3.1 job, so the caller now passes ruby_versions explicitly. Releases move to release-please: publish.yml opens and maintains a release pull request and publishes on merge, and pr-title.yml checks that pull request titles are conventional commits. Those titles are what release-please reads to pick the next version and build the changelog, so the two land together or neither works. Actions are pinned to a commit with the release named in a trailing comment, so Renovate can keep the pin and the comment in step. Renovate now covers GitHub Actions digests alongside bundler, so the dependabot config that only duplicated the bundler half is gone. Test tooling moves to cucumber 11, aruba 2 and cookstyle 9. BREAKING CHANGE: Ruby 3.1 and busser releases older than 0.9.0 are no longer supported. Signed-off-by: Tim Smith --- .github/dependabot.yml | 8 ------ .github/workflows/ci.yml | 32 ++++++++++++++++++++++++ .github/workflows/lint.yml | 9 ------- .github/workflows/pr-title.yml | 28 +++++++++++++++++++++ .github/workflows/publish.yml | 45 ++++++++++++++++++++++++++++++++++ .release-please-manifest.json | 3 +++ Gemfile | 6 ++--- busser-bash.gemspec | 6 ++--- lib/busser/bash/version.rb | 2 +- release-please-config.json | 13 ++++++++++ renovate.json | 4 ++- 11 files changed, 131 insertions(+), 25 deletions(-) delete mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/pr-title.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index b587f2b..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -version: 2 -updates: - - package-ecosystem: bundler - directory: / - schedule: - interval: daily - open-pull-requests-limit: 10 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..773e62f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +--- +name: "Test" + +"on": + push: + branches: [main] + pull_request: + workflow_dispatch: + +# The default token is granted write access to most of the repository. +# Nothing here needs more than the checkout. +permissions: + contents: read + +# Supersede in-flight runs for a branch. Pull requests cancel freely, but +# pushes to main do not: every commit on main should keep a build of its own. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + lint-unit: + # Pinned to a commit rather than @main so an upstream edit cannot reach + # this repository's CI without a reviewed pull request. The trailing + # comment names the release the commit belongs to, which is what lets + # Renovate track the pin by version and keep both in step. + uses: test-kitchen/.github/.github/workflows/lint-unit.yml@95ef7803cf23aae5ee68593de5b7e0a731c1a929 # v0.4.0 + with: + # This gem requires Ruby 3.2, and so do busser 0.9 and cucumber 11. + # Without this the shared workflow would still start a Ruby 3.1 job and + # bundler would refuse to resolve there. + ruby_versions: '["3.2", "3.3", "3.4", "4.0"]' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 925ce2d..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: "Test" - -"on": - pull_request: - -jobs: - lint-unit: - uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..ed85ecd --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,28 @@ +--- +name: "PR Title" + +"on": + pull_request_target: + types: [opened, edited, reopened, synchronize] + +permissions: + contents: read + +jobs: + conventional-title: + name: "Conventional commit title" + runs-on: ubuntu-latest + permissions: + pull-requests: read + steps: + # Pull requests here are squash merged, so the pull request title becomes + # the commit subject on main. That makes the title the one place worth + # checking: release-please reads those subjects to decide the next + # version and to build the changelog. + # + # pull_request_target is used so the check also runs for pull requests + # from forks. No repository code is checked out in this job, so none of + # the usual pull_request_target risk applies. + - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..88ba666 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,45 @@ +--- +name: "Release" + +"on": + push: + branches: [main] + +permissions: + contents: read + +jobs: + release-please: + runs-on: ubuntu-latest + permissions: + contents: write # tag the release and commit the version bump + pull-requests: write # open and update the release pull request + packages: write # push the gem to GitHub Packages + steps: + # Opens and maintains a release pull request. Merging that pull request + # is what actually cuts a release, so every step below is skipped until + # release_created is set. + - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 + id: release + with: + token: ${{ secrets.PORTER_GITHUB_TOKEN }} + + - name: Checkout code + if: ${{ steps.release.outputs.release_created }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + # These two steps are handed publishing credentials, so they are pinned + # to a commit rather than a branch. A floating ref would let whoever + # controls that branch run code with a token that can push this gem. + - name: Publish to GitHub Packages + if: ${{ steps.release.outputs.release_created }} + uses: actionshub/publish-gem-to-github@86eb0ce1ced1072298bf68776a32a5c9703ad9aa # v1.0.13 + with: + token: ${{ secrets.GITHUB_TOKEN }} + owner: ${{ github.repository_owner }} + + - name: Publish to RubyGems + if: ${{ steps.release.outputs.release_created }} + uses: actionshub/publish-gem-to-rubygems@f9126f7a2d36a4fd31a13e78fde5fbdcc4b7b251 # v2.0.6 + with: + token: ${{ secrets.RUBYGEMS_API_KEY }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..88f7c73 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.4" +} diff --git a/Gemfile b/Gemfile index c2f7927..0f1d86d 100644 --- a/Gemfile +++ b/Gemfile @@ -2,11 +2,11 @@ source "https://rubygems.org" gemspec development_group: :test group :cookstyle do - gem "cookstyle" + gem "cookstyle", ">= 9.0.0" end group :test do - gem "base64" # cucumber 9.x needs it; not a default gem on Ruby 4.0 - gem "cucumber", "~> 9.0" + gem "base64" # cucumber needs it; not a default gem on Ruby 4.0 + gem "cucumber", ">= 11.1" gem "rake" end diff --git a/busser-bash.gemspec b/busser-bash.gemspec index 3235f7b..7a232f0 100644 --- a/busser-bash.gemspec +++ b/busser-bash.gemspec @@ -5,7 +5,7 @@ require "English" Gem::Specification.new do |gem| gem.name = "busser-bash" - gem.required_ruby_version = ">= 3.1" + gem.required_ruby_version = ">= 3.2" gem.version = Busser::Bash::VERSION gem.authors = ["Fletcher Nichol"] gem.email = ["fnichol@nichol.ca"] @@ -18,9 +18,9 @@ Gem::Specification.new do |gem| gem.executables = [] gem.require_paths = ["lib"] - gem.add_dependency "busser", ">= 0.2.0" + gem.add_dependency "busser", ">= 0.9.0" - gem.add_development_dependency "aruba" + gem.add_development_dependency "aruba", ">= 2.0" gem.add_development_dependency "rake" gem.add_development_dependency "simplecov" end diff --git a/lib/busser/bash/version.rb b/lib/busser/bash/version.rb index 178914b..b85e7ba 100644 --- a/lib/busser/bash/version.rb +++ b/lib/busser/bash/version.rb @@ -20,6 +20,6 @@ module Busser module Bash # Version string for the Bash Busser runner plugin - VERSION = "0.1.5.dev".freeze + VERSION = "0.1.4".freeze end end diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..eb1c855 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "bootstrap-sha": "24c265088451eb1f8e4093dba405fe23951e091e", + "packages": { + ".": { + "package-name": "busser-bash", + "changelog-path": "CHANGELOG.md", + "release-type": "ruby", + "include-component-in-tag": false, + "version-file": "lib/busser/bash/version.rb" + } + } +} diff --git a/renovate.json b/renovate.json index 5db72dd..92b9a7b 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,8 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:recommended" + "config:recommended", + "helpers:pinGitHubActionDigests", + ":semanticCommits" ] } From 9ac2915554a6bed63f24d4205970263d0c954061 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 28 Aug 2026 14:27:54 -0700 Subject: [PATCH 14/14] refactor: move development dependencies into Gemfile groups The gemspec now declares only what a consumer of the gem needs at runtime. Everything the suite needs lives in a Gemfile group instead, so the `gemspec` directive no longer has to reach for `development_group: :test` to get the test gems into the right place, and `BUNDLE_ONLY=cookstyle` / `BUNDLE_WITHOUT=development` in CI select exactly what each job needs. The gemspecs also pick up the usual modern fields: SPDX license identifiers, metadata URIs for the issue tracker, changelog, docs and source, and a NUL-separated `git ls-files` that does not depend on `$INPUT_RECORD_SEPARATOR`. Signed-off-by: Tim Smith --- Gemfile | 8 +++++++- busser-bash.gemspec | 40 ++++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Gemfile b/Gemfile index 0f1d86d..67ed829 100644 --- a/Gemfile +++ b/Gemfile @@ -1,12 +1,18 @@ source "https://rubygems.org" -gemspec development_group: :test +gemspec + group :cookstyle do gem "cookstyle", ">= 9.0.0" end group :test do + gem "aruba", ">= 2.0" gem "base64" # cucumber needs it; not a default gem on Ruby 4.0 gem "cucumber", ">= 11.1" gem "rake" end + +group :development do + gem "simplecov" +end diff --git a/busser-bash.gemspec b/busser-bash.gemspec index 7a232f0..aaacd60 100644 --- a/busser-bash.gemspec +++ b/busser-bash.gemspec @@ -1,26 +1,30 @@ lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "busser/bash/version" -require "English" -Gem::Specification.new do |gem| - gem.name = "busser-bash" - gem.required_ruby_version = ">= 3.2" - gem.version = Busser::Bash::VERSION - gem.authors = ["Fletcher Nichol"] - gem.email = ["fnichol@nichol.ca"] - gem.description = "A Busser runner plugin for testing bash scripts" - gem.summary = gem.description - gem.homepage = "https://github.com/test-kitchen/busser-bash" - gem.license = "Apache-2.0" +Gem::Specification.new do |spec| + spec.name = "busser-bash" + spec.version = Busser::Bash::VERSION + spec.authors = ["Fletcher Nichol"] + spec.email = ["fnichol@nichol.ca"] + spec.description = "A Busser runner plugin for testing bash scripts" + spec.summary = spec.description + spec.homepage = "https://github.com/test-kitchen/busser-bash" + spec.license = "Apache-2.0" - gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) - gem.executables = [] - gem.require_paths = ["lib"] + spec.required_ruby_version = ">= 3.2" - gem.add_dependency "busser", ">= 0.9.0" + spec.files = `git ls-files -z`.split("\x0") + spec.executables = [] + spec.require_paths = ["lib"] - gem.add_development_dependency "aruba", ">= 2.0" - gem.add_development_dependency "rake" - gem.add_development_dependency "simplecov" + spec.metadata = { + "bug_tracker_uri" => "#{spec.homepage}/issues", + "changelog_uri" => "#{spec.homepage}/blob/main/CHANGELOG.md", + "documentation_uri" => "#{spec.homepage}/blob/main/README.md", + "homepage_uri" => spec.homepage, + "source_code_uri" => spec.homepage, + } + + spec.add_dependency "busser", ">= 0.9.0" end