diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-12 00:08:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-12 00:08:18 +0300 |
commit | d5012fff67191be53070d024a89195a666a581ed (patch) | |
tree | 08d4334c0202f365a5513dd2147d5a411fe05bcb /app/graphql/types | |
parent | 1a2f754734eb189e371e25e685413808f69a7f2c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql/types')
-rw-r--r-- | app/graphql/types/ci/job_type.rb | 21 | ||||
-rw-r--r-- | app/graphql/types/ci/runner_manager_type.rb (renamed from app/graphql/types/ci/runner_machine_type.rb) | 32 | ||||
-rw-r--r-- | app/graphql/types/ci/runner_type.rb | 10 |
3 files changed, 30 insertions, 33 deletions
diff --git a/app/graphql/types/ci/job_type.rb b/app/graphql/types/ci/job_type.rb index 60c1c2e601d..61f2d0cdb51 100644 --- a/app/graphql/types/ci/job_type.rb +++ b/app/graphql/types/ci/job_type.rb @@ -25,8 +25,8 @@ module Types description: 'References to builds that must complete before the jobs run.' field :pipeline, Types::Ci::PipelineType, null: true, description: 'Pipeline the job belongs to.' - field :runner_machine, ::Types::Ci::RunnerMachineType, null: true, - description: 'Runner machine assigned to the job.', + field :runner_manager, ::Types::Ci::RunnerManagerType, null: true, + description: 'Runner manager assigned to the job.', alpha: { milestone: '15.11' } field :stage, Types::Ci::StageType, null: true, description: 'Stage of the job.' @@ -172,17 +172,16 @@ module Types ::Gitlab::Graphql::Loaders::BatchModelLoader.new(::Ci::Stage, object.stage_id).find end - def runner_machine - BatchLoader::GraphQL.for(object.id).batch(key: :runner_machines) do |build_ids, loader| - plucked_build_to_machine_ids = ::Ci::RunnerMachineBuild.for_build(build_ids).pluck_build_id_and_runner_machine_id - runner_machines = ::Ci::RunnerMachine.id_in(plucked_build_to_machine_ids.values.uniq) - Preloaders::RunnerMachinePolicyPreloader.new(runner_machines, current_user).execute - runner_machines_by_id = runner_machines.index_by(&:id) + def runner_manager + BatchLoader::GraphQL.for(object.id).batch(key: :runner_managers) do |build_ids, loader| + plucked_build_to_runner_manager_ids = + ::Ci::RunnerManagerBuild.for_build(build_ids).pluck_build_id_and_runner_manager_id + runner_managers = ::Ci::RunnerManager.id_in(plucked_build_to_runner_manager_ids.values.uniq) + Preloaders::RunnerManagerPolicyPreloader.new(runner_managers, current_user).execute + runner_managers_by_id = runner_managers.index_by(&:id) build_ids.each do |build_id| - runner_machine_id = plucked_build_to_machine_ids[build_id] - - loader.call(build_id, runner_machines_by_id[runner_machine_id]) + loader.call(build_id, runner_managers_by_id[plucked_build_to_runner_manager_ids[build_id]]) end end end diff --git a/app/graphql/types/ci/runner_machine_type.rb b/app/graphql/types/ci/runner_manager_type.rb index 8e6656288d9..2a5053f8f07 100644 --- a/app/graphql/types/ci/runner_machine_type.rb +++ b/app/graphql/types/ci/runner_manager_type.rb @@ -2,50 +2,48 @@ module Types module Ci - class RunnerMachineType < BaseObject - graphql_name 'CiRunnerMachine' + class RunnerManagerType < BaseObject + graphql_name 'CiRunnerManager' connection_type_class(::Types::CountableConnectionType) - authorize :read_runner_machine + authorize :read_runner_manager - alias_method :runner_machine, :object + alias_method :runner_manager, :object field :architecture_name, GraphQL::Types::String, null: true, - description: 'Architecture provided by the runner machine.', + description: 'Architecture provided by the runner manager.', method: :architecture field :contacted_at, Types::TimeType, null: true, - description: 'Timestamp of last contact from the runner machine.', + description: 'Timestamp of last contact from the runner manager.', method: :contacted_at field :created_at, Types::TimeType, null: true, - description: 'Timestamp of creation of the runner machine.' + description: 'Timestamp of creation of the runner manager.' field :executor_name, GraphQL::Types::String, null: true, description: 'Executor last advertised by the runner.', method: :executor_name - field :id, ::Types::GlobalIDType[::Ci::RunnerMachine], null: false, - description: 'ID of the runner machine.' + field :id, ::Types::GlobalIDType[::Ci::RunnerManager], null: false, + description: 'ID of the runner manager.' field :ip_address, GraphQL::Types::String, null: true, - description: 'IP address of the runner machine.' + description: 'IP address of the runner manager.' field :platform_name, GraphQL::Types::String, null: true, - description: 'Platform provided by the runner machine.', + description: 'Platform provided by the runner manager.', method: :platform field :revision, GraphQL::Types::String, null: true, description: 'Revision of the runner.' - field :runner, RunnerType, null: true, description: 'Runner configuration for the runner machine.' + field :runner, RunnerType, null: true, description: 'Runner configuration for the runner manager.' field :status, Types::Ci::RunnerStatusEnum, null: false, - description: 'Status of the runner machine.' + description: 'Status of the runner manager.' field :system_id, GraphQL::Types::String, null: false, - description: 'System ID associated with the runner machine.', + description: 'System ID associated with the runner manager.', method: :system_xid field :version, GraphQL::Types::String, null: true, description: 'Version of the runner.' def executor_name - ::Ci::Runner::EXECUTOR_TYPE_TO_NAMES[runner_machine.executor_type&.to_sym] + ::Ci::Runner::EXECUTOR_TYPE_TO_NAMES[runner_manager.executor_type&.to_sym] end end end end - -Types::Ci::RunnerType.prepend_mod_with('Types::Ci::RunnerType') diff --git a/app/graphql/types/ci/runner_type.rb b/app/graphql/types/ci/runner_type.rb index 60ea78752ca..8b0a969f7f5 100644 --- a/app/graphql/types/ci/runner_type.rb +++ b/app/graphql/types/ci/runner_type.rb @@ -39,7 +39,7 @@ module Types field :edit_admin_url, GraphQL::Types::String, null: true, description: 'Admin form URL of the runner. Only available for administrators.' field :ephemeral_authentication_token, GraphQL::Types::String, null: true, - description: 'Ephemeral authentication token used for runner machine registration. Only available for the creator of the runner for a limited time during registration.', + description: 'Ephemeral authentication token used for runner manager registration. Only available for the creator of the runner for a limited time during registration.', authorize: :read_ephemeral_token, alpha: { milestone: '15.9' } field :executor_name, GraphQL::Types::String, null: true, @@ -65,12 +65,12 @@ module Types resolver: ::Resolvers::Ci::RunnerJobsResolver field :locked, GraphQL::Types::Boolean, null: true, description: 'Indicates the runner is locked.' - field :machines, ::Types::Ci::RunnerMachineType.connection_type, null: true, - description: 'Machines associated with the runner configuration.', - method: :runner_machines, - alpha: { milestone: '15.10' } field :maintenance_note, GraphQL::Types::String, null: true, description: 'Runner\'s maintenance notes.' + field :managers, ::Types::Ci::RunnerManagerType.connection_type, null: true, + description: 'Machines associated with the runner configuration.', + method: :runner_managers, + alpha: { milestone: '15.10' } field :maximum_timeout, GraphQL::Types::Int, null: true, description: 'Maximum timeout (in seconds) for jobs processed by the runner.' field :owner_project, ::Types::ProjectType, null: true, |