Skip to content

feat(worker): Filter test analytics by commit timestamp#789

Open
sentry[bot] wants to merge 1 commit intomainfrom
seer/feat/ta-timestamp-filter
Open

feat(worker): Filter test analytics by commit timestamp#789
sentry[bot] wants to merge 1 commit intomainfrom
seer/feat/ta-timestamp-filter

Conversation

@sentry
Copy link
Copy Markdown
Contributor

@sentry sentry bot commented Mar 31, 2026

Fixes WORKER-VPM. The issue was that: get_test_status calls get_pr_comment_agg without lower_bound_timestamp, forcing unoptimized TimescaleDB query.

  • Modified get_test_status to accept an optional lower_bound_timestamp parameter.
  • Passed the new lower_bound_timestamp to get_pr_comment_agg to filter test analytics data.
  • Updated the notify_upload_complete task to pass commit.timestamp when calling get_test_status.
  • This ensures that test analytics data considered for a commit's status is relevant to that commit's timeline, improving accuracy.

This fix was generated by Seer in Sentry, triggered by Tom Hu. 👁️ Run ID: 12643372

Not quite right? Click here to continue debugging with Seer.

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

Medium Risk
Touches the notification gating path by changing how Test Analytics pass/fail is computed, which could alter when notifications are skipped if timestamps are wrong or missing. Otherwise the change is small and primarily affects query scope/performance.

Overview
Test Analytics status checks are now time-bounded. get_test_status accepts an optional lower_bound_timestamp and forwards it to get_pr_comment_agg so Timescale queries can ignore older rows.

NotifyTask.run_impl_within_lock now passes commit.timestamp into get_test_status, ensuring pass/fail status (and the decision to skip notifications on failures) is computed only from data at/after the commit’s timestamp.

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

Copy link
Copy Markdown

@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 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

any_failures, all_tests_passed = get_test_status(commit.repoid, commit.commitid)
any_failures, all_tests_passed = get_test_status(
commit.repoid, commit.commitid, commit.timestamp
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Future commit dates hide failing tests

Medium Severity

get_test_status now filters TA rows using commit.timestamp. If a commit has a future-skewed Git timestamp, all uploaded test rows can fall before that bound and be excluded. This makes any_failures false and allows notifications to proceed even when tests actually failed.

Additional Locations (1)
Fix in Cursor Fix in Web

@sentry
Copy link
Copy Markdown
Contributor Author

sentry bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.25%. Comparing base (d005280) to head (8b0e4a3).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #789   +/-   ##
=======================================
  Coverage   92.25%   92.25%           
=======================================
  Files        1305     1305           
  Lines       47994    47995    +1     
  Branches     1636     1636           
=======================================
+ Hits        44276    44277    +1     
  Misses       3407     3407           
  Partials      311      311           
Flag Coverage Δ
workerintegration 58.58% <100.00%> (+<0.01%) ⬆️
workerunit 90.38% <100.00%> (+<0.01%) ⬆️

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
Copy Markdown

codecov-notifications bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

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.

0 participants