oliver-zehentleitner / maity

runner: one helper for the workspaces root as the agents' side names it (resolved here, as given on an ssh host)

Sign in to report

tsk-ev3tbfynctj9 Proposed

Audit round 4 (tsk-hgnbapyw7hnh), read at 0a1b832e. Kind: duplication.

What is wrong

  • The expression 'the root resolved locally, as given on an ssh host' is written inline five times: runner/supervisor.py:588 (_remove_pg_pass), runner/supervisor.py:1525 (_pg_holder), runner/supervisor.py:1949 (other_scratches), runner/workspace.py:138 (scratch_of), and the same split in workspace.locate (workspace.py:177-185). Three of them came with #2032. The password file path (supervisor.py:589 vs :1526 and _pg_pass at 1538) and the scratch path must name the same root as scratch_of does, or the sandbox deny lists miss them.

Proposal

  • workspace.agents_root(root, host) (or a Target.root property) used by all five; the pg holder path built by one helper next to scratch_of.

Effort / risk: S. Low; pure refactor, covered by test_supervisor and test_runner.