Skip to content

Restore the outer backend after nested runs - #567

Open
OskarEichler wants to merge 1 commit into
capistrano:masterfrom
OskarEichler:codex/restore-nested-backend
Open

Restore the outer backend after nested runs#567
OskarEichler wants to merge 1 commit into
capistrano:masterfrom
OskarEichler:codex/restore-nested-backend

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Save and restore the previous thread-local backend around run, including exceptions.

Reproduction and verification

Run a Local backend inside another Local backend and inspect Backend.current after the inner call. Baseline returns nil instead of the still-running outer backend; the candidate restores the outer instance on both success and error.

  • Focused branch against master 28e04dc73de911374a23c4fc3fd5ef34012dcd63; installed release is 1.25.1 (e35241b7a3acdf3df4d70442b4a2e69bbcfff155).
  • Relevant existing tests pass on this isolated branch. Combined release candidate passes 218 unit tests / 3,405 assertions and nine local functional tests / 13 assertions, plus 12 focused checks, 8,507 model assertions and 22 native local path checks. Combined totals cover this and the other focused changes, not this PR alone.
  • No test/spec files added or changed; focused checks are external scratch fixtures. Docker/SSH functional tests were not run. A wrapper disables Docker startup and after-run teardown during the unit/local suites.
  • Original RuboCop 0.52.1 fails with Ruby 4/Psych argument compatibility. With an external compatibility shim, changed files pass lint; full lint retains an unrelated existing Lint/BlockAlignment cop error in nil_cache.rb. No full green-lint claim.
  • Package build preserves 1.25.1, Ruby >=2.5, dependency metadata and all 96 package paths. Ruby 2.5 syntax parsed by upstream lint tooling; no older-runtime or remote-platform execution claim.

Breaking changes / compatibility / limitations

No intended breaking changes. Outside the outermost run, Backend.current is still nil; the current inner backend remains visible while its block runs. No new per-thread configuration API.

No production access, real SSH sessions, deployment or concurrency increase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant