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
Draft
cleanup: remove dead code and improve readability in NotifyTask [5/6]#698thomasrockhu-codecov wants to merge 1 commit intorefactor/notify-task-breakup-2from
thomasrockhu-codecov wants to merge 1 commit intorefactor/notify-task-breakup-2from
Conversation
- 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>
03b6632 to
4739a32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cleanup PR stacked on the NotifyTask refactoring PRs (#696, #697). Addresses readability issues and dead code in
notify.py.Changes
GENERIC_TA_ERROR_MSGconstant — defined on module level but never referenced anywhere in the codebaselog.infocall inrun_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"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")ta_error_msgvariable — the variable was alwaysNone(with a comment saying "TA error messaging is disabled for now") and was threaded through_prepare_and_send_notificationstosubmit_third_party_notifications. Sincetest_results_erroralready defaults toNone, we can skip the plumbing entirely.Test plan
ruff checkandruff formatpassMade with Cursor