secureli icon indicating copy to clipboard operation
secureli copied to clipboard

Abstract out logic that is reused between different actions

Open kevin-orlando opened this issue 2 years ago • 4 comments

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.

  1. eliminate calling other actions inside another action. Initialize current calls update, which could potentially lead to unwanted side effects if update action changes.
  2. Separate out action specific logic to be more generic for other actions to use i.e. logging and prompting
  3. Create more generic services or base classes for multiple actions to use.

kevin-orlando avatar Jan 11 '24 18:01 kevin-orlando

Revisit the code design to be determine if platform can do the check as a one off as opposed to during every scan.

dlolaogundipe avatar Jan 17 '24 18:01 dlolaogundipe

Core epic

dlolaogundipe avatar Jan 29 '24 20:01 dlolaogundipe

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

kevin-orlando avatar Feb 06 '24 16:02 kevin-orlando

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

JordoHeffernan avatar Mar 14 '24 15:03 JordoHeffernan