Skip to content

cleanup: remove dead code and improve readability in NotifyTask [5/6]#698

Draft
thomasrockhu-codecov wants to merge 1 commit intorefactor/notify-task-breakup-2from
refactor/notify-task-cleanup
Draft

cleanup: remove dead code and improve readability in NotifyTask [5/6]#698
thomasrockhu-codecov wants to merge 1 commit intorefactor/notify-task-breakup-2from
refactor/notify-task-cleanup

Conversation

@thomasrockhu-codecov
Copy link
Contributor

Summary

Cleanup PR stacked on the NotifyTask refactoring PRs (#696, #697). Addresses readability issues and dead code in notify.py.

Changes

  • Remove unused GENERIC_TA_ERROR_MSG constant — defined on module level but never referenced anywhere in the codebase
  • Fix tuple-wrapped log.info call in run_impl — the trailing comma and outer parentheses accidentally created a single-element tuple wrapping the log call ((log.info(...),)), which works but is confusing to read
  • Normalize verbose reason string — replaced the sentence-style reason "User doesnt want notifications warning them that current head differs from pull request most recent head." with the snake_case key "commit_not_pull_head" to match all other reason strings in the file (e.g. "no_head_report", "test_failures", "no_valid_bot")
  • Remove dead ta_error_msg variable — the variable was always None (with a comment saying "TA error messaging is disabled for now") and was threaded through _prepare_and_send_notifications to submit_third_party_notifications. Since test_results_error already defaults to None, we can skip the plumbing entirely.

Test plan

  • ruff check and ruff format pass
  • Existing tests pass in CI (updated test assertion for new reason string)

Made with Cursor

- Remove unused GENERIC_TA_ERROR_MSG constant (never referenced)
- Fix tuple-wrapped log.info call in run_impl (accidental trailing comma)
- Normalize verbose reason string to snake_case "commit_not_pull_head"
- Remove dead ta_error_msg variable (always None) and parameter threading
- Update test to match new reason string

Co-authored-by: Cursor <cursoragent@cursor.com>
@thomasrockhu-codecov thomasrockhu-codecov force-pushed the refactor/notify-task-cleanup branch from 03b6632 to 4739a32 Compare February 8, 2026 10:16
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