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.
Give workflows and jobs a name and description
1cde8b9ea2ba1483beb90f19cde0f58aede2a661 · Keenan Nemetz · 8d ago · parent 30de4a44
Give workflows and jobs a name and description The workflows page showed the file path and job IDs, so a reader had to open the YAML comments to learn what a workflow was for. Add optional top-level and job-level name and description fields, default them to the file stem and job ID, pin them with a queued run, and show them on the workflows and run pages. Also document what the workflow format still cannot express, and state that CI jobs are independent and unordered: only a local run uses the declaration order. Part of: #138
server/web/workflows.go +21−13
| @@ -12,20 +12,24 @@ import ( | |||
| 12 | 12 | ) | |
| 13 | 13 | ||
| 14 | 14 | type workflowJobView struct { | |
| 15 | ID string | ||
| 16 | Labels []string | ||
| 17 | Image string | ||
| 18 | Steps int | ||
| 19 | Artifacts int | ||
| 20 | Pages bool | ||
| 21 | Last *runs.Run | ||
| 15 | ID string | ||
| 16 | Name string | ||
| 17 | Description string | ||
| 18 | Labels []string | ||
| 19 | Image string | ||
| 20 | Steps int | ||
| 21 | Artifacts int | ||
| 22 | Pages bool | ||
| 23 | Last *runs.Run | ||
| 22 | 24 | } | |
| 23 | 25 | ||
| 24 | 26 | type workflowView struct { | |
| 25 | Path string | ||
| 26 | Branches []string | ||
| 27 | Tags []string | ||
| 28 | Jobs []workflowJobView | ||
| 27 | Path string | ||
| 28 | Name string | ||
| 29 | Description string | ||
| 30 | Branches []string | ||
| 31 | Tags []string | ||
| 32 | Jobs []workflowJobView | ||
| 29 | 33 | } | |
| 30 | 34 | ||
| 31 | 35 | func (w *Web) WorkflowsPage(rw http.ResponseWriter, r *http.Request) { | |
| @@ -50,14 +54,18 @@ func (w *Web) WorkflowsPage(rw http.ResponseWriter, r *http.Request) { | |||
| 50 | 54 | ||
| 51 | 55 | views := make([]workflowView, 0, len(workflows)) | |
| 52 | 56 | for _, wf := range workflows { | |
| 53 | view := workflowView{Path: wf.Path, Branches: wf.Branches, Tags: wf.Tags} | ||
| 57 | view := workflowView{ | ||
| 58 | Path: wf.Path, Name: wf.Name, Description: wf.Description, | ||
| 59 | Branches: wf.Branches, Tags: wf.Tags, | ||
| 60 | } | ||
| 54 | 61 | for _, job := range wf.Jobs { | |
| 55 | 62 | image := job.Image | |
| 56 | 63 | if job.ImageFile != "" { | |
| 57 | 64 | image = "file:" + job.ImageFile | |
| 58 | 65 | } | |
| 59 | 66 | view.Jobs = append(view.Jobs, workflowJobView{ | |
| 60 | ID: job.ID, Labels: job.Labels, Image: image, | ||
| 67 | ID: job.ID, Name: job.Name, Description: job.Description, | ||
| 68 | Labels: job.Labels, Image: image, | ||
| 61 | 69 | Steps: len(job.Steps), Artifacts: len(job.Artifacts), | |
| 62 | 70 | Pages: job.Pages != nil, | |
| 63 | 71 | Last: latest[wf.Path+"\x00"+job.ID], | |