The first attempt didn't migrate all rows on GitLab.com, due to a couple of
issues:
1. Some rows in merge_request_diffs had truly huge numbers of commits and diffs
serialised - one in particular had 26,000 commits!
2. The jobs were sometimes on Sidekiq hosts with frequent OOM errors, leading to
the job being lost.
The previous commit adds more logging, and a more robust insertion method. This
commit reschedules the jobs, with a generous pause between each.
This version does not use transactions, but individual statements. As we have
unique constraints on the target tables for the inserts, we can just ignore
uniqueness violations there (as long as we always insert the same batch size, in
the same order).
This means the spec now must use truncation, not a transaction, as the
uniqueness violation means that the whole transaction for that spec would be
invalid, which isn't what we'd want. In real-world use, this isn't run in a
transaction anyway.
This commit also wraps unhandled exceptions, for easier finding in Sentry, and
logs with a consistent format, for easier searching.
We were hitting the statement timeout for very large MR diffs. Now we insert at
most 1,000 rows to `merge_request_diff_commits` in a single statement, or 100
rows to `merge_request_diff_files`.
Previously the fork button was disabled for all users if they have
exceeded their project limit. This fixes that by changing the check
to see if the user can fork to a group instead of their own namespace.
This behaviour is already possible by visiting the new fork page
directly, so this just fixes the button being disabled.
Closes#38462
Correctly scrolls anchored content into view when the user loads the
page. This is most obvious when the user loads a link note in a
merge request & the page does not scroll down to the note.
Closes#38326
Before this change, the MR counter in the sidebar would be wrong if an MR had
been merged since the last update, but not opened or closed, as merging did not
trigger a counter cache update.
If the ref doesn't exist, and the source branch is deleted, we can't get it back
easily. Previously, we ignored this error by shelling out, so replicate that
behaviour.
MergeRequest#merge_jid should be cleaned up whenever we hit a known error on MergeService#execute. This way we can keep track if the MR is really "ongoing" or "stuck"
This fixes the breadcrumb titles not having links. This was a regression
in the updated breadcrumbs introduced in 10.0.
This introduces the link for all pages rather than selectively doing it.
This will cover issues, merge requests, pipelines, jobs etc.
Closes#38059
This was caused by the `notes` global class not existing when the
`file_comment_button` code is run. The notes class was used to check
if the diff is currently in parallel view or not. To get around this
I've added a check into the `file_comment_button` JS to check if the
view is currently parallel or not.
Closes#38117