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
2 changes: 1 addition & 1 deletion cmd/goose/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"time"

"github.com/codeGROOVE-dev/retry"
"github.com/ready-to-review/turnclient/pkg/turn"
"github.com/codeGROOVE-dev/turnclient/pkg/turn"
)

type cacheEntry struct {
Expand Down Expand Up @@ -102,7 +102,7 @@
if dirErr := os.MkdirAll(filepath.Dir(cacheFile), 0o700); dirErr != nil {
slog.Error("Failed to create cache directory", "error", dirErr)
} else if writeErr := os.WriteFile(cacheFile, cacheData, 0o600); writeErr != nil {
slog.Error("Failed to write cache file", "error", writeErr)

Check failure on line 105 in cmd/goose/cache.go

View workflow job for this annotation

GitHub Actions / golangci-lint

add-constant: string literal "error" appears, at least, 6 times, create a named constant for it (revive)
}
}
}
Expand Down
16 changes: 9 additions & 7 deletions cmd/goose/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"time"

"github.com/codeGROOVE-dev/retry"
"github.com/codeGROOVE-dev/turnclient/pkg/turn"
"github.com/google/go-github/v57/github"
"github.com/ready-to-review/turnclient/pkg/turn"
"golang.org/x/oauth2"
)

Expand All @@ -42,8 +42,8 @@
tc := oauth2.NewClient(ctx, ts)
app.client = github.NewClient(tc)

// Initialize Turn client with base URL
turnClient, err := turn.NewClient("https://turn.ready-to-review.dev")
// Initialize Turn client using default backend
turnClient, err := turn.NewDefaultClient()
if err != nil {
return fmt.Errorf("create turn client: %w", err)
}
Expand Down Expand Up @@ -450,7 +450,7 @@
cacheHits := 0

for result := range results {
if result.err == nil && result.turnData != nil && result.turnData.PRState.UnblockAction != nil {
if result.err == nil && result.turnData != nil && result.turnData.Analysis.NextAction != nil {

Check failure on line 453 in cmd/goose/github.go

View workflow job for this annotation

GitHub Actions / golangci-lint

`if result.err == nil && result.turnData != nil && result.turnData.Analysis.NextAction != nil` has complex nested blocks (complexity: 12) (nestif)
turnSuccesses++
if result.wasFromCache {
cacheHits++
Expand All @@ -460,13 +460,15 @@

// Check if user needs to review and get action reason
needsReview := false
isBlocked := false
actionReason := ""
if action, exists := result.turnData.PRState.UnblockAction[user]; exists {
if action, exists := result.turnData.Analysis.NextAction[user]; exists {
needsReview = true
isBlocked = action.Critical // Only critical actions are blocking
actionReason = action.Reason
// Only log fresh API calls
if !result.wasFromCache {
slog.Debug("[TURN] UnblockAction", "url", result.url, "reason", action.Reason, "kind", action.Kind)
slog.Debug("[TURN] NextAction", "url", result.url, "reason", action.Reason, "kind", action.Kind, "critical", action.Critical)
}
}

Expand All @@ -475,7 +477,7 @@
for i := range *outgoing {
if (*outgoing)[i].URL == result.url {
(*outgoing)[i].NeedsReview = needsReview
(*outgoing)[i].IsBlocked = needsReview
(*outgoing)[i].IsBlocked = isBlocked
(*outgoing)[i].ActionReason = actionReason
break
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/goose/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"time"

"github.com/codeGROOVE-dev/retry"
"github.com/codeGROOVE-dev/turnclient/pkg/turn"
"github.com/energye/systray"
"github.com/google/go-github/v57/github"
"github.com/ready-to-review/turnclient/pkg/turn"
)

// Version information - set during build with -ldflags.
Expand Down Expand Up @@ -219,7 +219,7 @@
logPath := filepath.Join(logDir, fmt.Sprintf("goose-%s.log", time.Now().Format("2006-01-02")))
logFile, err := os.OpenFile(logPath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0o600)
if err != nil {
slog.Error("Failed to open log file", "error", err)

Check failure on line 222 in cmd/goose/main.go

View workflow job for this annotation

GitHub Actions / golangci-lint

add-constant: string literal "error" appears, at least, 6 times, create a named constant for it (revive)
} else {
// Update logger to write to both stderr and file
multiHandler := &MultiHandler{
Expand Down Expand Up @@ -676,2 +676,2 @@
app.updatePRStatesAndNotify(ctx)
}
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ go 1.24.0

require (
github.com/codeGROOVE-dev/retry v1.2.0
github.com/codeGROOVE-dev/turnclient v0.0.0-20250922145707-664c2dcdf5b8
github.com/energye/systray v1.0.2
github.com/gen2brain/beeep v0.11.1
github.com/google/go-github/v57 v57.0.0
github.com/ready-to-review/turnclient v0.0.0-20250804200718-023200511dab
golang.org/x/oauth2 v0.31.0
)

require (
git.sr.ht/~jackmordaunt/go-toast v1.1.2 // indirect
github.com/codeGROOVE-dev/prx v0.0.0-20250908203157-0711b3ec5471 // indirect
github.com/esiqveland/notify v0.13.3 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
Expand All @@ -24,5 +25,5 @@ require (
github.com/sergeymakinen/go-ico v1.0.0-beta.0 // indirect
github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af // indirect
github.com/tevino/abool v0.0.0-20220530134649-2bfc934cb23c // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/sys v0.36.0 // indirect
)
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
git.sr.ht/~jackmordaunt/go-toast v1.1.2 h1:/yrfI55LRt1M7H1vkaw+NaH1+L1CDxrqDltwm5euVuE=
git.sr.ht/~jackmordaunt/go-toast v1.1.2/go.mod h1:jA4OqHKTQ4AFBdwrSnwnskUIIS3HYzlJSgdzCKqfavo=
github.com/codeGROOVE-dev/prx v0.0.0-20250908203157-0711b3ec5471 h1:CbUa70O+iNC9rPk5aoZGs/RZbpmPyfNydv5ncKLdOvk=
github.com/codeGROOVE-dev/prx v0.0.0-20250908203157-0711b3ec5471/go.mod h1:7qLbi18baOyS8yO/6/64SBIqtyzSzLFdsDST15NPH3w=
github.com/codeGROOVE-dev/retry v1.2.0 h1:xYpYPX2PQZmdHwuiQAGGzsBm392xIMl4nfMEFApQnu8=
github.com/codeGROOVE-dev/retry v1.2.0/go.mod h1:8OgefgV1XP7lzX2PdKlCXILsYKuz6b4ZpHa/20iLi8E=
github.com/codeGROOVE-dev/turnclient v0.0.0-20250922145707-664c2dcdf5b8 h1:3088TLJGgxzjM/bR1gafKQ609NMkBNlZe1Fd5SnRrrY=
github.com/codeGROOVE-dev/turnclient v0.0.0-20250922145707-664c2dcdf5b8/go.mod h1:7lBF4vS6T+D1rNjmJ+CNVrXALQvdwNfBVEy7vhIQtYk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -29,8 +33,6 @@ github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/ready-to-review/turnclient v0.0.0-20250804200718-023200511dab h1:8UppuvcSCqg/djzBRXu19P9hEn8yCmoIWIQZLevlUFk=
github.com/ready-to-review/turnclient v0.0.0-20250804200718-023200511dab/go.mod h1:0irrOtjtAxH3st+RktW2Gr9Telf8fn/zd4+LK5X7X6A=
github.com/sergeymakinen/go-bmp v1.0.0 h1:SdGTzp9WvCV0A1V0mBeaS7kQAwNLdVJbmHlqNWq0R+M=
github.com/sergeymakinen/go-bmp v1.0.0/go.mod h1:/mxlAQZRLxSvJFNIEGGLBE/m40f3ZnUifpgVDlcUIEY=
github.com/sergeymakinen/go-ico v1.0.0-beta.0 h1:m5qKH7uPKLdrygMWxbamVn+tl2HfiA3K6MFJw4GfZvQ=
Expand All @@ -50,8 +52,8 @@ golang.org/x/oauth2 v0.31.0 h1:8Fq0yVZLh4j4YA47vHKFTa9Ew5XIrCP8LC6UeNZnLxo=
golang.org/x/oauth2 v0.31.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
Loading