Skip to content

Clean Code | Refactor | Meaningful Logs | Better Error Handling#1

Merged
vimscientist69 merged 10 commits intomainfrom
refactor/cleanup-autoscaler-code
Sep 16, 2025
Merged

Clean Code | Refactor | Meaningful Logs | Better Error Handling#1
vimscientist69 merged 10 commits intomainfrom
refactor/cleanup-autoscaler-code

Conversation

@vimscientist69
Copy link
Contributor

@vimscientist69 vimscientist69 commented Sep 16, 2025

Reason

Clean code with better error handling, no unnecessary code duplication and better logs are important for building a system that lasts.

Tech Details List

  1. Refactored long methods into shorter ones
  2. Better methods, data types and object names
  3. Reduced code duplication
  4. Use "AutomaUtilities" package for utility methods used across multiple packages
  5. More and better logs
  6. Better error handling

Tasks:

  • Refactored long methods into shorter ones
  • Better methods, data types and object names
  • Reduced code duplication
  • Use "AutomaUtilities" package for utility methods used across multiple packages
  • More and better logs
  • Better error handling

Un-important tasks:

Links:

Testing

Steps:

  1. Run required commands to test all the code modified by this PR
# unit tests
# integration tests
# procs / testing logic
  1. Further testing can be done by following the notes in TESTING-QA

Output:

Testing QA

…idNodeAppInteractor

Refactor autoscaler and autodestroyer to have short methods as well. Initialize authHeader as class instance to avoid getting it from payload every time (very long). Then, add meaningful logs.
…dler to its own class to reduce function parameter passing and length of interactor struct
Still have a lot of todos left (left comment on top).
@vimscientist69 vimscientist69 merged commit 6580988 into main Sep 16, 2025
1 check passed
@vimscientist69 vimscientist69 deleted the refactor/cleanup-autoscaler-code branch September 16, 2025 17:39
vimscientist69 added a commit that referenced this pull request Dec 18, 2025
* refactor(SeleniumGridNodeAppInteractor): short methods for SeleniumGridNodeAppInteractor

Refactor autoscaler and autodestroyer to have short methods as well. Initialize authHeader as class instance to avoid getting it from payload every time (very long). Then, add meaningful logs.

* refactor: refactored a lot of code, around 50% done

* refactor(SeleniumGridNodeAppInteractor): done with refactoring

* refactor(SeleniumGridNodeAppInteractor): refactored fly api error handler to its own class to reduce function parameter passing and length of interactor struct

* refactor(SeleniumGridNodeAutoCreator): refactored name from autoscaler to autocreator

* refactor(SeleniumGridAutoCreator): refactored some code in auto creator

Still have a lot of todos left (left comment on top).

* refactor: semi done with refactoring all code

* refactor: more cleanup work

* refactor: added meaningful logs

* fix: fixed all swiftlint linting errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants