feat: add timeout-check report and refactor CLI args - #33
Merged
Conversation
Add new timeout-check subcommand that inspects in-progress team matches for actual timeouts and games where a team member's clock is running low. New features: - TimeoutCheckReport with two xlsx tabs (by-match alerts + by-player summary) plus concise stdout output - get_match_board() API method for fetching board-level game data with move_by timestamps - TimeoutAlert domain model and timeout risk analysis functions (calculate_hours_remaining, is_timeout_risk) - TIMEOUT_THRESHOLD_HOURS configurable via env var (default: 5h) CLI refactoring: - All subcommands now accept --club-ref and --club-name flags - match-participation accepts --year - prospects accepts --clubs and --exclusion-club - timeout-check accepts positional match IDs (or 'all') and --threshold - CLI args take precedence over env vars via _apply_cli_overrides() - Shared parent parser eliminates flag duplication Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… DevOps reviews Fixes applied: - HIGH: Exact slug matching in _is_our_player() — parse final URL path segment instead of substring match to prevent team-scotland matching team-scotland-juniors - MEDIUM: Surface board fetch failures — catch requests.RequestException specifically, track skipped boards, show warning in console summary - MEDIUM: CLI override semantics — use 'is not None' consistently in _apply_cli_overrides() to match documented behaviour - MEDIUM: Domain purity — inject optional 'now' parameter into calculate_hours_remaining() and is_timeout_risk() for deterministic testing - LOW: Threshold validation — reject negative, zero, NaN, and Inf values for TIMEOUT_THRESHOLD_HOURS - LOW: Fix stale AGENTS.md reference (4 → 5 concrete reports) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ldastey-dev
force-pushed
the
feat/timeout-check-and-cli-refactor
branch
from
June 7, 2026 14:01
81344b3 to
82a8457
Compare
Add --cov-fail-under=90 to pytest command so PRs that drop below the coverage threshold will fail CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allow match IDs to be configured via .env as well as CLI positional args. CLI args take precedence when provided; falls back to TIMEOUT_MATCH_IDS env var. Raises a clear error if neither is set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add timeout-check subcommand documentation with .env and CLI examples - Document common --club-ref and --club-name flags - Show both .env-only, CLI-only, and mixed usage for every subcommand - Update environment variables table with TIMEOUT_MATCH_IDS and TIMEOUT_THRESHOLD_HOURS - Update project structure to include timeout_check.py and TimeoutAlert - Note 90% coverage enforcement in CI section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Adds a new
timeout-checksubcommand and refactors all existing subcommands to accept CLI arguments alongside environment variables.New
timeout-checksubcommandplayed_as_white/black == "timeout")move_byagainst a configurable threshold (default 5 hours)CLI args refactoring (all 5 subcommands)
--club-refand--club-nameavailable on every subcommand (shared parent parser)--yearonmatch-participation--clubsand--exclusion-clubonprospects--thresholdontimeout-check_apply_cli_overrides()Review findings addressed
Four-reviewer fleet (security, principal, architect, DevOps) identified 6 findings, all fixed:
team-scotlandmatchingteam-scotland-juniorsis not Nonenowparameter for testabilityTest coverage
270 tests passing (+54 new), lint and format clean.