chore: sync formula and recovery work
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 17s
CI / Test (push) Failing after 1m20s
CI / Lint (push) Failing after 22s
CI / Integration Tests (push) Failing after 34s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 17s
CI / Test (push) Failing after 1m20s
CI / Lint (push) Failing after 22s
CI / Integration Tests (push) Failing after 34s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
- Update mol-deacon-patrol formula - Fix sling helpers, doctor branch check - Update startup session and tests - Remove obsolete research doc Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
package doctor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// BranchCheck detects persistent roles (crew, witness, refinery) that are
|
||||
@@ -89,18 +87,15 @@ func (c *BranchCheck) Run(ctx *CheckContext) *CheckResult {
|
||||
}
|
||||
}
|
||||
|
||||
// gitNetworkTimeout is the timeout for git network operations (pull, fetch).
|
||||
const gitNetworkTimeout = 30 * time.Second
|
||||
|
||||
// Fix switches all off-main directories to main branch.
|
||||
func (c *BranchCheck) Fix(checkCtx *CheckContext) error {
|
||||
func (c *BranchCheck) Fix(ctx *CheckContext) error {
|
||||
if len(c.offMainDirs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
var lastErr error
|
||||
for _, dir := range c.offMainDirs {
|
||||
// git checkout main (local operation, short timeout)
|
||||
// git checkout main
|
||||
cmd := exec.Command("git", "checkout", "main")
|
||||
cmd.Dir = dir
|
||||
if err := cmd.Run(); err != nil {
|
||||
@@ -108,16 +103,10 @@ func (c *BranchCheck) Fix(checkCtx *CheckContext) error {
|
||||
continue
|
||||
}
|
||||
|
||||
// git pull --rebase (network operation, needs timeout)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), gitNetworkTimeout)
|
||||
cmd = exec.CommandContext(ctx, "git", "pull", "--rebase")
|
||||
// git pull --rebase
|
||||
cmd = exec.Command("git", "pull", "--rebase")
|
||||
cmd.Dir = dir
|
||||
err := cmd.Run()
|
||||
cancel()
|
||||
if err != nil {
|
||||
if ctx.Err() == context.DeadlineExceeded {
|
||||
lastErr = fmt.Errorf("%s: git pull timed out after %v", dir, gitNetworkTimeout)
|
||||
}
|
||||
if err := cmd.Run(); err != nil {
|
||||
// Pull failure is not fatal, just warn
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user