Repository navigation
Keep the ruby crawl test off the host's Bundler env - #2056
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Conversation
crawl_all_finds_flat_bundler1_project went through the public crawl_all, which reads BUNDLE_GEMFILE, BUNDLE_PATH__SYSTEM, BUNDLE_APP_CONFIG and ~/.bundle/config from the process. Any of those set on a developer machine moved the install root away from vendor/bundle and failed the test on a clean checkout (#1919). Split the scan out of crawl_all_with_discovery into a private crawl_all_with_env that takes the Bundler environment explicitly. Production still passes the ambient values, so behaviour is unchanged; the test now passes an empty environment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011f9aePh5tehaLQ8MtWhUP5
|
bugbot run Generated by Claude Code |
PR SummaryLow Risk Overview The crawl loop is moved into a private Reviewed by Cursor Bugbot for commit 13b445e. Configure here. |
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 13b445e. Configure here.
|
Ready for review at
Generated by Claude Code |
Final review briefWhat it does: One Ruby unit test ( Risk: low. It is a pure extract-function refactor with one test caller. The argument list is the same one Look here
Verified: Locally, Changes I made: none. Open questions: none. Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
Problem
CI is healthy this run. The merge queue is empty, the last 20 merge_group runs passed, main's push runs are green, last night's scheduled CI passed (first green nightly since 2026-10-21, after #2049/#2050), and nothing is queued. Every PR failure in the last week traces to a real code change or to a release-504 class already fixed by #2039–#2042/#2046. So this run takes a priority-4 robustness target: the last unclaimed item from #1919 (unit tests that pass only because CI's environment is clean). #2054 (npm/yarn) and #2055 (python) cover the other items; this PR touches neither of their files.
ruby_crawler::tests::crawl_all_finds_flat_bundler1_projectcalls the publiccrawl_all, which readsBUNDLE_GEMFILE,BUNDLE_PATH__SYSTEM,BUNDLE_APP_CONFIG, and~/.bundle/configfrom the process. Reproduced onorigin/main(c09cb0e) withcargo test -p socket-patch-core --lib crawlers:::BUNDLE_PATH__SYSTEM=trueBUNDLE_GEMFILE=<other dir>/GemfileBUNDLE_APP_CONFIG=<dir with path.system config>HOMEwith.bundle/config→BUNDLE_PATH__SYSTEM: "true"BUNDLE_PATH,BUNDLE_DEPLOYMENT,BUNDLE_DISABLE_SHARED_GEMS,GEM_HOME,GEM_PATH,BUNDLE_IGNORE_CONFIG,BUNDLE_LOCKFILEThe failing test was the same one each time.
Root cause
The test exercised the ambient-env entry point instead of an injected-env seam. The test's doc only defended against
BUNDLE_PATH.Fix
crawl_all_with_discoveryinto a privatecrawl_all_with_envthat takes the Bundler environment as arguments. This is the same argument listgem_paths_and_discoveryanddiscover_bundle_stores_implalready take.crawl_all_with_discoverypasses the ambient values exactly as before, so production behaviour doesn't change.crawl_all_with_envwith an empty environment. It runs the same scan loop on the same fixture and makes the same assertion.EnvGuardplus#[serial], because mutating process env while other tests run in parallel is itself a flake source.crawl_all/crawl_all_with_discoverystay covered by the othercrawl_allunit tests in the module and byecosystem_dispatch.Proof
cargo clippy --locked -p socket-patch-core --all-features -- -D warnings(CI's clippy command, scoped to the crate) is clean.rustfmt --checkpasses on the touched file.Where tests run
Unchanged. The test still runs in the PR, merge-queue, and nightly unit test shards.
Generated by Claude Code
Generated by Claude Code