Skip to content

deps: bump flake inputs and cargo deps#588

Merged
NotAShelf merged 2 commits intomasterfrom
faukah/push-qnoollqwtvrv
Mar 11, 2026
Merged

deps: bump flake inputs and cargo deps#588
NotAShelf merged 2 commits intomasterfrom
faukah/push-qnoollqwtvrv

Conversation

@faukah
Copy link
Contributor

@faukah faukah commented Mar 8, 2026

Sanity Checking

  • I have updated the changelog as per my changes
  • I have tested, and self-reviewed my code
  • Style and consistency
    • I ran nix fmt to format my Nix code
    • I ran cargo fmt to format my Rust code
    • I have added appropriate documentation to new code
    • My changes are consistent with the rest of the codebase
  • Correctness
    • I ran cargo clippy and fixed any new linter warnings.
  • If new changes are particularly complex:
    • My code includes comments in particularly complex areas to explain the
      logic
    • I have documented the motive for those changes in the PR body or commit
      description.
  • Tested on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin

Add a 👍 reaction to pull requests you find important.

Summary by CodeRabbit

  • Chores

    • Updated workspace dependencies to newer major versions.
  • Tests

    • Improved test realism by using real command exit statuses.
  • Refactor

    • Overhauled remote/SSH process handling for more reliable execution, output capture, and error/time‑out handling.

@coderabbitai
Copy link

coderabbitai bot commented Mar 8, 2026

Walkthrough

Replaced workspace subprocess and roff versions and migrated process handling to the subprocess 1.0 Job API: popen()start(), updated waiting/killing/exit-status flows, switched SSH password stdin to pass bytes, and adjusted stdout/stderr reads and tests accordingly.

Changes

Cohort / File(s) Summary
Dependency Updates
Cargo.toml
Bumped workspace deps: subprocess 0.2.9 → 1.0.0, roff 0.2.2 → 1.0.0.
Core command changes
crates/nh-core/src/command.rs
Replaced popen() with start(); updated pipeline/job waiting and exit-status handling; changed SSH password stdin to bytes; adjusted tests to use real ExitStatus.
Remote execution & cleanup
crates/nh-remote/src/remote.rs
Migrated remote subprocess usage to Job API (start()), switched read/write to job.stdout/job.stderr/job.stdin bytes, updated wait/kill/reap/timeouts and error paths, improved stderr handling in cleanup flows.

Sequence Diagram(s)

sequenceDiagram
    rect rgba(200,200,255,0.5)
    participant Local
    end
    rect rgba(200,255,200,0.5)
    participant SSH
    end
    rect rgba(255,200,200,0.5)
    participant RemoteJob as Job
    end

    Local->>SSH: start() (returns Job)
    SSH->>RemoteJob: spawn remote command
    Local->>RemoteJob: write stdin bytes (password)
    RemoteJob-->>Local: stdout/stderr streams available
    Local->>RemoteJob: wait() / wait_timeout()
    alt timeout
        Local->>RemoteJob: kill()
        RemoteJob-->>Local: killed, collect exit status
    else success/fail
        RemoteJob-->>Local: exit status
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'deps: bump flake inputs and cargo deps' matches the core changes—dependencies are updated (roff, subprocess in Cargo.toml), and subprocess handling is refactored throughout the codebase. However, the title downplays significant implementation changes in process management (popen→start, stdin handling, exit status logic) that constitute the majority of lines changed.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch faukah/push-qnoollqwtvrv

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/nh-remote/src/remote.rs`:
- Around line 1660-1665: The polling loop that starts the SSH command via
ssh_cmd.start() and repeatedly calls job.wait_timeout(...) is not draining
stdout/stderr pipes and can deadlock when the remote process writes enough
output; update the wait loop in the exit_status logic to either: (1) replace the
manual wait_timeout loop with Job::join_timeout(...) which drains stdout/stderr
automatically, or (2) while polling with job.wait_timeout(...), spawn
non-blocking readers (or use asynchronous readers) to continuously drain
job.stdout and job.stderr into buffers/streams until the job completes, ensuring
pipes are read on each iteration; modify the code around ssh_cmd.start(), the
loop using job.wait_timeout, and the exit/completion handling so output is
drained before and during waits (alternatively use capture() if interrupt
polling is not required).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bcbb1a41-3877-4a22-9802-ed742c33a68b

📥 Commits

Reviewing files that changed from the base of the PR and between 9c9f282 and 9e824a3.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • Cargo.toml
  • crates/nh-core/src/command.rs
  • crates/nh-remote/src/remote.rs

@faukah faukah force-pushed the faukah/push-qnoollqwtvrv branch from 9e824a3 to 0e42e31 Compare March 11, 2026 12:23
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
crates/nh-remote/src/remote.rs (1)

1654-1704: ⚠️ Potential issue | 🔴 Critical

Piped output can still deadlock this polling loop.

This path starts SSH with both stdout and stderr piped, then repeatedly calls job.wait_timeout(...) without draining either pipe until after the child exits. In subprocess 1.0.0, Job::wait()/wait_timeout() do not drain piped output, while join(), capture(), and the communication helpers are the drain-safe APIs. A verbose remote build can therefore fill the pipe buffer, block the SSH child, and keep this loop from ever observing completion. (docs.rs)

Please either drain job.stdout/job.stderr concurrently while polling, or switch this path to a drain-aware API and rework the interrupt handling around that.

For subprocess 1.0.0 on docs.rs, does Job::wait()/wait_timeout() drain piped stdout/stderr, or do I need Job::join()/capture()/communicate() to avoid deadlock when output is redirected to pipes?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/nh-remote/src/remote.rs` around lines 1654 - 1704, The loop using
Job::wait_timeout on the spawned SSH Job while both stdout and stderr are piped
can deadlock because wait_timeout does not drain pipes; either (A) spawn
threads/tasks to continuously read from job.stdout and job.stderr into buffers
while the loop polls get_interrupt_flag()/job.wait_timeout (referencing
job.stdout, job.stderr, and job.wait_timeout), or (B) refactor to use a
drain-aware API such as Job::capture()/Job::join()/communicate() to collect
stdout/stderr atomically and then implement interrupt handling around that call
(ensure attempt_remote_cleanup and job.kill() are invoked if interrupted while
using the capture/join path). Make sure readers safely share the captured
buffers (or return results) so the later exit_status/error check and the output
String use the drained data instead of accessing job.stdout/job.stderr after
join/capture.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@crates/nh-remote/src/remote.rs`:
- Around line 1654-1704: The loop using Job::wait_timeout on the spawned SSH Job
while both stdout and stderr are piped can deadlock because wait_timeout does
not drain pipes; either (A) spawn threads/tasks to continuously read from
job.stdout and job.stderr into buffers while the loop polls
get_interrupt_flag()/job.wait_timeout (referencing job.stdout, job.stderr, and
job.wait_timeout), or (B) refactor to use a drain-aware API such as
Job::capture()/Job::join()/communicate() to collect stdout/stderr atomically and
then implement interrupt handling around that call (ensure
attempt_remote_cleanup and job.kill() are invoked if interrupted while using the
capture/join path). Make sure readers safely share the captured buffers (or
return results) so the later exit_status/error check and the output String use
the drained data instead of accessing job.stdout/job.stderr after join/capture.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3db1a262-3c3f-46a1-9b82-bd4f3f4fe85a

📥 Commits

Reviewing files that changed from the base of the PR and between 9e824a3 and 0e42e31.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • Cargo.toml
  • crates/nh-core/src/command.rs
  • crates/nh-remote/src/remote.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • Cargo.toml

Copy link
Member

@NotAShelf NotAShelf left a comment

Choose a reason for hiding this comment

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

can we censor j*b please

@NotAShelf NotAShelf merged commit 168c091 into master Mar 11, 2026
13 checks passed
@NotAShelf NotAShelf deleted the faukah/push-qnoollqwtvrv branch March 11, 2026 14:15
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.

2 participants