Encapsulate shell commands via implementing "Command" classes #1966
Labels
Code Quality
About code quality, refactoring, (unit) testing, linting, ...
Discussion
decision or consensus needed
External
depends on others/upstream
Milestone
Problem
BIT does call a lot of shell commands using
system.os()
or thesubprocess
package. Those calls are all over the whole code base and lack of isolation. This makes it hard to track them (e.g. logging) and to mock them in tests.Solution
Coding is in progress in a hidden branch. I do experiment with some ideas. In short each command will have its own class. And some of them can be combined, e.g.
class SshCmd
withclass RsyncCmd
.Known commands used by BIT
Quick n dirty pseudo code
The text was updated successfully, but these errors were encountered: