CLI framework
Since there are more commands to be added to the CLI in the future, I'd say we should take a step back and refactor the whole _main_.py (https://github.com/gefyrahq/gefyra/blob/main/client/gefyra/main__.py) into a CLI package. Ideally, we'd introduce a useful CLI framework such as Click to improve the CLI experience and tell the code for CLI and API apart. The CLI python package would be excluded for the wheel (for PyPI).
Strict typing
Implement a strict typing and check it with mypy for a better code climate and to uncover bugs related with
typing, (return) values and data structures.
The following code refactorings are recommended:
CLI framework Since there are more commands to be added to the CLI in the future, I'd say we should take a step back and refactor the whole _main_.py (https://github.com/gefyrahq/gefyra/blob/main/client/gefyra/main__.py) into a CLI package. Ideally, we'd introduce a useful CLI framework such as Click to improve the CLI experience and tell the code for CLI and API apart. The CLI python package would be excluded for the wheel (for PyPI).
Factory pattern for ClientConfiguration We have a couple of spots in the code creating and modifying the ClientConfiguration after initialization. I don't like the fragmentation and recommend implementing a factory pattern to consolidate the initialization of the object at one place. ref1: https://github.com/gefyrahq/gefyra/blob/main/client/gefyra/configuration.py#L233 ref2: https://github.com/gefyrahq/gefyra/blob/main/client/gefyra/__main__.py#L311 ref3: https://github.com/gefyrahq/gefyra/blob/main/client/gefyra/api/run.py#L78
Strict typing Implement a strict typing and check it with
mypy
for a better code climate and to uncover bugs related with typing, (return) values and data structures.If there is more, please let me know.