Automate your software build and release pipelines, even if it's a hobby

posted by Jeff | Friday, April 8, 2022, 7:45 PM | comments: 0

One thing that I really appreciate about the core CoasterBuzz community is that they're not afraid to tell me when my shit is broken. For the better part of a decade and a half, I used my own search algorithm on the sites. Basically, it looked at all of the words you had in a thread, deleted the "junk words" like "the" or "and," then gave them a score based on frequency, and whether or not they appeared in the topic title or first post. Believe it or not, this was actually a really good strategy that yielded decent results. The problem of course is that it doesn't take into account plural versions of words, misspellings, and other contextual outliers that I'm not aware of. When I moved all of this stuff to the cloud, there was an obvious opportunity to leverage something better, and Elastic's product was based on Lucerne, which I've messed with previously and it's pretty good. They also run their service in the Azure cloud where my stuff runs. The price isn't terrible either, because at the level I need it, it's only costing about $40 a month.

Anyway, I eventually moved the PointBuzz forums to the hosted version of POP Forums, which means there is so little I have to do to update or maintain it, and all of that is automated in terms of building it and deploying it. CoasterBuzz uses all of the user identification to do club members and track records, so I can't easily use the hosted forums for that. It means that CoasterBuzz has to rely more directly on the latest packages from the forum app. Here's the thing about the way the forum app is coded: As it stands on Github, it has no functionality to define a tenant, just a placeholder that says the tenant is nothing. On the hosted version, there's a replacement piece of code that determines what the tenant is, and that persists all the way into ElasticSearch to associate a "tenantID" with the search records. All of the sites use the same index with different tenant ID's. I'm pretty proud of how clever that is.

CoasterBuzz has no automated build process, which means that I can't rollback to a previous build if I deploy it and it's broken. I deploy from my computer at home. At some point, I decided that the functions, the background processes that do a number of things like send email, but importantly handle the search indexing, were the same as the forum's unmodified code, and I deployed that to the CoasterBuzz functions app. Naked, that code calls the tenant ID "-" by itself, not "coasterbuzz," but the web site itself searches on a tenant ID of "coasterbuzz." You can see why that's broken... the indexer was using "-" but the site was looking for "coasterbuzz," meaning any post made since I deployed the wrong thing wasn't going to be seen. Whoops.

Part of this happened because the functions back in the day didn't work as a package because the library didn't "see" the functions in an external package, and that may have changed by now. Still, this lack of automation broke the search, or at least, made it so most of it wasn't visible. About 300 topics did not appear in the index. Once I found the error, step one was to automate deployments, and step two was to reindex all of the topics. The latter step was kind of interesting because it demonstrated that it could index about 1,100 topics per minute without breaking a sweat.

This reinforces the fact that you should not leave it to chance and make mistakes. Automation is good even for hobby projects that only serve a few thousand visitors per day.


Comments

No comments yet.


Post your comment: