Repository navigation
Remove deprecated sensu-plugins-ruby subsystem (v6.0.0) - #1359
sourabhpatel-sumo wants to merge 2 commits into
Conversation
amdprophet
left a comment
There was a problem hiding this comment.
This is a major change as https://github.com/sensu/sensu-ruby-runtime has historically been used by many plugins from the community (not just our own). If we haven't already, please determine how many users are still using ruby plugins. I can see this being a blocker for upgrading to v6.0.0 of the puppet module for some people.
|
@amdprophet I've updated the PR description with a correction and the scope of what this actually touches — short version: On the usage numbers you asked for. Pulled from packagecloud — 30-day downloads, API
Two things stand out:
My read: el/8's 21 sits inside the noise floor set by platforms that can't have live users. I'd rather say that carefully — "indistinguishable from automated traffic," not "nobody uses this" — since I can't actually tell the two apart from download counts alone. Worth noting One caveat on the data itself: the repo page's "installs in the last 30 days" widget shows 80 for the same window, not 297 — apparently a different metric than the API's If you have visibility I don't — support tickets, customer reports, known EL8 shops — that would override my read here, and I'd trust it over the download data. One regression worth naming plainly: And you're right that there's no deprecation cycle here — I checked, and there never has been, on any part of this subsystem, in its whole history. That's a gap on my end, not a defense of the PR as it stands. Given that, I think the honest options are:
I don't have strong footing to pick between these myself — happy to do whichever you think is right, and (2) is not much extra work if you'd rather be safe. |
…p EOL platforms (#1358) * Upgraded module for Puppet 8 and current OS support - Bump module version to 5.12.0 - Update Puppet dependency to >= 8.0.0 - Add AlmaLinux 8/9, Ubuntu 22.04/24.04 support; drop EOL platforms (CentOS 7, Ubuntu 18.04/20.04, Amazon Linux 2018) - Refresh CI workflows with modern actions and Ruby 3.4/Puppet 8 matrix - Replace legacy nodesets with rocky-9-modern, almalinux-9, ubuntu-24.04 - Remove sensu-plugin-ruby system (sensu::plugins class, sensu_plugin type, sensu_gem provider, sensu::repo::community); expand Bonsai asset docs with migration guide - Update README, DESIGN.md, and REFERENCE.md accordingly Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * Update CI lint command and add puppet install helper Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * Added BEAKER_PUPPET_COLLECTION environment variable Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * Update acceptance test setup for Windows and Postgres Update the Windows acceptance workflow to exclude vendor and .git directories when copying modules to the module path. Update the test helper to dynamically determine the PostgreSQL service name based on the backend platform and ensure CA certificates are symlinked on Debian/Ubuntu systems. Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * Fix Windows acceptance workflow: SSL copy, module versions, windows_env - Fix SSL cert copy: create destination directory first with New-Item, then pipe Get-ChildItem | Copy-Item to avoid PowerShell's "Container cannot be copied onto existing leaf item" error with wildcards - Remove --ignore-dependencies from puppet module install calls now that version ranges are correct and Puppet resolves transitive deps - Update puppet-archive to >= 7.0.0 < 8.0.0 (matching fixtures v7.1.0) - Update puppetlabs-chocolatey to >= 9.0.0 < 10.0.0 (matching fixtures v9.0.0) - Replace puppet module install for puppet-windows_env with git clone from voxpupuli/puppet-windows_env v6.1.0: the Forge's highest version is 4.0.1 which declares puppet < 7.0.0, so no Puppet 8 compatible release is available on the Forge Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * Clear RUBYOPT for Windows subprocesses Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * 🔧chore(test): fix puppet binary path on windows Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * 🔧chore(windows): remove manual puppet agent installation and path hacking Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * 🔧chore(deps): add ffi gem for Windows compatibility Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * ✨feat(test): move openssl unfreeze logic to separate file The logic for unfreezing OpenSSL::SSLContext::DEFAULT_PARAMS is moved to spec/openssl_unfreeze.rb and loaded via RUBYOPT to ensure compatibility with Puppet monkey patches in Ruby 3.3+. Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * ♻️refactor(spec): hook OpenSSL unfreeze to avoid load order issues Ensures `OpenSSL::SSL::SSLContext::DEFAULT_PARAMS` is unfrozen by hooking `Kernel#require`. This prevents `Gem::LoadError` when loaded via `RUBYOPT` by ensuring the fix applies regardless of which component first activates the openssl gem. Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * ✨feat(workflow): add minitar compatibility shim for puppet 8 Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * ♻️refactor(sensu): allow mixed types in annotations Update annotations to use `HashProperty` instead of `HashOfStringsProperty` to support strings, arrays, and nested hashes. Added validation to ensure keys are non-empty strings or symbols and ensure consistent string keys via munging. Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * ✨feat(sensu): add sensu_pipeline resource type and properties Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * 🔧chore(ci): update acceptance test configurations - Disable BEAKER_debug and set log_level to warn across all test suites - Rename modern OS nodesets to standard naming (e.g., rocky-9-modern to rocky-9) - Update matrix definitions in acceptance workflows to match new naming Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * 📝docs(tests): update BEAKER_set to rocky-9 in README Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com> * 🐛 fix(sensu): resolve pr review blockers and test gaps Reverts review-flagged regressions (gpg bypass, tls downgrade, systemd conflict) instead of deleting the underlying features. * 🔧 chore(sensu): restore plugin subsystem for pr split Splits the breaking removal into its own 6.0.0 PR so this migration can merge on its own at 5.12.0. * 🐛 fix(ci): unfreeze ssl default_params for all rake tasks spec/openssl_unfreeze.rb only loaded via spec_helper.rb, so strings:generate crashed under CI's openssl 3.3+ build outside of rspec runs. Load it Rakefile-wide instead. * 🐛 fix(sensu): fix ci gem/fact/test gaps exposed by real spec runs Restores real unit test coverage that's been silently masked for a long time: no committed Gemfile.lock means CI's fresh bundle install could resolve json 3.0+, which breaks facterdb's jgrep dependency (JSON.create_id= was removed). Once past that, default_facter_version '3.11.9' matched nothing in facterdb's Facter 4.x/5.x-only fixtures, so on_supported_os silently returned zero cases for every spec/classes file -- 0 examples, 0 failures, indistinguishable from a clean run. - Gemfile: scope the json < 3.0 pin to development/unit_tests, where rspec-puppet-facts/facterdb actually need it - spec/spec_helper.rb: default_facter_version -> 5.6 (verified 13/13 metadata.json OS/release combos resolve; the one gap, Windows 2016, falls back to 4.4.0 via the existing loose-requirement check) - spec/acceptance/04_plugins_spec.rb: skip -- sensu-plugins-ruby has no package for any currently-supported OS, confirmed failing identically across rocky-9/debian-12/almalinux-9/ubuntu-22.04; removed entirely in the follow-up plugin-removal PR - 6 spec/classes files: facts[:osfamily] -> facts[:os]['family'] -- the legacy flat fact doesn't exist in Facter 4.x/5.x fixture data - 5 spec/classes files: stale RedHat 7 target -> 8 (7 was dropped from metadata.json entirely) With facts actually flowing for the first time, three more gaps surfaced once `rake spec_prep` populated the fixture modules: - spec/classes/repo_spec.rb: missing case branch left redhat-9/rocky-9/ almalinux-9 expecting an undefined baseurl instead of the real el/9 one -- my own gap from the earlier repo.pp revert in this branch - manifests/agent/annotation.pp: value was still typed String, so the "allow mixed types in annotations" fix never actually worked end to end for sensu::agent -- Array/Hash values passed the outer parameter check but still failed one layer deeper. Retyped to match Variant[String, Array, Hash]; agent_spec.rb's validation tests were wrong for the same reason and are corrected alongside it - spec/classes/common_spec.rb: second, unguarded compile check hit the same already-documented rspec-puppet Windows path-mocking limitation (rodjek/rspec-puppet#750) that an earlier check in the same file already works around spec/classes: 2194 examples, 0 failures (excluding the two files plugin-removal deletes outright). spec/unit: still 1523/1523. * 🐛 fix(sensu): fix psych safety and pipeline constant warning Two items from Sarvodaya Kumar's review of #1358 that were still outstanding after the earlier round of fixes. - lib/puppet/provider/sensuctl.rb: bare YAML.load rejects Time/Symbol under Ruby 3.1+/Psych 4+'s safe-by-default loading. Confirmed real: reproduced Psych::DisallowedClass with a plain timestamp-bearing document on this branch's own target Ruby 3.4.10/Psych 5.2.2. sensuctl_auth_types had no rescue at all, so any auth resource with a timestamp field crashed the whole run; parse_yaml_dump's fallback hit the same wall one layer deeper, right where it was meant to recover. YAML.load_stream (the primary path in parse_yaml_dump) is unaffected -- verified it already handles Time permissively, so it's intentionally left alone rather than blanket-patched. Added regression coverage: neither new test fails without the fix reverted (checked), both pass with it. - lib/puppet/type/sensu_pipeline.rb: SENSU_PIPELINE_VALIDATE_REF was a bare top-level constant. Puppet reloads type files repeatedly per compilation, so this logged "already initialized constant" on every reload. Moved under PuppetX::Sensu::Pipeline, matching this module's existing lib/puppet_x/sensu/ convention. spec/unit + spec/classes: 3719 examples, 0 failures. * 🐛 fix(sensu): fix plugins_spec/repo_community_spec CI-breaking crash bundle exec rake parallel_spec (the actual CI command) still failed even after the earlier facts[:osfamily] round, because these two files were deliberately skipped there on the reasoning that plugin-removal deletes them anyway. That reasoning missed that puppet8-modernization needs its own CI green before plugin-removal ever merges. - Same facts[:osfamily] -> facts[:os]['family'] fix as the other 6 files (6 occurrences across the two files) - spec/spec_helper.rb's platforms() helper never had :plugins_dependencies / :plugins_package_require keys added for this modernized branch, so plugins_spec.rb crashed with NoMethodError the moment real facts started flowing. Added them, matching data/os/{RedHat,Debian}.yaml's actual hiera values and manifests/plugins.pp's require chain. - repo_community_spec.rb's case statement was missing rocky-8/ almalinux-8/-9 family branches entirely (only redhat-8/centos-8 and a pre-2023-Amazon-support amazon regex existed). Added them, including a comment noting manifests/repo/community.pp itself still resolves Amazon 2023 to el/7 (unlike the newer repo.pp) -- the test now matches that actual behavior rather than fixing manifest logic in a class this branch's follow-up PR deletes outright. bundle exec rake parallel_spec (exact CI command, no exclusions): 4143 examples, 0 failures. * 🐛 fix(ci): fix rexml gem, plugin acceptance skip, and docker timeout - Gemfile: rexml stopped being a default gem in Ruby 3.4; only beaker (system_tests) pulled it in, so the Unit job's BUNDLE_WITHOUT=system_tests:development left it missing and crashed chocolatey's package provider autoload during any package-resource compile (e.g. sensu::backend::datastore::postgresql). - sensu_plugin_spec.rb: same dead-package root cause as 04_plugins_spec.rb (no sensu-plugins-ruby package for any supported OS); skip it too since mode=types was never run locally when that file was first skipped. - spec_helper_acceptance.rb: raise docker-api's read/write timeout so the 3-host EL8 cluster nodeset's cold image builds don't exceed beaker-docker's 300s default. --------- Signed-off-by: Sourabh Patel <sourabh.patel.ctr@sumologic.com>
Breaking: no deprecation cycle existed on master; sensu_bonsai_asset is the replacement. Ships as 6.0.0, stacked on the migration branch.
76bd4c0 to
af37c29
Compare
Summary
Stacked on #1358 (
puppet8-modernization) — this is the breaking-change follow-up split out ofthat PR so v5.12.0 can ship independently. This PR bumps to v6.0.0 and removes the deprecated
sensu-plugins-rubysubsystem entirely:sensu::pluginsclass andsensu::repo::communityclasssensu_plugintype/provider andsensu_gempackage providersensu::plugins::dependenciesindata/os/{RedHat,Debian}.yaml)Scope — what this does not touch
sensu-ruby-runtimeis a Bonsai asset, registered through thesensu_bonsai_assettype — abackend-registered tarball the agent downloads at runtime. It is unaffected by this PR and still
exercised in
spec/acceptance/sensu_bonsai_asset_spec.rb. Ruby plugins delivered as Bonsai assetskeep working exactly as they do today.
What this PR removes is
sensu-plugins-ruby: a Sensu Core 1.x-lineage host-level installer thatadds a third OS repo (
packagecloud.io/sensu/community, separate fromsensu/stable), installs anomnibus package with its own embedded Ruby at
/opt/sensu-plugins-ruby/embedded/, installs acompiler toolchain, and shells out to
sensu-installto compile gems at Puppet-run time. The twoshare the word "ruby" and nothing else.
Why: the modern replacement is
sensu_bonsai_asset(see the migration note already added toREADME.md): where you previously usedsensu::plugins { plugins => ['disk-checks'] }, usesensu_bonsai_assetwith the corresponding Bonsai namespace/name instead(e.g.
sensu/sensu-plugins-disk-checks).Package availability on
packagecloud.io/sensu/community, checked against every OS this modulecurrently supports (
metadata.json):sensu-plugins-rubypublished?0.2.0-1.el8,0.3.0-2.el8, x86_64 only, built 2020-08-11, embedded Ruby 2.4 (EOL Mar 2020)/^201\d$/regex inrepo/community.pp— a bug, not supportsensu::pluginsfails on WindowsCorrection to an earlier claim in this PR: I originally said no package exists for any currently
supported OS — that's wrong for EL8. The acceptance skip was verified on rocky-9, debian-12,
almalinux-9 and ubuntu-22.04;
04_plugins_spec.rbis gated onsensu_mode == 'base'and the onlyEL8 nodeset is
rocky-8-cluster.yml(cluster mode), so no EL8 node ever ran it.sensu::pluginsstill functions on EL8 x86_64 today. See discussion below for usage data on thatplatform.
Test plan
Full local CI-equivalent run on this branch (Apple Silicon; two acceptance-full jobs that require
an x86_64-only Puppet package are noted below and were verified via CI on the parent branch
instead):
rake sensu_validate lint strings:generate reference— clean,REFERENCE.mdmatchesrake parallel_spec(CI's exactBUNDLE_WITHOUT=system_tests:development) — 3701 examples, 0 failuresboltmode andtypesmode withuse_agent=yes(both rocky-9-only jobs) — notrunnable on Apple Silicon: confirmed by direct repro that Puppet Inc. publishes no aarch64
EL9 RPM for
puppet-boltorpuppetserver. Neither job is affected by this diff (no bolt-or puppetserver-setup code touched here), and both already pass on x86_64 GitHub Actions
CI for the parent
puppet8-modernizationbranch.REFERENCE.md, or remaining specs🤖 Generated with Claude Code