From a6ead89ca8acd56036456bc43ce97601a66a2af7 Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Sun, 9 Nov 2025 20:58:39 +0100 Subject: [PATCH] Remove event.debug_info basically unused --- bsmain/management/commands/send_json.py | 5 +---- events/admin.py | 4 +--- .../migrations/0024_remove_event_debug_info.py | 17 +++++++++++++++++ events/models.py | 5 ----- ingest/tests.py | 4 ---- ingest/views.py | 5 ----- issues/tests.py | 4 +--- 7 files changed, 20 insertions(+), 24 deletions(-) create mode 100644 events/migrations/0024_remove_event_debug_info.py diff --git a/bsmain/management/commands/send_json.py b/bsmain/management/commands/send_json.py index 8460928..ad0e705 100644 --- a/bsmain/management/commands/send_json.py +++ b/bsmain/management/commands/send_json.py @@ -66,7 +66,7 @@ class Command(BaseCommand): dsn = os.environ["SENTRY_DSN"] else: raise CommandError( - "You must provide a DSN to send data to Sentry. Use --dsn or set SENTRY_DSN environment variable.") + "You must provide a DSN. Use --dsn or set SENTRY_DSN environment variable.") else: dsn = options['dsn'] @@ -134,9 +134,6 @@ class Command(BaseCommand): headers = { "Content-Type": "application/json", "X-Sentry-Auth": get_header_value(dsn), - # as it stands we always send identifier here, even if it's not a filename. Whether that's useful or - # annoying is an open question, but no reason to change it for now - "X-BugSink-DebugInfo": identifier, } if options["x_forwarded_for"]: diff --git a/events/admin.py b/events/admin.py index 73783c3..403dbfa 100644 --- a/events/admin.py +++ b/events/admin.py @@ -32,7 +32,7 @@ class EventAdmin(admin.ModelAdmin): ordering = ['-timestamp'] - search_fields = ['event_id', 'debug_info'] + search_fields = ['event_id'] list_display = [ 'timestamp', @@ -41,7 +41,6 @@ class EventAdmin(admin.ModelAdmin): 'level', 'sdk_name', 'sdk_version', - 'debug_info', 'on_site', ] @@ -73,7 +72,6 @@ class EventAdmin(admin.ModelAdmin): 'environment', 'sdk_name', 'sdk_version', - 'debug_info', 'pretty_data', ] diff --git a/events/migrations/0024_remove_event_debug_info.py b/events/migrations/0024_remove_event_debug_info.py new file mode 100644 index 0000000..3017642 --- /dev/null +++ b/events/migrations/0024_remove_event_debug_info.py @@ -0,0 +1,17 @@ +# Generated by Django 5.2 on 2025-11-09 19:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("events", "0023_event_remote_addr"), + ] + + operations = [ + migrations.RemoveField( + model_name="event", + name="debug_info", + ), + ] diff --git a/events/models.py b/events/models.py index 5fc039b..02364fd 100644 --- a/events/models.py +++ b/events/models.py @@ -117,9 +117,6 @@ class Event(models.Model): sdk_name = models.CharField(max_length=255, blank=True, null=False, default="") sdk_version = models.CharField(max_length=255, blank=True, null=False, default="") - # this is a temporary(?), bugsink-specific value; - debug_info = models.CharField(max_length=255, blank=True, null=False, default="") - # denormalized/cached fields: calculated_type = models.CharField(max_length=128, blank=True, null=False, default="") calculated_value = models.TextField(max_length=1024, blank=True, null=False, default="") @@ -239,8 +236,6 @@ class Event(models.Model): sdk_name=maybe_empty(parsed_data.get("", {}).get("name", ""))[:255], sdk_version=maybe_empty(parsed_data.get("", {}).get("version", ""))[:255], - debug_info=event_metadata["debug_info"][:255], - # just getting from the dict would be more precise, since we always add this info, but doing the .get() # allows for backwards compatability (digesting events for which the info was not added on-ingest) so # we'll take the defensive approach "for now" (until most everyone is on >= 1.7.4) diff --git a/ingest/tests.py b/ingest/tests.py index 3e0d634..8313a89 100644 --- a/ingest/tests.py +++ b/ingest/tests.py @@ -49,7 +49,6 @@ def _digest_params(event_data, project, request, now=None): "event_id": event_data["event_id"], "project_id": project.id, "ingested_at": format_timestamp(now), - "debug_info": "", }, "event_data": event_data, "digested_at": now, @@ -329,7 +328,6 @@ class IngestViewTestCase(TransactionTestCase): content_type="application/json", headers={ "X-Sentry-Auth": sentry_auth_header, - "X-BugSink-DebugInfo": filename, }, data=data_bytes, ) @@ -380,7 +378,6 @@ class IngestViewTestCase(TransactionTestCase): content_type="application/json", headers={ "X-Sentry-Auth": sentry_auth_header, - "X-BugSink-DebugInfo": filename, }, data=data_bytes, ) @@ -471,7 +468,6 @@ class IngestViewTestCase(TransactionTestCase): content_type="application/json", headers={ "X-Sentry-Auth": sentry_auth_header, - "X-BugSink-DebugInfo": filename, }, data=data_bytes, ) diff --git a/ingest/views.py b/ingest/views.py index fdae6c5..d550ae2 100644 --- a/ingest/views.py +++ b/ingest/views.py @@ -170,10 +170,6 @@ class BaseIngestAPIView(View): @classmethod def get_event_meta(cls, event_id, ingested_at, request, project): - # Meta means: not part of the event data. Basically: information that is available at the time of ingestion, and - # that must be passed to digest() in a serializable form. - debug_info = request.META.get("HTTP_X_BUGSINK_DEBUGINFO", "") - # .get(..) -- don't want to crash on this and it's non-trivial to find a source that tells me with certainty # that the REMOTE_ADDR is always in request.META (it probably is in practice) remote_addr = request.META.get("REMOTE_ADDR") @@ -182,7 +178,6 @@ class BaseIngestAPIView(View): "event_id": event_id, "project_id": project.id, "ingested_at": format_timestamp(ingested_at), - "debug_info": debug_info, "remote_addr": remote_addr, } diff --git a/issues/tests.py b/issues/tests.py index 4e01b04..1a1d743 100644 --- a/issues/tests.py +++ b/issues/tests.py @@ -521,7 +521,6 @@ class IntegrationTest(TransactionTestCase): content_type="application/json", headers={ "X-Sentry-Auth": sentry_auth_header, - "X-BugSink-DebugInfo": filename, }, ) self.assertEqual( @@ -554,7 +553,7 @@ class IntegrationTest(TransactionTestCase): except Exception as e: # we want to know _which_ event failed, hence the raise-from-e here - raise AssertionError("Error rendering event %s" % event.debug_info) from e + raise AssertionError("Error rendering event") from e def test_render_stacktrace_md(self): user = User.objects.create_user(username='test', password='test') @@ -588,7 +587,6 @@ class IntegrationTest(TransactionTestCase): content_type="application/json", headers={ "X-Sentry-Auth": sentry_auth_header, - "X-BugSink-DebugInfo": filename, }, ) self.assertEqual(