Skip to content

Conversation

@johnsosoka
Copy link
Owner

Description

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement
  • CI/CD or tooling changes
  • Dependency updates

Related Issues

Fixes #
Relates to #

Changes Made

Testing

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated (if applicable)
  • All tests passing locally
  • Test coverage maintained or improved

Manual Testing

# Example code showing how you tested this change

Documentation

  • Code includes docstrings
  • README updated (if needed)
  • CHANGELOG.md updated (if applicable)
  • Examples added/updated (if needed)

Code Quality

  • Code follows project style guidelines (ruff, black)
  • Type hints added/updated (mypy passes)
  • No new linting warnings
  • Pre-commit hooks pass
  • Security considerations reviewed

Breaking Changes

Before:

# Old usage example

After:

# New usage example

Migration Guide

N/A or:

  1. Step 1
  2. Step 2

Screenshots

N/A

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Context

For Reviewers

Areas needing special review:


Note to maintainers: Please ensure code quality and documentation meet professional standards.

John Sosoka and others added 4 commits November 21, 2025 14:41
Set up develop branch workflow with branch protection:
- Added develop branch to CI workflow triggers
- Updated CONTRIBUTING.md to document develop workflow
- Created branch protection setup guide (llm_memory/)
- Created async support implementation plan (llm_memory/)

Changes:
- Feature branches now created from develop
- PRs target develop (not main)
- main receives periodic releases from develop
- CI runs on both main and develop branches
The badge was referencing 'workflows/CI' which doesn't match the
actual workflow name "Lint, Type Check & Tests". Updated to use
the workflow file name (ci.yml) which is more stable and specified
branch=main to show the stable release branch status.

Changes:
- Use actions/workflows/ci.yml/badge.svg instead of workflows/CI
- Add ?branch=main parameter to show main branch status
* feat: add stats API resource with 10 endpoints

Implements comprehensive stats resource providing analytical insights:
- Geographic stats (country_players, state_players, state_tournaments)
- Historical trends (events_by_year, players_by_year)
- Tournament rankings (largest_tournaments, lucrative_tournaments)
- Period analytics (points_given_period, events_attended_period)
- System metrics (overall)

Includes 22 Pydantic models for stats requests/responses.
API coverage increased from 36 to 46 endpoints (7 resources total).

* test: add comprehensive stats resource tests

Adds 1333 lines of unit tests and 642 lines of integration tests
for the Stats API resource. Tests cover all 10 endpoints with
inline mock data for unit tests and real API calls for integration.

Includes stats-specific test fixtures and helpers in conftest.py:
- Date range fixtures (90 days, 180 days, full year)
- Stats threshold fixtures for validation
- Rank type fixtures for parameterized testing
- Helper functions for field validation and ranking assertions

* docs: add stats mkdocs page

* docs: update docs index and navigation for stats resource

Updates MkDocs documentation to include Stats resource:
- Update API coverage count: 36 → 46 endpoints
- Add Stats row to resources table with description
- Add Stats to resource navigation links
- Update mkdocs.yml navigation to include stats.md

* docs: add stats section to README

Updates README with Stats resource documentation:
- Update API coverage: 36 → 46 endpoints, 6 → 7 resources
- Add Stats section with usage examples showing:
  - Overall IFPA statistics
  - Top point earners by period
  - Largest tournaments by country
  - Player counts by country
  - Most active players by period

* docs: add v0.4.0 changelog entry for stats resource

Adds comprehensive v0.4.0 release notes documenting:
- 10 new Stats API endpoints (geographic, historical, rankings, period-based)
- 22 new Pydantic models for stats responses
- 1333 lines of unit tests, 642 lines of integration tests
- Stats-specific test fixtures and helpers
- Known API issue with WOMEN parameter in overall() endpoint

Updates version links for 0.4.0 and 0.3.0 releases.

---------

Co-authored-by: John Sosoka <john@sosoka.com>
@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2025

Codecov Report

❌ Patch coverage is 96.34146% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ifpa_api/models/stats.py 94.76% 10 Missing ⚠️
src/ifpa_api/resources/stats/client.py 97.91% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

johnsosoka and others added 2 commits November 22, 2025 10:08
* feat: add type-safe enums for stats parameters

Add three new enums for improved type safety and IDE autocomplete:
- StatsRankType (OPEN, WOMEN) - used in 8 stats endpoints
- SystemCode (OPEN, WOMEN) - used in overall() endpoint
- MajorTournament (YES, NO) - used in lucrative_tournaments()

All enums maintain full backwards compatibility with string parameters
via union types (Enum | str).

Changes:
- Add enum definitions to models/common.py
- Update stats client signatures to accept enums
- Export enums from main package
- Add 21 new tests (15 enum tests + 6 quality improvements)
- Update documentation with enum usage examples

Benefits:
- Type safety: catch typos at development time
- IDE autocomplete: discover available values
- Self-documenting: clear what values are valid
- No breaking changes: strings still work

* feat: finalize v0.4.0 with verified response sizes and improved test coverage

Update version references from 0.3.0 to 0.4.0 across all documentation
and source files. Add 6 high-value edge case tests for stats resource
and verify response size documentation against live API.

Version Updates:
- Update pyproject.toml and __init__.py version to 0.4.0
- Update README "What's New" section to reference 0.4.0
- Update installation docs example output to show 0.4.0

Test Improvements:
- Add empty response handling test
- Add malformed API response validation (2 tests)
- Add invalid date format handling test
- Add enum/string equivalence test
- Add period endpoints smoke test (integration)
- Fix overly permissive assertion in validation test

Documentation:
- Verify response sizes via live API calls (2025-11-22)
- Update stats.md with accurate counts for all endpoints
- Add verification date and performance tips
- Document default 25-result limit for period queries

All 84 tests passing, 98% coverage on stats client maintained.

---------

Co-authored-by: John Sosoka <john@sosoka.com>
- Configure ReadTheDocs with Poetry dependency management
- Add RankingDivision enum for Rankings resource
- Add TournamentSearchType enum for Tournament searches
- Update test to handle intermittent API behavior
- Reorganize docs dependencies into dedicated Poetry group
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants