Open Bug 1338491 Opened 8 years ago Updated 4 years ago

Consolidate "cancel all jobs" with "cancel multiple pinned jobs"

Categories

(Tree Management :: Treeherder, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: emorley, Unassigned)

References

Details

Bug 1217570 added support for cancelling multiple jobs at once, by using the pinboard. This feature can be used by anyone. In addition, we have the existing "cancel all jobs" button on each push, which is only shown to sheriffs (though the API doesn't enforce this). As such, we now have two very similar codepaths both in the UI and the API, that each try to handle the various edge cases (eg pending/running jobs, making sure the pulse notification gets sent out etc), but in different ways. I think we should consider consolidating some of this: https://github.com/mozilla/treeherder/blob/067aad46bd4c2f1c298326bddeaef8cc118dfe34/ui/plugins/controller.js#L475-L501 https://github.com/mozilla/treeherder/blob/067aad46bd4c2f1c298326bddeaef8cc118dfe34/ui/js/controllers/jobs.js#L185-L198 https://github.com/mozilla/treeherder/blob/067aad46bd4c2f1c298326bddeaef8cc118dfe34/treeherder/webapp/api/jobs.py#L390-L417 https://github.com/mozilla/treeherder/blob/067aad46bd4c2f1c298326bddeaef8cc118dfe34/treeherder/webapp/api/resultset.py#L192-L222
Maybe I'm missing something, but I don't see any easy way of unifying these two operations. Each uses a different mechanisms and is meant to serve a different use case. I mean, theoretically I suppose we could remove the "cancel all jobs for push" option and just tell people to pin all the jobs in a push and cancel all of them at once if that's what they want to do, but that's liable to be slow (since each job would need to be cancelled individually) and less reliable than cancelling the push (which would also take care of any jobs which had not yet appeared in treeherder).
Perhaps - but at the least we should move the common "exclude pending/running and ..." parts out, along with a few other changes.
Component: Treeherder → Treeherder: Job Triggering & Cancellation
Here are some updated links on the JavaScript side: https://github.com/mozilla/treeherder/blob/f26576c7684bebb01f517989330f815a8110ece2/ui/job-view/details/summary/ActionBar.jsx#L237-L267 https://github.com/mozilla/treeherder/blob/1bf2e61f975a29b8153f3f3eec072db003f1f3f1/ui/job-view/PushHeader.jsx#L138-L153 So these functions are still not unified. But I think we should wait till buildbot (ESR60 and Thunderbird) is all the way gone before we unify them.
Component: Treeherder: Job Triggering & Cancellation → TreeHerder
You need to log in before you can comment on or make changes to this bug.