Skip to content

Commit

Permalink
Merge pull request #5023 from bgeuken/bugfix/manual_maintenance_relea…
Browse files Browse the repository at this point in the history
…se_project_wide

Bugfix/manual maintenance release project wide
  • Loading branch information
bgeuken committed Jun 19, 2018
2 parents 4c45d48 + 35728aa commit 16527db
Show file tree
Hide file tree
Showing 8 changed files with 704 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Metrics/AbcSize:
# Offense count: 486
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 493
Max: 505

# Offense count: 24
# Configuration parameters: CountBlocks.
Expand Down
1 change: 0 additions & 1 deletion src/api/app/models/binary_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def self.update_binary_releases_via_json(repository, json, time = Time.now)
rescue ActiveXML::Transport::NotFoundError
# patchinfo disappeared meanwhile
end
# no database object on purpose, since it must also work for historic releases...
hash[:binary_maintainer] = patchinfo.to_hash['packager'] if patchinfo && patchinfo.to_hash['packager']
end

Expand Down
5 changes: 5 additions & 0 deletions src/api/app/models/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,11 @@ def send_sysrq(params)
backend_build_command(:sendsysrq, params[:project], params.slice(:package, :arch, :repository, :sysrq))
end

def target_name
# The maintenance ID is always the sub project name of the maintenance project
project.is_maintenance_incident? ? "#{name}.#{project.basename}" : name
end

def release_target_name
# usually used in maintenance incidents
return releasename if releasename
Expand Down
7 changes: 6 additions & 1 deletion src/api/app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Project < ApplicationRecord
include HasRelationships
include HasRatings
include HasAttributes
include MaintenanceHelper

class CycleError < APIException
setup 'project_cycle'
Expand Down Expand Up @@ -696,6 +697,10 @@ def possible_ancestor_names
possible_projects
end

def basename
name.gsub(/.*:/, '')
end

def to_axml(_opts = {})
Rails.cache.fetch("xml_project_#{id}") do
# CanRenderModel
Expand Down Expand Up @@ -1223,7 +1228,7 @@ def do_project_release(params)
next if params[:targetreposiory] && params[:targetreposiory] != releasetarget.target_repository.name
# release source and binaries
# permission checking happens inside this function
release_package(pkg, releasetarget.target_repository, pkg.name, repo, nil, nil, params[:setrelease], true)
release_package(pkg, releasetarget.target_repository, pkg.target_name, repo, nil, nil, params[:setrelease], true)
end
end
end
Expand Down
Loading

0 comments on commit 16527db

Please sign in to comment.