Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
e0ef9dc8
Commit
e0ef9dc8
authored
Dec 16, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BB importer: Milestone importer
parent
ffa35233
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
lib/bitbucket/representation/issue.rb
lib/bitbucket/representation/issue.rb
+4
-0
lib/gitlab/bitbucket_import/importer.rb
lib/gitlab/bitbucket_import/importer.rb
+2
-0
spec/lib/bitbucket/representation/issue_spec.rb
spec/lib/bitbucket/representation/issue_spec.rb
+6
-0
No files found.
lib/bitbucket/representation/issue.rb
View file @
e0ef9dc8
...
...
@@ -27,6 +27,10 @@ module Bitbucket
raw
[
'title'
]
end
def
milestone
raw
.
dig
(
'milestone'
,
'name'
)
end
def
created_at
raw
[
'created_on'
]
end
...
...
lib/gitlab/bitbucket_import/importer.rb
View file @
e0ef9dc8
...
...
@@ -67,6 +67,7 @@ module Gitlab
description
+=
issue
.
description
label_name
=
issue
.
kind
milestone
=
issue
.
milestone
?
project
.
milestones
.
find_or_create_by
(
title:
issue
.
milestone
)
:
nil
issue
=
project
.
issues
.
create!
(
iid:
issue
.
iid
,
...
...
@@ -74,6 +75,7 @@ module Gitlab
description:
description
,
state:
issue
.
state
,
author_id:
gitlab_user_id
(
project
,
issue
.
author
),
milestone:
milestone
,
created_at:
issue
.
created_at
,
updated_at:
issue
.
updated_at
)
...
...
spec/lib/bitbucket/representation/issue_spec.rb
View file @
e0ef9dc8
...
...
@@ -9,6 +9,12 @@ describe Bitbucket::Representation::Issue do
it
{
expect
(
described_class
.
new
(
'kind'
=>
'bug'
).
kind
).
to
eq
(
'bug'
)
}
end
describe
'#milestone'
do
it
{
expect
(
described_class
.
new
({
'milestone'
=>
{
'name'
=>
'1.0'
}
}).
milestone
).
to
eq
(
'1.0'
)
}
it
{
expect
(
described_class
.
new
({}).
milestone
).
to
be_nil
}
end
describe
'#author'
do
it
{
expect
(
described_class
.
new
({
'reporter'
=>
{
'username'
=>
'Ben'
}
}).
author
).
to
eq
(
'Ben'
)
}
it
{
expect
(
described_class
.
new
({}).
author
).
to
be_nil
}
...
...
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