I did a thing! aka Test Reflector 29 Apr 2024

tldr; Test Reflector.

Over the past two years I've written or helped to write a lot of open source software. I would say that the last two years have been the most productive in my life, in terms of sheer amount of productive and useful lines of code that I have created. While I don't believe that lines of code are necessarily the best success metric, in terms of that code being useful to me, helping me to develop applications faster, and having confidence in the quality of code that I have shipped in production apps over that time… the last two years have been pretty good.

One problem that this has created is that on the days when I update dependencies or bump language versions across all our projects, it can be a bit of a hassle to track successes and failures of continuous integration for greater than a dozen repositories. We use GitHub Actions not only to run tests, but to continuously deploy applications and to publish new versions of libraries to package managers such as https://hex.pm. Also, while I have a lot of automation for testing and auditing changes prior to shipping those changes… stuff happens. Keys expire; external services change or flake out in CI; changes that work on the latest version of Elixir fail when run against older versions that we check in CI; etc.

𐡷

I was initially surprised that there was not an application that solved this problem, that I could either download for free or purchase. What I really wanted was a menu bar item that would show an aggregated state across all of the GitHub Actions runs across all my repos.

So I built it!

Enter Test Reflector. Over the past few months I built the thing that I wanted. I learned me some Swift.

When I started the project, I decided to write it entirely with SwiftUI and Swift Data, not only to learn the language but the newest of the new of Apple frameworks. After a very frustrating bit of fighting with XCode, reading documentation only to find that examples did not actually work without updating to beta versions of macOS and XCode, and even then were very prone to crashing, I decided to write the core of my application in Rust.

Swift Bridge allowed me to write a solid, tested core in Rust, write a very simple GitHub API client, run it in a solid async runtime with concurrency constraints that are fairly simple to understand, and then to share state with Swift such that the application can be rendered with SwiftUI. While I think that the latter is pretty cool and definitely the way of the future on Apple devices, I've found that the most fragile and buggy aspects of the application come from SwiftUI—I expect that if I had been building an iOS application it might have been less troublesome, but unfortunately on macOS the framework has a lot of both documented and undocumented bugs.

That said, I'm very excited with the fact that I was able to ship my first app to the app store.

What's next?

Now that I have an initial release, my plan is to iterate to more platforms. At my office and at home I have magnetic phone chargers that allow me to use my phone for display widgets such as clocks or photos. I would love to use my phone as a CI monitor, either running checks itself or syncing with my desktop application. If and when I ever get an Apple Watch, it would be nice to receive little buzzes on my arm when builds break. When developing on my laptop using Vision Pro virtual desktops, it would be amazing to have CI running as a floating window, somehow showing the build statuses concisely via some 3D visual structure.

Those are on the horizon… but maybe after a bit of time catching up on other projects.

If you do development on macOS and ever use GitHub Actions for your continuous integration, please check it out. If you do and it doesn't work for you or your git workflows, please let me know.

𐡷