Commit ba1fcf36 authored by James Lopez's avatar James Lopez

added commits and merge request diffs to export

parent 5fbcfab6
......@@ -11,13 +11,21 @@ module Projects
end
def project_tree
%i(issues merge_requests labels milestones snippets releases events commit_statuses) + members
%i(issues labels milestones snippets releases events) + [members, merge_requests, commit_statuses]
end
private
def merge_requests
{ merge_requests: { include: :merge_request_diff } }
end
def commit_statuses
{ commit_statuses: { include: :commit } }
end
def members
[{ project_members: { include: [user: { only: [:id, :email, :username] }] } }]
{ project_members: { include: [user: { only: [:id, :email, :username] }] } }
end
def storage_path
......
......@@ -85,6 +85,14 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do
it 'has project members' do
expect(saved_project_json['project_members']).not_to be_empty
end
it 'has merge requests diffs' do
expect(saved_project_json['merge_requests'].first['merge_request_diff']).not_to be_empty
end
it 'has ci commits' do
expect(saved_project_json['commit_statuses'].first['commit']).not_to be_empty
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment