Skip to content

fix: make multi-repo time attribution repo-aware + e2e tests#15

Open
Flyrell wants to merge 9 commits intomainfrom
feat/multirepo-support
Open

fix: make multi-repo time attribution repo-aware + e2e tests#15
Flyrell wants to merge 9 commits intomainfrom
feat/multirepo-support

Conversation

@Flyrell
Copy link
Copy Markdown
Owner

@Flyrell Flyrell commented Mar 27, 2026

No description provided.

Flyrell and others added 5 commits March 26, 2026 16:58
When a project has multiple repos, time attribution broke in two ways:
idle gaps from one repo were incorrectly applied to segments in another
repo (precise mode), and commits were orphaned when a cross-repo checkout
terminated the session they belonged to (both modes).

Introduce synthetic checkouts from commit-based repo switches so that
commits in different repos are never orphaned. Make all dedup, commit
matching, and idle gap logic repo-aware by comparing branch+repo pairs
instead of branch alone.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use safe allocation (make + append) instead of append(checkouts,
synthetic...) which could mutate the caller's backing array. Also set
the Previous field on synthetic checkouts and add per-row minute
assertions plus a dedicated mutation regression test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address code review feedback with two inline comment additions:
- buildCheckoutBucket: note that it does not inject synthetic checkouts
  from commits, directing readers to the segment-based pipeline instead
- buildIdleGaps: explain why only stop-repos are iterated (starts without
  a preceding stop cannot form a gap)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduce a comprehensive e2e test suite that builds the real hourgit
binary and exercises it against actual git repositories with simulated
reflog entries. Three parallel pipelines cover multi-project, single-
project, precise tracking, and normal tracking modes across two-repo
setups. Each pipeline runs in two phases: simulated reflog verification
followed by real git operations verification. Tests cover sync, status,
history, log add/edit/remove, project management, and PDF export.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extract filterHostEnv() to also strip XDG_CONFIG_HOME and HOURGIT_*
  vars, preventing host env leakage into test subprocesses
- Replace custom generateTestID with hashutil.GenerateIDFromSeed for
  production-consistent hash generation
- Fix silent assertion skip in pipeline3 by replacing conditional guard
  with require.NotEmpty on authCommits
- Add documentation comments: seed commit budget, PDF path coupling,
  pipeline2/3 init flow clarifications

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Flyrell Flyrell changed the title Feat/multirepo support fix: make multi-repo time attribution repo-aware + e2e tests Mar 27, 2026
Flyrell and others added 4 commits March 28, 2026 17:09
…arity

BREAKING CHANGE: The idle threshold configuration has changed from
minutes to seconds. The JSON config key is now `idle_threshold_seconds`
(was `idle_threshold_minutes`) and the default value is 600 (was 10).
Users with custom idle thresholds must multiply their value by 60.

- Rename IdleThresholdMinutes → IdleThresholdSeconds across all Go code
- Update daemon to use time.Second instead of time.Minute
- Update all tests with scaled values (e.g. 15 → 900, 20 → 1200)
- Update README.md, web docs, and add CHANGELOG.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Clarify the 600-second idle threshold by adding "(10 minutes)" in
README.md and configuration docs. Improve the interactive prompt in
project edit to show "e.g. 600 = 10min". Add version comparison links
to CHANGELOG.md per Keep a Changelog format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add end-to-end tests that exercise the file watcher daemon in Docker,
covering basic start/stop, multiple idle sessions, graceful shutdown,
crash recovery, multi-repo watching, and gitignore filtering. Introduce
HOURGIT_IDLE_THRESHOLD env var override so e2e tests can use short
thresholds without modifying project config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add os.MkdirAll before writing the file so that TouchFile works
correctly with nested paths (e.g. "src/main.go").

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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