diff options
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/ci/runners_finder.rb | 11 | ||||
-rw-r--r-- | app/finders/personal_access_tokens_finder.rb | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/app/finders/ci/runners_finder.rb b/app/finders/ci/runners_finder.rb index 18be2aec2e2..66b16e875c1 100644 --- a/app/finders/ci/runners_finder.rb +++ b/app/finders/ci/runners_finder.rb @@ -29,6 +29,7 @@ module Ci items = by_runner_type(items) items = by_tag_list(items) items = by_creator_id(items) + items = by_creator_username(items) items = by_version_prefix(items) items = request_tag_list(items) @@ -130,6 +131,16 @@ module Ci items.with_creator_id(creator_id) end + def by_creator_username(items) + creator_username = @params[:creator_username].presence + return items unless creator_username + + creator_id = User.find_by_username(creator_username)&.id + return Ci::Runner.none unless creator_id + + items.with_creator_id(creator_id) + end + def by_version_prefix(items) sanitized_prefix = @params.fetch(:version_prefix, '')[/^[\d+.]+/] return items unless sanitized_prefix diff --git a/app/finders/personal_access_tokens_finder.rb b/app/finders/personal_access_tokens_finder.rb index 5af08cf0660..659c52e200a 100644 --- a/app/finders/personal_access_tokens_finder.rb +++ b/app/finders/personal_access_tokens_finder.rb @@ -24,6 +24,7 @@ class PersonalAccessTokensFinder tokens = by_last_used_before(tokens) tokens = by_last_used_after(tokens) tokens = by_search(tokens) + tokens = tokens.allow_cross_joins_across_databases(url: "https://gitlab.com/gitlab-org/gitlab/-/issues/436657") sort(tokens) end |