(rows []db.ListRecentPatchRunsRow)
| 1475 | } |
| 1476 | |
| 1477 | func patchRunsToResponse(rows []db.ListRecentPatchRunsRow) []map[string]interface{} { |
| 1478 | out := make([]map[string]interface{}, len(rows)) |
| 1479 | for i, r := range rows { |
| 1480 | m := patchRunRowToMap(r.ID, r.HostID, r.JobID, r.PatchType, r.PackageName, r.PackageNames, r.Status, r.ShellOutput, r.ErrorMessage, r.StartedAt, r.CompletedAt, r.ScheduledAt, r.CreatedAt, r.UpdatedAt, r.HostFriendlyName, r.HostHostname, r.TriggeredByUsername) |
| 1481 | m["dry_run"] = r.DryRun |
| 1482 | if len(r.PackagesAffected) > 0 { |
| 1483 | var pkgs []string |
| 1484 | _ = json.Unmarshal(r.PackagesAffected, &pkgs) |
| 1485 | m["packages_affected"] = pkgs |
| 1486 | } |
| 1487 | out[i] = m |
| 1488 | } |
| 1489 | return out |
| 1490 | } |
| 1491 | |
| 1492 | func patchRunsActiveToResponse(rows []db.ListActivePatchRunsRow) []map[string]interface{} { |
| 1493 | out := make([]map[string]interface{}, len(rows)) |
no test coverage detected