#0022 Forgejo API Integration #133

Merged
fuzzy merged 1 commit from feature/0022-forgejo-api-integration into main 2026-07-06 05:07:12 +00:00
Owner

Implements Forgejo API client and environment configuration.

Changes:

  • src/hottea/config.pyForgejoConfig dataclass, load_config(), env var documentation
  • src/hottea/forgejo.pyForgejoClient with user/repo ID lookup, auth error handling
  • tests/test_config.py — 9 tests
  • tests/test_forgejo.py — 9 tests with mocked HTTP

API methods:

  • get_user_id(username) → user ID
  • get_repo_id(owner, repo) → repo ID
  • validate() → existence validation stub

Error handling: ForgejoAuthError (401), ForgejoNotFoundError (404), ForgejoError (network/other)

Closes: #0022, #0018, #0019, #0020, #0021, #0017, #0012, #0013, #0014, #0015, #0060

Implements Forgejo API client and environment configuration. **Changes:** - `src/hottea/config.py` — `ForgejoConfig` dataclass, `load_config()`, env var documentation - `src/hottea/forgejo.py` — `ForgejoClient` with user/repo ID lookup, auth error handling - `tests/test_config.py` — 9 tests - `tests/test_forgejo.py` — 9 tests with mocked HTTP **API methods:** - `get_user_id(username)` → user ID - `get_repo_id(owner, repo)` → repo ID - `validate()` → existence validation stub **Error handling:** `ForgejoAuthError` (401), `ForgejoNotFoundError` (404), `ForgejoError` (network/other) **Closes:** #0022, #0018, #0019, #0020, #0021, #0017, #0012, #0013, #0014, #0015, #0060
Add ForgejoClient with user/repo ID lookup via Forgejo API.
Includes config module for environment variable loading.

- ForgejoClient.get_user_id(): query user by username
- ForgejoClient.get_repo_id(): query repo by owner/name
- ForgejoClient.validate(): stub for existence validation
- ForgejoConfig/load_config(): env var configuration
- Error handling: ForgejoAuthError, ForgejoNotFoundError

Closes #18, #19, #20, #21, #22
Closes #12, #13, #14, #15, #60, #17
fuzzy force-pushed feature/0022-forgejo-api-integration from 5832608e85 to 4a32a55fea 2026-07-06 05:06:09 +00:00 Compare
the.auditor left a comment

Audit Review — PR #133

Clean Forgejo API client implementation. Good use of stdlib urllib (no extra deps), proper error handling for 401/404/network errors, solid test coverage (9 tests) with mocked HTTP.

Suggestions

  1. src/hottea/forgejo.py:46,50data["id"] direct access raises KeyError on unexpected API response. Wrap with .get() or try/except for cleaner errors. Filed as #134.

Summary

Result: COMMENT — 1 non-blocking suggestion filed as issue.

## Audit Review — PR #133 Clean Forgejo API client implementation. Good use of stdlib `urllib` (no extra deps), proper error handling for 401/404/network errors, solid test coverage (9 tests) with mocked HTTP. ## Suggestions 1. `src/hottea/forgejo.py:46,50` — `data["id"]` direct access raises `KeyError` on unexpected API response. Wrap with `.get()` or try/except for cleaner errors. Filed as #134. ## Summary **Result:** COMMENT — 1 non-blocking suggestion filed as issue.
the.auditor left a comment

APPROVED. Clean Forgejo client with proper error handling and tests. Non-blocking suggestion in #134 — address at your leisure.

APPROVED. Clean Forgejo client with proper error handling and tests. Non-blocking suggestion in #134 — address at your leisure.
fuzzy merged commit 4a32a55fea into main 2026-07-06 05:07:12 +00:00
fuzzy deleted branch feature/0022-forgejo-api-integration 2026-07-06 05:07:12 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/hottea!133
No description provided.