And here I was thinking that successfully using OpenSSL to setup and test a custom CA was the most exciting thing that happened today. Nope! Just check the mail and Iβve been asked to attend jury duty, for the first time in my life. Finally!
Yep, Iβm the strange one here. π
I have to set up mutual TLS authentication using our own CA for inter-service communication. I found this guide on how to prepare the certificates using openssl to be really useful. There’s also this tool which looks interesting.
Who thought that doing something properly would get results? I’ve been hacking around for the past hour trying to get a CI/CD pipeline to work, with no success. I then decided to change the pipeline properly, and it worked the first time.
π¨βπ» New post on Go over at Coding Bits: Disabling Imported Jobs In Gitlab CI/CD Pipeline
π AI βFriendβ Company Spent $1.8 Million and Most of Its Funds on Domain Name
“It’s real! Premium domains are expensive, but it’s worth it,β Schiffman told me in an email after I reached out to ask if it was true. […] “People just donβt get consumer, I view this as saving money. Much less money needs to be spent on marketing, itβs a one time thing,” Schiffmann said.
Is the marketing in the domain name, or in the word of mouth about how much they spent on the domain name? Well, I guess they got me to talk about it. π
I wonder who Amazon thinks are visiting the websites for AWS resources. They build landing pages full of copy that seems to be written for CTOs and people shopping around for solutions. Yet, I imagine most visitors to these sites are developers, trying to get to the reference documentation.
Archie is quite the photogenic bird.

Got treated to an “Ivy facial” today.

Current Project Update
Hmm, another long gap between posts. A little unexpected, but there’s an explanation for this: between setting up Forgejo and making the occasional update to Blogging Tools, I haven’t been doing any project work. Well, at least nothing involving code. What I have been doing is trying my hand at interactive fiction, using Evergreen by Big River Games.
Well, okay, it’s not completely without code: there is a bit of JavaScript involved for powering the “interactive” logic part. But a bulk of the effort is in writing the narrative, albeit a narrative that’s probably closer to a video game rather than a work of pure fiction.
Why? The main reason is to try something new. I had the occasional fancy to try my hand at fiction, like a short story or something. I have an idea for a novel β I mean, who doesn’t? β but the idea of writing it as a novel seems daunting at the moment (I’ve written it as short story for NanoWriteMo. It’s sitting online as an unedited draft somewhere. I should probably make a backup of it, actually). But the idea of writing something as interactive fiction seemed intriguing. I was never into text parser adventures, but I did enjoy the choose-your-own-adventure books growing up.
So what’s the story about, I hear you saying? Well, believe it or not, it’s about gardening. Yes, something I have zero experience in. And perhaps that’s what made it an interesting subject to explore.
I’ve been working on this for about a month now. I’m well past the everything-is-new-and-exciting phase, and I think I just made it through the oh-no-why-the-heck-am-I-even-doing-this pit of despair. I can see the finish line in terms of the narrative and the logic, and all that remains there should just be a matter of cleaning up, editing, and play testing. The biggest thing left to do is illustrations. I have zero artistic skills myself so I’m not quite sure what I’ll do here.
If you’re curious about it, here’s a sample. It’s about the first third of the story. It’s a little rough, and requires editing and proof-reading, and illustrations. But let me know what you think.
The guests have arrived. π¦

A lot will be happening this coming week. In fact, it feels like the whole year has been building up to it. Mum and Dad will be hosting some guests coming in from overseas, at the same time some distance cousins from Italy are over here. And Iβll be hosting some birds βflying inβ from Canberra (theyβre being driven in actually). Routines will be distrupted, but I think itβs going to be pretty good.
Mesdames et messieurs: voici la tentative d’aujourd’hui de passer Γ un petit-dΓ©jeuner plus minimaliste: deux grands cafΓ©s au lait.
Ladies and gentlemen: presenting today’s attempt to move to a more minimalist breakfast: two large cappuccinos.

Just listening to Ben Thompson’s and Andrew Sharp’s hot takes on baseball on the latest episode of Sharp Tech. My suggestion to Ben would be to try watching a game of test cricket some day. Sounds to me like they share many of the same attributes that Ben likes about baseball. π
Reddit’s decision to allow only Google to index their site will probably mean I’ll be seeing them far less often than I do β which is almost never anyway, and generally from the results of a search. So I’m recording this screenshot, which I call “Reddit in the results”, for posterity.

Edit: Turns out Ecosia sources some of their index from Google, so these Reddit links will likely remain in my searches. I guess that makes this post unnecessary. I’m going to keep it up though, for posterity of my unnecessary effort to post for posterity. π
Why did I eat the breakfast I did today? I told myself I wasn’t going to, as it tended to make me nauseous sometimes. Well, an hour later and here we are: mild nausea. π€¦ββοΈ
Need to work on that self control thing people talk about. The aroma of baked goods at the cafe was the thing that got me today, though. Maybe I should start wearing a nose clip.
I wonder if M.G. Siegler had anyone in mind when he wrote this.
Go Feature Request: A 'Rest' Operator for Literals
Here’s a feature request for Go: shamelessly copying JavaScript and adding support for the “rest” operator in literals. Go does have a rest operator, but it only works in function calls. I was writing a unit test today and I was thinking to myself that it would be nice to use this operator in both slice and struct literals as well.
This could be useful for making copies of values without modifying the originals. Imagine the following bit of code:
type Vector struct { X, Y, Z int }
oldInts := []int{3, 4}
oldVec := Vector{X: 1}
newInts := append([]int{1, 2}, oldInts...)
newVec := oldVec
newVec.Y = 2
newVec.Z = 3
Now imagine how it would look if rest operators in literals were supported:
type Vector struct { X, Y, Z int }
oldInts := []int{3, 4}
oldVec := Vector{X: 1}
newInts := []int{1, 2, oldInts...}
newVec := Vector{Y: 2, Z: 3, oldVec...}
I hope you’ll agree that it looks a bit neater than the former. Certainly it looks more pleasing to my eyes. True, this is a contrived example, but the code I’m writing for real is not too far off from this.
On the other hand, Go does prefer clarity over brevity; and I have seen some JavaScript codebases which use these “rest” operators to an absurd level, making the code terribly hard to read. But I think the Go user-base is pretty good at moderating themselves, and just because it could result in unreadable code, doesn’t make it a forgone conclusion. Just look at Go’s use of type parameters.
Anyway, if the Go team is looking for things to do, here’s one.
I hear Robb and John are looking for a new term for the bringer of snacks for Ruminate. Allow me to throw my suggestion into the ring. It might be difficult to get at first, but trust me, it’ll make sense after saying it a few times.
Okay.
You ready?
Better strap in: it’s going to get a little mind-blowy around here.
Okay, here it is:
It’s snack-plier.
Get it? Snackβ¦plier. The snacks supplier. What does a snack-plier do? They supply snacks. They are the snack supply person. Their whole purpose in their endeavour is to ensure the supply of snacks to those that are requiring snacks.
There it is: snack-plier. Yeah, I told you it’d be good. π
(Okay, I think I’ve embarrassed myself enough today. π)
Was talking to a fellow colleague today and he mentioned that he’s recently started a blog on Bear Blog. He was reluctant to share the URL to it though, which I can understand. I’m not in the habit of sharing mine with people I know.
Anyway, if J. C. happens to stumble upon this blog, hey! π
A Follow-Up To Mockless Unit Testing
I’m sure everyone’s dying to hear how the mockless unit tests are going. It’s been almost two months since we started this service, and we’re smack bang in the middle of brownfield iterative development: adding new features to existing ones, fixing bugs, etc. So it seems like now is a good time to reflect on whether this approach is working or not.
And so far, it’s been going quite well. The amount of code we have to modify when refactoring or changing existing behaviour is dramatically smaller than before. Previously, when a service introduces a new method call, every single test for that service needed to be changed to handle the new mock assertions. Now, in most circumstances, it’s only one or maybe two tests that need to change. This has made maintenance so much easier, and although I’m not sure it mades us any faster, it just feels faster. Probably because there’s less faffing around unrelated tests that broke due to the updated mocks.
I didn’t think of it at the time, but it also made code reviews easer too. The old way meant longer, noisier PRs which β and I know this is a quality of mine that I need to work at β I usually ignore (I know, I know, I really shouldn’t). With the reviews being smaller, I’m much more likely to keep atop of them, and I attribute this to the way in which the tests are being written.
Code hygiene plays a role here. I got into the habit of adding test helpers to each package I work on. Much like the package is responsible for fulfilling the contract it has with its dependants, so too is it responsible for providing testing facilities for those dependants. I found this to be a great approach. It simplified the level of setup each dependant package needed to do in their tests, reducing the amount of copy and pasted code and, thus, containing the “blast radius” of logic changes. It’s not perfect β there are a few tests where setup and teardown were simply copied-and-pasted from other tests β but it is better.
We didn’t quite get rid of all the mocking though. Tests that exercise the database and message bus do so by calling out to these servers running in Docker, but this service also had to make calls to another worker. Since we didn’t have a test service available to us, we just implemented this using old-school test mocks. The use of the package test helpers did help here: instead of having each test declare the expected calls on this mock, the helper just made “maybe” calls to each of the service methods, and provided a way to assert what calls were recorded.
Of course, much like everything, there are trade-offs. The tests run much slower now, thanks to the database setup and teardown, and we had to lock them down to run on a single thread. It’s not much of an issue now, but we could probably mitigate this with using random database names, rather than have all the test run against the same one. Something that would be less easy to solve are the tests around the message bus, which do need to wait for messages to be received and handled. There might be a way to simplify this too, but since the tests are verifying the entire message exchange, it’d probably be a little more involved.
Another trade-off is that it does feel like you’re repeating yourself. We have tests that check that items are written to the database correctly for the database provider, the service layer, and the handler layer. Since we’re writing tests that operate over multiple layers at a time, this was somewhat expected, but I didn’t expect it to be as annoying as I found it to be. Might be that a compromise is to write the handler tests to use mocks rather than call down to the service layer. Those tests really only validate whether the hander converts the request and response to the models correctly, so best to isolate it there, and leave the tests asserting whether the business rules are correct to the server layer.
So if I were to do this again, that’ll be the only thing I change. But, on the whole, it’s been really refreshing writing unit tests like this. And this is not just my own opinion; I asked my colleague, who’s has told me how difficult it’s been maintaining tests with mocks, and he agrees that this new way has been an improvement. I’d like to see if it’s possible doing this for all other services going forward.