vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
Merge change request 01M70WES5ZZDJ6RP226WB11BBZ: Let people rename and remove their own passkeys
keenan · 50m ago
4b8c9e1d
| 1 | package web |
| 2 | |
| 3 | // The Runs tab shows the workflow results recorded for the commit under review. |
| 4 | // It is the same queue history as the repository Runs page, narrowed to the |
| 5 | // change's head so a reviewer does not have to search for the matching commits. |
| 6 | |
| 7 | import ( |
| 8 | "net/http" |
| 9 | "sort" |
| 10 | |
| 11 | "rodent.software/vole/ci/runs" |
| 12 | ) |
| 13 | |
| 14 | type requestRunsView struct { |
| 15 | requestSidebarView |
| 16 | Tab string |
| 17 | Runs []*runs.Run |
| 18 | } |
| 19 | |
| 20 | // RequestRuns serves the Runs tab for one change. |
| 21 | func (w *Web) RequestRuns(rw http.ResponseWriter, r *http.Request) { |
| 22 | m, ok := w.open(rw, r) |
| 23 | if !ok { |
| 24 | return |
| 25 | } |
| 26 | req, err := w.requestAt(memoOf(r), m, r.PathValue("id")) |
| 27 | if err != nil { |
| 28 | w.notFound(rw, r) |
| 29 | return |
| 30 | } |
| 31 | |
| 32 | var results []*runs.Run |
| 33 | if w.Runs != nil && req.Head != "" { |
| 34 | if byKey, err := w.Runs.ForSHA(m.Name, req.Head); err == nil { |
| 35 | results = make([]*runs.Run, 0, len(byKey)) |
| 36 | for _, run := range byKey { |
| 37 | results = append(results, run) |
| 38 | } |
| 39 | sort.Slice(results, func(i, j int) bool { |
| 40 | if results[i].Workflow != results[j].Workflow { |
| 41 | return results[i].Workflow < results[j].Workflow |
| 42 | } |
| 43 | return results[i].Job < results[j].Job |
| 44 | }) |
| 45 | } else { |
| 46 | w.Logger("request runs %s: %v", req.ID, err) |
| 47 | } |
| 48 | } |
| 49 | w.render(rw, "request_runs", requestRunsView{ |
| 50 | requestSidebarView: w.requestSidebar(r, m, req, "runs", ""). |
| 51 | withLanding(w.landingFrom(m, req, w.reviewDiff(m, req))), |
| 52 | Tab: "runs", |
| 53 | Runs: results, |
| 54 | }, 0) |
| 55 | } |
| 56 |