feat: cancel in-progress reviewbot pushes before new ones are started - #3590
feat: cancel in-progress reviewbot pushes before new ones are started#3590bhearsum wants to merge 1 commit into
Conversation
This was originally motivated by mozilla#3578, but it's valid and worthwhile on its own. Aside from the very roundabout way we have to find task group ids, this is pretty straightforward: simply find and cancel all previous task groups for the revision. This avoids doing work for something that's already stale. If someone knows of a way to find the task group id of the reviewbot push other than the roundabout way it's happening here, I'd be very happy to switch to it. I could not find any way to pull it (or even the treeherder link) through the API directly; the only thing that seems to available there is the task id of the initial code review task. In addition to the unit tests, I managed to run code review bot locally as some sort of integration test. I didn't have it actually cancel any tasks, but I _think_ I've done enough to make this landable. Ideally we can test in a non-prod environment before production.
|
A downside of this is that the build on Phabricator would show up as pending, maybe there's some sort of "cancelled" result we could upload to Phab? |
|
Regarding Ben's question, @La0 can you think of another way to retrieve the task group? |
It would, but only on the previous Build, which probably doesn't matter...? In any case, I'll see if I can update the state in Phab, as it would be the Proper (tm) think to do. |
Currently i think it's the only way. But it would not be complicated to store the task group in the backend next to Then you could fetch that info through the revision_diffs_list endpoint |
This was originally motivated by #3578, but it's valid and worthwhile on its own.
Aside from the very roundabout way we have to find task group ids, this is pretty straightforward: simply find and cancel all previous task groups for the revision. This avoids doing work for something that's already stale.
If someone knows of a way to find the task group id of the reviewbot push other than the roundabout way it's happening here, I'd be very happy to switch to it. I could not find any way to pull it (or even the treeherder link) through the API directly; the only thing that seems to available there is the task id of the initial code review task.
In addition to the unit tests, I managed to run code review bot locally as some sort of integration test. I didn't have it actually cancel any tasks, but I think I've done enough to make this landable. Ideally we can test in a non-prod environment before production.