Commit 8476f91a authored by James Lopez's avatar James Lopez

WIP - added missing notes, trying to fix specs

parent 9d0038f2
...@@ -179,5 +179,9 @@ module Ci ...@@ -179,5 +179,9 @@ module Ci
self.yaml_errors = error self.yaml_errors = error
update_state update_state
end end
def notes
Note.for_commit_id(valid_commit_sha)
end
end end
end end
...@@ -5,7 +5,9 @@ project_tree: ...@@ -5,7 +5,9 @@ project_tree:
:author :author
- :labels - :labels
- :milestones - :milestones
- :snippets - snippets:
- notes:
:author
- :releases - :releases
- :events - :events
- project_members: - project_members:
......
...@@ -53,6 +53,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do ...@@ -53,6 +53,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do
expect(saved_project_json['snippets']).not_to be_empty expect(saved_project_json['snippets']).not_to be_empty
end end
it 'has snippet notes' do
expect(saved_project_json['snippets'].first['notes']).not_to be_empty
end
it 'has releases' do it 'has releases' do
expect(saved_project_json['releases']).not_to be_empty expect(saved_project_json['releases']).not_to be_empty
end end
...@@ -96,6 +100,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do ...@@ -96,6 +100,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do
it 'has ci commits' do it 'has ci commits' do
expect(saved_project_json['ci_commits']).not_to be_empty expect(saved_project_json['ci_commits']).not_to be_empty
end end
it 'has ci commits notes' do
expect(saved_project_json['ci_commits'].first['notes']).not_to be_empty
end
end end
end end
...@@ -115,11 +123,20 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do ...@@ -115,11 +123,20 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do
releases: [release] releases: [release]
) )
ci_commit = create(:ci_commit, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) commit_status = create(:commit_status, project: project)
create(:ci_build, commit: ci_commit)
ci_commit = create(:ci_commit,
project: project,
sha: merge_request.last_commit.id,
ref: merge_request.source_branch,
statuses: [commit_status])
create(:ci_build, commit: ci_commit, project: project)
create(:milestone, project: project) create(:milestone, project: project)
create(:note, noteable: issue) create(:note, noteable: issue, project: project)
create(:note, noteable: merge_request) create(:note, noteable: merge_request, project: project)
create(:note, noteable: ci_commit, project: project)
create(:note, noteable: snippet, project: project)
project project
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