The SSH workflows currently extend PhabricatorManagementWorkflow to benefit from sharing all the standard argument parsing code. Sharing the parsing code is good, but it also means they inherit a getViewer() method which returns the ommnipotent viewer.
This is appropriate for everything else which extends ManagementWorkflow (like bin/storage, bin/auth, etc.) but not appropriate for SSH workflows, which have a real user.
This caused a bug with the pull logs where pullerPHID was not recorded properly. We used $this->getViewer()->getPHID() but the correct code was $this->getUser()->getPHID().
To harden this against future mistakes:
- Don't extend ManagementWorkflow. Extend PhutilArgumentWorkflow instead. We only want the argument parsing code.
- Rename get/setUser() to get/setSSHUser() to make them explicit.
Then, fix the pull log bug by calling getSSHUser() instead of getViewer().