Repository navigation
Fix stale Bundler plugin registration after v5 (#1295) - #1367
Mikola Lysenko (mikolalysenko) merged 4 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
v5 removed setup --remove, which cleared Bundler's machine-local plugin registration in .bundle/plugin/index. Checkouts that ran bundle install under v4 kept pointing at the deleted .socket/bundler-plugin/, so Bundler 2.3-2.5 fail every install with a LoadError and newer versions warn on each run. scan and apply on gem projects now report such a registration as gem_bundler_plugin_stale with the one-line fix, and the migration guide, CLI contract and retired-setup error name the per-checkout bundle plugin uninstall step. Fixes #1295 Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 687e9fc. Configure here.
|
I haven't re-run CI because that would undo the queue purge. Re-run the CI workflow when the queue has room. Bugbot found nothing on this head. Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1295
Summary
After a team migrates to v5 as documented, every other checkout that ran
bundle installunder v4 (teammates' machines, persistent CI runners) still has Bundler's plugin registration forsocket-patch, pointing at the deleted.socket/bundler-plugin/. On Bundler 2.3–2.5 everybundle installthen fails with aLoadErrorthat doesn't mention socket-patch. 2.6+ prints a warning on every run.This PR:
scan(gem ecosystem selected, project mode) andapply(gem patches in scope, project mode) read$BUNDLE_APP_CONFIG/plugin/index(default.bundle/plugin/index). If it registerssocket-patchat a path that no longer exists, they report agem_bundler_plugin_stalerun warning. The detail names the path, the index file and the one-line fix (bundle plugin uninstall socket-patch, or delete.bundle/plugin/). Under--jsonit goes inwarnings[]; otherwise it prints oneWarning:line on stderr, andapplysuppresses it under--silent. A registration whose directory still exists is a working v4 setup and is not reported.docs/migrating-to-v5.md, inCLI_CONTRACT.md(the "Agent mode in CI" section, which never mentioned it before), and in the retired-setupusage error.Root cause
v4's
setup --removecleared.bundle/plugin/index(#210). v5 removedsetup(#279), and.bundle/is never committed, so nothing removes the registration in the checkouts that weren't the migrator's.Evidence
bundle installwith a v4-styleplugin "socket-patch", path: ".socket/bundler-plugin"block, the index readsplugin_paths:\n socket-patch: "<abs>/.socket/bundler-plugin". After removing the block and the directory, everybundle installprints "The following plugin paths don't exist…".bundle plugin uninstall socket-patchempties the index and clears the warning. The unit-test fixture uses that exact index text.cargo test -p socket-patch-cli --all-features --test apply -- gem_stale_bundler_pluginscan_json_warns_about_stale_plugin_registrationFAILED andapply_warns_about_stale_plugin_registrationFAILED;scan_json_is_quiet_while_the_plugin_dir_existspassedin_process_gem_config_warningtests still passcargo test -p socket-patch-core --lib: the 3 new tests (registered_plugin_path_reads_bundlers_index,stale_plugin_registration_is_reported,stale_plugin_registration_follows_bundle_app_config) pass. Full lib run: 6094 passed. The 4 failures are pre-existing permission tests (copy_tree,vlt_heal,pypi_poetry,pypi_requirements) that can't fail as intended because the sandbox runs as uid 0, which bypasses read-only permissions. They're unrelated to this diff.cargo test -p socket-patch-cli --all-features --lib: 915 passed.--test cli_parse_main setup_subcommand_is_removedpasses; it now also asserts that the error namesbundle plugin uninstall socket-patch.cargo clippy --workspace --all-features -- -D warningsis clean, and rustfmt is clean on every touched file.cargo test --workspacedoes not fit in this sandbox's disk allowance (ENOSPC while linking the test binaries), so CI runs the full matrix.Per-issue checklist
.bundle/pluginregistered in every other checkout, sobundle installcrashes with LoadError on Bundler 2.3–2.5 #1295, detection:gem_stale_bundler_plugin::{scan_json_warns_about_stale_plugin_registration, apply_warns_about_stale_plugin_registration, scan_json_is_quiet_while_the_plugin_dir_exists}, plus the core unit tests.bundle/pluginregistered in every other checkout, sobundle installcrashes with LoadError on Bundler 2.3–2.5 #1295, docs andsetuperror:cli_parse_main::setup_subcommand_is_removedNotes
npm/,pypi/,gem/) carry no Bundler plugin cleanup text, so they need no changes.CHANGELOG.mdchanges, per AGENTS.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01NBZNtzNwEeuo5izMsyMaGm
Generated by Claude Code
Note
Low Risk
Read-only detection and user-facing warnings plus documentation; no change to patch application or Bundler integration beyond surfacing remediation guidance.
Overview
Addresses #1295: after v5 removes the Bundler plugin files, other checkouts can still have a machine-local
socket-patchentry in.bundle/plugin/index(v4'ssetup --removeused to clear this). Bundler then breaks or warns on everybundle install.Detection adds
stale_plugin_registration_warningin the Ruby crawler: it reads the Bundler app config plugin index (honoringBUNDLE_APP_CONFIG), parses the registeredsocket-patchpath, and only warns when that directory is missing.scan(gem, project mode) andapply(gem in scope, project mode) surface codegem_bundler_plugin_stalevia JSONwarnings[]or a single stderrWarning:(apply respects--silent). Working v4 installs with the plugin dir still present stay quiet.Docs and UX expand v5 migration guidance and the retired
setuperror to requirebundle plugin uninstall socket-patch(or deleting.bundle/plugin/) on every checkout that ran v4bundle install. Integration and unit tests cover scan/apply JSON and stderr behavior plus index parsing.Reviewed by Cursor Bugbot for commit 687e9fc. Configure here.