Contribution experience report: NextCloud's Docker image

Welcome to my second contribution experience report. It follows the one for Git which gives some background about the initiative.

My motivation to contribute

In short: I had been hit by a very annoying bug and I wanted to fix it.

Here is more background. In Kanthaus we have a NextCloud instance that we use for shared documents. I have recently started helping out to maintain it, which means doing regular upgrades.

As the instance was a couple of versions behind, I tried updating it to the latest version by changing the tag of the Docker image we use to the latest available version. The Docker image detected that an upgrade from a previous version was necessary, so it started the upgrade process. However, NextCloud only supports upgrading from one major version to the next: jumping major versions is not supported. As a result, the upgrade process failed. What was particularly frustrating however, was that when restoring the previous version, NextCloud refused to start because the data files were apparently already tagged with the more recent version. So, I was left in a state where the NextCloud instance could not start anymore, no matter which version of NextCloud I used. And the backups I had were not fresh enough to afford restoring them. I should obviously have made backups just before the upgrade and checked the manual to realize that the upgrade path was not supported, but that did not make it less frustrating.

First contact with the project

I went to the GitHub repository for the Docker image I used (nextcloud/docker), found the files that define the Docker image and started tweaking them to add an earlier check, to prevent any upgrade from starting if the versions differ too much.

Development environment

Given that the Docker entry point is simply defined by a bash script, I could edit that with my text editor directly. I don’t really enjoy writing Bash, it feels super brittle and easy to break things unintentially, but well, for such a small change, I can hold my nose (and I guess Bash is probably a de-facto standard for such entrypoint scripts anyway).

Finding my way into the code base

I did not have to look into NextCloud’s own code base, just the Docker deployment, so it was a fairly simple job of looking for where the error message I had seen in my migration log was output in the bash script. From there, I could just backtrack to a place where to add my additional condition.

Reviewing experience

It was a bad experience. When opening my pull request, I first tried to collect all the issues it would fix - because the problem had been reported many times: at least in #1809, #1129, #616 and #617.

While making this inventory, I found another pull request filed nearly three years before, doing exactly the same fix (of course, with a different way to compare the versions, but that’s a detail). This pull request had been left without any comment and rejected two years later without explanation. That felt particularly frustrating. I had been badly hit by a really annoying problem that was not only well known but also for which a fix had been submitted, and simply left to linger for no apparent reason.

I pinged someone who seemed to have push access to the repository according to the recent activity on the repository and after two weeks, my PR got reviewed and merged.

Testing infrastructure

There were some GitHub Actions running on my PR, a bunch of them failing. I guess the failures were spurious given that my PR was merged without any reference to those.

Code formatting

No particular code style seemed to be enforced for this bash script (no idea if there actually are bash formatters out there). I just imitated the surrounding style.

Governance and roadmap

According to the README, this Docker image is maintained by the community and not Nextcloud GmbH, the company behind Nextcloud. Maybe I should consider migrating to the other one (nextcloud/all-in-one), but given its description it looked like it would be a lot heavier. Who knows!

Would I contribute again?

Only if I really have to!