Now, I am at the bottom of the barrel here and not the original creator of the repo. It is a clusterfuck tbh and I really want to refactor it. The thing is, this repo connects to almost everything else in the ecosystem and taking the time out to refactor it is not going to bode well for a number of interdependent features.
How did you guys proceed when your microservice was getting out of hand with all the new features? And what do you guys prioritise, as a SWE, the health of your service or new (and apparently important) features floated by the product team?
It's cliche, but implement the "leave it better than you found it" rule.
I'm in a similar situation at my job, we're in the "push out as many features as possible" phase and POs don't know/don't care about the trade offs. I started baking in 20% more time into an estimate to allow me enough room to refactor/add missing tests/general clean up.
I would caution against going in and doing a massive refactor unless it's absolutely necessary. The reason being that refactors are usually much more involved than they appear on the surface, and can also have unexpected side effects.
I understand the urge to want to burn everything down and start with a clean slate... but it's generally more work than its worth. Try to identify the worst areas of the code base, like core business logic missing tests, and try to chip away at it.
But yeah, as already said here, small steps. Do this for small areas of the code and stay away from the feared major rewrite.