Skip to content

Commit

Permalink
Merge pull request #14076 from eduardoj/fix/remove_post_build_reposit…
Browse files Browse the repository at this point in the history
…ory_route

Remove POST /build/{project_name}/{repository_name} API route
  • Loading branch information
eduardoj committed Mar 28, 2023
2 parents 7ffd60a + f877d0b commit d394dc7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/config/routes/api_routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
match 'build/:project/:repository/:arch(/:package)' => 'build#index', constraints: cons, via: [:get, :post]
get 'build/_result' => 'build#scmresult', constraints: cons
get 'build/:project/_result' => 'build#result', constraints: cons
match 'build/:project/:repository' => 'build#index', constraints: cons, via: [:get, :post]
get 'build/:project/:repository' => 'build#index', constraints: cons
match 'build/:project' => 'build#project_index', constraints: cons, via: [:get, :post, :put]
get 'build' => 'source#index'

Expand Down
8 changes: 4 additions & 4 deletions src/api/test/functional/interconnect_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ def test_read_and_command_tests
get '/build/UseRemoteInstance/pop/i586/pack2.linked/_log'
assert_response :success
# test source modifications
post '/build/UseRemoteInstance/pack2', params: { cmd: 'set_flag' }
assert_response 403
post '/build/UseRemoteInstance/pack2', params: { cmd: 'unlock' }
assert_response 403
# post '/source/UseRemoteInstance/pack2', params: { cmd: 'set_flag', flag: 'access', status: 'enable' }
# assert_response 500 # FIXME: don't fail with a 500 error. Return a 403 or a 404 error
post '/source/UseRemoteInstance/pack2', params: { cmd: 'unlock' }
assert_response 404 # FIXME: Return a 403 error...
get '/source/UseRemoteInstance/NotExisting'
assert_response 404
get '/source/UseRemoteInstance/NotExisting/_meta'
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/source_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ def test_lock_project
assert_response 403
post '/build/home:Iggy?cmd=wipe'
assert_response 403
post '/build/home:Iggy/TestLinkPack?cmd=wipe'
post '/source/home:Iggy/TestLinkPack?cmd=wipe'
assert_response 403

# check branching from a locked project
Expand Down

0 comments on commit d394dc7

Please sign in to comment.