@@ -15,8 +15,8 @@ import (
1515 "time"
1616
1717 "github.com/codeGROOVE-dev/retry"
18+ "github.com/codeGROOVE-dev/turnclient/pkg/turn"
1819 "github.com/google/go-github/v57/github"
19- "github.com/ready-to-review/turnclient/pkg/turn"
2020 "golang.org/x/oauth2"
2121)
2222
@@ -42,8 +42,8 @@ func (app *App) initClients(ctx context.Context) error {
4242 tc := oauth2 .NewClient (ctx , ts )
4343 app .client = github .NewClient (tc )
4444
45- // Initialize Turn client with base URL
46- turnClient , err := turn .NewClient ( "https://turn.ready-to-review.dev" )
45+ // Initialize Turn client using default backend
46+ turnClient , err := turn .NewDefaultClient ( )
4747 if err != nil {
4848 return fmt .Errorf ("create turn client: %w" , err )
4949 }
@@ -450,7 +450,7 @@ func (app *App) fetchTurnDataSync(ctx context.Context, issues []*github.Issue, u
450450 cacheHits := 0
451451
452452 for result := range results {
453- if result .err == nil && result .turnData != nil && result .turnData .PRState . UnblockAction != nil {
453+ if result .err == nil && result .turnData != nil && result .turnData .Analysis . NextAction != nil {
454454 turnSuccesses ++
455455 if result .wasFromCache {
456456 cacheHits ++
@@ -460,13 +460,15 @@ func (app *App) fetchTurnDataSync(ctx context.Context, issues []*github.Issue, u
460460
461461 // Check if user needs to review and get action reason
462462 needsReview := false
463+ isBlocked := false
463464 actionReason := ""
464- if action , exists := result .turnData .PRState . UnblockAction [user ]; exists {
465+ if action , exists := result .turnData .Analysis . NextAction [user ]; exists {
465466 needsReview = true
467+ isBlocked = action .Critical // Only critical actions are blocking
466468 actionReason = action .Reason
467469 // Only log fresh API calls
468470 if ! result .wasFromCache {
469- slog .Debug ("[TURN] UnblockAction " , "url" , result .url , "reason" , action .Reason , "kind" , action .Kind )
471+ slog .Debug ("[TURN] NextAction " , "url" , result .url , "reason" , action .Reason , "kind" , action .Kind , "critical" , action . Critical )
470472 }
471473 }
472474
@@ -475,7 +477,7 @@ func (app *App) fetchTurnDataSync(ctx context.Context, issues []*github.Issue, u
475477 for i := range * outgoing {
476478 if (* outgoing )[i ].URL == result .url {
477479 (* outgoing )[i ].NeedsReview = needsReview
478- (* outgoing )[i ].IsBlocked = needsReview
480+ (* outgoing )[i ].IsBlocked = isBlocked
479481 (* outgoing )[i ].ActionReason = actionReason
480482 break
481483 }
0 commit comments