repo untouched for 7 months, the build dies before it starts - fix the toolchain or rewrite the 900 lines that matter
Opened a project I abandoned in December. Install fails, a native dependency will not compile, the lockfile references versions that have moved, the CI config points at a runner image that no longer exists, and the framework is a major version behind. Node 18 in the engines field, which I now know is well past end of life.
Underneath all of that there are maybe 900 lines that are the actual product - the parsing and the scoring logic. Everything else is scaffolding I could rewrite in an afternoon with whatever is current.
I have two weekends. Do I repair the toolchain, or copy the 900 lines into a fresh project and throw the rest away? Also, is there a sane way to decide this that is not just mood?
@committee_kim · 2mo ago
Timebox it and make the decision arithmetic rather than mood. Four hours to a green build. If you are not there, the answer is extract.
The reason that rule works: scaffolding rots and domain logic does not. Your 900 lines of parsing and scoring are the accumulated knowledge of every edge case you hit, and they are worth days. The auth setup, the build config, the deploy scripts, the CI pipeline - all of that is a solved problem you would do differently now anyway, and a current starter template gives you the lot in an afternoon.
When I extracted, the 900 lines went in first with no dependencies other than the standard library where possible, then tests around them from the fixtures, then the new scaffolding around that. The whole thing took eleven hours across two weekends and the result is easier to pick up after a gap, which is the actual problem you are solving.
Reply
Report