gitlab-org--gitlab-foss/app/helpers
Douwe Maan 030c82267f Merge branch '23341-fix-viewing-mr-from-deleted-project' into 'master'
Fix a 500 error viewing an MR with a deleted source project

## What does this MR do?

Allows merged MRs to be shown without any 500 errors if the source project is removed

## Are there points in the code the reviewer needs to double check?

31c37c6c38 fixed this for closed MRs only. I had trouble understanding the introduced helper and logic, so reverted it and keyed everything on the existence of the source project or branch directly.

commits.json returns a 500 error for a closed or merged MR; the approach taken in the above MR was to hide the commits... tab, so I've run with that.

For merged MRs, the commits (but not the pipeline data) are in the target project, so we *could* do better, but it's a fairly nasty intervention to make it happen.

## Why was this MR needed?

Viewing merged MRs should work even if the fork they came from has been deleted or unlinked.

## Screenshots (if relevant)

![Screen_Shot_2016-10-19_at_17.56.37](/uploads/1aeadd5147b9a4ad29b946b1c7ea52cb/Screen_Shot_2016-10-19_at_17.56.37.png)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Closes #23341

See merge request !6991
2016-10-20 14:03:10 +00:00
..
appearances_helper.rb Enable CacheMarkdownField for the remaining models 2016-10-07 02:54:26 +01:00
application_helper.rb
application_settings_helper.rb Enable CacheMarkdownField for the remaining models 2016-10-07 02:54:26 +01:00
auth_helper.rb
avatars_helper.rb
award_emoji_helper.rb Simpler arguments passed to named_route on toggle_award_url helper method 2016-10-19 21:58:12 +02:00
blob_helper.rb
boards_helper.rb Moved data attribute values into helper method 2016-10-12 12:50:47 +01:00
branches_helper.rb
broadcast_messages_helper.rb Enable CacheMarkdownField for the remaining models 2016-10-07 02:54:26 +01:00
builds_helper.rb Remove unnecessary retried check & fix test failures 2016-10-18 08:29:29 -05:00
button_helper.rb Adds btn-transparent class in correct place due to changes in master 2016-10-11 11:03:47 +01:00
ci_status_helper.rb
commits_helper.rb
compare_helper.rb
dashboard_helper.rb
diff_helper.rb
dropdowns_helper.rb
emails_helper.rb
events_helper.rb Stop event_commit_title from escaping its output 2016-10-18 13:49:52 +01:00
explore_helper.rb
external_wiki_helper.rb
form_helper.rb
git_helper.rb
gitlab_markdown_helper.rb Enable CacheMarkdownField for the remaining models 2016-10-07 02:54:26 +01:00
gitlab_routing_helper.rb Add back the space which Sublime can't easily tell: 2016-10-14 20:11:56 +08:00
graph_helper.rb
groups_helper.rb
icons_helper.rb
import_helper.rb
issuables_helper.rb Added issuable_filters_present to check for active filters before rendering the reset button 2016-10-07 14:25:20 +01:00
issues_helper.rb Optimize the award_user_list helper spec 2016-10-07 16:34:58 +02:00
javascript_helper.rb
kerberos_spnego_helper.rb
labels_helper.rb Disable subscribing to group-level labels 2016-10-19 14:58:28 -02:00
lfs_helper.rb
members_helper.rb
merge_requests_helper.rb Fix the merge request view when source projects or branches are removed 2016-10-20 12:24:27 +01:00
milestones_helper.rb
namespaces_helper.rb
nav_helper.rb
notes_helper.rb
notifications_helper.rb
page_layout_helper.rb
preferences_helper.rb Add visibility level to project repository 2016-10-17 18:12:18 -02:00
projects_helper.rb Add visibility level to project repository 2016-10-17 18:12:18 -02:00
runners_helper.rb
search_helper.rb Make search results use the markdown cache columns, treating them consistently 2016-10-07 02:54:26 +01:00
selects_helper.rb
sentry_helper.rb
services_helper.rb
sidekiq_helper.rb
snippets_helper.rb
sorting_helper.rb
submodule_helper.rb
tab_helper.rb
tags_helper.rb
time_helper.rb
todos_helper.rb
tree_helper.rb
triggers_helper.rb
u2f_helper.rb
version_check_helper.rb
visibility_level_helper.rb
workhorse_helper.rb