Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/resolvers/ci/runner_status_resolver.rb')
-rw-r--r--app/graphql/resolvers/ci/runner_status_resolver.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/graphql/resolvers/ci/runner_status_resolver.rb b/app/graphql/resolvers/ci/runner_status_resolver.rb
new file mode 100644
index 00000000000..d916a8a13f0
--- /dev/null
+++ b/app/graphql/resolvers/ci/runner_status_resolver.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+module Resolvers
+ module Ci
+ # NOTE: This class was introduced to allow modifying the meaning of certain values in RunnerStatusEnum
+ # while preserving backward compatibility. It can be removed in 15.0 once the API has stabilized.
+ class RunnerStatusResolver < BaseResolver
+ type Types::Ci::RunnerStatusEnum, null: false
+
+ alias_method :runner, :object
+
+ argument :legacy_mode,
+ type: GraphQL::Types::String,
+ default_value: '14.5',
+ required: false,
+ description: 'Compatibility mode. A null value turns off compatibility mode.',
+ deprecated: { reason: 'Will be removed in 15.0. From that release onward, the field will behave as if legacyMode is null', milestone: '14.6' }
+
+ def resolve(legacy_mode:, **args)
+ runner.status(legacy_mode)
+ end
+ end
+ end
+end