feat: add upload breadcrumbs to bundle analysis tasks#715
feat: add upload breadcrumbs to bundle analysis tasks#715thomasrockhu-codecov wants to merge 1 commit intotomhu/revert-pipeline-contextfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## tomhu/revert-pipeline-context #715 +/- ##
=================================================================
- Coverage 92.25% 92.23% -0.02%
=================================================================
Files 1302 1302
Lines 47837 47934 +97
Branches 1628 1628
=================================================================
+ Hits 44131 44211 +80
- Misses 3397 3414 +17
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! |
| milestone=Milestones.PROCESSING_UPLOAD, | ||
| upload_ids=[upload.id_], | ||
| error=Errors.TASK_TIMED_OUT, | ||
| ) |
There was a problem hiding this comment.
Retries incorrectly logged as TASK_TIMED_OUT breadcrumbs
Medium Severity
The except (CeleryError, SoftTimeLimitExceeded) block catches Retry exceptions (since Retry is a subclass of CeleryError) raised by self.retry() on line 341. This means every retryable-error retry produces a spurious Errors.TASK_TIMED_OUT breadcrumb in addition to the correct Errors.INTERNAL_RETRYING breadcrumb already logged at lines 324–330. The breadcrumb data will be misleading — retries will appear as timeouts in upload breadcrumb records.
Additional Locations (1)
Add lock lifecycle breadcrumbs (LOCK_ACQUIRING, LOCK_ACQUIRED, LOCK_RELEASED) and processing/notification breadcrumbs to both BundleAnalysisProcessorTask and BundleAnalysisNotifyTask. Each breadcrumb includes task_name and parent_task_id for pipeline traceability. Processor breadcrumbs: - Lock lifecycle (acquiring/acquired/released/error) - PROCESSING_UPLOAD at start of processing - UPLOAD_COMPLETE on success - INTERNAL_OUT_OF_RETRIES / INTERNAL_RETRYING on retryable errors - TASK_TIMED_OUT on timeout - UNKNOWN on unhandled exception Notify breadcrumbs: - Lock lifecycle (acquiring/acquired/released/error) - NOTIFICATIONS_TRIGGERED at start of notification - NOTIFICATIONS_SENT on completion or all-errored Co-authored-by: Cursor <cursoragent@cursor.com>
e3efc05 to
9cf42b5
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| "repo_id": repoid, | ||
| "task_name": self.name, | ||
| "parent_task_id": self.request.parent_id, | ||
| } |
There was a problem hiding this comment.
Unexpected keyword arguments crash all breadcrumb calls
High Severity
The bc_kwargs dictionaries include task_name and parent_task_id, but _call_upload_breadcrumb_task only accepts commit_sha, repo_id, milestone, upload_ids, error, and error_text — it has no **kwargs. Every call using **bc_kwargs will raise a TypeError for unexpected keyword arguments. Since the error occurs at the call site (not inside the method's try/except), it will propagate unhandled and crash the bundle analysis tasks.
Additional Locations (2)
| } | ||
|
|
||
| self._call_upload_breadcrumb_task( | ||
| milestone=Milestones.LOCK_ACQUIRING, **bc_kwargs |
There was a problem hiding this comment.
Non-existent milestone enum values cause AttributeError
High Severity
Milestones.LOCK_ACQUIRING, Milestones.LOCK_ACQUIRED, and Milestones.LOCK_RELEASED don't exist in the Milestones enum. The enum only defines FETCHING_COMMIT_DETAILS, COMMIT_PROCESSED, PREPARING_FOR_REPORT, READY_FOR_REPORT, WAITING_FOR_COVERAGE_UPLOAD, COMPILING_UPLOADS, PROCESSING_UPLOAD, NOTIFICATIONS_TRIGGERED, UPLOAD_COMPLETE, and NOTIFICATIONS_SENT. Accessing these non-existent attributes raises an AttributeError at runtime, crashing the tasks.


Summary
_call_upload_breadcrumb_taskcalls toBundleAnalysisProcessorTaskandBundleAnalysisNotifyTaskupload_processor.py,upload_finisher.py,notify.py)PROCESSING_UPLOAD,UPLOAD_COMPLETE,NOTIFICATIONS_TRIGGERED,NOTIFICATIONS_SENT) and errors (INTERNAL_OUT_OF_RETRIES,INTERNAL_RETRYING,TASK_TIMED_OUT,UNKNOWN,INTERNAL_LOCK_ERROR) at each stage of the BA pipelineTest plan
Made with Cursor
Note
Low Risk
Primarily adds fire-and-forget breadcrumb task enqueueing without changing bundle analysis business logic; main risk is extra task traffic and potential noise/ordering issues in observability events.
Overview
Adds upload breadcrumb instrumentation to the bundle analysis pipeline by emitting
_call_upload_breadcrumb_taskevents fromBundleAnalysisProcessorTaskandBundleAnalysisNotifyTask.The tasks now record milestones for lock acquiring/acquired/released, upload processing start/complete, and notification triggered/sent, and also record error breadcrumbs for lock failures, retrying/out-of-retries, timeouts, and unexpected exceptions (including the “all processors errored” notify short-circuit).
Written by Cursor Bugbot for commit 9cf42b5. This will update automatically on new commits. Configure here.