Skip to content
Draft
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
28 changes: 9 additions & 19 deletions apps/worker/tasks/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@

log = logging.getLogger(__name__)

GENERIC_TA_ERROR_MSG = "Test Analytics upload error: We are unable to process any of the uploaded JUnit XML files. Please ensure your files are in the right format."


class NotifyTask(BaseCodecovTask, name=notify_task_name):
def run_impl(
Expand Down Expand Up @@ -123,16 +121,14 @@ def run_impl(
**kwargs,
)
except LockRetry as err:
(
log.info(
"Not notifying because there is another notification already happening",
extra={
"repoid": repoid,
"commitid": commitid,
"error_type": type(err),
"lock_acquired": lock_acquired,
},
),
log.info(
"Not notifying because there is another notification already happening",
extra={
"repoid": repoid,
"commitid": commitid,
"error_type": type(err),
"lock_acquired": lock_acquired,
},
)
self.log_checkpoint(UploadFlow.NOTIF_LOCK_ERROR)
self._call_upload_breadcrumb_task(
Expand Down Expand Up @@ -223,9 +219,6 @@ def run_impl_within_lock(
commit = self._fetch_commit(db_session, repoid, commitid)
any_failures, all_tests_passed = get_test_status(commit.repoid, commit.commitid)

# TA error messaging is disabled for now (too noisy for customers)
ta_error_msg = None

if any_failures and not all_tests_passed:
self._call_upload_breadcrumb_task(
commit_sha=commit.commitid,
Expand Down Expand Up @@ -285,7 +278,6 @@ def run_impl_within_lock(
installation_name_to_use=installation_name_to_use,
empty_upload=empty_upload,
all_tests_passed=all_tests_passed,
ta_error_msg=ta_error_msg,
milestone=milestone,
)

Expand Down Expand Up @@ -510,7 +502,6 @@ def _prepare_and_send_notifications(
installation_name_to_use,
empty_upload,
all_tests_passed,
ta_error_msg,
milestone,
):
"""Prepare comparison context and dispatch all notifications."""
Expand Down Expand Up @@ -545,7 +536,7 @@ def _prepare_and_send_notifications(
return {
"notified": False,
"notifications": None,
"reason": "User doesnt want notifications warning them that current head differs from pull request most recent head.",
"reason": "commit_not_pull_head",
}

base_report = (
Expand Down Expand Up @@ -594,7 +585,6 @@ def _prepare_and_send_notifications(
repository_service,
empty_upload,
all_tests_passed=all_tests_passed,
test_results_error=ta_error_msg,
installation_name_to_use=installation_name_to_use,
gh_is_using_codecov_commenter=self.is_using_codecov_commenter(
repository_service
Expand Down
2 changes: 1 addition & 1 deletion apps/worker/tasks/tests/unit/test_notify_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def test_simple_call_no_notifications_commit_differs_from_pulls_head(
assert result == {
"notified": False,
"notifications": None,
"reason": "User doesnt want notifications warning them that current head differs from pull request most recent head.",
"reason": "commit_not_pull_head",
}
mocked_should_send_notifications.assert_called_with(
UserYaml({"codecov": {"notify": {"manual_trigger": True}}}),
Expand Down
Loading