Close locked MRs in MergeRequests::RefreshService

https://gitlab.zendesk.com/agent/tickets/84935

It looks like a Sidekiq job got picked by two hosts at once, which is scary (https://github.com/mperham/sidekiq/issues/3303).

I think the upshot of this was that the MR was merged, but we left it in a locked state. It was then unlocked automatically a couple of hours later, but by that time, it was marked as opened, even though it should be marked as merged.

In MergeRequests::RefreshService, we close MRs on a push to the target branch if the push to the target branch contains the MR's HEAD commit. We only do this for MRs in the opened state, though.

@oswaldo could we extend this to locked, perhaps by doing an additional check for the JID? That's not perfect, but it makes us less likely to fail in this way.

Assignee Loading
Time tracking Loading