fix(github): copy the watch handed to the initial-check goroutine (#2492)

This commit is contained in:
João Salavisa
2026-08-10 18:04:52 +02:00
committed by GitHub
parent a6a26911b7
commit f6fc6b3c72
14 changed files with 5431 additions and 8 deletions
@@ -247,6 +247,18 @@ func (r staticPromptResolver) ResolvePromptContent(context.Context, string, stri
}
func setupControllerStoreTest(t *testing.T) (*gin.Engine, *Store) {
t.Helper()
svc, store := setupWatchServiceTest(t)
ctrl := NewController(svc, newControllerTestLogger())
router := gin.New()
useControllerTestWorkspace(router)
ctrl.RegisterHTTPRoutes(router)
return router, store
}
// setupWatchServiceTest builds a Service backed by a real SQLite store and the
// stub client, with the ws-1 workspace connected so watch checks resolve.
func setupWatchServiceTest(t *testing.T) (*Service, *Store) {
t.Helper()
gin.SetMode(gin.TestMode)
tmp := t.TempDir()
@@ -289,11 +301,7 @@ func setupControllerStoreTest(t *testing.T) (*gin.Engine, *Store) {
return svc.client, AuthMethodPAT, nil
})
svc.SetPromptResolver(staticPromptResolver{content: "resolved default prompt"})
ctrl := NewController(svc, log)
router := gin.New()
useControllerTestWorkspace(router)
ctrl.RegisterHTTPRoutes(router)
return router, store
return svc, store
}
func TestCredentialBrokerReadinessUsesExactResolveRoute(t *testing.T) {