From 0945329b37870a364e188979b0ad45df4492b910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Vantomme?= Date: Thu, 4 Mar 2021 17:35:44 +0100 Subject: [PATCH] Update 'remove_variable' to allow filtering by environment_scope Scoped variables require filtering on environment to be deleted. usage: remove_variable(3, 'DEL_VARIABLE', filter: { environment_scope: 'production' }) --- lib/gitlab/client/build_variables.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/gitlab/client/build_variables.rb b/lib/gitlab/client/build_variables.rb index bc1d4ebc9..7c2571a82 100644 --- a/lib/gitlab/client/build_variables.rb +++ b/lib/gitlab/client/build_variables.rb @@ -63,9 +63,10 @@ def update_variable(project, key, value, **opts) # # @param [Integer, String] project The ID or name of a project. # @param [String] key The key of a variable. + # @param [Hash] opts optional parameters # @return [Gitlab::ObjectifiedHash] The variable. - def remove_variable(project, key) - delete("/projects/#{url_encode project}/variables/#{key}") + def remove_variable(project, key, **opts) + delete("/projects/#{url_encode project}/variables/#{key}", query: opts) end # Gets a list of the group's build variables