This week I had to go back to an old (2015) Rails app, after the (internal) customer asked for a second version for a slightly different set of users. It was the standard thing of “can you create and deploy a duplicate version, then just make this minor change …”, when the “create and deploy” turned out to be about 30% of the work, and the “minor change” the remaining 70%.
Fortunately it was a fairly simple app, we seem to have done a reasonable job of writing it cleanly in the first place, and I’ve made at least some effort to keep it up-to-date with Rails versions etc in the meantime, so it wasn’t too horrendous. These days I spend 99% of my time with Elixir and Phoenix, but apparently I still remember most of my Rails knowledge. As expected, there were a few things that felt a bit too magical compared to Phoenix’s intentional focus on clarity, but generally the “it just works” stuff still did. The only thing I think we might have over-complicated was the acceptance/integration tests, which in retrospect seemed to have a few too many levels of abstraction (Cucumber features, step definitions, SitePrism page objects and custom matchers).
I initially intended to deploy a second instance with its own database, and control the small behavioural differences with an environment variable, but abandoned that halfway through in favour of leaving it as a single app with two separate DNS entries, with users and root-level models partitioned by app, which was determined based on hostname. Even with the false start, that bit only took a day. The last half hour of that day was a bit of search-and-replace and repeating the DNS registration and SSL cert ordering, once I realised that I’d called the new version IPCC, when it should have been ITCC. Oops.
The “minor change” bit was one of those judgement calls where it was clear that the design wasn’t ideal – if it had been something under active development I’d definitely have spent some time refactoring, but as I suspect it’ll go back to humming along without me touching it for a few years I decided to put up with a bit of cruft.
Back in Elixir, I spent Friday fiddling with some potential improvements to a Phoenix app which might entail some proper BEAM stuff like custom supervision trees and ETS tables, but it’s all still a bit vague.
Garmin has continued to accuse me of overreaching, and after an easy run on Thursday it recommended 3.5 days of rest, but it seems to have settled down again now. It’s the Great Bentley half next weekend – I think that’ll be my first half marathon race since lockdown.
I’ve been doing a bit more unicycle practice this week, and can now just about wobble along for a few feet, using the garage door for balance but no longer holding on for dear life. It feels like actually riding it might not be too far off now.
I was surprised to find a couple of new chillis on last year’s plants that are still sitting on the kitchen windowsill, just when I was about to turf them out and think about planting new ones. In other culinary news, he third and final batch of marmalade is done, and turned out the best. It was a bit of a Goldilocks situation, with the first lot too runny and the second burnt and over-set.