If MR diff is not ready, Overview page has never ending spinner ("Checking if mr can be merged")
Summary
As surfaced by this automated test: #392984 (closed) (Also occurred in staging and prod)
Other affected tests:
As we now load diffs asynchronously, if a user navigates to the Overview
tab of an MR before the diffs are available "Checking if MR can be merged" will be in the merge widget and a never ending spinner will occur. The user must refresh the page after the diff has loaded to see the correct merge status.
The automated E2E tests create the MR via the API and then immediately navigate to MRs that have just been created.
The logs from the browser indicate a 404, see below
Steps to reproduce
- Create MR via API (the larger the more likely this issue will occur)
- Immediately navigate to the MR (Overview tab)
Example Project
Any
What is the current bug behavior?
What is the expected correct behavior?
Diff eventually loads
Relevant logs and/or screenshots
This is output from the browser:
2023-03-21 18:50:00 +0000 SEVERE: https://staging.gitlab.com/gitlab-qa-sandbox-group-3/qa-test-2023-03-21-18-40-16-f9e1caef173456e0/assign-approvers-99f31bf91d31d159/-/merge_requests/1/diffs_metadata.json?diff_head=true&view=inline&w=0 - Failed to load resource: the server responded with a status of 404 ()
2023-03-21 18:50:00 +0000 WARNING: https://staging.gitlab.com/assets/webpack/sentry.442f48bf.chunk.js 0:26842 "[gitlab] Something went wrong with the startup call for \"/gitlab-qa-sandbox-group-3/qa-test-2023-03-21-18-40-16-f9e1caef173456e0/assign-approvers-99f31bf91d31d159/-/merge_requests/1/diffs_metadata.json?diff_head=true&view=inline&w=0\"" Error
at https://staging.gitlab.com/assets/webpack/main.29803a57.chunk.js:99:18560
at async https://staging.gitlab.com/assets/webpack/main.29803a57.chunk.js:99:18484
at async d.Kt (https://staging.gitlab.com/assets/webpack/pages.projects.merge_requests.show.70c18751.chunk.js:1:126688)
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)