Skip to content

feat: add upload breadcrumbs to bundle analysis tasks#715

Open
thomasrockhu-codecov wants to merge 1 commit intotomhu/revert-pipeline-contextfrom
tomhu/ba-upload-breadcrumbs
Open

feat: add upload breadcrumbs to bundle analysis tasks#715
thomasrockhu-codecov wants to merge 1 commit intotomhu/revert-pipeline-contextfrom
tomhu/ba-upload-breadcrumbs

Conversation

@thomasrockhu-codecov
Copy link
Contributor

@thomasrockhu-codecov thomasrockhu-codecov commented Feb 19, 2026

Summary

  • Adds _call_upload_breadcrumb_task calls to BundleAnalysisProcessorTask and BundleAnalysisNotifyTask
  • Mirrors the existing breadcrumb pattern used by coverage upload tasks (upload_processor.py, upload_finisher.py, notify.py)
  • Records milestones (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 pipeline

Test plan

  • Verify breadcrumbs are created for successful BA processing and notification
  • Verify error breadcrumbs are recorded on retryable errors, timeouts, and lock failures
  • Confirm no impact on existing BA processing behavior (breadcrumb calls are fire-and-forget)

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_task events from BundleAnalysisProcessorTask and BundleAnalysisNotifyTask.

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.

@thomasrockhu-codecov thomasrockhu-codecov changed the base branch from main to tomhu/revert-pipeline-context February 19, 2026 13:05
@sentry
Copy link

sentry bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.23%. Comparing base (9b95e6b) to head (9cf42b5).
⚠️ Report is 2 commits behind head on tomhu/revert-pipeline-context.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/worker/tasks/bundle_analysis_processor.py 93.33% 1 Missing ⚠️
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              
Flag Coverage Δ
workerintegration 58.65% <81.48%> (+0.03%) ⬆️
workerunit 90.29% <92.59%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link

codecov-notifications bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/worker/tasks/bundle_analysis_processor.py 93.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

milestone=Milestones.PROCESSING_UPLOAD,
upload_ids=[upload.id_],
error=Errors.TASK_TIMED_OUT,
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

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>
@thomasrockhu-codecov thomasrockhu-codecov force-pushed the tomhu/ba-upload-breadcrumbs branch from e3efc05 to 9cf42b5 Compare February 19, 2026 13:19
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

}

self._call_upload_breadcrumb_task(
milestone=Milestones.LOCK_ACQUIRING, **bc_kwargs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant