fix(data-imports): use dateReceived as the incremental field for Sentry event endpoints - #78771
Conversation
|
😎 Merged successfully - details. |
|
Hey @Gilbert09! 👋 It looks like your git author email on this PR isn't your
You can fix it for this repo with: git config user.email "you@posthog.com"Or set it globally with |
🤖 CI report✅ Backend coverage — all changed backend lines covered🧪 Backend test coveragePatch coverage — changed backend lines (products + core): All changed backend lines are covered ✅ Per-product line coverage (touched products)
Report-only. Patch coverage = changed backend lines covered vs
|
|
|
Note 🤖 stamphog reviewed Gates denied this PR (data migration touches the deny-list and it's classified T2-never), so it requires human sign-off regardless of code quality; the change also includes a data migration correcting existing records, which is risky territory needing explicit review.
Gate mechanics and policy version
Updated in place — this replaces 2 earlier stamphog review(s) on this PR. |
…ry event endpoints Sentry's issue_events and project_events endpoints fetch full event bodies (full=true), which carry a dateReceived timestamp rather than the dateCreated field the lightweight issue/event list serializers use. dateCreated was the only incremental field ever offered for these two endpoints, so every incremental sync of them failed with IncrementalFieldMissingFromDataError. Update the endpoint config to the field Sentry actually returns, and add a data migration to fix already-configured schemas that persisted the broken "dateCreated" value. Generated-By: PostHog Code Task-Id: 156813b8-9c0d-4e82-8e02-e39915577fdc
546a96d to
688711e
Compare
Generated-By: PostHog Code Task-Id: 6c39a9b6-fb18-4c51-929f-33521fb062a6
fuziontech
left a comment
There was a problem hiding this comment.
The endpoint configuration and targeted data migration are narrowly scoped, idempotent, and covered by focused tests. CI reports the Django and Python checks passing.
Non-blocking follow-up: consider updating the issue_events and project_events canonical column descriptions to include dateReceived, so the corrected cursor column receives the expected catalog description.
This review was generated by an automated review agent on behalf of @fuziontech.
|
/trunk merge |
Problem
Every incremental sync of a Sentry
issue_eventsorproject_eventstable fails withIncrementalFieldMissingFromDataError, permanently pausing the schema. Confirmed in error tracking.Both endpoints fetch full event bodies (
full=true), which carry adateReceivedtimestamp.dateCreatedwas the only incremental field ever offered for these two endpoints, so the configured cursor never matched a real column and every sync failed at cursor extraction.Changes
issue_eventsandproject_eventsendpoint configs to usedateReceivedas the incremental field (and matchingpartition_key), the field Sentry's full event serializer actually returns.incremental_fieldis the broken"dateCreated"value, so existing paused schemas pick up the fix without manual reconfiguration.How did you test this code?
test_events_endpoints_default_to_date_received, parameterized over both endpoints: guards against the default incremental field regressing todateCreated.test_migration_0075pattern) covering the new data migration: fixes both affected schemas, is idempotent, and leaves unrelated schema names and source types untouched.test_sentry.pysuite (133 tests, all pass).makemigrations --checkreports no model drift.Automatic notifications
Docs update
None — internal source config only, no documented behavior changes.
🤖 Agent context
Autonomy: Fully autonomous
Investigated via PostHog error tracking (issue
019fd673-7755-7962-9f4c-0a8f8ab9070b), reading the stack trace down toget_incremental_field_valueinpipelines/common/load.py, then tracing the schema/pipeline-version properties on the exception event back to the Sentryissue_eventssource config. Confirmed the actual Sentry API field name via docs before changing the default. Skills invoked:/django-migrations,/writing-tests,/writing-pr-descriptions.