MCPcopy Create free account
hub / github.com/bytebase/bytebase / buildPlanCheckInfo

Function buildPlanCheckInfo

backend/api/mcp/tool_change.go:415–437  ·  view source on GitHub ↗

buildPlanCheckInfo converts a completed plan check run into PlanCheckInfo.

(run planCheckRunResponse)

Source from the content-addressed store, hash-verified

413
414// buildPlanCheckInfo converts a completed plan check run into PlanCheckInfo.
415func buildPlanCheckInfo(run planCheckRunResponse) *PlanCheckInfo {
416 info := &PlanCheckInfo{
417 Status: planCheckDone,
418 Summary: &PlanCheckSummary{},
419 }
420 for _, r := range run.Results {
421 msg := r.Title
422 if msg == "" {
423 msg = r.Content
424 }
425 switch r.Status {
426 case "ERROR":
427 info.Summary.Error++
428 info.Results = append(info.Results, PlanCheckResult{Type: "ERROR", Message: msg})
429 case "WARNING":
430 info.Summary.Warning++
431 info.Results = append(info.Results, PlanCheckResult{Type: "WARNING", Message: msg})
432 default:
433 // SUCCESS and other statuses are not included in the output.
434 }
435 }
436 return info
437}
438
439// createIssue creates an issue linked to a plan.
440func (s *Server) createIssue(ctx context.Context, project, title, planName, description string) (string, string, error) {

Callers 1

runPlanChecksMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected