add some more comments
This commit is contained in:
parent
d8252efea9
commit
ec394d4908
|
@ -1,12 +1,12 @@
|
|||
module Gitlab
|
||||
module ImportExport
|
||||
# Given a class, it finds or creates a new object
|
||||
# (initializes in the case of Label) at group or project level
|
||||
# If it does not exist in the group, it creates it at project level
|
||||
# (initializes in the case of Label) at group or project level.
|
||||
# If it does not exist in the group, it creates it at project level.
|
||||
#
|
||||
# For example:
|
||||
# `GroupProjectObjectBuilder.build(Label, label_attributes)`
|
||||
# finds or initializes a label with the given attributes.
|
||||
# Example:
|
||||
# `GroupProjectObjectBuilder.build(Label, label_attributes)`
|
||||
# finds or initializes a label with the given attributes.
|
||||
#
|
||||
# It also adds some logic around Group Labels/Milestones for edge cases.
|
||||
class GroupProjectObjectBuilder
|
||||
|
@ -88,6 +88,8 @@ module Gitlab
|
|||
# - Importing into a user namespace project with exported group milestones
|
||||
# where the IID of the Group milestone could conflict with a project one.
|
||||
def claim_iid
|
||||
# The milestone has to be a group milestone, as it's the only case where
|
||||
# we set the IID as the maximum. The rest of them are fixed.
|
||||
group_milestone = @project.milestones.find_by(iid: @attributes['iid'])
|
||||
|
||||
group_milestone.update!(iid: max_milestone_iid + 1) if group_milestone
|
||||
|
|
|
@ -78,6 +78,9 @@ module Gitlab
|
|||
@restored_project = Project.find(@project_id)
|
||||
end
|
||||
|
||||
# Remove project models that became group models as we found them at group level.
|
||||
# This no longer required saving them at the root project level.
|
||||
# For example, in the case of an existing group label that matched the title.
|
||||
def remove_group_models(relation_hash)
|
||||
relation_hash.reject! do |value|
|
||||
value.respond_to?(:group_id) && value.group_id && GROUP_MODELS.include?(value.class)
|
||||
|
|
Loading…
Reference in New Issue