fix: correct the execution of commands and re-organize code#177
fix: correct the execution of commands and re-organize code#177KrLite wants to merge 9 commits intojoshrotenberg:mainfrom
Conversation
|
This will fix #176 |
|
I just found that there are much more problems to solve. WIP-ing this pull request. |
|
Thanks for the help! Would you be willing to split this into separate PRs?
Happy to merge the bug fix quickly if you can isolate it. |
|
I actually went ahead and merged a fix in #180 for the docker docker bug with you as the author so you get proper credit. For the rest of this PR, I'd love to get some of these improvements in, but would prefer smaller, focused PRs if possible. For example:
Breaking it up makes it easier to review and merge incrementally, and reduces the risk of conflicts or CI issues. Let me know if you're interested in splitting this up, or if you'd prefer I cherry-pick specific changes. |
|
Thanks for merging the fix! For the rest of the PR, yes I prefer splitting into smaller ones because it's quite a hard work to toggle all the stuffs. Actually, I'm thinking of creating a generic DSL that accepts command declarations and generates structured, type-safe interfaces. In that case we won't ever worry about architecture, namings and documents and can quickly create command wrappers for any CLI application. |
This replaces all the
self.executor.execute_command("docker", args)withself.execute_command(args). The former ones are absolutely incorrect because they ignore the wrapping layer ofself.execute_commandand generate doubledockercommands likedocker docker pull.This reveals another problem: how can we integrate this behavior into tests? Currently the command executor is not mocked in tests, so we cannot make a final check of how the commands are actually performed. Maybe we should implement a way of mocking the executor.