This week, I needed to confirm that a microservice could reach its database in test.
That worked — but getting there turned into a deeper refactor of the DB layer. It exposed flaws in how we handled connections. Fixing them made the system better and clearer.
Then came the familiar pull:
If I’m already in the internals…
Logging could be cleaner. Should I tidy it now?
Error handling needs work. Do I rewrite it?
The Docker image size is bloated. Should I reduce it?
Each would be a win — but also scope creep.
I knocked out two cleanly, but the third sent me down a rabbit hole before I made the call to stop.
What helped me decide?
The core issue was fixed and tested.
The changes were stable in review.
Everything else could stand on its own.
We talk a lot about knowing when to refactor.
We talk less about knowing when to stop.