Commit Graph

45 Commits

Author SHA1 Message Date
Klaas van Schelven
ae9cb209a5 Create 'bsmain' (for bugsink-main) app to hold commands
As had been noted on some of the commands, 'ingest' was not the best place for
them.  However, [project-level apps are not supported in
Django](https://forum.djangoproject.com/t/allow-project-to-have-management-commands/5220/2)
So just create a 'main' app. I want to qualify it as 'myproject-main' though, to avoid
further unqualified global namespace pollution. And I want to avoid prefixing with 'bugsink'
b/c that's annoying for tab-completion. So 'bs' it is.

I've moved all commands over; even though a case could be made that the "feeding" commands
(raise_exception, send_json, stress_test) are somewhat related to ingestion, that's not
a very good case :-)
2025-01-23 11:55:34 +01:00
Klaas van Schelven
4a28c51b6a Tests: Add known-broken handling for events that are invalid on purpose 2024-11-15 11:20:12 +01:00
Klaas van Schelven
3222c0d85e Fix the tests (missing initial data in transactiontestcase) 2024-11-15 10:14:01 +01:00
Klaas van Schelven
0e48f346d1 Avoid cross-transaction pollution
in IMMEDIATE mode, project was passed from an (implicit) read transaction to
the immediate_atomic-wrapped code; this meant that it was possible to miscount
project.digested_event_count
2024-10-08 11:53:31 +02:00
Klaas van Schelven
c50ae7afe7 Pin sample to test
on github.com the glob evaluated such that the sample could not be
modified according to the test-setup
2024-09-19 15:01:07 +02:00
Klaas van Schelven
096d1f7d9a Add 'samples' tests as such explicitly 2024-09-19 13:10:13 +02:00
Klaas van Schelven
618e4c43b2 Don't 'manually revert' on failure, this is what we have transactions for
and in fact doing a manual revert leads to a TransactionManagementError
2024-09-19 09:23:10 +02:00
Klaas van Schelven
9eed504474 test: raise exception when invalid data is present 2024-09-19 09:21:15 +02:00
Klaas van Schelven
f2a78fed9d Use the envelope's event_id when using the envelope endpoint
* As per the spec 'takes precendence'
* Also fixes the reported bug on Laravel, which apparently doesn't send event_id
  as part of the event payload.
* Fixes the envelope tests (they were doing nothing when I moved the
  data samples around recently)
* Adds a 'no event_id in data, but yes in envelope' test to that test.
* Adds handling to send_json such that we can send envelopes when the event_id
  is missing from the event data.
2024-09-18 11:36:47 +02:00
Klaas van Schelven
1b6d17c947 Fix: when the first event of a new release is a regression, detect it
not detecting it was caused by incongruency between in-memory and serialized states of the data
2024-09-18 09:08:59 +02:00
Klaas van Schelven
c99702d046 Comment about why a patch function is used 2024-09-18 08:55:17 +02:00
Klaas van Schelven
f7972cbec0 use datetime.timezone.utc
RemovedInDjango50Warning: The django.utils.timezone.utc alias is deprecated. Please update your code to use datetime.timezone.utc instead.
2024-08-21 09:01:20 +02:00
Klaas van Schelven
1bfac5d8c6 assertEquals -> assertEual (Python 3.12)
<<insert remarks about fashion police>>
2024-08-21 08:49:49 +02:00
Klaas van Schelven
3128392d9a Distinguish ingested_at and digested_at 2024-07-18 14:45:59 +02:00
Klaas van Schelven
51a53c09a4 quota: check as little as possible & check-on-digest
Also fix various off-by-one errors with the help of tests
2024-07-17 14:48:19 +02:00
Klaas van Schelven
d56a8663a7 Remove the periodCounter and the PC registry
direct consequence of switching to SQL-based counting
2024-07-16 15:08:05 +02:00
Klaas van Schelven
12acd2c950 Add test for digest-non-immediate 2024-04-27 21:39:56 +02:00
Klaas van Schelven
ab791941ed Add test for envelope ingestion 2024-04-27 21:24:25 +02:00
Klaas van Schelven
58435754e0 Digest immediately implemented 2024-04-26 14:48:07 +02:00
Klaas van Schelven
387234b847 Read the Envelope specification once more, implement some more details 2024-04-25 13:39:52 +02:00
Klaas van Schelven
c3af388461 envelope endpoint: use StreamingEnvelopeParser
in the process, the DRF was removed (it's non-streaming)
2024-04-25 11:39:19 +02:00
Klaas van Schelven
1ad14e72fd Check that an item is present when a header is given
Refactor: NewlineFinder always accepts EOF as an implicit ending
2024-04-25 10:41:43 +02:00
Klaas van Schelven
13913c37c4 Implement EnvelopeParser (at least all examples implemented) 2024-04-25 10:20:45 +02:00
Klaas van Schelven
5d874f7a46 EnvelopeParser's read_until: reimplement using output-stream; write tests 2024-04-25 08:54:01 +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
1e1f7c4a6d Fix tests (for recent timezone change) 2024-04-18 08:39:29 +02:00
Klaas van Schelven
5ae0a8227f Implement bookkeeping of events_at
(I didn't think the effects on regressions through, but this will at least
manifest itself because you cannot mark an issue as "fixed in" a release
in which it occurs. It will also show up once we start displaying "events_at"
in the UI, which should be "soon")
2024-04-16 13:25:18 +02:00
Klaas van Schelven
8e44f7f68e Unmute reason: show in email alert 2024-04-15 10:17:18 +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
2c4e8b9f20 Regular v.s. Django Testcase: be explicit
I recently ran into a funny issue where the TestCases were influencing my
development DB's contents
2024-04-15 09:17:53 +02:00
Klaas van Schelven
280bd2172b History page: 'mostly done' (a first setup) 2024-04-12 16:07:25 +02:00
Klaas van Schelven
f098802fde Event already exists: return 400; implement with one less query 2024-04-11 11:03:41 +02:00
Klaas van Schelven
1a036e6e48 Implement unmute-after-time 2024-03-08 20:53:31 +01:00
Klaas van Schelven
2bc75598f7 Test no alerts (when configured as such at the project level) 2024-01-12 22:34:51 +01:00
Klaas van Schelven
be8b60d399 Factor out self.xxx_project from tests 2024-01-12 22:17:28 +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
8766e2ccfe new-issue and regression alerts (not actually implemented, but the call is) 2024-01-10 17:14:49 +01:00
Klaas van Schelven
12e24e9146 Fix the tests 2024-01-10 17:08:09 +01:00
Klaas van Schelven
6a27a248af Split up ingest/digest (and have a test for process_event) 2024-01-07 22:09:38 +01:00
Klaas van Schelven
700c9e68b4 Add timezone tests 2024-01-05 19:15:54 +01:00
Klaas van Schelven
d01652a6f1 More complete understanding of Auth header based on the docs 2023-11-10 18:07:55 +01:00
Klaas van Schelven
00b4cceca7 Add test for parse_auth_header 2023-11-09 23:32:37 +01:00
Klaas van Schelven
7202fbaf43 More thoughts on auth-header parsing noted 2023-11-09 23:28:15 +01:00
Klaas van Schelven
bfea1b30cc Last time's work: we can get something on-screen now 2023-11-03 19:25:26 +01:00