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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
7237bfa2
Commit
7237bfa2
authored
Jan 10, 2020
by
Aishwarya Subramanian
Committed by
Jan Provaznik
Jan 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Included specs for the newer entities
Added changelog entry for the fix Corrected typo in spec description
parent
30160961
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
4 deletions
+128
-4
changelogs/unreleased/fix-missing-emoji-import.yml
changelogs/unreleased/fix-missing-emoji-import.yml
+5
-0
lib/gitlab/import_export/import_export.yml
lib/gitlab/import_export/import_export.yml
+5
-0
spec/fixtures/lib/gitlab/import_export/complex/project.json
spec/fixtures/lib/gitlab/import_export/complex/project.json
+82
-4
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+36
-0
No files found.
changelogs/unreleased/fix-missing-emoji-import.yml
0 → 100644
View file @
7237bfa2
---
title
:
Add support to export and import award emojis for issues, issue notes, MR, MR notes and snippet notes
merge_request
:
22493
author
:
type
:
fixed
lib/gitlab/import_export/import_export.yml
View file @
7237bfa2
...
...
@@ -16,6 +16,7 @@ tree:
-
:timelogs
-
notes
:
-
:author
-
:award_emoji
-
events
:
-
:push_event_payload
-
label_links
:
...
...
@@ -32,18 +33,22 @@ tree:
-
:issue_assignees
-
:zoom_meetings
-
:sentry_issue
-
:award_emoji
-
snippets
:
-
:award_emoji
-
notes
:
-
:author
-
:award_emoji
-
releases
:
-
:links
-
project_members
:
-
:user
-
merge_requests
:
-
:metrics
-
:award_emoji
-
notes
:
-
:author
-
:award_emoji
-
events
:
-
:push_event_payload
-
:suggestions
...
...
spec/fixtures/lib/gitlab/import_export/complex/project.json
View file @
7237bfa2
...
...
@@ -80,6 +80,17 @@
"issue_id"
:
40
}
],
"award_emoji"
:
[
{
"id"
:
1
,
"name"
:
"musical_keyboard"
,
"user_id"
:
1
,
"awardable_type"
:
"Issue"
,
"awardable_id"
:
40
,
"created_at"
:
"2020-01-07T11:55:22.234Z"
,
"updated_at"
:
"2020-01-07T11:55:22.234Z"
}
],
"zoom_meetings"
:
[
{
"id"
:
1
,
...
...
@@ -188,7 +199,18 @@
"author"
:
{
"name"
:
"User 4"
},
"events"
:
[]
"events"
:
[],
"award_emoji"
:
[
{
"id"
:
1
,
"name"
:
"clapper"
,
"user_id"
:
1
,
"awardable_type"
:
"Note"
,
"awardable_id"
:
351
,
"created_at"
:
"2020-01-07T11:55:22.234Z"
,
"updated_at"
:
"2020-01-07T11:55:22.234Z"
}
]
},
{
"id"
:
352
,
...
...
@@ -2297,7 +2319,32 @@
"updated_at"
:
"2019-11-05T15:37:24.645Z"
}
],
"notes"
:
[]
"notes"
:
[
{
"id"
:
872
,
"note"
:
"This is a test note"
,
"noteable_type"
:
"Snippet"
,
"author_id"
:
1
,
"created_at"
:
"2019-11-05T15:37:24.645Z"
,
"updated_at"
:
"2019-11-05T15:37:24.645Z"
,
"noteable_id"
:
1
,
"author"
:
{
"name"
:
"Random name"
},
"events"
:
[],
"award_emoji"
:
[
{
"id"
:
12
,
"name"
:
"thumbsup"
,
"user_id"
:
1
,
"awardable_type"
:
"Note"
,
"awardable_id"
:
872
,
"created_at"
:
"2019-11-05T15:37:21.287Z"
,
"updated_at"
:
"2019-11-05T15:37:21.287Z"
}
]
}
]
}
],
"releases"
:
[],
...
...
@@ -2434,7 +2481,18 @@
"author"
:
{
"name"
:
"User 4"
},
"events"
:
[]
"events"
:
[],
"award_emoji"
:
[
{
"id"
:
1
,
"name"
:
"tada"
,
"user_id"
:
1
,
"awardable_type"
:
"Note"
,
"awardable_id"
:
1
,
"created_at"
:
"2019-11-05T15:37:21.287Z"
,
"updated_at"
:
"2019-11-05T15:37:21.287Z"
}
]
},
{
"id"
:
672
,
...
...
@@ -2840,7 +2898,27 @@
"author_id"
:
1
}
],
"approvals_before_merge"
:
1
"approvals_before_merge"
:
1
,
"award_emoji"
:
[
{
"id"
:
1
,
"name"
:
"thumbsup"
,
"user_id"
:
1
,
"awardable_type"
:
"MergeRequest"
,
"awardable_id"
:
27
,
"created_at"
:
"2020-01-07T11:21:21.235Z"
,
"updated_at"
:
"2020-01-07T11:21:21.235Z"
},
{
"id"
:
2
,
"name"
:
"drum"
,
"user_id"
:
1
,
"awardable_type"
:
"MergeRequest"
,
"awardable_id"
:
27
,
"created_at"
:
"2020-01-07T11:21:21.235Z"
,
"updated_at"
:
"2020-01-07T11:21:21.235Z"
}
]
},
{
"id"
:
26
,
...
...
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
7237bfa2
...
...
@@ -219,6 +219,16 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
expect
(
award_emoji
.
map
(
&
:name
)).
to
contain_exactly
(
'thumbsup'
,
'coffee'
)
end
it
'snippet has notes'
do
expect
(
@project
.
snippets
.
first
.
notes
.
count
).
to
eq
(
1
)
end
it
'snippet has award emojis on notes'
do
award_emoji
=
@project
.
snippets
.
first
.
notes
.
first
.
award_emoji
.
first
expect
(
award_emoji
.
name
).
to
eq
(
'thumbsup'
)
end
it
'restores `ci_cd_settings` : `group_runners_enabled` setting'
do
expect
(
@project
.
ci_cd_settings
.
group_runners_enabled?
).
to
eq
(
false
)
end
...
...
@@ -240,6 +250,18 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
expect
(
sentry_issue
.
sentry_issue_identifier
).
to
eq
(
1234567891
)
end
it
'has award emoji for an issue'
do
award_emoji
=
@project
.
issues
.
first
.
award_emoji
.
first
expect
(
award_emoji
.
name
).
to
eq
(
'musical_keyboard'
)
end
it
'has award emoji for a note in an issue'
do
award_emoji
=
@project
.
issues
.
first
.
notes
.
first
.
award_emoji
.
first
expect
(
award_emoji
.
name
).
to
eq
(
'clapper'
)
end
it
'restores container_expiration_policy'
do
policy
=
Project
.
find_by_path
(
'project'
).
container_expiration_policy
...
...
@@ -266,6 +288,20 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
it
'has no source if source/target differ'
do
expect
(
MergeRequest
.
find_by_title
(
'MR2'
).
source_project_id
).
to
be_nil
end
it
'has award emoji'
do
award_emoji
=
MergeRequest
.
find_by_title
(
'MR1'
).
award_emoji
expect
(
award_emoji
.
map
(
&
:name
)).
to
contain_exactly
(
'thumbsup'
,
'drum'
)
end
context
'notes'
do
it
'has award emoji'
do
award_emoji
=
MergeRequest
.
find_by_title
(
'MR1'
).
notes
.
first
.
award_emoji
.
first
expect
(
award_emoji
.
name
).
to
eq
(
'tada'
)
end
end
end
context
'tokens are regenerated'
do
...
...
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