Some error messages tell you exactly what went wrong. Others just shrug.
In gitlab-shell — the Go program that handles Git over SSH for GitLab — a failed JSON parse produced this, and only this:
parsing failed No URL. No content type. Nothing about which request had just been parsed. If you were the operator staring at that log line, you knew something had failed and nothing else. Issue #888 in gitlab-shell asked for the obvious thing: when parsing fails, say what you were parsing.
I'm a high-school student in Tunisia, and that issue became my first contribution to GitLab.
The change
The fix itself is small. When the JSON parsing path in gitlab-shell fails now, it logs the request context before returning the error — the content type, and the URL it was talking to — using LabKit, GitLab's structured logging library.
One thing deliberately did not change: the returned error is still exactly parsing failed. Other code and other people's log searches match on that string, so the context goes to the logs, not into the error. The first version of my patch had loosened a couple of test expectations to make them pass; the review pushed back, the expectations went back to being strict, and I added a regression test for the new logging instead. That was round one.
What three rounds of review actually taught me
The automated reviewer on my merge request (!1664) was not a rubber stamp. It found real things, including one I should have caught myself.
Round two was a security catch. My first version logged the full request URL. URLs carry query strings, and query strings can carry tokens. The reviewer asked for the URL to be sanitized before it touched a log file — scheme, host and path only, with the query, fragment and any embedded credentials stripped. It was right, and it is the kind of mistake you only have to be taught once: a log line is a publication, and anything you would not paste in public does not belong in one.
Round three was about a test that could not fail. I had written an assertion that a sensitive string did not appear in the logged values — but the assertion ran against a list, in a form that would pass even if the string was there. A check that passes no matter what is worse than no check, because it gives you confidence you have not earned. The fix was to join the values into one string first, so the assertion could genuinely fail — and I verified that it does fail against the old code.
The part nobody warns you about
My fork's CI pipelines never ran. GitLab requires identity verification to run pipelines on my account, and verification wants a bank card, which I do not have. So the merge request carries a note from me explaining exactly that: the full test suite passes locally (31 packages), and the pipeline gap is an account limitation, not a code failure. Maintainers can run the pipeline on their side. If you are a young contributor without a card, this wall exists — it is not a rejection, and saying so plainly on the MR is better than staying silent.
Where it stands
After the third round, the automated review approved the merge request. It is now waiting on a human maintainer's review, which is where it should be — I am not claiming a merge that has not happened. Whatever the verdict, the three rounds already did their work:
- Error messages are written for the person who reads them at 3 a.m. Context is not decoration.
- Sanitize before you log. URLs, headers and tokens leak through helpfulness.
- A test that cannot fail is a lie you tell yourself. Make it prove it can fail first.
If you are looking for a first contribution of your own: pick the error message that annoyed you, in a project you actually use, and make it say what it knows