Skip to content

fix: pre-existing issues in server.py and common.py (raise_if_dead, has_minimum_version)#641

Open
tony wants to merge 1 commit into
masterfrom
fix/has-minimum-version-cache
Open

fix: pre-existing issues in server.py and common.py (raise_if_dead, has_minimum_version)#641
tony wants to merge 1 commit into
masterfrom
fix/has-minimum-version-cache

Conversation

@tony

@tony tony commented Mar 8, 2026

Copy link
Copy Markdown
Member

Summary

Three pre-existing issues surfaced during a fresh code review of PR #636. This PR addresses them as atomic commits against master.

  • P1 common(fix[has_minimum_version]): has_minimum_version was calling get_version() twice, spawning two subprocesses for no reason. Now cached in a local variable.
  • P2 server(docs[raise_if_dead]): raise_if_dead had no Raises section in its docstring. Both TmuxCommandNotFound (missing binary) and CalledProcessError (server not running) are now documented.
  • P3 server(fix[raise_if_dead]): subprocess.check_call in raise_if_dead inherited the parent process's stdout/stderr, leaking list-sessions output to the terminal. Now redirected to subprocess.DEVNULL.

Test plan

  • uv run ruff check . --fix --show-fixes — clean
  • uv run ruff format . — no changes
  • uv run mypy — no issues (60 source files)
  • uv run py.test -x -q — 885 passed, 1 skipped
@codecov

codecov Bot commented Mar 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.29%. Comparing base (5a34cc5) to head (63c205a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #641   +/-   ##
=======================================
  Coverage   51.29%   51.29%           
=======================================
  Files          25       25           
  Lines        3488     3488           
  Branches      686      686           
=======================================
  Hits         1789     1789           
  Misses       1404     1404           
  Partials      295      295           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@tony tony force-pushed the fix/has-minimum-version-cache branch from cd81d15 to 1cccc1d Compare April 26, 2026 10:25
@tony tony force-pushed the fix/has-minimum-version-cache branch from 1cccc1d to 451573b Compare May 10, 2026 15:47
why: subprocess.check_call without stdout/stderr redirection inherits the
     parent process's file descriptors, printing tmux output directly to
     the terminal. Library code should not produce terminal noise.
what:
- Pass stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL to check_call
@tony tony force-pushed the fix/has-minimum-version-cache branch from 451573b to 63c205a Compare May 30, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant