Commit 5f6df793 authored by Alex Buijs's avatar Alex Buijs

Refactor Labkit::Context to Gitlab::ApplicationContext

From Refactor Labkit::Context::KNOWN_KEYS
To Gitlab::ApplicationContext::KNOWN_KEYS
parent a6b8a86f
...@@ -8,7 +8,7 @@ module Mutations ...@@ -8,7 +8,7 @@ module Mutations
ADMIN_MESSAGE = 'You must be an admin to use this mutation' ADMIN_MESSAGE = 'You must be an admin to use this mutation'
Labkit::Context::KNOWN_KEYS.each do |key| Gitlab::ApplicationContext::KNOWN_KEYS.each do |key|
argument key, argument key,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
required: false, required: false,
......
...@@ -12,11 +12,11 @@ module API ...@@ -12,11 +12,11 @@ module API
namespace 'queues' do namespace 'queues' do
desc 'Drop jobs matching the given metadata from the Sidekiq queue' desc 'Drop jobs matching the given metadata from the Sidekiq queue'
params do params do
Labkit::Context::KNOWN_KEYS.each do |key| Gitlab::ApplicationContext::KNOWN_KEYS.each do |key|
optional key, type: String, allow_blank: false optional key, type: String, allow_blank: false
end end
at_least_one_of(*Labkit::Context::KNOWN_KEYS) at_least_one_of(*Gitlab::ApplicationContext::KNOWN_KEYS)
end end
delete ':queue_name' do delete ':queue_name' do
result = result =
......
...@@ -8,6 +8,8 @@ module Gitlab ...@@ -8,6 +8,8 @@ module Gitlab
Attribute = Struct.new(:name, :type) Attribute = Struct.new(:name, :type)
KNOWN_KEYS = Labkit::Context::KNOWN_KEYS
APPLICATION_ATTRIBUTES = [ APPLICATION_ATTRIBUTES = [
Attribute.new(:project, Project), Attribute.new(:project, Project),
Attribute.new(:namespace, Namespace), Attribute.new(:namespace, Namespace),
......
...@@ -21,7 +21,7 @@ module Gitlab ...@@ -21,7 +21,7 @@ module Gitlab
job_search_metadata = job_search_metadata =
search_metadata search_metadata
.stringify_keys .stringify_keys
.slice(*Labkit::Context::KNOWN_KEYS) .slice(*Gitlab::ApplicationContext::KNOWN_KEYS)
.transform_keys { |key| "meta.#{key}" } .transform_keys { |key| "meta.#{key}" }
.compact .compact
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment