Skip to content

Conversation

@thomasrockhu-codecov
Copy link
Contributor

@thomasrockhu-codecov thomasrockhu-codecov commented Nov 19, 2025

Makes uploads retriable even if there is no error. This helps us retry the upload if there was another issue that isn't caught by our system.

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

Enables resending uploads from the admin UI regardless of failure status, adds a safeguard when upload_ids is None, and updates tests accordingly.

  • Admin (upload_breadcrumbs)
    • Always show resend_upload_button and enable resend_upload_action regardless of failure state.
    • Remove failure checks in resend_upload_view; proceed to resend for any breadcrumb.
    • Add _resend_upload guard: return error if breadcrumb.upload_ids is None.
  • Tests
    • Update expectations to always render resend button/action.
    • Change non-failed resend test to expect success instead of error.
    • Add assertions for success messaging and commit short SHA presence.

Written by Cursor Bugbot for commit 3727ba0. This will update automatically on new commits. Configure here.

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.

Bug: TypeError when resending upload with null upload_ids

The _resend_upload method crashes when breadcrumb.upload_ids is None because it attempts len(breadcrumb.upload_ids) at line 695 and passes it to filter(id__in=breadcrumb.upload_ids) at line 700. Both operations fail with TypeError on None values. The removed _is_failed_upload check previously prevented this by requiring upload_ids to be present. The method needs validation to handle breadcrumbs without upload IDs before attempting these operations.

libs/shared/shared/django_apps/upload_breadcrumbs/admin.py#L694-L700

log.info(
f"Collecting upload data for {len(breadcrumb.upload_ids)} uploads",
extra={"upload_ids": breadcrumb.upload_ids},
)
uploads = (
ReportSession.objects.filter(id__in=breadcrumb.upload_ids)

Fix in Cursor Fix in Web


@codspeed-hq
Copy link

codspeed-hq bot commented Nov 19, 2025

CodSpeed Performance Report

Merging #578 will not alter performance

Comparing th/make-uploads-retriable (3727ba0) with main (aa50839)1

Summary

✅ 9 untouched

Footnotes

  1. No successful run was found on main (5d93f94) during the generation of this report, so aa50839 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@sentry
Copy link

sentry bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.83%. Comparing base (061ed90) to head (3727ba0).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...red/shared/django_apps/upload_breadcrumbs/admin.py 40.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #578      +/-   ##
==========================================
- Coverage   93.85%   93.83%   -0.02%     
==========================================
  Files        1284     1284              
  Lines       46432    46417      -15     
  Branches     1524     1522       -2     
==========================================
- Hits        43578    43557      -21     
- Misses       2545     2550       +5     
- Partials      309      310       +1     
Flag Coverage Δ
apiunit 96.55% <ø> (+<0.01%) ⬆️
sharedintegration 38.75% <0.00%> (+0.01%) ⬆️
sharedunit 88.76% <40.00%> (-0.03%) ⬇️
workerintegration 58.59% <ø> (+<0.01%) ⬆️
workerunit 91.14% <ø> (-0.04%) ⬇️

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 Nov 19, 2025

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...red/shared/django_apps/upload_breadcrumbs/admin.py 40.00% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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.

Bug: TypeError when resending breadcrumbs with null upload_ids

The _resend_upload method calls len(breadcrumb.upload_ids) at line 695 and filters with id__in=breadcrumb.upload_ids at line 700, but upload_ids can be None (as seen when creating breadcrumbs at line 779). Removing the _is_failed_upload validation allows resending breadcrumbs with null upload_ids, causing a TypeError when attempting to get the length of or filter by None. The method needs null checks before accessing upload_ids.

libs/shared/shared/django_apps/upload_breadcrumbs/admin.py#L693-L700

log.info(
f"Collecting upload data for {len(breadcrumb.upload_ids)} uploads",
extra={"upload_ids": breadcrumb.upload_ids},
)
uploads = (
ReportSession.objects.filter(id__in=breadcrumb.upload_ids)

Fix in Cursor Fix in Web


@thomasrockhu-codecov thomasrockhu-codecov requested a review from a team November 19, 2025 19:57
return (
False,
"This breadcrumb has no associated upload IDs. It may be a resend breadcrumb that hasn't been processed yet.",
)
Copy link

Choose a reason for hiding this comment

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

Bug: Empty upload IDs list not handled properly

The check if breadcrumb.upload_ids is None only catches None values but not empty lists []. Since upload_ids can be either None or an empty list (both representing no upload IDs), the condition should be if not breadcrumb.upload_ids to handle both cases consistently. Currently, empty lists fall through to a less helpful error message at line 720 instead of the clearer message about breadcrumbs that haven't been processed yet.

Fix in Cursor Fix in Web

Copy link
Contributor

@maxweng-sentry maxweng-sentry left a comment

Choose a reason for hiding this comment

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

I think this looks good. Was wondering if it might be good to allow retried uploads when there aren't upload_ids tied to it though. Maybe like searching the commit from the db?

@thomasrockhu-codecov thomasrockhu-codecov added this pull request to the merge queue Nov 19, 2025
Merged via the queue into main with commit 6d14cbf Nov 19, 2025
53 of 55 checks passed
@thomasrockhu-codecov thomasrockhu-codecov deleted the th/make-uploads-retriable branch November 19, 2025 22:05
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.

3 participants