Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-06-29 17:15:47 +0300
committerStan Hu <stanhu@gmail.com>2015-06-29 17:15:47 +0300
commite3dbaa7027d4561bdec6860af84a9d8704d6b2a0 (patch)
treea76afdc03c19219cf3459e14cc279c8da3b87889 /lib
parent88162f697087594e714283f43301a0c35d8b44ee (diff)
parent4a203aab57c69ea402939cf8fc423a0e5aaa1cab (diff)
Merge branch '1791-fix-github-issue-order' into 'master'
Fix wrong order of issues when importing from github ### 1. What does this MR do? The order of issues imported from GitHub is fixed. ### 2. Are there points in the code the reviewer needs to double check? Nothing. ### 3. Why was this MR needed? The default behaviors of GitHub API at listing issues are sort: :created and direction: :desc. See GitHub API details at https://developer.github.com/v3/issues/#list-issues. ### 4. What are the relevant issue numbers / Feature requests? Fixes #1791 ### 5. Screenshots (if relevant) Nothing See merge request !898
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/github_import/importer.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/github_import/importer.rb b/lib/gitlab/github_import/importer.rb
index 23832b3233c..98039a76dcd 100644
--- a/lib/gitlab/github_import/importer.rb
+++ b/lib/gitlab/github_import/importer.rb
@@ -11,7 +11,9 @@ module Gitlab
def execute
#Issues && Comments
- client.list_issues(project.import_source, state: :all).each do |issue|
+ client.list_issues(project.import_source, state: :all,
+ sort: :created,
+ direction: :asc).each do |issue|
if issue.pull_request.nil?
body = @formatter.author_line(issue.user.login, issue.body)