feat(backend): add root cause calculation
ci-agent / build (push) Has started running

This commit is contained in:
2026-04-05 08:22:41 +03:00
parent ad9d567d2c
commit 247505a310
4 changed files with 237 additions and 7 deletions
+17 -7
View File
@@ -218,15 +218,25 @@ func main() {
jobsGroup.GET("/metrics", jobsHandlers.GetJobMetrics)
}
// Service dependency graph (requires admin permission)
// Service dependency graph
graphGroup := v1.Group("/graph")
graphGroup.Use(auth.AuthMiddleware(), handlers.RequireAdmin())
graphGroup.Use(auth.AuthMiddleware())
{
graphGroup.GET("", graphHandlers.GetYAML)
graphGroup.PUT("", graphHandlers.UpdateYAML)
graphGroup.GET("/order", graphHandlers.StartupOrder)
graphGroup.GET("/cycle", graphHandlers.CycleCheck)
graphGroup.GET("/failure", graphHandlers.GetFailureRootCause)
// Read-only endpoints: GET (require view)
graphView := graphGroup.Group("")
graphView.Use(handlers.RequireView())
{
graphView.GET("", graphHandlers.GetYAML)
graphView.GET("/order", graphHandlers.StartupOrder)
graphView.GET("/cycle", graphHandlers.CycleCheck)
graphView.GET("/failure", graphHandlers.GetFailureRootCause)
}
// Write endpoints: PUT (require admin)
graphAdmin := graphGroup.Group("")
graphAdmin.Use(handlers.RequireAdmin())
{
graphAdmin.PUT("", graphHandlers.UpdateYAML)
}
}
// Agent registration