Skip to content

Commit

Permalink
Drop unused StatusController#bsrequest
Browse files Browse the repository at this point in the history
It is not used since:
openSUSE/openSUSE-release-tools@25043f9#diff-d286af753758fa38e0b8f3ef47228d0fR32

Co-authored-by: Victor Pereira <vpereira@suse.com>
  • Loading branch information
saraycp and vpereira committed Sep 6, 2018
1 parent 5ed7f30 commit ea3715a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 50 deletions.
19 changes: 0 additions & 19 deletions src/api/app/controllers/status_controller.rb
Expand Up @@ -14,25 +14,6 @@ def project
find_relationships_for_packages(@packages)
end

def bsrequest
required_parameters :id
Backend::Test.start if Rails.env.test?
@id = params[:id]

@result = {}
BsRequest.find_by_number!(params[:id]).bs_request_actions.each do |action|
sproj = Project.find_by_name!(action.source_project)
tproj = Project.find_by_name!(action.target_project)
spkg = sproj.packages.find_by_name!(action.source_package)

dir = Directory.hashed(project: action.source_project,
package: action.source_package,
expand: 1, rev: action.source_rev)
@result.deep_merge!(PackageBuildStatus.new(spkg).result(target_project: tproj, srcmd5: dir['srcmd5']))
end
render xml: render_to_string(partial: 'bsrequest')
end

private

def role_from_cache(role_id)
Expand Down
13 changes: 0 additions & 13 deletions src/api/app/views/status/_bsrequest.xml.builder

This file was deleted.

1 change: 0 additions & 1 deletion src/api/config/routes.rb
Expand Up @@ -624,7 +624,6 @@ def self.public_or_about_path?(request)
get 'status/workerstatus' => 'worker/status#index'
get 'status/history' => :history
get 'status/project/:project' => :project, constraints: cons
get 'status/bsrequest' => :bsrequest
end

### /message
Expand Down
11 changes: 0 additions & 11 deletions src/api/test/functional/request_controller_test.rb
Expand Up @@ -237,17 +237,6 @@ def test_submit_request_of_new_package
# aka sleep 1
Timecop.freeze(1)

# sneak in a test case for the status controller
get "/status/bsrequest?id=#{id}"
assert_response :success
node = Xmlhash.parse(@response.body)
assert_equal({ 'id' => id,
'repository' =>
{ 'name' => '10.2',
'arch' =>
[{ 'arch' => 'i586', 'result' => 'unknown' },
{ 'arch' => 'x86_64', 'result' => 'unknown' }] } }, node)

# create more history entries prio change, decline, reopen and finally accept it
post "/request/#{id}?cmd=setpriority&priority=ILLEGAL&comment=dontcare"
assert_response 400
Expand Down
6 changes: 0 additions & 6 deletions src/api/test/functional/status_controller_test.rb
Expand Up @@ -99,12 +99,6 @@ def test_project_status
assert_response :success
end

def test_bsrequest
get '/status/bsrequest?id=1'
assert_xml_tag(tag: 'status', attributes: { code: 'not_found' })
assert_response 404
end

def test_history
get '/status/history'
assert_response 400
Expand Down

0 comments on commit ea3715a

Please sign in to comment.