Commit Graph

235 Commits

Author SHA1 Message Date
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
cal
8693576f1c Update .gitea/workflows/docker-build.yml
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m12s
2026-02-13 20:36:59 +00:00
cal
c0619e78a6 Update VERSION
Some checks failed
Build Docker Image / build (pull_request) Failing after 1m2s
2026-02-13 20:26:47 +00:00
Cal Corum
2c6cc499fa Audit and compress CLAUDE.md from 775 to 67 lines
Some checks failed
Build Docker Image / build (pull_request) Failing after 15s
Remove historical changelogs, redundant documentation references,
and content already covered by parent/sub-directory CLAUDE.md files.
Update deployment section to reflect Gitea Actions workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:24:22 -06:00
cal
d40ddb76be Merge pull request 'ci: switch Docker build cache to type=registry' (#5) from ci/registry-cache into main
All checks were successful
Build Docker Image / build (push) Successful in 4m7s
2026-02-11 22:14:23 +00:00
cal
d72595cef7 ci: switch Docker build cache from type=gha to type=registry
Some checks failed
Build Docker Image / build (pull_request) Failing after 16s
The gha cache backend silently fails on Gitea Actions due to Docker
networking issues between the Buildx builder container and the
act_runner cache server. Registry-based caching stores layers on
Docker Hub, which is more reliable for self-hosted runners.
2026-02-11 22:12:21 +00:00
cal
0ed0446607 Merge pull request 'Raise exception on spreadsheet errors instead of silently skipping' (#4) from fix/validate-spreadsheet-decision-data into main
All checks were successful
Build Docker Image / build (push) Successful in 44s
Reviewed-on: #4
2026-02-06 13:55:52 +00:00
cal
085e76134b Update VERSION
All checks were successful
Build Docker Image / build (pull_request) Successful in 34s
2026-02-06 07:54:33 -06:00
Cal Corum
1d08dc1755 Raise exception on spreadsheet errors instead of silently skipping
**Problem:**
The _is_spreadsheet_error() check was logging a warning and silently skipping
rows with formula errors (#REF!, #N/A, etc.). This could lead to incomplete
game data being submitted without the user knowing.

**Solution:**
Raise SheetsException immediately when spreadsheet errors are detected,
providing:
- Exact row number and field name
- Actual error value found in the cell
- Common error type explanations
- Clear action required to fix

**Impact:**
- Users get immediate feedback about spreadsheet errors
- No partial/incomplete data submitted to API
- Clear instructions on what needs to be fixed
- Better data integrity

**Example Error Message:**
```
 Spreadsheet Error Detected

**Location:** Row 7, Column 'pitcher_id'
**Value Found:** `#REF!`

This cell contains a formula error that must be fixed before submission.

**Action Required:** Fix cell pitcher_id in row 7 and resubmit.
```

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 07:54:33 -06:00
cal
ff3f9a0d1d Merge pull request 'fix: Validate and sanitize pitching decision data from Google Sheets' (#3) from fix/validate-spreadsheet-decision-data into main
All checks were successful
Build Docker Image / build (push) Successful in 1m10s
Reviewed-on: #3
2026-02-06 13:38:36 +00:00
cal
2be93dfc8a Update VERSION
All checks were successful
Build Docker Image / build (pull_request) Successful in 2m32s
2026-02-06 13:35:49 +00:00
Cal Corum
92eb9055f1 fix: Validate and sanitize pitching decision data from Google Sheets
Some checks failed
Build Docker Image / build (pull_request) Failing after 19s
Added robust validation to handle spreadsheet errors and invalid data
when reading pitching decisions from scorecards.

Problem:
- POST /api/v3/decisions was failing with 422 errors
- Google Sheets cells containing "#N/A" were passed directly to API
- API correctly rejected invalid team_id values like "#N/A" string
- No validation of integer fields or required fields

Root Cause:
- sheets_service.py:read_pitching_decisions() read values without
  validation or type checking
- Spreadsheet formula errors (#N/A, #REF!, etc.) passed through
- Invalid data types not caught until API validation failed

Solution:
1. Added _is_spreadsheet_error() to detect formula errors
2. Added _sanitize_int_field() to validate and convert integers
3. Enhanced read_pitching_decisions() to:
   - Detect and skip rows with spreadsheet errors
   - Validate integer fields (pitcher_id, team_id, etc.)
   - Ensure required fields (pitcher_id, team_id) are present
   - Log warnings for invalid data with row numbers
   - Only return valid, sanitized decision data

Impact:
- Prevents 422 errors from bad spreadsheet data
- Provides clear warnings in logs when data is invalid
- Gracefully skips invalid rows instead of crashing
- Helps identify scorecard data entry errors

Testing:
- Handles #N/A, #REF!, #VALUE!, #DIV/0! and other errors
- Converts "123.0" strings to integers correctly
- Validates required fields before sending to API
- Logs row numbers for debugging bad data

Production logs showed:
  "Input should be a valid integer, unable to parse string as
   an integer", input: "#N/A" for team_id field

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 21:44:06 -06:00
cal
e0af40804d Merge pull request 'chore-cc-update' (#2) from chore-cc-update into main
All checks were successful
Build Docker Image / build (push) Successful in 1m29s
Reviewed-on: #2
2026-02-06 02:46:46 +00:00
Cal Corum
42b9fa5df2 Fix /player autocomplete timeout by using current season only
All checks were successful
Build Docker Image / build (pull_request) Successful in 57s
The all_seasons=True parameter causes the API search query to take 15+ seconds,
exceeding Discord's 3-second autocomplete timeout. Changed to all_seasons=False
to search only the current season, which is fast enough.

Users can still access historical players by manually typing the name and using
the season parameter in the /player command.

Fixes: discord.errors.NotFound 404 (error code: 10062): Unknown interaction

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 20:45:09 -06:00
cal
0bc1ebc354 Update VERSION
All checks were successful
Build Docker Image / build (pull_request) Successful in 2m37s
2026-02-06 02:26:32 +00:00
cal
9f6db12d5a Update VERSION
Some checks failed
Build Docker Image / build (pull_request) Failing after 13s
2026-02-06 02:25:13 +00:00
Cal Corum
310e685670 Update format of /cc response 2026-02-05 20:23:49 -06:00
cal
9f11401f8b Merge pull request 'bugfix/injury-team-null-errors' (#1) from bugfix/injury-team-null-errors into main
All checks were successful
Build Docker Image / build (push) Successful in 1m44s
Reviewed-on: #1
2026-02-05 22:54:26 +00:00
cal
e03ba79fa5 Update VERSION
All checks were successful
Build Docker Image / build (pull_request) Successful in 2m54s
2026-02-05 22:50:06 +00:00
Cal Corum
ac3cbebb9f Remove unused .mcp.json config file
Some checks failed
Build Docker Image / build (pull_request) Failing after 18s
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 15:14:36 -06:00
Cal Corum
bfe78fb7ac Clean up legacy CI/CD files and one-time scripts
Removed legacy CI/CD infrastructure:
- GitLab CI config (.gitlab-ci.yml, .gitlab/ directory)
- Manual build scripts (build-and-push.sh, BUILD_AND_PUSH.md)
- Unused Dockerfile variant (Dockerfile.versioned)

Removed outdated documentation:
- AGENTS.md (superseded by comprehensive CLAUDE.md files)

Removed one-time recovery scripts:
- scripts/ directory (week 19 transaction recovery - completed)
- test_real_data.py (ad-hoc testing script)

Note: Runtime artifacts (.coverage, htmlcov/, __pycache__/, etc.) are already
properly excluded via .gitignore and were not tracked in git.

All CI/CD is now handled by .gitea/workflows/docker-build.yml

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 15:09:24 -06:00
Cal Corum
c7f55d79e3 Fix injury commands player.team None errors and add Gitea CI/CD
- Fix /injury roll and /injury clear commands crashing when player.team is None
- Add team fetching logic after search_players() for all injury commands
- The search_players() API endpoint returns team as ID only (not nested object)
- Added null checks and explicit team fetching using team_service.get_team()

- Add Gitea Actions workflow for automated Docker builds
- Implements semantic version validation on PRs
- Builds and pushes to Docker Hub on main branch merges
- Sends Discord notifications on success/failure
- Generates 3 image tags: latest, v{VERSION}, v{VERSION}-{COMMIT}

Fixes AttributeError: 'NoneType' object has no attribute 'roster_type'
Fixes AttributeError: 'NoneType' object has no attribute 'thumbnail'

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 14:16:22 -06:00
Cal Corum
ab8bfa115f Fix /injury roll command crash when player.team is None
The search_players() API endpoint returns team as an ID only (not nested object),
causing player.team to be None. Added null check before accessing team.thumbnail.

Fixes AttributeError: 'NoneType' object has no attribute 'thumbnail'

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 21:50:43 -06:00
Cal Corum
6935465210 Bump version to 2.29.2 2026-02-01 21:28:31 -06:00
Cal Corum
060287b7ca Fix API parameter name: use 'demotion_week' instead of 'dem_week'
The API expects 'demotion_week' as the query parameter name, not 'dem_week'.
Updated service to send correct parameter name and tests to verify.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-01 21:27:52 -06:00
Cal Corum
c7820eaea0 Bump version to 2.29.1 2026-02-01 21:16:48 -06:00
Cal Corum
788b7b30fc Fix missing Optional import in transaction_freeze.py
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-01 21:16:25 -06:00
Cal Corum
dca629a279 Bump version to 2.29.0 2026-02-01 21:15:51 -06:00
Cal Corum
00f8f4f0aa Merge branch 'feature/add-dem-week-to-player-updates' 2026-02-01 21:13:09 -06:00
Cal Corum
be3dbf1f8d Add dem_week parameter to player team updates
- Add optional dem_week parameter to PlayerService.update_player_team()
- Transaction freeze sets dem_week to current.week + 2
- /ilmove command sets dem_week to current.week
- Draft picks (manual and auto) set dem_week to current.week + 2
- Backwards compatible - admin commands don't set dem_week
- Add 4 unit tests for dem_week scenarios
- Enhanced logging shows dem_week values

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-01 21:12:06 -06:00
Cal Corum
f4523b99f2 Clear confirmation message content on delete result
Prevents double emoji display by clearing the " Confirmed!" content
when showing the delete result embed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:40:03 -06:00
Cal Corum
b5365f01f9 Fix custom command delete permission check using wrong ID field
Changed from command.creator_id (database ID) to command.creator.discord_id
to properly compare against the deleter's Discord user ID.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:10:52 -06:00
Cal Corum
4fb3bcef51 Bump version to 2.28.1
Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 16:02:31 -06:00
Cal Corum
2ab82aa2bf Fix custom command delete not actually deleting from database
The delete confirmation was showing success but never calling the delete
service. Added the actual delete_command() call when user confirms.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 16:02:26 -06:00
Cal Corum
484042e8ae Bump version to 2.28.0
Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 15:45:47 -06:00