gitlab-org--gitlab-foss/app/controllers
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
..
admin Merge remote-tracking branch 'upstream/master' into pipeline-emails 2016-10-08 07:51:07 +00:00
ci Remove Ci::ApplicationController 2016-10-10 16:47:27 +02:00
concerns Show labels widget on issuable sidebar if project has only group labels 2016-10-19 14:58:24 -02:00
dashboard Limit what label fields we expose on Dashboard::LabelsController#index 2016-10-19 14:58:26 -02:00
explore Precalculate trending projects 2016-10-10 12:27:08 +02:00
groups Disable subscribing to group-level labels 2016-10-19 14:58:28 -02:00
import Enable import/export back for non-admins 2016-10-03 10:53:18 +02:00
oauth
profiles
projects Merge branch '23341-fix-viewing-mr-from-deleted-project' into 'master' 2016-10-20 14:03:10 +00:00
sherlock
abuse_reports_controller.rb
application_controller.rb Merge branch 'master' into merge-conflicts-editor-2 2016-10-17 10:56:55 +01:00
autocomplete_controller.rb
confirmations_controller.rb
dashboard_controller.rb
emojis_controller.rb
groups_controller.rb Syntax fixes and better tests for helper methods. Updated docs. 2016-09-15 14:10:49 -05:00
health_check_controller.rb
help_controller.rb
invites_controller.rb
jwt_controller.rb Be nice to Docker Clients talking to JWT/auth 2016-09-27 16:59:05 +02:00
koding_controller.rb Split Koding admin/user docs 2016-08-22 17:09:15 +03:00
notification_settings_controller.rb
omniauth_callbacks_controller.rb
passwords_controller.rb
profiles_controller.rb Add organization field to user profile 2016-09-27 14:04:39 +03:00
projects_controller.rb Add visibility level to project repository 2016-10-17 18:12:18 -02:00
registrations_controller.rb
root_controller.rb
search_controller.rb Fixed search dropdown labels not displaying 2016-09-12 09:00:57 +01:00
sent_notifications_controller.rb Fix initial implementation to actually render the unsubscribe page 2016-09-20 09:52:57 +02:00
sessions_controller.rb
snippets_controller.rb Added 'Download' button to snippet view 2016-10-11 15:36:59 -04:00
uploads_controller.rb
users_controller.rb Add exists to users routes and fix endpoint. 2016-10-15 08:28:55 +02:00