Skip to content

feat(gittest): add read_gitstate(repo_path) -> GitState (TICKET-054) - #62

Merged
belarusian merged 2 commits into
mainfrom
build14/gittest-read-gitstate
Aug 20, 2026
Merged

feat(gittest): add read_gitstate(repo_path) -> GitState (TICKET-054)#62
belarusian merged 2 commits into
mainfrom
build14/gittest-read-gitstate

Conversation

@belarusian

Copy link
Copy Markdown
Owner

Summary

Adds the git-side work-in-flight signal for a project repo: fleet/gittest.py exposing read_gitstate(repo_path) -> GitState.

  • GitState (frozen dataclass): unmerged_build_branches (sorted local build* branches with >= 1 commit not reachable from main) and unpushed_commits (commits on main not on origin/main / its upstream).
  • read_gitstate never raises: missing path, non-repo dir, no main branch, or any git failure -> GitState((), 0).
  • All git access via git -C {repo} ... (stdlib only, no CWD / ~/AI dependency).
  • Hermetic tests in tests/test_gittest.py build real git repos in tmp_path (git init -b main + git init --bare origin).

This is the module + tests only; it is NOT yet wired into health.py (that is a later cycle).

Closes TICKET-054.

New fleet/gittest.py (stdlib only) exposes the git-side work-in-flight
signal for a project repo: unmerged build* branches and unpushed commits
on main. read_gitstate never raises (missing path / non-repo / no main /
any git failure -> GitState((), 0)). Hermetic tests in tests/test_gittest.py
build real git repos in tmp_path (git init -b main + bare origin).

Closes TICKET-054.
@belarusian
belarusian merged commit 0fbc33c into main Aug 20, 2026
2 checks passed
@belarusian
belarusian deleted the build14/gittest-read-gitstate branch August 20, 2026 01:09
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.

1 participant