Commit 838bef87 authored by Sean McGivern's avatar Sean McGivern Committed by Jose Ivan Vargas

Merge branch 'fix/import-events' into 'master'

Fix events error importing GitLab projects

Closes #36965

See merge request !13868
parent 6b71f328
---
title: Fix events error importing GitLab projects
merge_request:
author:
type: fixed
...@@ -135,3 +135,7 @@ methods: ...@@ -135,3 +135,7 @@ methods:
- :diff_head_sha - :diff_head_sha
project: project:
- :description_html - :description_html
events:
- :action
push_event_payload:
- :action
\ No newline at end of file
...@@ -79,6 +79,10 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do ...@@ -79,6 +79,10 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
expect(event).not_to be_nil expect(event).not_to be_nil
end end
it 'has the action' do
expect(event.action).not_to be_nil
end
it 'event belongs to note, belongs to merge request, belongs to a project' do it 'event belongs to note, belongs to merge request, belongs to a project' do
expect(event.note.noteable.project).not_to be_nil expect(event.note.noteable.project).not_to be_nil
end end
......
...@@ -35,7 +35,8 @@ module ExportFileHelper ...@@ -35,7 +35,8 @@ module ExportFileHelper
project: project, project: project,
commit_id: ci_pipeline.sha) commit_id: ci_pipeline.sha)
create(:event, :created, target: milestone, project: project, author: user) event = create(:event, :created, target: milestone, project: project, author: user, action: 5)
create(:push_event_payload, event: event)
create(:project_member, :master, user: user, project: project) create(:project_member, :master, user: user, project: project)
create(:ci_variable, project: project) create(:ci_variable, project: project)
create(:ci_trigger, project: project) create(:ci_trigger, project: project)
......
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