GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix stale Bundler plugin registration after v5 (#1295) by mikolalysenko · Pull Request #1367 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 9, 2026 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

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 install under v4 (teammates' machines, persistent CI runners) still has Bundler's plugin registration for socket-patch, pointing at the deleted .socket/bundler-plugin/. On Bundler 2.3–2.5 every bundle install then fails with a LoadError that doesn't mention socket-patch. 2.6+ prints a warning on every run.

This PR:

  • Detects it. scan (gem ecosystem selected, project mode) and apply (gem patches in scope, project mode) read $BUNDLE_APP_CONFIG/plugin/index (default .bundle/plugin/index). If it registers socket-patch at a path that no longer exists, they report a gem_bundler_plugin_stale run warning. The detail names the path, the index file and the one-line fix (bundle plugin uninstall socket-patch, or delete .bundle/plugin/). Under --json it goes in warnings[]; otherwise it prints one Warning: line on stderr, and apply suppresses it under --silent. A registration whose directory still exists is a working v4 setup and is not reported.
  • Documents the per-checkout step in docs/migrating-to-v5.md, in CLI_CONTRACT.md (the "Agent mode in CI" section, which never mentioned it before), and in the retired-setup usage error.

Root cause

v4's setup --remove cleared .bundle/plugin/index (#210). v5 removed setup (#279), and .bundle/ is never committed, so nothing removes the registration in the checkouts that weren't the migrator's.

Evidence

  • Reproduced locally with Bundler 4.0.18 / Ruby 3.3.6. After bundle install with a v4-style plugin "socket-patch", path: ".socket/bundler-plugin" block, the index reads plugin_paths:\n socket-patch: "<abs>/.socket/bundler-plugin". After removing the block and the directory, every bundle install prints "The following plugin paths don't exist…". bundle plugin uninstall socket-patch empties the index and clears the warning. The unit-test fixture uses that exact index text.
  • Red → green: cargo test -p socket-patch-cli --all-features --test apply -- gem_stale_bundler_plugin
    • without the scan/apply wiring: scan_json_warns_about_stale_plugin_registration FAILED and apply_warns_about_stale_plugin_registration FAILED; scan_json_is_quiet_while_the_plugin_dir_exists passed
    • with the fix: all 3 pass, and the existing in_process_gem_config_warning tests still pass
  • cargo 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_removed passes; it now also asserts that the error names bundle plugin uninstall socket-patch.
  • cargo clippy --workspace --all-features -- -D warnings is clean, and rustfmt is clean on every touched file.
  • A full cargo test --workspace does not fit in this sandbox's disk allowance (ENOSPC while linking the test binaries), so CI runs the full matrix.

Per-issue checklist

  • v5 Bundler plugin cleanup leaves .bundle/plugin registered in every other checkout, so bundle install crashes 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
  • v5 Bundler plugin cleanup leaves .bundle/plugin registered in every other checkout, so bundle install crashes with LoadError on Bundler 2.3–2.5 #1295, docs and setup error: cli_parse_main::setup_subcommand_is_removed

Notes

  • Wrappers (npm/, pypi/, gem/) carry no Bundler plugin cleanup text, so they need no changes.
  • No CHANGELOG.md changes, 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-patch entry in .bundle/plugin/index (v4's setup --remove used to clear this). Bundler then breaks or warns on every bundle install.

Detection adds stale_plugin_registration_warning in the Ruby crawler: it reads the Bundler app config plugin index (honoring BUNDLE_APP_CONFIG), parses the registered socket-patch path, and only warns when that directory is missing. scan (gem, project mode) and apply (gem in scope, project mode) surface code gem_bundler_plugin_stale via JSON warnings[] or a single stderr Warning: (apply respects --silent). Working v4 installs with the plugin dir still present stay quiet.

Docs and UX expand v5 migration guidance and the retired setup error to require bundle plugin uninstall socket-patch (or deleting .bundle/plugin/) on every checkout that ran v4 bundle install. Integration and unit tests cover scan/apply JSON and stderr behavior plus index parsing.

Reviewed by Cursor Bugbot for commit 687e9fc. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
Start fix for #1295
8129622
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 9, 2026
v5 Bundler plugin cleanup leaves .bundle/plugin registered in every other checkout, so bundle install crashes with LoadError on Bundler 2.3–2.5 #1295
Closed
Claude (claude) added 2 commits October 9, 2026 19:29
@claude
Warn about stale v4 Bundler plugin registrations
ccf2c02
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
@claude
Keep unrelated upstream module untouched
687e9fc
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 9, 2026 19:53
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Oct 9, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

✅ 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

ci-ok is red on 687e9fc2 only because the CI run was cancelled manually ("The run was canceled by Mikola Lysenko (@mikolalysenko)"). It was part of a queue-wide cancel that hit about 20 runs. No test failed. Every check that finished before the cancel passed, including clippy, unit tests and the non-Gradle e2e jobs. The cancelled jobs were the Gradle e2e matrix and coverage-merge, and this PR changes no Gradle code.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 9, 2026
View reviewed changes
@mikolalysenko
Merge branch 'main' into agent/fix-bundler-stale-plugin-registration
e3d50bb
@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge October 9, 2026 22:18
@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 9, 2026
@mikolalysenko
Mikola Lysenko (mikolalysenko) removed this pull request from the merge queue due to a manual request Oct 9, 2026

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit da800c5 Oct 9, 2026
53 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-bundler-stale-plugin-registration branch October 9, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@Tanmay182003 Tanmay Singla (Tanmay182003) Tanmay182003 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

v5 Bundler plugin cleanup leaves .bundle/plugin registered in every other checkout, so bundle install crashes with LoadError on Bundler 2.3–2.5

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mikolalysenko @Tanmay182003 @claude
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.