Skip to content

Conversation

@franccesco
Copy link
Owner

Summary

Major refactoring to reduce code duplication and improve maintainability. Net reduction of ~800 lines while maintaining 95% test coverage.

Breaking Changes

  • HeadlineListItem merged into HeadlineDetails (type alias maintained for backward compatibility)

Changes

Models

  • Extract shared OptionalDatetime and OptionalFloat annotated types using Pydantic's BeforeValidator
  • Remove 3 duplicate parse_optional_datetime validators

Operations Architecture

  • Add transformation mixins with _transform suffix naming (goals_transform.py, etc.)
  • Add generic bulk operations helpers to base classes
  • Simplify all create_many methods using generic helpers
  • Standardize error handling with raise_for_status()
  • Remove redundant __init__ methods from async operations

Documentation

  • Update CHANGELOG, README, and guide docs
  • Update CLAUDE.md with new architecture patterns

Commits

  • refactor(models): consolidate validators and merge identical models
  • refactor(mixins): add transformation mixins with _transform suffix
  • refactor(utils): add generic bulk operations helpers
  • refactor(operations): simplify using mixins and bulk helpers
  • test: update tests for refactored error handling
  • docs: update documentation for v0.21.0 refactoring
  • chore: bump version to 0.21.0

Test plan

  • All 197 tests pass
  • 95% code coverage maintained
  • basedpyright: 0 errors
  • ruff check: all passed

🤖 Generated with Claude Code

franccesco and others added 8 commits January 9, 2026 14:37
- Extract shared OptionalDatetime and OptionalFloat annotated types
- Remove duplicate parse_optional_datetime validators from Todo, Issue, Goal
- Merge HeadlineListItem into HeadlineDetails (type alias for backward compat)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create goals_transform.py, meetings_transform.py, issues_transform.py
- Create headlines_transform.py, todos_transform.py
- Rename users.py to users_transform.py for consistency
- Update mixins/__init__.py exports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add _validate_bulk_item() to AbstractOperations
- Add _process_bulk_sync() for sequential bulk processing
- Add _process_bulk_async() with semaphore-based concurrency control

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update all operations to inherit from transformation mixins
- Replace inline transformation logic with mixin method calls
- Simplify create_many methods using generic bulk helpers
- Standardize error handling with raise_for_status()
- Remove redundant __init__ methods from async operations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update test_async_todos_extra to expect HTTPStatusError
- Update test_misc_coverage for renamed users_transform module

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add CHANGELOG entry for v0.21.0 with breaking changes
- Update README with correct method names
- Update CLAUDE.md with mixins architecture and patterns
- Fix outdated examples in guide docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@franccesco franccesco merged commit 19beff8 into main Jan 10, 2026
6 checks passed
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.

2 participants