Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/api/app/models/bs_request_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,13 @@ def check_action_permission_source!
sprj
end

def allow_action_to_scmsync?
return true unless target_project_object # no object, no scmsync
return true if target_project_object.scmsync.present? # no scmsync, no problems

false if target_package # we allow to change the target project, but not the target package
end

def check_action_permission_target!
return unless target_project

Expand All @@ -957,7 +964,7 @@ def check_action_permission_target!
'a submit self is not possible, please use the maintenance workflow instead.'
end

if tprj.scmsync.present?
unless allow_action_to_scmsync?
raise RequestRejected,
"The target project #{target_project} is managed in an external SCM: #{tprj.scmsync}"
end
Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_change_devel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ def short_name
'Change Devel'
end

def allow_action_to_scmsync?
false
end

#### Alias of methods
end

Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_maintenance_incident.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ def short_name

private

def allow_action_to_scmsync?
false
end

def _merge_pkg_into_maintenance_incident(incident_project)
# recreate package based on link target and throw everything away, except source changes
# silently as maintenance teams requests ...
Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_maintenance_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def short_name

private

def allow_action_to_scmsync?
false
end

def sanity_check!
# get sure that the releasetarget definition exists or we release without binaries
prj = Project.get_by_name(source_project)
Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ def short_name

private

def allow_action_to_scmsync?
false
end

def sanity_check!
# get sure that the releasetarget definition exists or we release without binaries
prj = Project.get_by_name(source_project)
Expand Down
6 changes: 6 additions & 0 deletions src/api/app/models/bs_request_action_submit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ def target_srcmd5
backend_package&.[]('linkinfo')&.[]('xsrcmd5') || backend_package&.[]('srcmd5')
end

private

def allow_action_to_scmsync?
false
end

#### Alias of methods
end

Expand Down