diff options
Diffstat (limited to 'app/graphql/types/ci')
27 files changed, 146 insertions, 141 deletions
diff --git a/app/graphql/types/ci/analytics_type.rb b/app/graphql/types/ci/analytics_type.rb index ba987b133bd..f52b9eae229 100644 --- a/app/graphql/types/ci/analytics_type.rb +++ b/app/graphql/types/ci/analytics_type.rb @@ -6,27 +6,27 @@ module Types class AnalyticsType < BaseObject graphql_name 'PipelineAnalytics' - field :week_pipelines_totals, [GraphQL::INT_TYPE], null: true, + field :week_pipelines_totals, [GraphQL::Types::Int], null: true, description: 'Total weekly pipeline count.' - field :week_pipelines_successful, [GraphQL::INT_TYPE], null: true, + field :week_pipelines_successful, [GraphQL::Types::Int], null: true, description: 'Total weekly successful pipeline count.' - field :week_pipelines_labels, [GraphQL::STRING_TYPE], null: true, + field :week_pipelines_labels, [GraphQL::Types::String], null: true, description: 'Labels for the weekly pipeline count.' - field :month_pipelines_totals, [GraphQL::INT_TYPE], null: true, + field :month_pipelines_totals, [GraphQL::Types::Int], null: true, description: 'Total monthly pipeline count.' - field :month_pipelines_successful, [GraphQL::INT_TYPE], null: true, + field :month_pipelines_successful, [GraphQL::Types::Int], null: true, description: 'Total monthly successful pipeline count.' - field :month_pipelines_labels, [GraphQL::STRING_TYPE], null: true, + field :month_pipelines_labels, [GraphQL::Types::String], null: true, description: 'Labels for the monthly pipeline count.' - field :year_pipelines_totals, [GraphQL::INT_TYPE], null: true, + field :year_pipelines_totals, [GraphQL::Types::Int], null: true, description: 'Total yearly pipeline count.' - field :year_pipelines_successful, [GraphQL::INT_TYPE], null: true, + field :year_pipelines_successful, [GraphQL::Types::Int], null: true, description: 'Total yearly successful pipeline count.' - field :year_pipelines_labels, [GraphQL::STRING_TYPE], null: true, + field :year_pipelines_labels, [GraphQL::Types::String], null: true, description: 'Labels for the yearly pipeline count.' - field :pipeline_times_values, [GraphQL::INT_TYPE], null: true, + field :pipeline_times_values, [GraphQL::Types::Int], null: true, description: 'Pipeline times.' - field :pipeline_times_labels, [GraphQL::STRING_TYPE], null: true, + field :pipeline_times_labels, [GraphQL::Types::String], null: true, description: 'Pipeline times labels.' end end diff --git a/app/graphql/types/ci/application_setting_type.rb b/app/graphql/types/ci/application_setting_type.rb index 8616280057c..2322778d159 100644 --- a/app/graphql/types/ci/application_setting_type.rb +++ b/app/graphql/types/ci/application_setting_type.rb @@ -7,7 +7,7 @@ module Types authorize :read_application_setting - field :keep_latest_artifact, GraphQL::BOOLEAN_TYPE, null: true, + field :keep_latest_artifact, GraphQL::Types::Boolean, null: true, description: 'Whether to keep the latest jobs artifacts.' end end diff --git a/app/graphql/types/ci/build_need_type.rb b/app/graphql/types/ci/build_need_type.rb index 19ff758ad1d..7bd12c99a08 100644 --- a/app/graphql/types/ci/build_need_type.rb +++ b/app/graphql/types/ci/build_need_type.rb @@ -7,9 +7,9 @@ module Types class BuildNeedType < BaseObject graphql_name 'CiBuildNeed' - field :id, GraphQL::ID_TYPE, null: false, + field :id, GraphQL::Types::ID, null: false, description: 'ID of the job we need to complete.' - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the job we need to complete.' end end diff --git a/app/graphql/types/ci/ci_cd_setting_type.rb b/app/graphql/types/ci/ci_cd_setting_type.rb index f90c75454ba..790deab8f68 100644 --- a/app/graphql/types/ci/ci_cd_setting_type.rb +++ b/app/graphql/types/ci/ci_cd_setting_type.rb @@ -7,16 +7,16 @@ module Types authorize :admin_project - field :merge_pipelines_enabled, GraphQL::BOOLEAN_TYPE, null: true, + field :merge_pipelines_enabled, GraphQL::Types::Boolean, null: true, description: 'Whether merge pipelines are enabled.', method: :merge_pipelines_enabled? - field :merge_trains_enabled, GraphQL::BOOLEAN_TYPE, null: true, + field :merge_trains_enabled, GraphQL::Types::Boolean, null: true, description: 'Whether merge trains are enabled.', method: :merge_trains_enabled? - field :keep_latest_artifact, GraphQL::BOOLEAN_TYPE, null: true, + field :keep_latest_artifact, GraphQL::Types::Boolean, null: true, description: 'Whether to keep the latest builds artifacts.', method: :keep_latest_artifacts_available? - field :job_token_scope_enabled, GraphQL::BOOLEAN_TYPE, null: true, + field :job_token_scope_enabled, GraphQL::Types::Boolean, null: true, description: 'Indicates CI job tokens generated in this project have restricted access to resources.', method: :job_token_scope_enabled? field :project, Types::ProjectType, null: true, diff --git a/app/graphql/types/ci/config/config_type.rb b/app/graphql/types/ci/config/config_type.rb index 88caf21c376..6ac21968bd4 100644 --- a/app/graphql/types/ci/config/config_type.rb +++ b/app/graphql/types/ci/config/config_type.rb @@ -7,9 +7,9 @@ module Types class ConfigType < BaseObject graphql_name 'CiConfig' - field :errors, [GraphQL::STRING_TYPE], null: true, + field :errors, [GraphQL::Types::String], null: true, description: 'Linting errors.' - field :merged_yaml, GraphQL::STRING_TYPE, null: true, + field :merged_yaml, GraphQL::Types::String, null: true, description: 'Merged CI configuration YAML.' field :stages, Types::Ci::Config::StageType.connection_type, null: true, description: 'Stages of the pipeline.' diff --git a/app/graphql/types/ci/config/group_type.rb b/app/graphql/types/ci/config/group_type.rb index 11be701e73f..e5cb0d4e72f 100644 --- a/app/graphql/types/ci/config/group_type.rb +++ b/app/graphql/types/ci/config/group_type.rb @@ -7,11 +7,11 @@ module Types class GroupType < BaseObject graphql_name 'CiConfigGroup' - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the job group.' field :jobs, Types::Ci::Config::JobType.connection_type, null: true, description: 'Jobs in group.' - field :size, GraphQL::INT_TYPE, null: true, + field :size, GraphQL::Types::Int, null: true, description: 'Size of the job group.' end end diff --git a/app/graphql/types/ci/config/job_restriction_type.rb b/app/graphql/types/ci/config/job_restriction_type.rb index 294e3c94571..891ba18dacc 100644 --- a/app/graphql/types/ci/config/job_restriction_type.rb +++ b/app/graphql/types/ci/config/job_restriction_type.rb @@ -7,7 +7,7 @@ module Types class JobRestrictionType < BaseObject graphql_name 'CiConfigJobRestriction' - field :refs, [GraphQL::STRING_TYPE], null: true, + field :refs, [GraphQL::Types::String], null: true, description: 'The Git refs the job restriction applies to.' end end diff --git a/app/graphql/types/ci/config/job_type.rb b/app/graphql/types/ci/config/job_type.rb index 65fdc4c2615..4cf6780ef60 100644 --- a/app/graphql/types/ci/config/job_type.rb +++ b/app/graphql/types/ci/config/job_type.rb @@ -7,32 +7,32 @@ module Types class JobType < BaseObject graphql_name 'CiConfigJob' - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the job.' - field :group_name, GraphQL::STRING_TYPE, null: true, + field :group_name, GraphQL::Types::String, null: true, description: 'Name of the job group.' - field :stage, GraphQL::STRING_TYPE, null: true, + field :stage, GraphQL::Types::String, null: true, description: 'Name of the job stage.' field :needs, Types::Ci::Config::NeedType.connection_type, null: true, description: 'Builds that must complete before the jobs run.' - field :allow_failure, GraphQL::BOOLEAN_TYPE, null: true, + field :allow_failure, GraphQL::Types::Boolean, null: true, description: 'Allow job to fail.' - field :before_script, [GraphQL::STRING_TYPE], null: true, + field :before_script, [GraphQL::Types::String], null: true, description: 'Override a set of commands that are executed before the job.' - field :script, [GraphQL::STRING_TYPE], null: true, + field :script, [GraphQL::Types::String], null: true, description: 'Shell script that is executed by a runner.' - field :after_script, [GraphQL::STRING_TYPE], null: true, + field :after_script, [GraphQL::Types::String], null: true, description: 'Override a set of commands that are executed after the job.' - field :when, GraphQL::STRING_TYPE, null: true, + field :when, GraphQL::Types::String, null: true, description: 'When to run the job.', resolver_method: :restrict_when_to_run_jobs - field :environment, GraphQL::STRING_TYPE, null: true, + field :environment, GraphQL::Types::String, null: true, description: 'Name of an environment to which the job deploys.' field :except, Types::Ci::Config::JobRestrictionType, null: true, description: 'Limit when jobs are not created.' field :only, Types::Ci::Config::JobRestrictionType, null: true, description: 'Jobs are created when these conditions do not apply.' - field :tags, [GraphQL::STRING_TYPE], null: true, + field :tags, [GraphQL::Types::String], null: true, description: 'List of tags that are used to select a runner.' def restrict_when_to_run_jobs diff --git a/app/graphql/types/ci/config/need_type.rb b/app/graphql/types/ci/config/need_type.rb index 01f73100409..6e9aea8eb64 100644 --- a/app/graphql/types/ci/config/need_type.rb +++ b/app/graphql/types/ci/config/need_type.rb @@ -7,7 +7,7 @@ module Types class NeedType < BaseObject graphql_name 'CiConfigNeed' - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the need.' end end diff --git a/app/graphql/types/ci/config/stage_type.rb b/app/graphql/types/ci/config/stage_type.rb index 060efb7d45c..7e2aa9470f2 100644 --- a/app/graphql/types/ci/config/stage_type.rb +++ b/app/graphql/types/ci/config/stage_type.rb @@ -7,7 +7,7 @@ module Types class StageType < BaseObject graphql_name 'CiConfigStage' - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the stage.' field :groups, Types::Ci::Config::GroupType.connection_type, null: true, description: 'Groups of jobs for the stage.' diff --git a/app/graphql/types/ci/detailed_status_type.rb b/app/graphql/types/ci/detailed_status_type.rb index 6310a62a103..4433e921971 100644 --- a/app/graphql/types/ci/detailed_status_type.rb +++ b/app/graphql/types/ci/detailed_status_type.rb @@ -6,26 +6,26 @@ module Types class DetailedStatusType < BaseObject graphql_name 'DetailedStatus' - field :id, GraphQL::STRING_TYPE, null: false, + field :id, GraphQL::Types::String, null: false, description: 'ID for a detailed status.', extras: [:parent] - field :group, GraphQL::STRING_TYPE, null: true, + field :group, GraphQL::Types::String, null: true, description: 'Group of the status.' - field :icon, GraphQL::STRING_TYPE, null: true, + field :icon, GraphQL::Types::String, null: true, description: 'Icon of the status.' - field :favicon, GraphQL::STRING_TYPE, null: true, + field :favicon, GraphQL::Types::String, null: true, description: 'Favicon of the status.' - field :details_path, GraphQL::STRING_TYPE, null: true, + field :details_path, GraphQL::Types::String, null: true, description: 'Path of the details for the status.' - field :has_details, GraphQL::BOOLEAN_TYPE, null: true, + field :has_details, GraphQL::Types::Boolean, null: true, description: 'Indicates if the status has further details.', method: :has_details? - field :label, GraphQL::STRING_TYPE, null: true, + field :label, GraphQL::Types::String, null: true, calls_gitaly: true, description: 'Label of the status.' - field :text, GraphQL::STRING_TYPE, null: true, + field :text, GraphQL::Types::String, null: true, description: 'Text of the status.' - field :tooltip, GraphQL::STRING_TYPE, null: true, + field :tooltip, GraphQL::Types::String, null: true, description: 'Tooltip associated with the status.', method: :status_tooltip field :action, Types::Ci::StatusActionType, null: true, diff --git a/app/graphql/types/ci/group_type.rb b/app/graphql/types/ci/group_type.rb index 3da183cb842..3ae23ba9bd4 100644 --- a/app/graphql/types/ci/group_type.rb +++ b/app/graphql/types/ci/group_type.rb @@ -6,11 +6,11 @@ module Types class GroupType < BaseObject graphql_name 'CiGroup' - field :id, GraphQL::STRING_TYPE, null: false, + field :id, GraphQL::Types::String, null: false, description: 'ID for a group.' - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the job group.' - field :size, GraphQL::INT_TYPE, null: true, + field :size, GraphQL::Types::Int, null: true, description: 'Size of the group.' field :jobs, Ci::JobType.connection_type, null: true, description: 'Jobs in group.' diff --git a/app/graphql/types/ci/job_artifact_type.rb b/app/graphql/types/ci/job_artifact_type.rb index 7dc93041b53..f80681bcf36 100644 --- a/app/graphql/types/ci/job_artifact_type.rb +++ b/app/graphql/types/ci/job_artifact_type.rb @@ -6,7 +6,7 @@ module Types class JobArtifactType < BaseObject graphql_name 'CiJobArtifact' - field :download_path, GraphQL::STRING_TYPE, null: true, + field :download_path, GraphQL::Types::String, null: true, description: "URL for downloading the artifact's file." field :file_type, ::Types::Ci::JobArtifactFileTypeEnum, null: true, diff --git a/app/graphql/types/ci/job_type.rb b/app/graphql/types/ci/job_type.rb index 360ea3ba7a9..4a3518e1865 100644 --- a/app/graphql/types/ci/job_type.rb +++ b/app/graphql/types/ci/job_type.rb @@ -14,7 +14,7 @@ module Types description: 'ID of the job.' field :pipeline, Types::Ci::PipelineType, null: true, description: 'Pipeline the job belongs to.' - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the job.' field :needs, BuildNeedType.connection_type, null: true, description: 'References to builds that must complete before the jobs run.' @@ -24,11 +24,11 @@ module Types description: "Status of the job." field :stage, Types::Ci::StageType, null: true, description: 'Stage of the job.' - field :allow_failure, ::GraphQL::BOOLEAN_TYPE, null: false, + field :allow_failure, ::GraphQL::Types::Boolean, null: false, description: 'Whether the job is allowed to fail.' - field :duration, GraphQL::INT_TYPE, null: true, + field :duration, GraphQL::Types::Int, null: true, description: 'Duration of the job in seconds.' - field :tags, [GraphQL::STRING_TYPE], null: true, + field :tags, [GraphQL::Types::String], null: true, description: 'Tags for the current job.' # Life-cycle timestamps: @@ -53,33 +53,33 @@ module Types description: 'Detailed status of the job.' field :artifacts, Types::Ci::JobArtifactType.connection_type, null: true, description: 'Artifacts generated by the job.' - field :short_sha, type: GraphQL::STRING_TYPE, null: false, + field :short_sha, type: GraphQL::Types::String, null: false, description: 'Short SHA1 ID of the commit.' - field :scheduling_type, GraphQL::STRING_TYPE, null: true, + field :scheduling_type, GraphQL::Types::String, null: true, description: 'Type of job scheduling. Value is `dag` if the job uses the `needs` keyword, and `stage` otherwise.' - field :commit_path, GraphQL::STRING_TYPE, null: true, + field :commit_path, GraphQL::Types::String, null: true, description: 'Path to the commit that triggered the job.' - field :ref_name, GraphQL::STRING_TYPE, null: true, + field :ref_name, GraphQL::Types::String, null: true, description: 'Ref name of the job.' - field :ref_path, GraphQL::STRING_TYPE, null: true, + field :ref_path, GraphQL::Types::String, null: true, description: 'Path to the ref.' - field :playable, GraphQL::BOOLEAN_TYPE, null: false, method: :playable?, + field :playable, GraphQL::Types::Boolean, null: false, method: :playable?, description: 'Indicates the job can be played.' - field :retryable, GraphQL::BOOLEAN_TYPE, null: false, method: :retryable?, + field :retryable, GraphQL::Types::Boolean, null: false, method: :retryable?, description: 'Indicates the job can be retried.' - field :cancelable, GraphQL::BOOLEAN_TYPE, null: false, method: :cancelable?, + field :cancelable, GraphQL::Types::Boolean, null: false, method: :cancelable?, description: 'Indicates the job can be canceled.' - field :active, GraphQL::BOOLEAN_TYPE, null: false, method: :active?, + field :active, GraphQL::Types::Boolean, null: false, method: :active?, description: 'Indicates the job is active.' - field :stuck, GraphQL::BOOLEAN_TYPE, null: false, method: :stuck?, + field :stuck, GraphQL::Types::Boolean, null: false, method: :stuck?, description: 'Indicates the job is stuck.' field :coverage, GraphQL::FLOAT_TYPE, null: true, description: 'Coverage level of the job.' - field :created_by_tag, GraphQL::BOOLEAN_TYPE, null: false, + field :created_by_tag, GraphQL::Types::Boolean, null: false, description: 'Whether the job was created by a tag.' - field :manual_job, GraphQL::BOOLEAN_TYPE, null: true, + field :manual_job, GraphQL::Types::Boolean, null: true, description: 'Whether the job has a manual action.' - field :triggered, GraphQL::BOOLEAN_TYPE, null: true, + field :triggered, GraphQL::Types::Boolean, null: true, description: 'Whether the job was triggered.' def pipeline diff --git a/app/graphql/types/ci/pipeline_type.rb b/app/graphql/types/ci/pipeline_type.rb index f4a6c18f73e..0375257eb7b 100644 --- a/app/graphql/types/ci/pipeline_type.rb +++ b/app/graphql/types/ci/pipeline_type.rb @@ -12,25 +12,25 @@ module Types expose_permissions Types::PermissionTypes::Ci::Pipeline - field :id, GraphQL::ID_TYPE, null: false, + field :id, GraphQL::Types::ID, null: false, description: 'ID of the pipeline.' - field :iid, GraphQL::STRING_TYPE, null: false, + field :iid, GraphQL::Types::String, null: false, description: 'Internal ID of the pipeline.' - field :sha, GraphQL::STRING_TYPE, null: false, + field :sha, GraphQL::Types::String, null: false, description: "SHA of the pipeline's commit." - field :before_sha, GraphQL::STRING_TYPE, null: true, + field :before_sha, GraphQL::Types::String, null: true, description: 'Base SHA of the source branch.' - field :complete, GraphQL::BOOLEAN_TYPE, null: false, method: :complete?, + field :complete, GraphQL::Types::Boolean, null: false, method: :complete?, description: 'Indicates if a pipeline is complete.' field :status, PipelineStatusEnum, null: false, description: "Status of the pipeline (#{::Ci::Pipeline.all_state_names.compact.join(', ').upcase})" - field :warnings, GraphQL::BOOLEAN_TYPE, null: false, method: :has_warnings?, + field :warnings, GraphQL::Types::Boolean, null: false, method: :has_warnings?, description: "Indicates if a pipeline has warnings." field :detailed_status, Types::Ci::DetailedStatusType, null: false, @@ -39,7 +39,7 @@ module Types field :config_source, PipelineConfigSourceEnum, null: true, description: "Configuration source of the pipeline (#{::Enums::Ci::Pipeline.config_sources.keys.join(', ').upcase})" - field :duration, GraphQL::INT_TYPE, null: true, + field :duration, GraphQL::Types::Int, null: true, description: 'Duration of the pipeline in seconds.' field :queued_duration, Types::DurationType, null: true, @@ -76,12 +76,12 @@ module Types null: true, description: 'Pipeline user.' - field :retryable, GraphQL::BOOLEAN_TYPE, + field :retryable, GraphQL::Types::Boolean, description: 'Specifies if a pipeline can be retried.', method: :retryable?, null: false - field :cancelable, GraphQL::BOOLEAN_TYPE, + field :cancelable, GraphQL::Types::Boolean, description: 'Specifies if a pipeline can be canceled.', method: :cancelable?, null: false @@ -103,7 +103,7 @@ module Types required: false, description: 'ID of the job.' argument :name, - type: ::GraphQL::STRING_TYPE, + type: ::GraphQL::Types::String, required: false, description: 'Name of the job.' end @@ -122,19 +122,19 @@ module Types description: 'Pipeline that triggered the pipeline.', method: :triggered_by_pipeline - field :path, GraphQL::STRING_TYPE, null: true, + field :path, GraphQL::Types::String, null: true, description: "Relative path to the pipeline's page." - field :commit_path, GraphQL::STRING_TYPE, null: true, + field :commit_path, GraphQL::Types::String, null: true, description: 'Path to the commit that triggered the pipeline.' field :project, Types::ProjectType, null: true, description: 'Project the pipeline belongs to.' - field :active, GraphQL::BOOLEAN_TYPE, null: false, method: :active?, + field :active, GraphQL::Types::Boolean, null: false, method: :active?, description: 'Indicates if the pipeline is active.' - field :uses_needs, GraphQL::BOOLEAN_TYPE, null: true, + field :uses_needs, GraphQL::Types::Boolean, null: true, method: :uses_needs?, description: 'Indicates if the pipeline has jobs with `needs` dependencies.' @@ -150,7 +150,7 @@ module Types description: 'A specific test suite in a pipeline test report.', resolver: Resolvers::Ci::TestSuiteResolver - field :ref, GraphQL::STRING_TYPE, null: true, + field :ref, GraphQL::Types::String, null: true, description: 'Reference to the branch from which the pipeline was triggered.' def detailed_status diff --git a/app/graphql/types/ci/recent_failures_type.rb b/app/graphql/types/ci/recent_failures_type.rb index eeff7222762..f56b0939086 100644 --- a/app/graphql/types/ci/recent_failures_type.rb +++ b/app/graphql/types/ci/recent_failures_type.rb @@ -9,10 +9,10 @@ module Types connection_type_class(Types::CountableConnectionType) - field :count, GraphQL::INT_TYPE, null: true, + field :count, GraphQL::Types::Int, null: true, description: 'Number of times the test case has failed in the past 14 days.' - field :base_branch, GraphQL::STRING_TYPE, null: true, + field :base_branch, GraphQL::Types::String, null: true, description: 'Name of the base branch of the project.' end # rubocop: enable Graphql/AuthorizeTypes diff --git a/app/graphql/types/ci/runner_architecture_type.rb b/app/graphql/types/ci/runner_architecture_type.rb index 229974d4d13..08d3f98592b 100644 --- a/app/graphql/types/ci/runner_architecture_type.rb +++ b/app/graphql/types/ci/runner_architecture_type.rb @@ -6,9 +6,9 @@ module Types class RunnerArchitectureType < BaseObject graphql_name 'RunnerArchitecture' - field :name, GraphQL::STRING_TYPE, null: false, + field :name, GraphQL::Types::String, null: false, description: 'Name of the runner platform architecture.' - field :download_location, GraphQL::STRING_TYPE, null: false, + field :download_location, GraphQL::Types::String, null: false, description: 'Download location for the runner for the platform architecture.' end end diff --git a/app/graphql/types/ci/runner_platform_type.rb b/app/graphql/types/ci/runner_platform_type.rb index 5636f88835e..ffcf6364968 100644 --- a/app/graphql/types/ci/runner_platform_type.rb +++ b/app/graphql/types/ci/runner_platform_type.rb @@ -6,9 +6,9 @@ module Types class RunnerPlatformType < BaseObject graphql_name 'RunnerPlatform' - field :name, GraphQL::STRING_TYPE, null: false, + field :name, GraphQL::Types::String, null: false, description: 'Name slug of the runner platform.' - field :human_readable_name, GraphQL::STRING_TYPE, null: false, + field :human_readable_name, GraphQL::Types::String, null: false, description: 'Human readable name of the runner platform.' field :architectures, Types::Ci::RunnerArchitectureType.connection_type, null: true, description: 'Runner architectures supported for the platform.' diff --git a/app/graphql/types/ci/runner_setup_type.rb b/app/graphql/types/ci/runner_setup_type.rb index 61a2ea2a411..70f33cef8ad 100644 --- a/app/graphql/types/ci/runner_setup_type.rb +++ b/app/graphql/types/ci/runner_setup_type.rb @@ -6,9 +6,9 @@ module Types class RunnerSetupType < BaseObject graphql_name 'RunnerSetup' - field :install_instructions, GraphQL::STRING_TYPE, null: false, + field :install_instructions, GraphQL::Types::String, null: false, description: 'Instructions for installing the runner on the specified architecture.' - field :register_instructions, GraphQL::STRING_TYPE, null: true, + field :register_instructions, GraphQL::Types::String, null: true, description: 'Instructions for registering the runner.' end end diff --git a/app/graphql/types/ci/runner_type.rb b/app/graphql/types/ci/runner_type.rb index 9c5041b0860..e2c8070af0c 100644 --- a/app/graphql/types/ci/runner_type.rb +++ b/app/graphql/types/ci/runner_type.rb @@ -5,6 +5,7 @@ module Types class RunnerType < BaseObject graphql_name 'CiRunner' authorize :read_runner + present_using ::Ci::RunnerPresenter JOB_COUNT_LIMIT = 1000 @@ -12,38 +13,38 @@ module Types field :id, ::Types::GlobalIDType[::Ci::Runner], null: false, description: 'ID of the runner.' - field :description, GraphQL::STRING_TYPE, null: true, + field :description, GraphQL::Types::String, null: true, description: 'Description of the runner.' field :contacted_at, Types::TimeType, null: true, description: 'Last contact from the runner.', method: :contacted_at - field :maximum_timeout, GraphQL::INT_TYPE, null: true, + field :maximum_timeout, GraphQL::Types::Int, null: true, description: 'Maximum timeout (in seconds) for jobs processed by the runner.' field :access_level, ::Types::Ci::RunnerAccessLevelEnum, null: false, description: 'Access level of the runner.' - field :active, GraphQL::BOOLEAN_TYPE, null: false, + field :active, GraphQL::Types::Boolean, null: false, description: 'Indicates the runner is allowed to receive jobs.' field :status, ::Types::Ci::RunnerStatusEnum, null: false, description: 'Status of the runner.' - field :version, GraphQL::STRING_TYPE, null: true, + field :version, GraphQL::Types::String, null: true, description: 'Version of the runner.' - field :short_sha, GraphQL::STRING_TYPE, null: true, + field :short_sha, GraphQL::Types::String, null: true, description: %q(First eight characters of the runner's token used to authenticate new job requests. Used as the runner's unique ID.) - field :revision, GraphQL::STRING_TYPE, null: true, + field :revision, GraphQL::Types::String, null: true, description: 'Revision of the runner.' - field :locked, GraphQL::BOOLEAN_TYPE, null: true, + field :locked, GraphQL::Types::Boolean, null: true, description: 'Indicates the runner is locked.' - field :run_untagged, GraphQL::BOOLEAN_TYPE, null: false, + field :run_untagged, GraphQL::Types::Boolean, null: false, description: 'Indicates the runner is able to run untagged jobs.' - field :ip_address, GraphQL::STRING_TYPE, null: true, + field :ip_address, GraphQL::Types::String, null: true, description: 'IP address of the runner.' field :runner_type, ::Types::Ci::RunnerTypeEnum, null: false, description: 'Type of the runner.' - field :tag_list, [GraphQL::STRING_TYPE], null: true, + field :tag_list, [GraphQL::Types::String], null: true, description: 'Tags associated with the runner.' - field :project_count, GraphQL::INT_TYPE, null: true, + field :project_count, GraphQL::Types::Int, null: true, description: 'Number of projects that the runner is associated with.' - field :job_count, GraphQL::INT_TYPE, null: true, + field :job_count, GraphQL::Types::Int, null: true, description: "Number of jobs processed by the runner (limited to #{JOB_COUNT_LIMIT}, plus one to indicate that more items exist)." def job_count diff --git a/app/graphql/types/ci/stage_type.rb b/app/graphql/types/ci/stage_type.rb index ce3edb6c54f..63357e2345b 100644 --- a/app/graphql/types/ci/stage_type.rb +++ b/app/graphql/types/ci/stage_type.rb @@ -6,9 +6,9 @@ module Types graphql_name 'CiStage' authorize :read_commit_status - field :id, GraphQL::ID_TYPE, null: false, + field :id, GraphQL::Types::ID, null: false, description: 'ID of the stage.' - field :name, type: GraphQL::STRING_TYPE, null: true, + field :name, type: GraphQL::Types::String, null: true, description: 'Name of the stage.' field :groups, type: Ci::GroupType.connection_type, null: true, extras: [:lookahead], @@ -18,7 +18,7 @@ module Types field :jobs, Ci::JobType.connection_type, null: true, description: 'Jobs for the stage.', method: 'latest_statuses' - field :status, GraphQL::STRING_TYPE, + field :status, GraphQL::Types::String, null: true, description: 'Status of the pipeline stage.' @@ -52,9 +52,13 @@ module Types # rubocop: disable CodeReuse/ActiveRecord def jobs_for_pipeline(pipeline, stage_ids, include_needs) - results = pipeline.latest_statuses.where(stage_id: stage_ids) - results = results.preload(:project) - results = results.preload(:needs) if include_needs + builds_results = pipeline.latest_builds.where(stage_id: stage_ids).preload(:job_artifacts, :project) + bridges_results = pipeline.bridges.where(stage_id: stage_ids).preload(:project) + builds_results = builds_results.preload(:needs) if include_needs + bridges_results = bridges_results.preload(:needs) if include_needs + commit_status_results = pipeline.latest_statuses.where(stage_id: stage_ids) + + results = builds_results | bridges_results | commit_status_results results.group_by(&:stage_id) end diff --git a/app/graphql/types/ci/status_action_type.rb b/app/graphql/types/ci/status_action_type.rb index a06b09735b3..15e5344e130 100644 --- a/app/graphql/types/ci/status_action_type.rb +++ b/app/graphql/types/ci/status_action_type.rb @@ -5,19 +5,19 @@ module Types class StatusActionType < BaseObject graphql_name 'StatusAction' - field :id, GraphQL::STRING_TYPE, null: false, + field :id, GraphQL::Types::String, null: false, description: 'ID for a status action.', extras: [:parent] - field :button_title, GraphQL::STRING_TYPE, null: true, + field :button_title, GraphQL::Types::String, null: true, description: 'Title for the button, for example: Retry this job.' - field :icon, GraphQL::STRING_TYPE, null: true, + field :icon, GraphQL::Types::String, null: true, description: 'Icon used in the action button.' - field :method, GraphQL::STRING_TYPE, null: true, + field :method, GraphQL::Types::String, null: true, description: 'Method for the action, for example: :post.', resolver_method: :action_method - field :path, GraphQL::STRING_TYPE, null: true, + field :path, GraphQL::Types::String, null: true, description: 'Path for the action.' - field :title, GraphQL::STRING_TYPE, null: true, + field :title, GraphQL::Types::String, null: true, description: 'Title for the action, for example: Retry.' def id(parent:) diff --git a/app/graphql/types/ci/template_type.rb b/app/graphql/types/ci/template_type.rb index 5f07fa16928..7e7ee44025f 100644 --- a/app/graphql/types/ci/template_type.rb +++ b/app/graphql/types/ci/template_type.rb @@ -7,9 +7,9 @@ module Types graphql_name 'CiTemplate' description 'GitLab CI/CD configuration template.' - field :name, GraphQL::STRING_TYPE, null: false, + field :name, GraphQL::Types::String, null: false, description: 'Name of the CI template.' - field :content, GraphQL::STRING_TYPE, null: false, + field :content, GraphQL::Types::String, null: false, description: 'Contents of the CI template.' end end diff --git a/app/graphql/types/ci/test_case_type.rb b/app/graphql/types/ci/test_case_type.rb index 9cc3f918125..9ec5daa44ea 100644 --- a/app/graphql/types/ci/test_case_type.rb +++ b/app/graphql/types/ci/test_case_type.rb @@ -12,25 +12,25 @@ module Types field :status, Types::Ci::TestCaseStatusEnum, null: true, description: "Status of the test case (#{::Gitlab::Ci::Reports::TestCase::STATUS_TYPES.join(', ')})." - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the test case.' - field :classname, GraphQL::STRING_TYPE, null: true, + field :classname, GraphQL::Types::String, null: true, description: 'Classname of the test case.' field :execution_time, GraphQL::FLOAT_TYPE, null: true, description: 'Test case execution time in seconds.' - field :file, GraphQL::STRING_TYPE, null: true, + field :file, GraphQL::Types::String, null: true, description: 'Path to the file of the test case.' - field :attachment_url, GraphQL::STRING_TYPE, null: true, + field :attachment_url, GraphQL::Types::String, null: true, description: 'URL of the test case attachment file.' - field :system_output, GraphQL::STRING_TYPE, null: true, + field :system_output, GraphQL::Types::String, null: true, description: 'System output of the test case.' - field :stack_trace, GraphQL::STRING_TYPE, null: true, + field :stack_trace, GraphQL::Types::String, null: true, description: 'Stack trace of the test case.' field :recent_failures, Types::Ci::RecentFailuresType, null: true, diff --git a/app/graphql/types/ci/test_report_total_type.rb b/app/graphql/types/ci/test_report_total_type.rb index 1123734adc3..aa07a391519 100644 --- a/app/graphql/types/ci/test_report_total_type.rb +++ b/app/graphql/types/ci/test_report_total_type.rb @@ -10,22 +10,22 @@ module Types field :time, GraphQL::FLOAT_TYPE, null: true, description: 'Total duration of the tests.' - field :count, GraphQL::INT_TYPE, null: true, + field :count, GraphQL::Types::Int, null: true, description: 'Total number of the test cases.' - field :success, GraphQL::INT_TYPE, null: true, + field :success, GraphQL::Types::Int, null: true, description: 'Total number of test cases that succeeded.' - field :failed, GraphQL::INT_TYPE, null: true, + field :failed, GraphQL::Types::Int, null: true, description: 'Total number of test cases that failed.' - field :skipped, GraphQL::INT_TYPE, null: true, + field :skipped, GraphQL::Types::Int, null: true, description: 'Total number of test cases that were skipped.' - field :error, GraphQL::INT_TYPE, null: true, + field :error, GraphQL::Types::Int, null: true, description: 'Total number of test cases that had an error.' - field :suite_error, GraphQL::STRING_TYPE, null: true, + field :suite_error, GraphQL::Types::String, null: true, description: 'Test suite error message.' end # rubocop: enable Graphql/AuthorizeTypes diff --git a/app/graphql/types/ci/test_suite_summary_type.rb b/app/graphql/types/ci/test_suite_summary_type.rb index a80a9179cb4..3db2d80d591 100644 --- a/app/graphql/types/ci/test_suite_summary_type.rb +++ b/app/graphql/types/ci/test_suite_summary_type.rb @@ -9,31 +9,31 @@ module Types connection_type_class(Types::CountableConnectionType) - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the test suite.' field :total_time, GraphQL::FLOAT_TYPE, null: true, description: 'Total duration of the tests in the test suite.' - field :total_count, GraphQL::INT_TYPE, null: true, + field :total_count, GraphQL::Types::Int, null: true, description: 'Total number of the test cases in the test suite.' - field :success_count, GraphQL::INT_TYPE, null: true, + field :success_count, GraphQL::Types::Int, null: true, description: 'Total number of test cases that succeeded in the test suite.' - field :failed_count, GraphQL::INT_TYPE, null: true, + field :failed_count, GraphQL::Types::Int, null: true, description: 'Total number of test cases that failed in the test suite.' - field :skipped_count, GraphQL::INT_TYPE, null: true, + field :skipped_count, GraphQL::Types::Int, null: true, description: 'Total number of test cases that were skipped in the test suite.' - field :error_count, GraphQL::INT_TYPE, null: true, + field :error_count, GraphQL::Types::Int, null: true, description: 'Total number of test cases that had an error.' - field :suite_error, GraphQL::STRING_TYPE, null: true, + field :suite_error, GraphQL::Types::String, null: true, description: 'Test suite error message.' - field :build_ids, [GraphQL::ID_TYPE], null: true, + field :build_ids, [GraphQL::Types::ID], null: true, description: 'IDs of the builds used to run the test suite.' end # rubocop: enable Graphql/AuthorizeTypes diff --git a/app/graphql/types/ci/test_suite_type.rb b/app/graphql/types/ci/test_suite_type.rb index 7d4c01da81b..f9f37d4045e 100644 --- a/app/graphql/types/ci/test_suite_type.rb +++ b/app/graphql/types/ci/test_suite_type.rb @@ -9,28 +9,28 @@ module Types connection_type_class(Types::CountableConnectionType) - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the test suite.' field :total_time, GraphQL::FLOAT_TYPE, null: true, description: 'Total duration of the tests in the test suite.' - field :total_count, GraphQL::INT_TYPE, null: true, + field :total_count, GraphQL::Types::Int, null: true, description: 'Total number of the test cases in the test suite.' - field :success_count, GraphQL::INT_TYPE, null: true, + field :success_count, GraphQL::Types::Int, null: true, description: 'Total number of test cases that succeeded in the test suite.' - field :failed_count, GraphQL::INT_TYPE, null: true, + field :failed_count, GraphQL::Types::Int, null: true, description: 'Total number of test cases that failed in the test suite.' - field :skipped_count, GraphQL::INT_TYPE, null: true, + field :skipped_count, GraphQL::Types::Int, null: true, description: 'Total number of test cases that were skipped in the test suite.' - field :error_count, GraphQL::INT_TYPE, null: true, + field :error_count, GraphQL::Types::Int, null: true, description: 'Total number of test cases that had an error.' - field :suite_error, GraphQL::STRING_TYPE, null: true, + field :suite_error, GraphQL::Types::String, null: true, description: 'Test suite error message.' field :test_cases, Types::Ci::TestCaseType.connection_type, null: true, |