Commit c2453d3d authored by Tomasz Maczukin's avatar Tomasz Maczukin

Improve output of /debug/jobs/list

parent 00b1acaf
Pipeline #17264849 passed with stages
in 30 minutes and 48 seconds
......@@ -3,7 +3,6 @@ package commands
import (
......@@ -209,15 +208,12 @@ func (b *buildsHelper) Collect(ch chan<- prometheus.Metric) {
func (b *buildsHelper) ListJobsHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Content-Type", "text/plain")
var jobs []string
for _, job := range b.builds {
jobDescription := fmt.Sprintf(
"id=%d url=%s state=%s stage=%s executor_stage=%s",
"id=%d url=%s state=%s stage=%s executor_stage=%s\n",
job.ID, job.RepoCleanURL(),
job.CurrentState, job.CurrentStage, job.CurrentExecutorStage(),
jobs = append(jobs, jobDescription)
w.Write([]byte(strings.Join(jobs, "\n")))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment