Commit Graph

269 Commits

Author SHA1 Message Date
cal
269429254f Merge pull request 'fix: targeted trailing slashes for POST endpoints (hotfix)' (#74) from fix/trailing-slash-307-redirect into main
All checks were successful
Build Docker Image / build (push) Successful in 52s
Reviewed-on: #74
2026-03-09 22:52:29 +00:00
Cal Corum
f6a25aa16d fix: use targeted trailing slashes instead of universal (hotfix)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m7s
Reverts universal trailing slash in _build_url which broke custom_commands
endpoints (401 on /execute/). Instead, add trailing slashes only to the
two batch POST endpoints (plays/, decisions/) that need them to avoid
307 redirects dropping request bodies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:50:58 -05:00
cal
52ab92523c Merge pull request 'fix: add trailing slashes to prevent 307 redirects dropping POST bodies' (#73) from fix/trailing-slash-307-redirect into main
All checks were successful
Build Docker Image / build (push) Successful in 53s
Reviewed-on: #73
2026-03-09 22:26:52 +00:00
Cal Corum
9379ba587a fix: add trailing slashes to API URLs to prevent 307 redirects dropping POST bodies
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m13s
The FastAPI server returns 307 redirects for URLs without trailing slashes.
aiohttp follows these redirects but converts POST to GET, silently dropping
the request body. This caused play-by-play and decision data from
/submit-scorecard to never be persisted to the database despite the API
returning success.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:25:08 -05:00
cal
b3b8cd9683 Merge pull request 'fix: show validation errors in trade embed Quick Status' (#70) from fix/trade-embed-errors-and-cleanup into main
All checks were successful
Build Docker Image / build (push) Successful in 50s
Reviewed-on: #70
2026-03-08 16:29:06 +00:00
Cal Corum
58fe9f22de fix: trade validation now checks against next week's projected roster
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m5s
validate_trade() was passing next_week=None to each team's
validate_transaction(), which skipped load_existing_transactions()
entirely. Trades were validated against the current roster only,
ignoring pending /dropadd transactions for next week.

Now auto-fetches current week from league_service and passes
next_week=current_week+1, matching /dropadd validation behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:27:03 +00:00
Cal Corum
e98a658fde fix: show actual validation errors in trade embed Quick Status
Quick Status previously only showed "X errors found" with no details.
Now lists each error and suggestion inline. Also stripped all emoji
from embed titles, field names, values, buttons, and messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:27:03 +00:00
cal
111a6cf338 Merge pull request 'fix: replace create_item_in_table placeholder with direct endpoint call (#30)' (#69) from ai/major-domo-v2#30 into main
All checks were successful
Build Docker Image / build (push) Successful in 57s
Reviewed-on: #69
2026-03-07 03:25:08 +00:00
Cal Corum
18ae65a8e2 fix: replace create_item_in_table placeholder with direct endpoint call (#30)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m10s
Remove the generic placeholder method from BaseService and replace the
single call site in CustomCommandsService.get_or_create_creator with a
direct client.post("custom_commands/creators", ...) call, consistent
with how _update_creator_stats and _update_creator_info already work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 14:04:05 -06:00
cal
f7a65706a1 Merge pull request 'next-release' (#51) from next-release into main
All checks were successful
Build Docker Image / build (push) Successful in 1m0s
Reviewed-on: #51
2026-03-01 20:56:38 +00:00
cal
46afbf25e0 Merge pull request 'fix: roster validation includes org affiliate transactions' (#50) from fix/roster-validation-org-affiliates into next-release
All checks were successful
Build Docker Image / build (pull_request) Successful in 4m10s
Reviewed-on: #50
2026-03-01 20:50:21 +00:00
Cal Corum
aa27769ed6 fix: roster validation now includes org affiliate transactions (closes #49)
load_existing_transactions only queried for the base team abbreviation
(e.g. "POR"), missing trades involving MiL/IL affiliates ("PORMIL",
"PORIL"). This caused false "too many players" errors when a pending
trade would have cleared a roster spot.

- get_team_transactions now accepts Union[str, List[str]] for team_abbrev
- load_existing_transactions queries all org affiliates [BASE, BASEMiL, BASEIL]
- Added 5 tests covering the fix and backwards compatibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:45:21 -06:00
cal
a80addc742 Merge pull request 'next-release' (#47) from next-release into main
All checks were successful
Build Docker Image / build (push) Successful in 46s
Reviewed-on: #47
2026-02-22 22:33:35 +00:00
cal
22c7f841e8 Merge branch 'main' into next-release
All checks were successful
Build Docker Image / build (pull_request) Successful in 48s
2026-02-22 22:31:07 +00:00
cal
e280928b4d Merge pull request 'feat: include current week number in weekly-info channel post' (#46) from feat/weekly-info-current-week into next-release
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m10s
Reviewed-on: #46
2026-02-22 22:22:00 +00:00
Cal Corum
b7a88844b6 feat: include current week number in weekly-info channel post
The #weekly-info message already shows season and game times but not
which week it is, making managers check elsewhere for that context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 16:20:08 -06:00
cal
1df9527697 Merge pull request 'fix: use explicit America/Chicago timezone for freeze/thaw scheduling' (#45) from fix/utc-timezone-scheduling into next-release
Reviewed-on: #45
2026-02-22 22:16:54 +00:00
Cal Corum
8a1a957c2a fix: use explicit America/Chicago timezone for freeze/thaw scheduling
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m16s
The production container has ambiguous timezone config — /etc/localtime
points to Etc/UTC but date reports CST. The transaction freeze/thaw task
used datetime.now() (naive, relying on OS timezone), causing scheduling
to fire at unpredictable wall-clock times.

- Add utils/timezone.py with centralized Chicago timezone helpers
- Fix tasks/transaction_freeze.py to use now_chicago() for scheduling
- Fix utils/logging.py timestamp to use proper UTC-aware datetime
- Add 14 timezone utility tests
- Update freeze task tests to mock now_chicago instead of datetime

Closes #43

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 16:00:22 -06:00
Cal Corum
a668a3505c docs: add release workflow section to CLAUDE.md
Documents the next-release staging branch pattern used for
batching changes before merging to main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 15:59:07 -06:00
cal
12fe600e83 Merge pull request 'next-release' (#42) from next-release into main
All checks were successful
Build Docker Image / build (push) Successful in 50s
Reviewed-on: #42
2026-02-20 20:28:15 +00:00
Cal Corum
d1a6b57ccd fix: scorebug stale data, win probability parsing, and read-failure tolerance (closes #39, #40)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m14s
#40: ScorecardTracker cached data in memory at startup — background task never
saw newly published scorecards. Fixed by reloading from disk on every read.

#39: Win percentage defaulted to 50% when unavailable, showing a misleading
50/50 bar. Now defaults to None with "unavailable" message in embed. Parsing
handles decimal (0.75), percentage string, and empty values. Also fixed
orientation bug where win% was always shown as home team's even when the
sheet reports the away team as the leader.

Additionally: live scorebug tracker now distinguishes between "all games
confirmed final" and "sheet read failures" — transient Google Sheets errors
no longer hide the live scores channel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:14:23 -06:00
Cal Corum
67f9c734b0 Merge branch 'fix/quick-wins-batch' into next-release 2026-02-20 13:14:49 -06:00
Cal Corum
9cd577cba1 fix: batch quick-wins — 4 issues resolved (closes #37, #27, #25, #38)
- #37: Fix stale comment in transaction_freeze.py referencing wrong moveid format
- #27: Change config.testing default from True to False (was masking prod behavior)
- #25: Replace deprecated asyncio.get_event_loop() with get_running_loop()
- #38: Replace naive datetime.now() with timezone-aware datetime.now(UTC) across
  7 source files and 4 test files to prevent subtle timezone bugs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:48:16 -06:00
Cal Corum
f64fee8d2e fix: remove 226 unused imports across the codebase (closes #33)
Ran `ruff check --select F401 --fix` to auto-remove 221 unused imports,
manually removed 4 unused `import discord` from package __init__.py files,
and fixed test import for DISAPPOINTMENT_TIERS to reference canonical location.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:35:04 -06:00
Cal Corum
a44d037611 Merge branch 'fix/security-issues' into next-release 2026-02-20 10:39:47 -06:00
Cal Corum
f4be20afb3 fix: address 7 security issues across the codebase
- Remove hardcoded Giphy API key from config.py, load from env var (#19)
- URL-encode query parameters in APIClient._add_params (#20)
- URL-encode Giphy search phrases before building request URLs (#21)
- Replace internal exception details with generic messages to users (#22)
- Replace all bare except: with except Exception: (#23)
- Guard interaction.guild access in has_player_role (#24)
- Replace MD5 with SHA-256 for command change detection hash (#32)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 09:54:53 -06:00
Cal Corum
5af62171da chore: remove obsolete MoveAction test stubs
Closes #16

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 22:28:47 -06:00
Cal Corum
9e43ffa1c1 feat: add local deploy script for production deploys
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m13s
Automates the SSH-to-akamai deploy workflow: pulls latest image,
restarts the container, and verifies health. Includes pre-deploy
checks (dirty git warning, confirmation prompt) and prints a
rollback command if the image changed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 21:45:56 -06:00
cal
eaaa9496a3 Merge pull request 'fix: ContextualLogger crashes when callers pass exc_info=True' (#14) from fix/contextual-logger-exc-info into main
All checks were successful
Build Docker Image / build (push) Successful in 48s
Reviewed-on: #14
2026-02-20 03:26:39 +00:00
cal
9db128bd27 Merge branch 'main' into fix/contextual-logger-exc-info
All checks were successful
Build Docker Image / build (pull_request) Successful in 46s
2026-02-20 03:25:32 +00:00
Cal Corum
62b058bddf test: fix weather test expecting 4 embed fields instead of 5
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m30s
The Stadium Image field was added to the weather embed but the
test_full_weather_workflow assertion wasn't updated to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 21:19:31 -06:00
Cal Corum
313c3f857b fix: ContextualLogger crashes when callers pass exc_info=True
ContextualLogger methods forwarded all **kwargs as extra={} to Python's
standard logger. When callers passed exc_info=True, it landed in the
extra dict and Python's LogRecord raised KeyError("Attempt to overwrite
'exc_info' in LogRecord") since exc_info is a reserved attribute.

This caused /submit-scorecard to crash after game data was already
posted, masking the original error and preventing proper rollback.

Fix: Extract exc_info and stack_info from kwargs before passing as extra,
forwarding them as proper logging parameters instead. Also fix direct
callers in submit_scorecard.py and views/players.py to use error=e.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 21:19:06 -06:00
cal
42b7369b17 Merge pull request 'ci: Fix act_runner auth for composite actions' (#13) from ci/fix-action-auth into main
All checks were successful
Build Docker Image / build (push) Successful in 48s
Reviewed-on: #13
2026-02-18 19:49:31 +00:00
Cal Corum
4137204d9d Fix act_runner auth: short-form local actions + full GitHub URLs
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m17s
DEFAULT_ACTIONS_URL=self requires local actions use short form
(cal/gitea-actions/...) so the runner passes its auth token, and
GitHub actions use full URLs (https://github.com/...) to bypass
local resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 13:32:15 -06:00
cal
e0d86785a6 Merge pull request 'fix: Use Gitea API for CI tag creation' (#12) from fix/ci-tag-release-api into main
All checks were successful
Build Docker Image / build (push) Successful in 48s
Reviewed-on: #12
2026-02-17 23:28:52 +00:00
Cal Corum
5745a2334a fix: use Gitea API for tag creation to avoid branch protection failures
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m10s
The git push approach fails on protected main branches. Switch to the
Gitea REST API (POST /repos/{repo}/tags) matching the fix already
applied to Paper Dynasty's workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:27:17 -06:00
cal
af2fbc0234 Merge pull request 'ci: Switch to CalVer (YYYY.MM.BUILD) with auto-generated versions' (#11) from ci/calver into main
Some checks failed
Build Docker Image / build (push) Failing after 48s
Reviewed-on: #11
2026-02-17 23:05:16 +00:00
Cal Corum
c030a2835e ci: Switch to CalVer (YYYY.MM.BUILD) with auto-generated versions
All checks were successful
Build Docker Image / build (pull_request) Successful in 47s
Remove manual semver validation from PR checks. Versions are now
auto-generated on merge to main by counting existing monthly tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:02:59 -06:00
cal
d889106c4b Merge pull request 'ci: Switch to CalVer versioning' (#10) from ci/calver into main
Some checks failed
Build Docker Image / build (push) Failing after 58s
Reviewed-on: #10
2026-02-17 22:31:50 +00:00
Cal Corum
d4dbe8f019 ci: Switch to CalVer (YYYY.MM.BUILD) with auto-generated versions
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m11s
Remove manual semver validation from PR checks. Versions are now
auto-generated on merge to main by counting existing monthly tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 16:29:24 -06:00
cal
4eddcd112f Merge pull request 'fix: roster validation includes pending trades, fixes sWAR field' (#9) from bugfix/roster-validation-fixes into main
All checks were successful
Build Docker Image / build (push) Successful in 52s
Reviewed-on: #9
2026-02-16 05:00:31 +00:00
Cal Corum
c1ae955155 Bump version to 2.29.9
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m21s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 22:58:55 -06:00
Cal Corum
f29cccd3ab fix: roster validation now includes pending trades and fixes sWAR field name
Some checks failed
Build Docker Image / build (pull_request) Failing after 15s
RosterValidation used total_wara instead of total_sWAR, causing /legal
to silently fail. Transaction embed and submit validation now pass
next_week to validate_transaction() so pending trades are included in
roster count projections. Moved lazy imports to top-level in
transaction_embed.py. Fixed dropadd integration test fixtures that
exceeded sWAR cap.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 22:57:06 -06:00
cal
25ba45e529 Merge pull request 'Fix thaw report channel lookup' (#8) from fix/thaw-report-channel into main
All checks were successful
Build Docker Image / build (push) Successful in 49s
Reviewed-on: #8
2026-02-16 00:02:29 +00:00
Cal Corum
67de736581 Add production environment details to CLAUDE.md
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m8s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 18:01:55 -06:00
Cal Corum
bf2f3005c3 Bump version to 2.29.8, fix stale deploy script reference in CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 18:01:55 -06:00
Cal Corum
23d8129b80 Fix thaw report posting to use channel ID instead of nonexistent channel names
The Saturday thaw report was silently failing because it searched for
channels named 'bot-admin', 'admin', or 'bot-logs' which don't exist.
Now uses a configurable channel ID (overridable via THAW_REPORT_CHANNEL_ID).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 18:01:39 -06:00
cal
8a4c6e459d Merge pull request 'fix: add stadium image link to weather command' (#7) from bugfix/weather-image-link into main
All checks were successful
Build Docker Image / build (push) Successful in 47s
Reviewed-on: #7
2026-02-13 20:55:42 +00:00
Discord Bot
4db02a516a fix: add stadium image link to weather command
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m11s
Add clickable link field to weather embed as fallback for Discord
caching issues. Users can click the link to view the stadium image
in their browser if the embedded image fails to render.

Changes:
- Added "Stadium Image" field with direct link to team.stadium
- Bump version to 2.29.7

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 20:52:10 +00:00
cal
cb6be23b3b Merge pull request 'chore: Compress CLAUDE.md from 775 to 67 lines' (#6) from chore/compress-claude-md into main
All checks were successful
Build Docker Image / build (push) Successful in 49s
Reviewed-on: #6
2026-02-13 20:41:17 +00:00