Extract duplicated command hash logic into a shared helper in bot.py #31

Closed
opened 2026-02-20 06:50:09 +00:00 by cal · 1 comment
Owner

Description

bot.py:204-254 and bot.py:256-297_should_sync_commands and _save_command_hash contain an identical ~35-line block that builds command data list and computes an MD5 hash. DRY violation.

File Locations

  • bot.py:204-254
  • bot.py:256-297

Labels

tech-debt

Priority

low

## Description `bot.py:204-254` and `bot.py:256-297` — `_should_sync_commands` and `_save_command_hash` contain an identical ~35-line block that builds command data list and computes an MD5 hash. DRY violation. ## File Locations - `bot.py:204-254` - `bot.py:256-297` ## Labels tech-debt ## Priority low
cal added the
ai-working
status/in-progress
labels 2026-03-05 06:31:26 +00:00
cal removed the
status/in-progress
label 2026-03-05 06:32:24 +00:00
Author
Owner

Opened PR #65: #65

Extracted the duplicated ~35-line block into a new _compute_command_hash() helper method. Both _should_sync_commands and _save_command_hash now delegate to it. Net −30 lines in bot.py. 924 tests pass.

Opened PR #65: https://git.manticorum.com/cal/major-domo-v2/pulls/65 Extracted the duplicated ~35-line block into a new `_compute_command_hash()` helper method. Both `_should_sync_commands` and `_save_command_hash` now delegate to it. Net −30 lines in `bot.py`. 924 tests pass.
cal added
status/pr-open
ai-pr-opened
and removed
ai-working
labels 2026-03-05 06:32:37 +00:00
cal closed this issue 2026-03-07 03:28:29 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-v2#31
No description provided.