69 Commits

Author SHA1 Message Date
Klaas van Schelven db486adb35 Rewrite comments on 'reopen' and 'issue_is_regression' 2024-09-17 23:01:41 +02:00
Klaas van Schelven eb08bd562c When there's no (meaningful) release info, don't display it 2024-09-12 13:58:36 +02:00
Klaas van Schelven e59fd3a225 Implement 'occurs_in_last_release' 2024-09-12 09:49:22 +02:00
Klaas van Schelven 3128392d9a Distinguish ingested_at and digested_at 2024-07-18 14:45:59 +02:00
Klaas van Schelven 717a632b7d check_for_thresholds refactoring: 'metadata' is superfluous
because it was basically the input-tuple (in a different format)
2024-07-18 09:43:37 +02:00
Klaas van Schelven 65ea181f37 vbc-unmute: reduce calls to the expensive check
as done in the previous commit for project quota
2024-07-17 15:33:15 +02:00
Klaas van Schelven c01d332e18 Rename ingest_order to digest_order and clarify event_count
* issue.event_count to digested_event_count
* event.ingest_order to event.digest_order
* issue.ingest_order to digest_order

This is generally more correct/explicit, and is also in preparation
of doing work on-digest (which may or may not happen)
2024-07-16 15:23:40 +02:00
Klaas van Schelven 5ce840f62f Move period_utils to separate file 2024-07-15 14:38:35 +02:00
Klaas van Schelven 93365f4c8d Period-counting using SQL instead of custom-made (PoC)
The direct cause for this was the following observation: there was no mechanism
in place to safeguard counted events across evictions, i.e. the following order
of events was not accounted for:

* ingest/digest a bunch of events (PCs correctly updated)
* eviction (PC still correct)
* server/snappea restart (PC reloaded, but based on new events. not correct).

I though about various approaches to fix this (e.g. snapshotting) but in the end
such approaches added even more complexity to the PC mechanism. I decided to first
check how non-performant the SQL route would be, and this PoC seems to say: just
go SQL.

There's also a small semantic change (probably in the direction of what you'd
expect), namely: the periods are no longer 'calendar' periods.
2024-07-15 14:28:13 +02:00
Klaas van Schelven edff0e219c PeriodCounter: remove event-based approach
Replacing it with passing the thresholds on each call to `inc`.

The event-based approach was broken in a multi-process setup (such as having a separate
gunicorn and snappea), because the unmute events would be registered GUI-side
(gunicorn), and the single process where the counting happened had a different PC
instance.

The solution is to get rid of the event-listener approach, and just make an inventory of
the threshold-checks that need to be done right before each call to `inc`. Because the
calls to `inc` happen in a single process (we [will] enforce this elsewhere) this fixes
the problem.

During refactoring it became clear that this is probably a good idea anyway: many
comments about corner-cases could be removed.

Other things I found:

* The now-removed `_digest_event_python_postprocessing` did more than Python alone (it
  also touched the DB for unmutes) so that was probably a separate bug (now fixed).

* In the event-listener-based code, I foresaw the need for `on_become_false` (but did
  not use it yet). The idea was probably that this could be useful in the quota setting
  (a quota can become unmet after a while) but in fact it isn't useful, because when a
  quota becomes unmet you'd still need to check all quota and OR them.

Tests have not been truly refactored (the new architecture probably points to a new
desired set of tests) but rather have been made to run in the simplest way possible.
2024-07-09 09:31:36 +02:00
Klaas van Schelven fe6c955465 never_evict events that are a Historic Turning Point
Both for technical (foreign keys) and business reasons (these are events you
care about)
2024-06-24 22:50:00 +02:00
Klaas van Schelven 5e2cc0575f Retention, small fixes (from Friday) 2024-06-23 22:20:18 +02:00
Klaas van Schelven cef1127e48 Make user-model swappable
I may just need this later, and doing it this late was already painful enough.
2024-05-29 10:22:57 +02:00
Klaas van Schelven 41a4913299 Implement SNAPPEA_TASK_ALWAYS_EAGER 2024-04-19 21:41:42 +02:00
Klaas van Schelven c50780ab4e Use atomic transactions in views 2024-04-18 13:15:46 +02:00
Klaas van Schelven d75bede5dd Show current status for issues 2024-04-16 21:54:36 +02:00
Klaas van Schelven d89e3d4dd5 Add 'next-materialized historic annotation 2024-04-16 09:31:12 +02:00
Klaas van Schelven 875f306079 Reduce queries of 'history' view
* select_related for users (which are displayed in many locations)
* use 'xxx_id' if that's all you need
2024-04-15 15:06:27 +02:00
Klaas van Schelven 8e44f7f68e Unmute reason: show in email alert 2024-04-15 10:17:18 +02:00
Klaas van Schelven ad93e22fff Fix the double-creating of TurningPoints for time-based-unmute 2024-04-15 09:55:22 +02:00
Klaas van Schelven 490899975b Add tests for TurningPoint creation
this also proves one existing bug: the double-creating of TurningPoints
for time-based-unmute
2024-04-15 09:51:30 +02:00
Klaas van Schelven 280bd2172b History page: 'mostly done' (a first setup) 2024-04-12 16:07:25 +02:00
Klaas van Schelven 1cf19c83d5 Various code-clarification 2024-04-12 08:38:46 +02:00
Klaas van Schelven 4dfefec468 denormalize/cache last_frame_* and transaction on Event and Issue
for performance, but also fixes:

* not just the 'last frame' but the 'last relevant frame' (in-app)
* truncation is properly done (matching the DB size, and for each of the fields)
2024-04-10 09:12:15 +02:00
Klaas van Schelven d46cb7f6e8 DB: unique_together and PositiveIntegerField 2024-04-09 12:34:29 +02:00
Klaas van Schelven 21c4904524 Implement friendly_id 2024-04-09 11:09:31 +02:00
Klaas van Schelven 652823f8c3 Store calculated type and value on issue and event and use these values in the templates 2024-04-08 15:30:41 +02:00
Klaas van Schelven 48307daa0f Introduce 'Grouping' data-modeling 2024-04-08 11:41:15 +02:00
Klaas van Schelven d94bfa8aa6 Log Messages: my first take
they should somehow show up in the title; in the interface it should be clear that we're
dealing with log messages (rather than exceptions)
2024-04-04 15:40:31 +02:00
Klaas van Schelven f69befd20a Harmonize displayed timestamps
I picked server-time as the thing which has the most likeliness of being correct
2024-04-01 23:00:19 +02:00
Klaas van Schelven 3aae32b54f blank=True; as implied by the default='' 2024-03-30 20:50:02 +01:00
Klaas van Schelven 91bc396588 Missing entry in dateutil_kwargs_map: weeks 2024-03-20 20:42:58 +01:00
Klaas van Schelven 99b66ab472 Mutiple resolve/mute/... from UI: use querysets 2024-03-20 19:32:41 +01:00
Klaas van Schelven 28bf2f383e Store fixed_at/events_at newline-terminated
easier to do 'contains' on later
2024-03-20 19:12:30 +01:00
Klaas van Schelven d5e9aa07ca Issue.fixed_at and Issue.events_at: bracketless
for easier qs-based updates (later/soon)
2024-03-20 17:42:59 +01:00
Klaas van Schelven feba3b7410 'is_regression' fix when seeing your first real release 2024-03-19 22:28:20 +01:00
Klaas van Schelven 624cfd3f0f IssueStatemanager improvements
* triggerd_by_event instead of implicitly called (see test for why)
* IngruentStateException check
2024-03-14 20:15:31 +01:00
Klaas van Schelven 1a036e6e48 Implement unmute-after-time 2024-03-08 20:53:31 +01:00
Klaas van Schelven af8bff3799 unmute_after: implement the setting side
at least from the list-view
2024-03-08 20:29:38 +01:00
Klaas van Schelven f0e93b4d5d 'Resolved in' actually sends the relevant version 'under water'
if you have an old screen open which says 'resolved in v1.0' that's what
should happen when you click, even when v2.0 has been seen in the meanwhile
2024-02-21 18:55:52 +01:00
Klaas van Schelven 20361ce75a Date/issue_count correct in list_view 2024-02-20 17:49:48 +01:00
Klaas van Schelven 1426c2f572 Sending of emails: tests, .txt versions, further small improvements 2024-01-16 18:01:45 +01:00
Klaas van Schelven 84885cf9ae Various fixes after visiting the running server
(it's been a while)
2024-01-15 23:20:03 +01:00
Klaas van Schelven 74188297dc Infrastructure for email-html debugging 2024-01-15 22:59:28 +01:00
Klaas van Schelven 6e10a6c10d Document load_from_scratch unmute-strictness 2024-01-14 10:34:55 +01:00
Klaas van Schelven 9d044c0d66 Factor out set_unmuter_handlers 2024-01-12 22:53:55 +01:00
Klaas van Schelven de4d55eaf1 Guard against already-true unmute-conditions 2024-01-12 22:41:41 +01:00
Klaas van Schelven 0a616f5c92 Unmute/mute further work
* IssueStateManager.mute
* IssueStateManager.unmute (from Issue.unmute)
* more tests for alerts
* unmute moved to IssueStateManager
* create_unmute_issue_handler moved-over to models.py
2024-01-12 22:15:50 +01:00
Klaas van Schelven 6c097b215a Rename -> IssueStateManager 2024-01-10 22:44:56 +01:00
Klaas van Schelven a328b68d24 unmute when moving to/from resolved state 2024-01-10 22:43:44 +01:00