@@ -21,6 +21,7 @@ import (
2121
2222 "cloud.google.com/go/logging"
2323 "cloud.google.com/go/logging/logadmin"
24+ "github.com/google/syzkaller/dashboard/app/aidb"
2425 "github.com/google/syzkaller/dashboard/dashapi"
2526 "github.com/google/syzkaller/pkg/debugtracer"
2627 "github.com/google/syzkaller/pkg/email"
@@ -83,6 +84,7 @@ func initHTTPHandlers() {
8384 http .Handle ("/" + ns + "/backports" , handlerWrapper (handleBackports ))
8485 http .Handle ("/" + ns + "/s/" , handlerWrapper (handleSubsystemPage ))
8586 http .Handle ("/" + ns + "/manager/" , handlerWrapper (handleManagerPage ))
87+ http .Handle ("/" + ns + "/ai/" , handlerWrapper (handleAIPage ))
8688 }
8789 http .HandleFunc ("/cron/cache_update" , cacheUpdate )
8890 http .HandleFunc ("/cron/minute_cache_update" , handleMinuteCacheUpdate )
@@ -300,6 +302,7 @@ type uiBugPage struct {
300302 TestPatchJobs * uiJobList
301303 LabelGroups []* uiBugLabelGroup
302304 DebugSubsystems string
305+ AIWorkflows []string
303306}
304307
305308type uiBugLabelGroup struct {
@@ -1215,6 +1218,13 @@ func handleBug(c context.Context, w http.ResponseWriter, r *http.Request) error
12151218 Crashes : crashesTable ,
12161219 LabelGroups : getLabelGroups (c , bug ),
12171220 }
1221+ if hdr .AI && bug .ReproLevel > dashapi .ReproLevelNone {
1222+ workflows , err := aidb .LoadActiveWorkflows (c )
1223+ if err != nil {
1224+ return err
1225+ }
1226+ data .AIWorkflows = workflows
1227+ }
12181228 if accessLevel == AccessAdmin && ! bug .hasUserSubsystems () {
12191229 data .DebugSubsystems = urlutil .SetParam (data .Bug .Link , "debug_subsystems" , "1" )
12201230 }
@@ -1243,6 +1253,13 @@ func handleBug(c context.Context, w http.ResponseWriter, r *http.Request) error
12431253 "Cause bisection attempts" , uiList ))
12441254 }
12451255 }
1256+
1257+ if workflow := r .FormValue ("ai-workflow-create" ); workflow != "" {
1258+ if err := aiWorkflowCreate (c , bug ); err != nil {
1259+ return err
1260+ }
1261+ hdr .Message = fmt .Sprintf ("AI workflow %v is created" , workflow )
1262+ }
12461263 if r .FormValue ("json" ) == "1" {
12471264 w .Header ().Set ("Content-Type" , "application/json" )
12481265 return writeJSONVersionOf (w , data )
0 commit comments