Skip to content
Snippets Groups Projects
Commit d6edecde authored by James Lopez's avatar James Lopez
Browse files

Fix duplicated build token problem and added relevant spec

parent 2c49c1af
No related branches found
No related tags found
No related merge requests found
---
title: Fix Import/Export duplicated builds error
merge_request:
author:
Loading
Loading
@@ -99,6 +99,8 @@ module Gitlab
def generate_imported_object
if BUILD_MODELS.include?(@relation_name) # call #trace= method after assigning the other attributes
trace = @relation_hash.delete('trace')
@relation_hash.delete('token')
imported_object do |object|
object.trace = trace
object.commit_id = nil
Loading
Loading
Loading
Loading
@@ -6548,7 +6548,9 @@
"url": null
},
"erased_by_id": null,
"erased_at": null
"erased_at": null,
"type": "Ci::Build",
"token": "abcd"
},
{
"id": 72,
Loading
Loading
Loading
Loading
@@ -189,6 +189,14 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do
end
end
end
context 'existing builds' do
it 'do not throw errors' do
create(:ci_build, token: 'abcd')
expect(restored_project_json).to be true
end
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment