lab icon indicating copy to clipboard operation
lab copied to clipboard

fix(ci): job relaunched are positioned at the end of the pipeline

Open davinkevin opened this issue 4 years ago • 2 comments

Following https://github.com/zaquestion/lab/issues/471, another problem occurs in the same time.

The order is now correct in the ci view, but if I restart a failed job, the job is inserted at the end of the pipeline.

davinkevin avatar Jan 06 '21 15:01 davinkevin

I'm not sure this is fixable.

There is code to replace old jobs with restarted ones, but in my testing gitlab now only includes the most recent jobs in the listing, so this no longer works.

It should be possible to do slightly better by making sure that all jobs from the same stage are grouped together, but as we don't know the expected order of the stages, it's possible that we then mess up that order (say, showing "deploy" jobs before "build").

But as far as I can see, a proper fix needs additional gitlab API (at the very least, an option to list all jobs in a pipeline, including those superseded by restarted jobs)

fmuellner avatar Jan 15 '21 00:01 fmuellner

For reference here's the code that originally addressed this by picking the latest versions of jobs

https://github.com/zaquestion/lab/blob/master/cmd/ci_view.go#L604-L630

cc: @profclems this is probably an issue for y'all too

zaquestion avatar Jan 25 '21 19:01 zaquestion