d8fe3f5a3c8e8e9c95287dcf5bf88c18776f2289
- Add internal/batching package for git operation batching - Implement GitBatcher with configurable batch size and age - Queue git operations (commit, push, merge) - Auto-flush on max batch size - Manual flush on demand - Time-based flush (max batch age) - Batch status tracking (pending, executing, completed, failed) - Network savings calculation - Statistics tracking per batch and aggregated - 24 batching tests, all passing Features: - Enqueue() for adding operations to queue - Flush() for manual batch creation - GetPendingBatch() for next pending batch - MarkBatchExecuting/Completed/Failed() for status tracking - GetStats() for batching statistics - CalculateNetworkSavings() for round trip savings - GetExecutedBatches() for completed batch history - TimeSinceLastFlush() for age checking - ShouldFlush() for time-based decisions Performance Benefits: - N commits batched into 1 push saves N-1 round trips - Example: 10 commits in 2 batches saves 8 round trips - Configurable batch size (default 10) - Configurable max age (default 5s) - FIFO queue processing Network Savings Example: - 10 operations in 2 batches of 5 each - Network savings: 8 round trips (vs 10 individual operations) - Verified in TestGetStats Status Tracking: - pending: queued and ready to execute - executing: currently being executed - completed: finished successfully - failed: execution failed (kept for retry) Test Coverage: - 24 batching tests (enqueue, flush, status, stats) - Auto-flush on max size verified - Time-based flush behavior tested - Network savings calculation verified - Error handling and state management - Concurrent safe operations (RWMutex) Next: T2.6 (LLM request batching)
Description
No description provided
54 MiB
Languages
Go
99.3%
Shell
0.6%
Go Template
0.1%