Skip to content
Snippets Groups Projects
Verified Commit 6b8ad689 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Update grape gem


New version of the gem returns 200 status code on delete with content
instead of 204 so we explicitly set status code to keep existing
behavior

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4766a77b
No related branches found
No related tags found
No related merge requests found
Showing with 28 additions and 9 deletions
Loading
Loading
@@ -71,7 +71,7 @@ gem 'gollum-rugged_adapter', '~> 0.4.4', require: false
gem 'github-linguist', '~> 4.7.0', require: 'linguist'
 
# API
gem 'grape', '~> 0.19.0'
gem 'grape', '~> 0.19.2'
gem 'grape-entity', '~> 0.6.0'
gem 'rack-cors', '~> 0.4.0', require: 'rack/cors'
 
Loading
Loading
Loading
Loading
@@ -332,13 +332,13 @@ GEM
multi_json (~> 1.11)
os (~> 0.9)
signet (~> 0.7)
grape (0.19.1)
grape (0.19.2)
activesupport
builder
hashie (>= 2.1.0)
multi_json (>= 1.3.2)
multi_xml (>= 0.5.2)
mustermann-grape (~> 0.4.0)
mustermann-grape (~> 1.0.0)
rack (>= 1.3.0)
rack-accept
virtus (>= 1.0.0)
Loading
Loading
@@ -463,10 +463,9 @@ GEM
multi_json (1.12.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
mustermann (0.4.0)
tool (~> 0.2)
mustermann-grape (0.4.0)
mustermann (= 0.4.0)
mustermann (1.0.0)
mustermann-grape (1.0.0)
mustermann (~> 1.0.0)
mysql2 (0.4.5)
net-ldap (0.12.1)
netrc (0.11.0)
Loading
Loading
@@ -850,7 +849,6 @@ GEM
timfel-krb5-auth (0.8.3)
toml-rb (0.3.15)
citrus (~> 3.0, > 3.0)
tool (0.2.3)
truncato (0.7.8)
htmlentities (~> 4.3.1)
nokogiri (~> 1.6.1)
Loading
Loading
@@ -981,7 +979,7 @@ DEPENDENCIES
gollum-rugged_adapter (~> 0.4.4)
gon (~> 6.1.0)
google-api-client (~> 0.8.6)
grape (~> 0.19.0)
grape (~> 0.19.2)
grape-entity (~> 0.6.0)
haml_lint (~> 0.21.0)
hamlit (~> 2.6.1)
Loading
Loading
Loading
Loading
@@ -68,6 +68,7 @@ class AccessRequests < Grape::API
delete ":id/access_requests/:user_id" do
source = find_source(source_type, params[:id])
 
status 204
::Members::DestroyService.new(source, current_user, params)
.execute(:requesters)
end
Loading
Loading
Loading
Loading
@@ -88,6 +88,7 @@ class AwardEmoji < Grape::API
 
unauthorized! unless award.user == current_user || current_user.admin?
 
status 204
award.destroy
end
end
Loading
Loading
Loading
Loading
@@ -91,6 +91,7 @@ def find_message
delete ':id' do
message = find_message
 
status 204
message.destroy
end
end
Loading
Loading
Loading
Loading
@@ -125,6 +125,7 @@ class DeployKeys < Grape::API
key = user_project.deploy_keys_projects.find_by(deploy_key_id: params[:key_id])
not_found!('Deploy Key') unless key
 
status 204
key.destroy
end
end
Loading
Loading
Loading
Loading
@@ -79,6 +79,7 @@ class Environments < Grape::API
 
environment = user_project.environments.find(params[:environment_id])
 
status 204
environment.destroy
end
 
Loading
Loading
Loading
Loading
@@ -125,6 +125,8 @@ def present_groups(groups, options = {})
delete ":id" do
group = find_group!(params[:id])
authorize! :admin_group, group
status 204
::Groups::DestroyService.new(group, current_user).execute
end
 
Loading
Loading
Loading
Loading
@@ -224,6 +224,7 @@ def find_issues(args = {})
not_found!('Issue') unless issue
 
authorize!(:destroy_issue, issue)
status 204
issue.destroy
end
 
Loading
Loading
Loading
Loading
@@ -56,6 +56,7 @@ class Labels < Grape::API
label = user_project.labels.find_by(title: params[:name])
not_found!('Label') unless label
 
status 204
label.destroy
end
 
Loading
Loading
Loading
Loading
@@ -96,6 +96,7 @@ class Members < Grape::API
# Ensure that memeber exists
source.members.find_by!(user_id: params[:user_id])
 
status 204
::Members::DestroyService.new(source, current_user, declared_params).execute
end
end
Loading
Loading
Loading
Loading
@@ -137,6 +137,7 @@ def find_merge_requests(args = {})
merge_request = find_project_merge_request(params[:merge_request_iid])
 
authorize!(:destroy_merge_request, merge_request)
status 204
merge_request.destroy
end
 
Loading
Loading
Loading
Loading
@@ -131,6 +131,7 @@ class Notes < Grape::API
note = user_project.notes.find(params[:note_id])
authorize! :admin_note, note
 
status 204
::Notes::DestroyService.new(user_project, current_user).execute(note)
end
end
Loading
Loading
Loading
Loading
@@ -96,6 +96,7 @@ class ProjectHooks < Grape::API
delete ":id/hooks/:hook_id" do
hook = user_project.hooks.find(params.delete(:hook_id))
 
status 204
hook.destroy
end
end
Loading
Loading
Loading
Loading
@@ -116,6 +116,7 @@ def snippets_for_current_user
not_found!('Snippet') unless snippet
 
authorize! :admin_project_snippet, snippet
status 204
snippet.destroy
end
 
Loading
Loading
Loading
Loading
@@ -361,6 +361,7 @@ def present_projects(options = {})
authorize! :remove_fork_project, user_project
 
if user_project.forked?
status 204
user_project.forked_project_link.destroy
else
not_modified!
Loading
Loading
@@ -405,6 +406,7 @@ def present_projects(options = {})
link = user_project.project_group_links.find_by(group_id: params[:group_id])
not_found!('Group Link') unless link
 
status 204
link.destroy
end
 
Loading
Loading
Loading
Loading
@@ -45,6 +45,7 @@ class Runner < Grape::API
end
delete '/' do
authenticate_runner!
status 204
Ci::Runner.find_by_token(params[:token]).destroy
end
 
Loading
Loading
Loading
Loading
@@ -79,6 +79,7 @@ class Runners < Grape::API
runner = get_runner(params[:id])
authenticate_delete_runner!(runner)
 
status 204
runner.destroy!
end
end
Loading
Loading
@@ -134,6 +135,7 @@ class Runners < Grape::API
runner = runner_project.runner
forbidden!("Only one project associated with the runner. Please remove the runner instead") if runner.projects.count == 1
 
status 204
runner_project.destroy
end
end
Loading
Loading
Loading
Loading
@@ -123,6 +123,7 @@ def public_snippets
 
authorize! :destroy_personal_snippet, snippet
 
status 204
snippet.destroy
end
 
Loading
Loading
Loading
Loading
@@ -66,6 +66,7 @@ class SystemHooks < Grape::API
hook = SystemHook.find_by(id: params[:id])
not_found!('System hook') unless hook
 
status 204
hook.destroy
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment