BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d13bba44
Commit
d13bba44
authored
Apr 15, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GitHub Issue/PR number as iid to keep references
With these changes we don’t lost the issue/pr references when importing them to GitLab.
parent
70e6fa31
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
4 deletions
+13
-4
internal_id.rb
app/models/concerns/internal_id.rb
+6
-4
issue_formatter.rb
lib/gitlab/github_import/issue_formatter.rb
+1
-0
pull_request_formatter.rb
lib/gitlab/github_import/pull_request_formatter.rb
+1
-0
issue_formatter_spec.rb
spec/lib/gitlab/github_import/issue_formatter_spec.rb
+2
-0
pull_request_formatter_spec.rb
spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
+3
-0
No files found.
app/models/concerns/internal_id.rb
View file @
d13bba44
...
...
@@ -7,11 +7,13 @@ module InternalId
end
def
set_iid
records
=
project
.
send
(
self
.
class
.
name
.
tableize
)
records
=
records
.
with_deleted
if
self
.
paranoid?
max_iid
=
records
.
maximum
(
:iid
)
if
iid
.
blank?
records
=
project
.
send
(
self
.
class
.
name
.
tableize
)
records
=
records
.
with_deleted
if
self
.
paranoid?
max_iid
=
records
.
maximum
(
:iid
)
self
.
iid
=
max_iid
.
to_i
+
1
self
.
iid
=
max_iid
.
to_i
+
1
end
end
def
to_param
...
...
lib/gitlab/github_import/issue_formatter.rb
View file @
d13bba44
...
...
@@ -3,6 +3,7 @@ module Gitlab
class
IssueFormatter
<
BaseFormatter
def
attributes
{
iid:
number
,
project:
project
,
title:
raw_data
.
title
,
description:
description
,
...
...
lib/gitlab/github_import/pull_request_formatter.rb
View file @
d13bba44
...
...
@@ -3,6 +3,7 @@ module Gitlab
class
PullRequestFormatter
<
BaseFormatter
def
attributes
{
iid:
number
,
title:
raw_data
.
title
,
description:
description
,
source_project:
source_project
,
...
...
spec/lib/gitlab/github_import/issue_formatter_spec.rb
View file @
d13bba44
...
...
@@ -30,6 +30,7 @@ describe Gitlab::GithubImport::IssueFormatter, lib: true do
it
'returns formatted attributes'
do
expected
=
{
iid:
1347
,
project:
project
,
title:
'Found a bug'
,
description:
"*Created by: octocat*
\n\n
I'm having a problem with this."
,
...
...
@@ -50,6 +51,7 @@ describe Gitlab::GithubImport::IssueFormatter, lib: true do
it
'returns formatted attributes'
do
expected
=
{
iid:
1347
,
project:
project
,
title:
'Found a bug'
,
description:
"*Created by: octocat*
\n\n
I'm having a problem with this."
,
...
...
spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
View file @
d13bba44
...
...
@@ -35,6 +35,7 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
it
'returns formatted attributes'
do
expected
=
{
iid:
1347
,
title:
'New feature'
,
description:
"*Created by: octocat*
\n\n
Please pull these awesome changes"
,
source_project:
project
,
...
...
@@ -58,6 +59,7 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
it
'returns formatted attributes'
do
expected
=
{
iid:
1347
,
title:
'New feature'
,
description:
"*Created by: octocat*
\n\n
Please pull these awesome changes"
,
source_project:
project
,
...
...
@@ -81,6 +83,7 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
it
'returns formatted attributes'
do
expected
=
{
iid:
1347
,
title:
'New feature'
,
description:
"*Created by: octocat*
\n\n
Please pull these awesome changes"
,
source_project:
project
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment