Skip to content

Commit

Permalink
Merge pull request #8718 from eduardoj/fix_8712_stage_new_packages
Browse files Browse the repository at this point in the history
Allow to stage new packages again
  • Loading branch information
coolo committed Nov 14, 2019
2 parents 535ab0c + 8c34201 commit 8a8ef05
Show file tree
Hide file tree
Showing 6 changed files with 1,793 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/api/app/models/staging/staged_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ def link_package(bs_request_action)
source_package = Package.get_by_project_and_name!(bs_request_action.source_project,
bs_request_action.source_package)

# it is possible that target_package doesn't exist
target_package = Package.get_by_project_and_name(bs_request_action.target_project,
bs_request_action.target_package)

query_options = { expand: 1 }
query_options[:rev] = bs_request_action.source_rev if bs_request_action.source_rev

Expand All @@ -129,13 +125,6 @@ def link_package(bs_request_action)
create_link(staging_project.name, link_package.name, User.session!, project: source_package.project.name,
package: source_package.name, rev: package_rev,
vrev: source_vrev)
# for multispec packages, we have to create local links to the main package
if target_package.present?
target_package.find_project_local_linking_packages.each do |local_linking_package|
linked_package = Package.find_or_create_by!(project: staging_project, name: local_linking_package.name)
create_link(staging_project.name, linked_package.name, User.session!, package: target_package.name, cicount: 'copy')
end
end

ProjectLogEntry.create!(
project: staging_project,
Expand Down
Loading

0 comments on commit 8a8ef05

Please sign in to comment.