refactor: extract TIER_NAMES/TIER_COLORS to shared constants module #146
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
ai-working
bug
enhancement
feature
in-queue
performance
security
tech-debt
todo
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-discord#146
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Tier name mappings are triplicated:
cogs/refractor.py:29asTIER_NAMEShelpers/refractor_notifs.py:18asTIER_NAMEScogs/players.py:474asREFRACTOR_TIER_NAMESTIER_COLORSis duplicated betweencogs/refractor.pyandhelpers/refractor_notifs.pywith intentionally different values (status view vs notification colors), but this is undocumented.The existing divergence test (
test_refractor_commands.py:418) only checks parity between the first two —cogs/players.pycopy is untested.Fix
Extract a single
helpers/refractor_constants.pymodule that owns all shared refractor constants. Each consumer imports from there. Document the intentional color differences if they exist for a reason.Impact
Low risk today, but divergence is inevitable as the system grows. Classic tech debt — cheap to fix now, expensive later.
PR #155 opens the fix: #155
Created
helpers/refractor_constants.pywithTIER_NAMES,STATUS_TIER_COLORS(status view), andNOTIF_TIER_COLORS(notifications). All three consumers now import from there. The intentional color differences are documented. Divergence test updated to covercogs/players.py.