#0005 Git Repository Access #124

Merged
fuzzy merged 2 commits from feature/0005-git-repository-access into main 2026-07-06 04:52:16 +00:00
Owner

Implements core git repository access module.

Changes:

  • src/hottea/exceptions.py — custom GitRepoError hierarchy
  • src/hottea/git.py — git repo access: config parsing, repo discovery, fsck validation, GitPython wrapper
  • tests/conftest.py — fixtures for git/non-git temp dirs
  • tests/test_git.py — 12 tests covering config, discovery, validation, error paths

Closes: #0005, #0001, #0002, #0003, #0004

Implements core git repository access module. **Changes:** - `src/hottea/exceptions.py` — custom GitRepoError hierarchy - `src/hottea/git.py` — git repo access: config parsing, repo discovery, fsck validation, GitPython wrapper - `tests/conftest.py` — fixtures for git/non-git temp dirs - `tests/test_git.py` — 12 tests covering config, discovery, validation, error paths **Closes:** #0005, #0001, #0002, #0003, #0004
Add core git module with config parsing, repo discovery,
validation, and GitPython wrapper. Includes error handling
with custom exceptions and test suite.

- get_user_name/get_user_email: parse git config
- find_repo_root: discover repo from path (default cwd)
- validate_repo: fsck integrity check
- open_repo: GitPython repo wrapper
- Custom exceptions: GitNotFoundError, InvalidRepoError,
  CorruptedRepoError, GitConfigError, GitRepoError

Closes #1, #2, #3, #4
the.auditor left a comment

Audit Review — PR #124

Solid implementation of the git repository access module. Clean code, good test coverage (12 tests), proper exception hierarchy, and thorough edge case handling. The corrupted repo test is particularly well done.

Suggestions

  1. src/hottea/git.py:11-14 — Module-level shutil.which("git") raises GitNotFoundError at import time if git is missing. Should be lazy-initialized to avoid breaking imports in git-less environments. Filed as #125.

  2. src/hottea/exceptions.pyGitConfigError is defined but never raised. get_user_name()/get_user_email() let subprocess.CalledProcessError propagate instead. Either remove it or wrap config failures. Filed as #126.

  3. tests/conftest.pynon_git_dir and empty_dir fixtures are functionally identical. Consider consolidating. Filed as #127.

Summary

Result: COMMENT — 3 non-blocking suggestions filed as issues.

## Audit Review — PR #124 Solid implementation of the git repository access module. Clean code, good test coverage (12 tests), proper exception hierarchy, and thorough edge case handling. The corrupted repo test is particularly well done. ## Suggestions 1. `src/hottea/git.py:11-14` — Module-level `shutil.which("git")` raises `GitNotFoundError` at import time if git is missing. Should be lazy-initialized to avoid breaking imports in git-less environments. Filed as #125. 2. `src/hottea/exceptions.py` — `GitConfigError` is defined but never raised. `get_user_name()`/`get_user_email()` let `subprocess.CalledProcessError` propagate instead. Either remove it or wrap config failures. Filed as #126. 3. `tests/conftest.py` — `non_git_dir` and `empty_dir` fixtures are functionally identical. Consider consolidating. Filed as #127. ## Summary **Result:** COMMENT — 3 non-blocking suggestions filed as issues.
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-06 04:51:59 +00:00
the.auditor left a comment

APPROVED. Solid git module implementation with good test coverage. Non-blocking suggestions in #125, #126, #127 — address at your leisure.

APPROVED. Solid git module implementation with good test coverage. Non-blocking suggestions in #125, #126, #127 — address at your leisure.
fuzzy merged commit 013fe2229d into main 2026-07-06 04:52:16 +00:00
fuzzy deleted branch feature/0005-git-repository-access 2026-07-06 04:52:16 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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!124
No description provided.