Incorrect MR status in JIRA after potential network failure
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Merge request status is not correctly reflected in Jira.
Steps to reproduce
Not reproducible at will.
What is the current bug behavior?
Merge request is successfully merged on GitLab.com, however the Jira PR's status remains open.
What is the expected correct behavior?
The Jira PR should accurately reflect the status of the MR.
Relevant logs and/or screenshots
For the MR in question we have observed the following in Kibana (internal):
We can see that every single job had failed on the first attempt, but succeeded on the second attempt. It would appear that the MergeWorker does not properly execute the after_merge actions on the 2nd attempt.
Kibana link (internal)
Which is where we believe the sync to Jira is handled, see:
- https://gitlab.com/gitlab-org/gitlab/-/blob/403d78ed6794f8776d57939d73f75a101a4ae14b/app/services/merge_requests/merge_service.rb#L31-37
- https://gitlab.com/gitlab-org/gitlab/-/blob/403d78ed6794f8776d57939d73f75a101a4ae14b/app/models/merge_request.rb#L1652-1657
In addition to this specific MR, similar failures been identified in Kibana (internal), however as these are namespaces unrelated to the initial report, it is not known if these result in failure to update/sync the Jira PR.
Output of checks
This bug happens on gitlab.com
Possible fixes
Ensure Jira sync is handled correctly on subsequent retries.
