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 Fix endless redirections when accessing user OAuth applications when they are disabled 2016-06-08 05:52:04 -07:00
profiles Address review comments from @smcgivern. 2016-08-18 22:12:02 +05:30
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 Move to project dropdown with infinite scroll for better performance 2016-08-17 07:33:51 +02:00
confirmations_controller.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
dashboard_controller.rb Restrict starred projects to viewable ones 2016-05-10 18:13:52 +01:00
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 Support token header for health check token, and general cleanup of the health_check feature. 2016-05-11 17:27:08 -07:00
help_controller.rb Replace reject_blocked with reject_blocked! in callbacks. 2016-07-27 13:56:30 -06:00
invites_controller.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
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 merge master into issue_3359_3 2016-06-29 11:04:18 -03:00
omniauth_callbacks_controller.rb Added tests for 2FA check on OAuth request 2016-07-04 11:00:34 -05:00
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 Enable Style/SpaceAroundEqualsInParameterDefault cop 2016-08-06 04:03:01 +02:00
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 Remove provider path, replace with dynamic path. 2016-08-03 11:50:38 -06:00
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