I made some very good project in the final item there: upgrading the codebase to Django 3. The basic upgrade completely broke the site, and tonight, I was able to at least generate blankets again. I’ve been struggling with a couple aspects of this: minimizing the amount I need to rewrite, and updating my automated tests.
Minimizing Rewriting
For background, it’s useful to know that I wrote GSC 10 years ago, which is honestly a fair chunk of my professional career ago. I made some bad decisions in the coding process, so when I go in to make changes that might be overall minor, sometimes I hit a wall due to old architectural decisions I made. It gets harder every year to make changes, but a rewrite would take forever at the pace at which I’ve worked these last few years.
So I try to slice down updates to the smallest bit that doesn’t require me to rewrite everything. That’s difficult when the upgrade is to Django itself, the very bedrock of the application. I try to clean up the area that I’m working in as I go.
Tests
I have code-driven tests that help me ensure that I don’t break the site when I update it with new features. An upgrade to Django not only requires me to change my code, it requires me to change the tests to match, and the way tests run have changed, requiring more work. Usually keeping tests up to date isn’t too hard, but in this particular effort, it’s adding lots of time. Worth it, but cumbersome.