Our depot printing agent is a small Node program that runs on a PC in each of our forty depots, and it updates itself from our GitHub releases. The releases are made by semantic-release, which runs on every push to main, reads the commits since the last version tag and decides from their messages whether there is anything to release. A commit starting fix: means a patch, feat: means a minor version, and most other messages mean no release at all.
At the start of September we turned on squash merging for the repository, so that main would have one commit per pull request, and set the default squash message to the pull request title and commit details. On the second of October a fix for labels printing at the wrong size on one model of printer was merged. Five weeks later a depot manager asked when it would arrive. Nothing had been released since the last week of August.
The release job had run on every merge and gone green each time, ending with the line There are no relevant changes, so no new version is released. Squash merging made the pull request title the first line of the only commit main ever saw, and our titles were written for people: Print labels at the right size on the ZD421. The commit analyser takes the type from the first line of a message. The fix: lines from the individual commits were still there, in the body, where they looked right to anyone reading the history and counted for nothing.
Nobody was waiting for a release, because merging felt like shipping. In our issue tracker a merged pull request closes its issue, so the printer bug had been marked as fixed since the second of October, in forty depots that were still printing labels too small to scan.
Every pull request now has a required check that rejects a title that is not a conventional commit, so the line that becomes the commit is the line the analyser reads. When a merge to main produces no release, the job posts the subjects it read to the team channel. And the agent reports its version when it starts, so our depot dashboard shows how far behind main each depot is, in days.
semantic-release read the messages we wrote. Squash merging changed which message that was, and we had only ever written the other one for it.
– Sergey Shinder
Top comments (0)