diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /lib/feature.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'lib/feature.rb')
-rw-r--r-- | lib/feature.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/feature.rb b/lib/feature.rb index f317e8cb2c5..5841828da0e 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -301,11 +301,11 @@ module Feature end def gate_specified? - %i(user project group feature_group namespace).any? { |key| params.key?(key) } + %i(user project group feature_group namespace repository).any? { |key| params.key?(key) } end def targets - [feature_group, users, projects, groups, namespaces].flatten.compact + [feature_group, users, projects, groups, namespaces, repositories].flatten.compact end private @@ -350,6 +350,17 @@ module Feature Namespace.without_project_namespaces.find_by_full_path(arg) || (raise UnknowTargetError, "#{arg} is not found!") end end + + def repositories + return unless params.key?(:repository) + + params[:repository].split(',').map do |arg| + container, _project, _type, _path = Gitlab::RepoPath.parse(arg) + raise UnknowTargetError, "#{arg} is not found!" if container.nil? + + container.repository + end + end end end |