In the "Details" and "Log" pages Healthchecks displays a list
of events (incoming pings and sent alerts). At the top of the
events list is a two- or three-way selector for selecting
the timezone for formatting event dates and times. The selector
options are "UTC", check's configured timezone, and "Browser's
time zone". The "Browser's time zone" used to be default, initial
selection for all checks.
With this change, for checks that use cron schedule, the default
selected timezone will be the check's configured timezone.
The "Browser's time zone" option is of course still there and the
user can switch to it to see dates and times in their local time.
Rationale: I semi-regularly get support requests about unexpected
or missing alerts, where the problem boil downs to a timezone
mismatch between the client and the Healthchecks server. Sometimes
the confusion seems to be caused by the user seeing ping arrival
times in their local time zone, comparing them to their cron
expression, and not realizing their server may be using a different
timezone. By switching the default display timezone to the check's
configured timezone, I hope users will be more likely to notice
discrepancies between ping arrival times, the cron schedule,
and their local clock.
For checks using simple schedules (timeout and grace), we still
default to browser's timezone for display.
HTML files in /templates/docs/ are not Django templates,
they contain HTML content to be used verbatim in
hc.front.views.serve_doc view.
Some of these files contain "{{ ... }}" syntax. When
we run "./manage.py compress", django-compressor trips
up on this syntax because it treats them as Django templates.
The fix is to change file extension for these files
from .html to something else (I picked .html-fragment)
so django-compressor would ignore them.
The bug: the Log page would sometimes show a number of "zombie"
notifications at the very end: notifications that should not be
shown to the user, but have not yet been garbage-collected.
The fix: when preparing the created__gte filter value for the
notification query, make sure the filter value is not lower than the
timestamp of the oldest visible ping.