Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/CODEJOB.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ job := devflow.NewCodeJob(devflow.NewJulesDriver(cfg))

## Integrated Flow (via gopush)

`codejob` uses `gopush` to sync changes before dispatch and to publish changes when "closing the loop".
`codejob` uses `gopush` to sync changes before dispatch and to publish changes when "closing the loop". It inherits all `gopush` behavior, including **automatic internal submodule syncing** when publishing a release.

## State Check & Cleanup

Expand Down
11 changes: 8 additions & 3 deletions docs/GOPUSH.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ gopush 'commit message' [tag]

1. Verifies `go.mod`
2. Runs `gotest` (vet, tests, race, coverage, badges)
3. Commits changes with your message
4. Creates/uses tag
5. Intelligent push: Pushes to remote (auto-pulls/rebases if remote is ahead).
3. **Internal submodules sync**: Any submodule inside the repo that depends on the parent module is automatically updated:
- Ensures a relative `replace` points to the local parent.
- Bumps the parent requirement to the next tag.
- Runs `go mod tidy`.
These changes are included in the same release commit.
4. Commits changes with your message
5. Creates/uses tag
6. Intelligent push: Pushes to remote (auto-pulls/rebases if remote is ahead).
6. Automatically installs binaries with version tag (if `cmd/` exists)
7. Finds dependent modules in search path
8. For each dependent (in parallel):
Expand Down
87 changes: 0 additions & 87 deletions docs/GOPUSH_SELFDEP_PLAN.md

This file was deleted.

15 changes: 9 additions & 6 deletions docs/GOTEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,25 @@ Shows only failed tests with error details, filters out passing tests. Failed ru

## Timeout

By default, each package has a **30-second** timeout. If a test hangs or takes too long, Go's test framework kills the package and `gotest` reports the offending test:
`gotest` uses a **per-test stall watchdog** (default 30s). Unlike Go's native cumulative package timeout, `gotest` kills the process only if a *single* test makes no progress for the specified duration.

If a test stalls:
```
❌ timeout: TestSlowOperation (exceeded 30s)
❌ timeout: TestSlowOperation stalled >30s (no progress)
```

Override with `-t`:
```bash
gotest -t 120 # 120s per package
gotest -t 120 # 120s per test stall
```

If you pass `-timeout` directly (Go's native flag), `gotest` respects it and does not inject its own:
```bash
gotest -timeout 2m # Go-native flag, gotest won't override
A **backstop timeout** (10x the watchdog limit) is also injected into `go test -timeout` to catch genuine package-level hangs where the watchdog might be bypassed. If hit, it reports:
```
timeout: package exceeded 300s total (backstop)
```

If you pass `-timeout` directly (Go's native flag), `gotest` still injects its watchdog using that value (or its default if not parseable), but respects your explicit package timeout.

## Notes

- Supports all standard `go test` flags
Expand Down
84 changes: 0 additions & 84 deletions docs/GOTEST_TIMEOUT_PLAN.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/img/badges.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ require github.com/zalando/go-keyring v0.2.6

require (
github.com/tinywasm/gorun v0.0.24
github.com/tinywasm/mcp v0.1.18
github.com/tinywasm/mcp v0.1.19
github.com/tinywasm/model v0.0.6
golang.org/x/term v0.40.0
)

require (
github.com/tinywasm/fetch v0.1.24 // indirect
github.com/tinywasm/json v0.5.10 // indirect
github.com/tinywasm/model v0.0.6 // indirect
github.com/tinywasm/router v0.1.3 // indirect
github.com/tinywasm/router v0.1.4 // indirect
github.com/tinywasm/time v0.5.0 // indirect
github.com/tinywasm/unixid v0.2.23 // indirect
)
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ github.com/tinywasm/gorun v0.0.24 h1:qduMrpcw0nf65nx8Fi2duBWN7pCIwXxePPa9KL0rmWM
github.com/tinywasm/gorun v0.0.24/go.mod h1:9pApF2ZoaH/km6kGBVxL5WlStOoLwEZiV1uG4R4qeKo=
github.com/tinywasm/json v0.5.10 h1:GBnCQhTx3ZFKfyTgQwv8xcj8X8lZNxqe9xEvjPm+0/0=
github.com/tinywasm/json v0.5.10/go.mod h1:KJdG19+pLcAlV6bWGebSt5WJbg2an1IxP1jSnHSVi9k=
github.com/tinywasm/mcp v0.1.18 h1:duDh83HsxRQiwP1fcclHxZwS5bUTKyTCPTD3VmtUAog=
github.com/tinywasm/mcp v0.1.18/go.mod h1:buwfBL++Ljmwxyz9q05J7tFIwzXXRcD6I5hBAtJnuRw=
github.com/tinywasm/mcp v0.1.19 h1:xJ0ugoPEeLwzIPlt+ck64Sxf1Z2fTjrWdGLa16mjdYk=
github.com/tinywasm/mcp v0.1.19/go.mod h1:dh91vRW8almXcKlYPP0LKOMKu9QR3fjyQq90q/KqM/I=
github.com/tinywasm/model v0.0.6 h1:Zh/JvRiBSDOTLLiHmnTXKfxyUrObKGQHNX+gdGyfV4U=
github.com/tinywasm/model v0.0.6/go.mod h1:af3eNGmQA/BMVjMqMUXVgL0B8+NMTwlc6h7TpdEggTo=
github.com/tinywasm/router v0.1.3 h1:RMG7+6JaRjU6sYgkCxEWkxNV26fgFDP4tnUovPIfC6o=
github.com/tinywasm/router v0.1.3/go.mod h1:GuEC1pbuKvhxQLJ3yzKuYZj/hUih+ILl3T6NSrbdidw=
github.com/tinywasm/router v0.1.4 h1:kiW3p3wkxs5jcR9Vbb75NsEoOcp7mlxeJ7WfqaY0t9c=
github.com/tinywasm/router v0.1.4/go.mod h1:2GOrA6+KRQq0om5FxtONAUKfiZ9L5XGZAoK/A3hl7FM=
github.com/tinywasm/time v0.5.0 h1:M17DNgKrMYfkCK42V6miL9AcwfN/FHghbKOSTXJrkMo=
github.com/tinywasm/time v0.5.0/go.mod h1:vxGAkKA40im4ObiTS6hcsJYiIsVVLSz/A63JC/+TwvA=
github.com/tinywasm/unixid v0.2.23 h1:Lp/TER0RwbaT7EcHbQNzXj9LOGA2VD8rC8XLYmxJBc0=
Expand Down
22 changes: 20 additions & 2 deletions go_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ func (g *Go) Push(message, tag string, skipTests, skipRace, skipDependents, skip
summary = append(summary, "Tests skipped")
}

// 3. Execute git push workflow
// 3. Prepare internal submodules and execute git push workflow
var pushResult PushResult
var err error

modulePath, _ := g.GetModulePath()

if skipTag {
if err := g.git.Add(); err != nil {
return PushResult{}, fmt.Errorf("git add failed: %w", err)
Expand All @@ -223,6 +225,22 @@ func (g *Go) Push(message, tag string, skipTests, skipRace, skipDependents, skip
pushResult.Summary = "No changes to commit"
}
} else {
// Hoist tag computation so we can sync internal submodules BEFORE commit
nextTag := tag
if nextTag == "" && g.git != nil {
var err error
nextTag, err = g.git.GenerateNextTag()
if err != nil {
g.log("Warning: could not generate next tag for submodule sync:", err)
}
}

if nextTag != "" && modulePath != "" {
if err := g.syncInternalSubmodules(modulePath, nextTag); err != nil {
g.log("Warning: failed to sync internal submodules:", err)
}
}

pushResult, err = g.git.Push(message, tag)
if err != nil {
return PushResult{}, fmt.Errorf("push workflow failed: %w", err)
Expand All @@ -241,7 +259,7 @@ func (g *Go) Push(message, tag string, skipTests, skipRace, skipDependents, skip
}

// 5. Get module name
modulePath, err := g.GetModulePath()
modulePath, err = g.GetModulePath()
if err != nil {
summary = append(summary, fmt.Sprintf("Warning: could not get module path: %v", err))
return PushResult{Summary: strings.Join(summary, ", "), Tag: createdTag}, nil
Expand Down
Loading