Abstract out logic that is reused between different actions
Multiple actions call fuctions from other actions e.g. init calling scan and then update and scan calling logic for init/installation. This change should consider refactoring some of the large action specific functions to be reused among different actions.
- eliminate calling other actions inside another action.
Initializecurrent callsupdate, which could potentially lead to unwanted side effects if update action changes. - Separate out action specific logic to be more generic for other actions to use i.e. logging and prompting
- Create more generic services or base classes for multiple actions to use.
Revisit the code design to be determine if platform can do the check as a one off as opposed to during every scan.
Core epic
Discovery Notes
Areas to refactor
- Create smaller functions in action.py e.g. verify_install, install_secureli
- create an installer service to move some of the install logic out of action.py
- move update logic to base class for init to use, and remove update action call from init action call
- possibly use a factory or some generic pattern for creating different logic in reusable actions i.e. different cli output or prompting
There's some good suggestions here that I think could lend themselves to smaller individual tickets to either be included in our current refactor effort, or as a next phase feature a la refactor pt. 2