There's no such thing as a trivial change

Often when developing it's easy to let "trivial" edits just slip in without having to jump through all the hoops we put "more serious" patches through. Be this a code-review, running the test suite or any other means of checking over our code: nothing is too small to matter.

A recent example for work is the following patch for a Django project. We were just finishing off a big project to upgrade our version of Django, and were making final touches to the last few corner cases. After a tweak to some templates, we subsequently decided that our decision could do with a comment to explain the situation for next time we upgrade.

A quick patch was added, and a pull-request raised. Someone else looked at the patch and it was merged in… without anyone checking things were still ok. After all, it was a two line change consisting of a single comment:

--- a/templates/admin/change_form.html
+++ b/templates/admin/change_form.html
{% block object-tools %}
{% if change %}{% if not is_popup %}
    <ul class="object-tools">
+       {#  We remove the "View on site" link as it uses Django sites to
+           unexpectedly redirect to production #}
        {% block object-tools-items %}
        <li><a href="history/" class="historylink">{% trans "History" %}</a></li>

For those less familiar with Django:

Unlike Jinja template syntax, {# #} notation can only delimit comments across single lines. Otherwise, the comment (and indeed the markers) are rendered like regular text. For multiline comments in django, {% comment %}{% endcomment %} is required.

Comments !