Personal Monorepo

Today I completed my long-standing project to merge all of my open source Go repositories into a single repo.

At some point I drank the koolaid that monorepos are better than poly-repos. I don’t really want to go into all of the various reasons for that, but I will say there are a couple clear benefits for my own code:

  1. I can easily change code across all callers if everything is in a single repo.
  2. I benefit from whatever automation I set up for all of my projects.

I’ve written about leatherman here plenty of times before, so I won’t go into too much depth in this post. In short: I already built github actions based CICD for my leatherman, have nice little test libraries, etc. I also tend to have the leatherman binary handy everywhere (hence the name.)

In December I migrated my notes software zine to leatherman. That wasn’t too hard. The main difficulty was finding a non-C implementation of SQLite so I can avoid cgo (which I found, absurdly.)

That was mostly pretty easy because it’s pretty simple, young software. The other major software I wanted to merge in was amygdala, a notes system (of course) built around SMS and deployed to Heroku.

To merge it I took the following steps:

  1. Fetched the Amygdala history from a leatherman checkout: git fetch git://
  2. Made a branch of that code where I’d re-arrange the code before trying to use git merge: git checkout -b pre-merge FETCH_HEAD
  3. I made a commit where I moved things around (like main.go from the root of the repo to where it’d be post proper-merge)
  4. After that I did a proper git merge, which included actually building amygdala into the leatherman binary.

Finally I updated Heroku and Twilio.

Now that this is done I expect to make the leatherman notes tool support more, or even all, of the stuff Amygdala can do. The SMS interface is useful but obviously very limited. Having access to a full web interface is preferable.

Comically I now have three notes related systems in my leatherman:

  • notes: a stateless web interface that runs on a rasbperry pi and interacts with files over dropbox
  • zine: a rich web interface that runs on a laptop and interacts with local files.
  • amygdala: a stateless SMS interface that runs on heroku and interacts with files over dropbox.

I would like to merge notes and zine, such that they are just different modes of the same thing. I’d like amgydala to be an SMS oriented subset, rather than a weird vestigal alternate path.

zine rebuilds an SQLite database on demand with basically no persistence. I think that’s a good default; for notes what I want to do is to read all of the files from dropbox at startup and build an in memory SQLite database and update the database when files change. I already have a pretty good file-watch interface for dropbox. The risk though is that somehow I miss changes and get out of sync, so maybe daily or hourly I reload everything and track unexpected changes.

(Affiliate links below.)

Recently Brendan Gregg’s Systems Performance got its second edition released. He wrote about it here. I am hoping to get a copy myself soon. I loved the first edition and think the second will be even more useful.

At the end of 2019 I read BPF Performance Tools. It was one of my favorite tech books I read in the past five years. Not only did I learn how to (almost) trivially see deeply inside of how my computer is working, but I learned how that works via the excellent detail Gregg added in each chapter. Amazing stuff.

Posted Sat, Jan 23, 2021

If you're interested in being notified when new posts are published, you can subscribe here; you'll get an email once a week at the most.