Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/worker/helpers/ta_status.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
from datetime import datetime

from django.conf import settings

from services.test_analytics.ta_timeseries import get_pr_comment_agg


def get_test_status(repo_id: int, commit_sha: str) -> tuple[bool, bool]:
def get_test_status(
repo_id: int,
commit_sha: str,
lower_bound_timestamp: datetime | None = None,
) -> tuple[bool, bool]:
if not settings.TA_TIMESERIES_ENABLED:
return False, False

pr_comment_agg = get_pr_comment_agg(repo_id, commit_sha)
pr_comment_agg = get_pr_comment_agg(repo_id, commit_sha, lower_bound_timestamp)
failed = pr_comment_agg.get("failed", 0)
passed = pr_comment_agg.get("passed", 0)

Expand Down
4 changes: 3 additions & 1 deletion apps/worker/tasks/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ def run_impl_within_lock(
commit: Commit = commits_query.first()
assert commit, "Commit not found in database."

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
)

# This functionality is disabled for now because it's too noisy for customers
ta_error_msg = None
Expand Down
Loading