Adrian/create owner data admin trigger#655
Conversation
…n/create-archive-collector
…h within bucket instead
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #655 +/- ##
==========================================
+ Coverage 92.44% 92.57% +0.12%
==========================================
Files 1295 1295
Lines 47608 47563 -45
Branches 1592 1592
==========================================
+ Hits 44012 44030 +18
+ Misses 3287 3224 -63
Partials 309 309
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…n/create-owner-data-admin-trigger
| owner_id=owner.ownerid, | ||
| export_id=export.id, | ||
| user_id=user.id if user else None, | ||
| ) |
There was a problem hiding this comment.
Missing cleanup leaves orphaned export blocking future exports
Medium Severity
The export_owner_data admin action creates an OwnerExport record before calling task_service.export_owner_data(), but if the task service call fails (e.g., Celery broker unavailable, network error), there's no error handling to clean up the created record. The export remains stuck in PENDING status permanently, and since the check at lines 167-179 blocks new exports when one is PENDING or IN_PROGRESS, this owner can never have another export triggered until an admin manually deletes the orphaned record.
There was a problem hiding this comment.
Pretty sporadic, okay not addressing atm, can tweak later
drazisil-codecov
left a comment
There was a problem hiding this comment.
Approred after the Feedback from Cursor is checked.
This PR creates a django admin trigger for an owner to export data. Should be reviewed after #651.
https://linear.app/getsentry/issue/CCMRG-2015/create-django-admin-trigger-for-export-task
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
Note
Adds an admin-triggered pipeline for owner data exports and UI to manage results.
export_owner_dataaction onOwnercreatesOwnerExport(withsince_datefromEXPORT_DAYS_DEFAULT,created_byset from request user), prevents duplicate in-progress exports, triggersTaskService.export_owner_data, and logs viaHistorywith success/error messagesOwnerExportAdminwith list views, filters, read-only fields,owner_linkto Owner, anddownload_linkshowing a presigned URL when completed; add-only disabled, delete allowedexport_owner_datatoOwnerAdmin.actions; minor imports added forOwnerExport,CodecovUser, and export configWritten by Cursor Bugbot for commit 83dd4da. This will update automatically on new commits. Configure here.