gitlab-org--gitlab-foss/spec
Rémy Coutable 8e5bf15732 Merge branch 'gh-pull-requests' into 'master'
Fix importer for GitHub Pull Requests when a branch was reused across Pull Requests

Closes #17766

## What does this MR do?

GitHub importer fails when a repository has two Pull Requests, with the same branch name and different SHA, one of which was closed without merging, and one which is open or was merged in. This happens because we only checks if the branch exists in the [Gitlab::GithubImport::BranchFormatter#exists?](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/github_import/branch_formatter.rb#L6-8), before creating the missing references on Github. With this MR we check if both branch, and SHA exists in the current project. If no, we create the missing reference on GitHub before import the PR.

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

Nope.

## Why was this MR needed?

Github importer will fail if branch was reused across Pull Requests.

## What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/19439

/cc @royaldark @thomasjachmann

See merge request !5103
2016-07-06 17:25:40 +00:00
..
config Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
controllers Assert against ActionMailer::Base.deliveries relatively. 2016-07-05 10:20:32 +05:30
factories Add Todos API 2016-07-01 10:49:34 +02:00
features Fix specs 2016-07-06 17:52:59 +02:00
finders Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
fixtures optimize png images losslessly using zopflipng 2016-06-29 19:22:15 +08:00
helpers Move unescape_html_entities from LabelsHelper to Label model 2016-07-05 20:57:09 -03:00
initializers Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
javascripts Merge branch 'emoji-menu-stick-search' into 'master' 2016-06-27 18:03:08 +00:00
lib Consider that a GH exists only if both ref, and sha exist 2016-07-06 13:08:12 -03:00
mailers Merge branch 'explicit-requesters-scope' into 'master' 2016-07-01 22:23:26 +00:00
models Merge branch '19092-fix-event-for-legacydiffnote-not-considered-note' into 'master' 2016-07-06 15:25:54 +00:00
requests Allow '?', or '&' for label titles 2016-07-05 20:57:09 -03:00
routing Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
services Handle custom Git hook result in GitLab UI 2016-07-04 20:16:55 +03:00
support Merge branch 'user-avatar-header' into 'master' 2016-07-04 18:51:12 +00:00
tasks/gitlab Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
views Do not show build retry link when build is active 2016-06-30 11:06:19 +02:00
workers Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
factories_spec.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
rails_helper.rb
spec_helper.rb Remove coveralls lines 2016-06-30 19:52:36 +02:00
teaspoon_env.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00