Ask
298
@pentalobe_junie ·

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?

8 answers Share
Report

Answering anonymously — a moderator will review it first.

  • @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.

    84
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @bobbin_bind · 2mo ago · 2 replies

    First job is not to upgrade anything, it is to make it run once, exactly as it was, so you can see what it does. Container with the old runtime pinned, install with the lockfile untouched, get it green. That gives you a reference implementation, which is the thing that makes the rewrite decision safe rather than a leap.

    Sequence that has worked for me every time: pin and run, capture the output of a few real inputs and save them as fixtures, then upgrade in one deliberate step to a supported runtime, then compare against the fixtures. Node 18 went end of life in April 2025 and 20 followed in April 2026, so 22 is the sensible target and it is a two-major jump, which is usually painless for application code and painful only where native modules are involved.

    On the native dependency: check whether it now ships prebuilt binaries for current versions before you spend an evening on build toolchains. That problem frequently solved itself while you were not looking.

    118
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @goroutine_gil · 2mo ago

      And delete the lockfile last, never first. The instinct when install fails is to wipe it and let the resolver sort things out, which replaces one broken state you understand with a new one you do not. Pin, run, capture, then regenerate.

      37
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
  • @eleven_tabs · 2mo ago

    Pin the old runtime, capture fixtures, then extract the 900 lines into a current template. Two weekends is plenty for that and not enough for a full repair.

    38
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @goldenhour_glen · 2mo ago · 2 replies

    Going to be the annoying one. The toolchain is not why this stalled.

    It sat for seven months before the dependencies rotted. Something else stopped you, and if you spend two weekends on npm and CI you will arrive back at exactly the point you walked away from, except tired and with the sense you already put in the work.

    Write down two things before you touch the repo. What was the last thing you were doing when you stopped, honestly, and who is waiting for this. If the answer to the second is nobody, the technical question does not matter yet - go and find one person who wants it, then decide.

    66
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @stealth_park_stu · 2mo ago

      The cheap version of that test: write the launch paragraph first. Three sentences about what it does and who it is for, no code. If writing them is a slog and you do not believe the result, that tells you more in twenty minutes than a weekend of dependency archaeology.

      29
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
  • @heirloom_hank · 2mo ago

    Did this exact thing in March and the single most useful hour was writing a RESTART file at the top of the repo before doing anything else.

    It has five sections and they are all boring: the exact commands to install and run, what the three moving parts are in two sentences each, what I was in the middle of when I stopped, the three things I know are broken, and one line saying what the next task is. Ninety minutes to write from reading my own code and commits.

    The second weekend started with me opening that file and being productive in five minutes instead of two hours. I now write it whenever I know I am about to have a gap, even a two week one.

    47
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @dax_darian · 2mo ago

    Worth considering a third option if neither weekend appeals: package it for someone else. That means a running deployment or a container that starts, the 900 lines with a paragraph explaining the domain rules, whatever users or waitlist exists, and an honest note about what is broken.

    Assembling that takes about as long as the repair and it forces the same clarity. Half the time I have started that exercise I have talked myself back into finishing the thing, because writing down what is left made it look small. The other half, someone took it and shipped it, which is a better outcome than a repo I open once a year and close again.

    31
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report