- Create new gitea/ package with clean API facade - Establish proper separation of concerns: tddai uses gitea, not vice versa - Replace duplicate curl+subprocess patterns with unified HTTP client - Add rich domain models with properties (issue.priority, issue.status) - Maintain full backwards compatibility in tddai modules - Reduce code complexity: -373 lines, +151 lines (net -222 lines) - Improve testability and maintainability through clean interfaces Architecture: - gitea.client.GiteaClient - main facade with sub-clients - gitea.api_client - high-level API with model conversion - gitea.http_client - low-level HTTP operations - gitea.models - rich domain objects (Issue, Milestone, Label) - gitea.config - gitea-specific configuration - gitea.exceptions - clean exception hierarchy 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
1006 B
Python
33 lines
1006 B
Python
"""
|
|
Gitea API facade - Clean interface for Gitea repository operations.
|
|
|
|
This package provides a clean, well-structured interface to Gitea API operations,
|
|
following the facade pattern to decouple application logic from specific API
|
|
implementation details.
|
|
|
|
Structure:
|
|
- client: Main GiteaClient facade
|
|
- models: Domain models (Issue, Milestone, Label, etc.)
|
|
- config: Gitea-specific configuration
|
|
- exceptions: Gitea-specific exceptions
|
|
|
|
Usage:
|
|
from gitea import GiteaClient
|
|
|
|
client = GiteaClient()
|
|
issues = client.issues.list()
|
|
issue = client.issues.get(42)
|
|
client.issues.create("Bug fix", "Description")
|
|
"""
|
|
|
|
from .client import GiteaClient
|
|
from .models import Issue, Milestone, Label, ProjectState, Priority
|
|
from .config import GiteaConfig
|
|
from .exceptions import GiteaError, GiteaAuthError, GiteaNotFoundError
|
|
|
|
__all__ = [
|
|
'GiteaClient',
|
|
'Issue', 'Milestone', 'Label', 'ProjectState', 'Priority',
|
|
'GiteaConfig',
|
|
'GiteaError', 'GiteaAuthError', 'GiteaNotFoundError'
|
|
] |