GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix .bundle/config values keeping a trailing # comment (#951) by mikolalysenko · Pull Request #953 · SocketDev/socket-patch Conversation
|
| Issue scenario | Test |
|---|---|
| #951 value parsing (pinned against Bundler's own loader output) | ruby_crawler::tests::bundle_config_values_drop_a_trailing_comment_like_bundler |
#951 commented path, path.system, cache_path, gemfile |
ruby_crawler::tests::commented_bundle_config_settings_follow_bundler |
#951 repro: .gems # comment store discovery |
ruby_crawler::tests::commented_app_config_bundle_path_discovers_the_bundler_store |
#951 repro end to end, real bundle install + agent apply patches the copy bundle exec loads |
in_process_alternate_installers::bundler_commented_config_path_apply_patches_loaded_gem |
#951 follow-up: hosted stale-install guard with commented BUNDLE_CACHE_PATH |
e2e_redirect_gem_stale_install::gem_hosted_stale_archive_at_configured_cache_path_warns_and_is_not_attested (new app-config-commented row) |
Bugbot: commented path.system: true + leftover recorded dir stays on system gems |
ruby_crawler::tests::commented_path_system_true_ignores_a_leftover_recorded_path |
| No regression for legacy-era Bundler | ruby_crawler::tests::commented_bundle_path_keeps_the_legacy_bundler_store (passes before and after) |
Every test above except the legacy guard fails with the main crawler (verified locally by swapping ruby_crawler.rs back to main) and passes with the fix. The Bugbot test also fails against the first version of the era fallback. The legacy guard passes on both, by design. The e2e ran against Bundler 4.0.18 / RubyGems 3.5.22 (Ruby 3.3.6), and bundle exec confirmed the patched file is the one Bundler loads.
cargo clippy --workspace --all-features -- -D warnings: clean.cargo test --workspace --all-features --no-fail-fast: 226 suites pass. 12 tests in 4 targets fail locally only because this sandbox runs as root, which ignores the read-only chmod those tests depend on (covgap_commands_vendor ×3, in_process_redirect ×3, repair ×2, and core lib ×4: copy_tree::relax_loop…, vlt_heal::an_unremovable…, pypi_poetry::wire_write_failure…, pypi_requirements::wire_failure_rolls_back…). They are all permission-mode tests, none touch gem code, and CI runs them as a normal user.e2e_redirect_gem_build -- --ignored (16 passed) and e2e_vendor_gem_build -- --ignored (8 passed); in_process_alternate_installers bundler legs pass.3f8e1c1, cherry-picked with -x) to fix the production_digests_go_through_the_helpers failure that is already red on main. It becomes a no-op once Route Gradle digests through utils::digest #878 lands.All 412 check runs on 52542db are green (406 success, 6 skipped), and the merge state is clean. Two jobs needed one re-run each after hitting their timeout-minutes with no failing test: coverage passed in 14 minutes on re-run, and gradle 8.14.3 / jdk 21 / hosted / macos-latest passed on re-run. Both had passed on 3f8e1c1, which runs the same tests. Bugbot reviewed 52542db and found no new issues, and its one finding on 3f8e1c1 is fixed and resolved.
Notes: the npm, PyPI and gem wrappers only dispatch to the binary, so none of them needs a change. cargo fmt --all -- --check reports ~466 pre-existing diffs on main itself (CI has no fmt gate). The three files this PR touches are rustfmt-clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CcuTzWw24ikXbTnMaqW4JJ
Note
Medium Risk
Changes Ruby gem path and cache discovery used by apply and hosted stale-install/VEX guards; behavior is constrained by extensive tests and mirrors Bundler, but mis-parsing could still patch or attest the wrong tree.
Overview
Fixes #951 by aligning .bundle/config parsing with Bundler: values like BUNDLE_PATH: .gems # note and BUNDLE_CACHE_PATH: vendor/gems # … are no longer resolved with the comment still in the path string.
unquote_bundle_config_value now trims, unwraps quotes, then applies Bundler-style strip_comment (first # ends the value unless the value starts with #). bundle_config_dir_reading picks between modern and legacy readings for directory settings (path, cache_path) when only an old-era directory exists on disk; commented path.system: true still clears the path and is not revived by leftover dirs.
Gem apply, vendor-bundle discovery, and hosted stale-archive warnings now target the install/cache dirs Bundler actually uses. New unit, in-process (bundle install + apply on commented BUNDLE_PATH), and e2e cases cover commented cache paths and legacy Bundler layouts.
Reviewed by Cursor Bugbot for commit 4515d75. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
Bundler cuts a .bundle/config value at its first `#` (RubyGems and Bundler 2.5.6+), but socket-patch kept the comment as part of the value. A hand-commented `BUNDLE_PATH: .gems # note` therefore made agent apply patch the system gem copy, and vex attest not_affected, while Bundler loaded the unpatched .gems copy. A commented BUNDLE_CACHE_PATH also hid stale archives from the hosted stale-install guard, and commented path.system / gemfile values were misread too. The shared config value reader now strips the comment the way Bundler's config loader does. Older Bundler keeps the comment in the value, so for directory settings (path, cache_path) the legacy reading is used when only its directory exists on disk. Fixes #951 Assisted-by: Claude Code:claude-opus-5-5
main has failed socket-patch-core's lib tests since Gradle support (#646) and the digest helpers (#865) both landed. The guard test production_digests_go_through_the_helpers flags three files #646 added that still hash inline: crawlers/gradle_cache.rs, patch/jvm_jar.rs and patch/sidecars/maven.rs. That breaks test, test-release and coverage on every open PR. Each inline sha1/sha256 call now goes through sha1_hex_of or sha256_hex_of, which compute the same lowercase hex. Behaviour is unchanged. Assisted-by: Claude Code:claude-opus-5-5 (cherry picked from commit 659ac2c)
|
[agent] On the start commit Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
A `BUNDLE_PATH__SYSTEM: true # note` line makes Bundler 2.5.6+ ignore the recorded BUNDLE_PATH and load system gems. The era fallback added for #951 could still pick the recorded path when a leftover directory existed there, so apply would patch a copy Bundler never loads. The legacy reading now only competes with another directory reading; an unset current reading always stands. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] On Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] The Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] Ready for review at
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Conflict in crates/socket-patch-core/src/crawlers/ruby_crawler.rs (parse_bundle_config_path_with): main (#916) reads BUNDLE_PATH__SYSTEM with bundler_truthy, this branch passes the era-specific unquote function. Resolved as bundler_truthy(unquote(rest)) so both apply. Co-Authored-By: Claude <[email protected]>
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] Root cause of the
Minimal fix: delete those three entries from Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem 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 4515d75. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] Ready for review at
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Gem.bundle/config reader keeps a trailing # comment in the value, so a commented BUNDLE_PATH is missed, agent apply patches the system copy and vex attests not_affected while Bundler loads the unpatched project copy
There was an error while loading. Please reload this page.