Skip to content

Adopt kit git helpers and pin the Go toolchain#576

Open
mariusvniekerk wants to merge 9 commits into
mainfrom
adopt-kit-git-features
Open

Adopt kit git helpers and pin the Go toolchain#576
mariusvniekerk wants to merge 9 commits into
mainfrom
adopt-kit-git-features

Conversation

@mariusvniekerk
Copy link
Copy Markdown
Collaborator

Summary

  • Switch git repository discovery and author lookup onto go.kenn.io/kit v0.1.0
  • Thread caller ctx through the git outcome path instead of using background contexts
  • Pin the Go toolchain consistently in go.mod and the Docker build image

Testing

  • go test ./internal/db/git ./internal/db
  • docker build --target build -t agentsview-kit-check .
  • go test ./... reported one unrelated existing failure in internal/parser (TestParseWorkBuddySession)

Kit v0.1.0 now carries the shared git subprocess and repository-root helpers that were previously duplicated across Kenn repos. Switching the outcome aggregation path to those released helpers keeps agentsview aligned with the shared implementation while preserving caller cancellation through the stats context instead of creating background contexts inside git discovery or author lookup.

The Go toolchain pin moves to 1.26.3 because kit declares that patch level. The Docker build image is pinned to the matching golang:1.26.3-bookworm tag, verified with Docker so container builds use the same patch release as go.mod.

Validation: go test ./internal/db/git ./internal/db; docker build --target build -t agentsview-kit-check .; go test ./... was run and failed only in internal/parser TestParseWorkBuddySession, which expected project name proj but got agentsview.

Generated with Codex
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented Jun 1, 2026

roborev: Combined Review (4369768)

Medium severity finding: internal/db/git/log.go:166 may miss repo-specific Git identities configured via includeIf.gitdir, causing repos to be skipped from outcome stats even though Git would resolve an author email.

Medium

  • internal/db/git/log.go:166: AuthorEmail now performs the repo-scoped lookup using the kit runner’s default global-config behavior, then falls back to git config --global outside the repo. This misses common setups where user.email is supplied by includeIf.gitdir in the global config, because those conditionals resolve correctly only when git config user.email runs inside the target repo with global config enabled.
    • Fix: Run the repo-scoped git config user.email with global config enabled, keep the explicit global fallback only if still needed, and add a test covering includeIf.gitdir-provided user.email.

Synthesized from 2 reviews (agents: codex | types: default, security)

Project-name extraction has its own linked-worktree resolver separate from outcome stats. Existing live worktrees can use kit's released gitrepo.MainRoot helper to canonicalize back to the owning checkout, but deleted session paths still need the local filesystem heuristics because there is no working directory for git to inspect.

The sync worker path now carries its caller context into file processing and the Claude/iFlow project hint extraction path. SyncSingleSession also has a context-aware entry point so request-driven callers can avoid losing cancellation at the git resolution boundary.

Validation: go test ./internal/parser -run 'TestExtractProjectFromCwd'; go test ./internal/sync ./internal/db/git ./internal/db ./cmd/agentsview.

Generated with Codex
The parser worktree path should not carry an extra local wrapper around kit's gitrepo.MainRoot. Calling the released helper at the point of live repository resolution keeps the behavior obvious while preserving the local fallback logic for deleted cwd paths that git cannot inspect.

Validation: go test ./internal/parser -run 'TestExtractProjectFromCwd'.

Generated with Codex
Outcome stats should use the same repo-scoped identity Git would use for commits. Keeping global config disabled for the repo lookup skipped includeIf.gitdir identities, so some repositories appeared to have no author email and were excluded from aggregation.

This also restores stderr context for failing git log calls and completes context propagation through the single-session Claude/iFlow project preservation lookups reported by roborev.

Validation: go test ./internal/db/git ./internal/sync ./cmd/agentsview.

Generated with Codex
The no-context project extraction API must preserve its existing basename behavior for special paths like . and ... Direct kit git resolution remains enabled for the context-aware sync path, where callers can pass cancellation through.

Validation: go test ./internal/parser -run 'TestExtractProjectFromCwd'; go test ./internal/db/git ./internal/sync ./cmd/agentsview; golangci-lint run ./... .

Generated with Codex
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented Jun 1, 2026

roborev: Combined Review (98c7d5d)

Summary verdict: One Medium issue needs to be fixed before merge.

Medium

  • go.mod:16 - New direct dependency go.kenn.io/kit v0.1.0 was added without corresponding go.sum entries. Clean checkouts using readonly module mode or dependency verification can fail, and normal Go commands may dirty the working tree by regenerating sums.
    • Fix: Run go mod tidy or go mod download with the new dependency and commit the resulting go.sum updates.

Synthesized from 2 reviews (agents: codex | types: default, security)

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented Jun 1, 2026

roborev: Combined Review (e4ef7ee)

Medium issue found: AggregateLog may ignore required global Git config and skip affected repos.

Medium

  • [internal/db/git/log.go:37] AggregateLog now uses the kit git runner with its default global-config behavior, unlike AuthorEmail, which explicitly sets NullGlobalConfig = false. This can cause git log to ignore global settings such as safe.directory, making previously working repos error and get skipped from outcome stats.

    Fix: Create a runner explicitly, set NullGlobalConfig = false before Run, and add coverage for a repo that depends on global Git config.


Synthesized from 2 reviews (agents: codex | types: default, security)

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented Jun 1, 2026

roborev: Combined Review (d72537c)

Summary: One medium correctness issue was found; no high or critical issues.

Medium

  • internal/parser/project.go:439 - Relative cwd values such as . and .. now pass through gitrepo.MainRoot, which resolves them relative to the agentsview process working directory. That can incorrectly attribute archived sessions with unanchored cwd metadata to the agentsview checkout, even though the session data does not identify that repo. The updated test also locks in this process-dependent behavior.

    Fix: Treat relative cwd values as unresolvable for git-root probing, or only run the kit resolver when cwd is absolute. Keep the existing basename/invalid-base fallback for relative inputs.


Synthesized from 2 reviews (agents: codex | types: default, security)

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented Jun 1, 2026

roborev: Combined Review (b90c133)

Summary verdict: One medium issue needs fixing before merge.

Medium

  • go.mod:17 - The new go.kenn.io/kit dependency is added and imported, but the corresponding go.sum checksum updates are missing. Read-only or reproducible Go builds may fail, and non-read-only builds may dirty the worktree.

    Fix: Run go mod tidy or go mod download go.kenn.io/kit@v0.1.0, then commit the resulting go.sum entries.


Synthesized from 2 reviews (agents: codex | types: default, security)

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented Jun 1, 2026

roborev: Pass

No issues found.


Review type: | Agent: codex | Job: 19195

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented Jun 2, 2026

roborev: Pass

No issues found.


Review type: security | Agent: codex | Job: 20036

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