diff options
Diffstat (limited to 'app/graphql/types/ci')
-rw-r--r-- | app/graphql/types/ci/analytics_type.rb | 22 | ||||
-rw-r--r-- | app/graphql/types/ci/application_setting_type.rb | 14 | ||||
-rw-r--r-- | app/graphql/types/ci/ci_cd_setting_type.rb | 3 | ||||
-rw-r--r-- | app/graphql/types/ci/config/config_type.rb | 8 | ||||
-rw-r--r-- | app/graphql/types/ci/config/group_type.rb | 6 | ||||
-rw-r--r-- | app/graphql/types/ci/config/need_type.rb | 2 | ||||
-rw-r--r-- | app/graphql/types/ci/config/stage_type.rb | 4 | ||||
-rw-r--r-- | app/graphql/types/ci/detailed_status_type.rb | 21 | ||||
-rw-r--r-- | app/graphql/types/ci/group_type.rb | 8 | ||||
-rw-r--r-- | app/graphql/types/ci/job_artifact_type.rb | 4 | ||||
-rw-r--r-- | app/graphql/types/ci/job_type.rb | 12 | ||||
-rw-r--r-- | app/graphql/types/ci/pipeline_type.rb | 52 | ||||
-rw-r--r-- | app/graphql/types/ci/runner_architecture_type.rb | 4 | ||||
-rw-r--r-- | app/graphql/types/ci/runner_platform_type.rb | 6 | ||||
-rw-r--r-- | app/graphql/types/ci/runner_setup_type.rb | 4 | ||||
-rw-r--r-- | app/graphql/types/ci/stage_type.rb | 6 | ||||
-rw-r--r-- | app/graphql/types/ci/status_action_type.rb | 10 |
17 files changed, 103 insertions, 83 deletions
diff --git a/app/graphql/types/ci/analytics_type.rb b/app/graphql/types/ci/analytics_type.rb index c8b12c6a9b8..ba987b133bd 100644 --- a/app/graphql/types/ci/analytics_type.rb +++ b/app/graphql/types/ci/analytics_type.rb @@ -7,27 +7,27 @@ module Types graphql_name 'PipelineAnalytics' field :week_pipelines_totals, [GraphQL::INT_TYPE], null: true, - description: 'Total weekly pipeline count' + description: 'Total weekly pipeline count.' field :week_pipelines_successful, [GraphQL::INT_TYPE], null: true, - description: 'Total weekly successful pipeline count' + description: 'Total weekly successful pipeline count.' field :week_pipelines_labels, [GraphQL::STRING_TYPE], null: true, - description: 'Labels for the weekly pipeline count' + description: 'Labels for the weekly pipeline count.' field :month_pipelines_totals, [GraphQL::INT_TYPE], null: true, - description: 'Total monthly pipeline count' + description: 'Total monthly pipeline count.' field :month_pipelines_successful, [GraphQL::INT_TYPE], null: true, - description: 'Total monthly successful pipeline count' + description: 'Total monthly successful pipeline count.' field :month_pipelines_labels, [GraphQL::STRING_TYPE], null: true, - description: 'Labels for the monthly pipeline count' + description: 'Labels for the monthly pipeline count.' field :year_pipelines_totals, [GraphQL::INT_TYPE], null: true, - description: 'Total yearly pipeline count' + description: 'Total yearly pipeline count.' field :year_pipelines_successful, [GraphQL::INT_TYPE], null: true, - description: 'Total yearly successful pipeline count' + description: 'Total yearly successful pipeline count.' field :year_pipelines_labels, [GraphQL::STRING_TYPE], null: true, - description: 'Labels for the yearly pipeline count' + description: 'Labels for the yearly pipeline count.' field :pipeline_times_values, [GraphQL::INT_TYPE], null: true, - description: 'Pipeline times' + description: 'Pipeline times.' field :pipeline_times_labels, [GraphQL::STRING_TYPE], null: true, - description: 'Pipeline times labels' + description: 'Pipeline times labels.' end end end diff --git a/app/graphql/types/ci/application_setting_type.rb b/app/graphql/types/ci/application_setting_type.rb new file mode 100644 index 00000000000..8616280057c --- /dev/null +++ b/app/graphql/types/ci/application_setting_type.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Types + module Ci + class ApplicationSettingType < BaseObject + graphql_name 'CiApplicationSettings' + + authorize :read_application_setting + + field :keep_latest_artifact, GraphQL::BOOLEAN_TYPE, null: true, + description: 'Whether to keep the latest jobs artifacts.' + end + 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 e80771cdf9d..b34a91446a2 100644 --- a/app/graphql/types/ci/ci_cd_setting_type.rb +++ b/app/graphql/types/ci/ci_cd_setting_type.rb @@ -14,7 +14,8 @@ module Types description: 'Whether merge trains are enabled.', method: :merge_trains_enabled? field :keep_latest_artifact, GraphQL::BOOLEAN_TYPE, null: true, - description: 'Whether to keep the latest builds artifacts.' + description: 'Whether to keep the latest builds artifacts.', + method: :keep_latest_artifacts_available? field :project, Types::ProjectType, null: true, description: 'Project the CI/CD settings belong to.' end diff --git a/app/graphql/types/ci/config/config_type.rb b/app/graphql/types/ci/config/config_type.rb index 29093c6d3c9..88caf21c376 100644 --- a/app/graphql/types/ci/config/config_type.rb +++ b/app/graphql/types/ci/config/config_type.rb @@ -8,13 +8,13 @@ module Types graphql_name 'CiConfig' field :errors, [GraphQL::STRING_TYPE], null: true, - description: 'Linting errors' + description: 'Linting errors.' field :merged_yaml, GraphQL::STRING_TYPE, null: true, - description: 'Merged CI config YAML' + description: 'Merged CI configuration YAML.' field :stages, Types::Ci::Config::StageType.connection_type, null: true, - description: 'Stages of the pipeline' + description: 'Stages of the pipeline.' field :status, Types::Ci::Config::StatusEnum, null: true, - description: 'Status of linting, can be either valid or invalid' + description: 'Status of linting, can be either valid or invalid.' end end end diff --git a/app/graphql/types/ci/config/group_type.rb b/app/graphql/types/ci/config/group_type.rb index 8e133bbcba8..11be701e73f 100644 --- a/app/graphql/types/ci/config/group_type.rb +++ b/app/graphql/types/ci/config/group_type.rb @@ -8,11 +8,11 @@ module Types graphql_name 'CiConfigGroup' field :name, GraphQL::STRING_TYPE, null: true, - description: 'Name of the job group' + description: 'Name of the job group.' field :jobs, Types::Ci::Config::JobType.connection_type, null: true, - description: 'Jobs in group' + description: 'Jobs in group.' field :size, GraphQL::INT_TYPE, null: true, - description: 'Size of the job group' + description: 'Size of the job group.' end end end diff --git a/app/graphql/types/ci/config/need_type.rb b/app/graphql/types/ci/config/need_type.rb index a442450b9ae..01f73100409 100644 --- a/app/graphql/types/ci/config/need_type.rb +++ b/app/graphql/types/ci/config/need_type.rb @@ -8,7 +8,7 @@ module Types graphql_name 'CiConfigNeed' field :name, GraphQL::STRING_TYPE, null: true, - description: 'Name of the need' + description: 'Name of the need.' end end end diff --git a/app/graphql/types/ci/config/stage_type.rb b/app/graphql/types/ci/config/stage_type.rb index 2008c553629..060efb7d45c 100644 --- a/app/graphql/types/ci/config/stage_type.rb +++ b/app/graphql/types/ci/config/stage_type.rb @@ -8,9 +8,9 @@ module Types graphql_name 'CiConfigStage' field :name, GraphQL::STRING_TYPE, null: true, - description: 'Name of the stage' + description: 'Name of the stage.' field :groups, Types::Ci::Config::GroupType.connection_type, null: true, - description: 'Groups of jobs for the stage' + description: 'Groups of jobs for the stage.' end end end diff --git a/app/graphql/types/ci/detailed_status_type.rb b/app/graphql/types/ci/detailed_status_type.rb index 80d73e9b174..0b643a6b676 100644 --- a/app/graphql/types/ci/detailed_status_type.rb +++ b/app/graphql/types/ci/detailed_status_type.rb @@ -7,26 +7,27 @@ module Types graphql_name 'DetailedStatus' field :group, GraphQL::STRING_TYPE, null: true, - description: 'Group of the status' + description: 'Group of the status.' field :icon, GraphQL::STRING_TYPE, null: true, - description: 'Icon of the status' + description: 'Icon of the status.' field :favicon, GraphQL::STRING_TYPE, null: true, - description: 'Favicon of the status' + description: 'Favicon of the status.' field :details_path, GraphQL::STRING_TYPE, null: true, - description: 'Path of the details for the status' + description: 'Path of the details for the status.' field :has_details, GraphQL::BOOLEAN_TYPE, null: true, - description: 'Indicates if the status has further details', + description: 'Indicates if the status has further details.', method: :has_details? field :label, GraphQL::STRING_TYPE, null: true, - description: 'Label of the status' + calls_gitaly: true, + description: 'Label of the status.' field :text, GraphQL::STRING_TYPE, null: true, - description: 'Text of the status' + description: 'Text of the status.' field :tooltip, GraphQL::STRING_TYPE, null: true, - description: 'Tooltip associated with the status', + description: 'Tooltip associated with the status.', method: :status_tooltip field :action, Types::Ci::StatusActionType, null: true, - calls_gitaly: true, - description: 'Action information for the status. This includes method, button title, icon, path, and title' + calls_gitaly: true, + description: 'Action information for the status. This includes method, button title, icon, path, and title.' def action if object.has_action? diff --git a/app/graphql/types/ci/group_type.rb b/app/graphql/types/ci/group_type.rb index 03fd50d5dbb..d6d4252e8d7 100644 --- a/app/graphql/types/ci/group_type.rb +++ b/app/graphql/types/ci/group_type.rb @@ -7,13 +7,13 @@ module Types graphql_name 'CiGroup' field :name, GraphQL::STRING_TYPE, null: true, - description: 'Name of the job group' + description: 'Name of the job group.' field :size, GraphQL::INT_TYPE, null: true, - description: 'Size of the group' + description: 'Size of the group.' field :jobs, Ci::JobType.connection_type, null: true, - description: 'Jobs in group' + description: 'Jobs in group.' field :detailed_status, Types::Ci::DetailedStatusType, null: true, - description: 'Detailed status of the group' + description: 'Detailed status of the group.' def detailed_status object.detailed_status(context[:current_user]) diff --git a/app/graphql/types/ci/job_artifact_type.rb b/app/graphql/types/ci/job_artifact_type.rb index c34a12dcc61..7dc93041b53 100644 --- a/app/graphql/types/ci/job_artifact_type.rb +++ b/app/graphql/types/ci/job_artifact_type.rb @@ -7,10 +7,10 @@ module Types graphql_name 'CiJobArtifact' field :download_path, GraphQL::STRING_TYPE, null: true, - description: "URL for downloading the artifact's file" + description: "URL for downloading the artifact's file." field :file_type, ::Types::Ci::JobArtifactFileTypeEnum, null: true, - description: 'File type of the artifact' + description: 'File type of the artifact.' def download_path ::Gitlab::Routing.url_helpers.download_project_job_artifacts_path( diff --git a/app/graphql/types/ci/job_type.rb b/app/graphql/types/ci/job_type.rb index f8bf1732e63..ba463cdd9c1 100644 --- a/app/graphql/types/ci/job_type.rb +++ b/app/graphql/types/ci/job_type.rb @@ -7,17 +7,17 @@ module Types authorize :read_commit_status field :pipeline, Types::Ci::PipelineType, null: true, - description: 'Pipeline the job belongs to' + description: 'Pipeline the job belongs to.' field :name, GraphQL::STRING_TYPE, null: true, - description: 'Name of the job' + description: 'Name of the job.' field :needs, BuildNeedType.connection_type, null: true, - description: 'References to builds that must complete before the jobs run' + description: 'References to builds that must complete before the jobs run.' field :detailed_status, Types::Ci::DetailedStatusType, null: true, - description: 'Detailed status of the job' + description: 'Detailed status of the job.' field :scheduled_at, Types::TimeType, null: true, - description: 'Schedule for the build' + description: 'Schedule for the build.' field :artifacts, Types::Ci::JobArtifactType.connection_type, null: true, - description: 'Artifacts generated by the job' + description: 'Artifacts generated by the job.' def pipeline Gitlab::Graphql::Loaders::BatchModelLoader.new(::Ci::Pipeline, object.pipeline_id).find diff --git a/app/graphql/types/ci/pipeline_type.rb b/app/graphql/types/ci/pipeline_type.rb index 4709d5e8dd6..2c386c9b564 100644 --- a/app/graphql/types/ci/pipeline_type.rb +++ b/app/graphql/types/ci/pipeline_type.rb @@ -8,94 +8,98 @@ module Types connection_type_class(Types::CountableConnectionType) authorize :read_pipeline + present_using ::Ci::PipelinePresenter expose_permissions Types::PermissionTypes::Ci::Pipeline field :id, GraphQL::ID_TYPE, null: false, - description: 'ID of the pipeline' + description: 'ID of the pipeline.' field :iid, GraphQL::STRING_TYPE, null: false, - description: 'Internal ID of the pipeline' + description: 'Internal ID of the pipeline.' field :sha, GraphQL::STRING_TYPE, null: false, - description: "SHA of the pipeline's commit" + description: "SHA of the pipeline's commit." field :before_sha, GraphQL::STRING_TYPE, null: true, - description: 'Base SHA of the source branch' + description: 'Base SHA of the source branch.' 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?, + description: "Indicates if a pipeline has warnings." + field :detailed_status, Types::Ci::DetailedStatusType, null: false, - description: 'Detailed status of the pipeline' + description: 'Detailed status of the pipeline.' field :config_source, PipelineConfigSourceEnum, null: true, - description: "Config source of the pipeline (#{::Enums::Ci::Pipeline.config_sources.keys.join(', ').upcase})" + description: "Configuration source of the pipeline (#{::Enums::Ci::Pipeline.config_sources.keys.join(', ').upcase})" field :duration, GraphQL::INT_TYPE, null: true, - description: 'Duration of the pipeline in seconds' + description: 'Duration of the pipeline in seconds.' field :coverage, GraphQL::FLOAT_TYPE, null: true, - description: 'Coverage percentage' + description: 'Coverage percentage.' field :created_at, Types::TimeType, null: false, - description: "Timestamp of the pipeline's creation" + description: "Timestamp of the pipeline's creation." field :updated_at, Types::TimeType, null: false, - description: "Timestamp of the pipeline's last activity" + description: "Timestamp of the pipeline's last activity." field :started_at, Types::TimeType, null: true, - description: 'Timestamp when the pipeline was started' + description: 'Timestamp when the pipeline was started.' field :finished_at, Types::TimeType, null: true, - description: "Timestamp of the pipeline's completion" + description: "Timestamp of the pipeline's completion." field :committed_at, Types::TimeType, null: true, - description: "Timestamp of the pipeline's commit" + description: "Timestamp of the pipeline's commit." field :stages, Types::Ci::StageType.connection_type, null: true, - description: 'Stages of the pipeline', + description: 'Stages of the pipeline.', extras: [:lookahead], resolver: Resolvers::Ci::PipelineStagesResolver field :user, Types::UserType, null: true, - description: 'Pipeline user' + description: 'Pipeline user.' field :retryable, GraphQL::BOOLEAN_TYPE, - description: 'Specifies if a pipeline can be retried', + description: 'Specifies if a pipeline can be retried.', method: :retryable?, null: false field :cancelable, GraphQL::BOOLEAN_TYPE, - description: 'Specifies if a pipeline can be canceled', + description: 'Specifies if a pipeline can be canceled.', method: :cancelable?, null: false field :jobs, ::Types::Ci::JobType.connection_type, null: true, - description: 'Jobs belonging to the pipeline', + description: 'Jobs belonging to the pipeline.', resolver: ::Resolvers::Ci::JobsResolver field :source_job, Types::Ci::JobType, null: true, - description: 'Job where pipeline was triggered from' + description: 'Job where pipeline was triggered from.' field :downstream, Types::Ci::PipelineType.connection_type, null: true, - description: 'Pipelines this pipeline will trigger', + description: 'Pipelines this pipeline will trigger.', method: :triggered_pipelines_with_preloads field :upstream, Types::Ci::PipelineType, null: true, - description: 'Pipeline that triggered the pipeline', + description: 'Pipeline that triggered the pipeline.', method: :triggered_by_pipeline field :path, GraphQL::STRING_TYPE, null: true, - description: "Relative path to the pipeline's page" + description: "Relative path to the pipeline's page." field :project, Types::ProjectType, null: true, - description: 'Project the pipeline belongs to' + description: 'Project the pipeline belongs to.' field :active, GraphQL::BOOLEAN_TYPE, null: false, method: :active?, - description: 'Indicates if the pipeline is active' + description: 'Indicates if the pipeline is active.' def detailed_status object.detailed_status(context[:current_user]) diff --git a/app/graphql/types/ci/runner_architecture_type.rb b/app/graphql/types/ci/runner_architecture_type.rb index 526348abd9d..229974d4d13 100644 --- a/app/graphql/types/ci/runner_architecture_type.rb +++ b/app/graphql/types/ci/runner_architecture_type.rb @@ -7,9 +7,9 @@ module Types graphql_name 'RunnerArchitecture' field :name, GraphQL::STRING_TYPE, null: false, - description: 'Name of the runner platform architecture' + description: 'Name of the runner platform architecture.' field :download_location, GraphQL::STRING_TYPE, null: false, - description: 'Download location for the runner for the platform architecture' + description: 'Download location for the runner for the platform architecture.' end end end diff --git a/app/graphql/types/ci/runner_platform_type.rb b/app/graphql/types/ci/runner_platform_type.rb index 64719bc4908..5636f88835e 100644 --- a/app/graphql/types/ci/runner_platform_type.rb +++ b/app/graphql/types/ci/runner_platform_type.rb @@ -7,11 +7,11 @@ module Types graphql_name 'RunnerPlatform' field :name, GraphQL::STRING_TYPE, null: false, - description: 'Name slug of the runner platform' + description: 'Name slug of the runner platform.' field :human_readable_name, GraphQL::STRING_TYPE, null: false, - description: 'Human readable name of the runner platform' + description: 'Human readable name of the runner platform.' field :architectures, Types::Ci::RunnerArchitectureType.connection_type, null: true, - description: 'Runner architectures supported for the platform' + description: 'Runner architectures supported for the platform.' end end end diff --git a/app/graphql/types/ci/runner_setup_type.rb b/app/graphql/types/ci/runner_setup_type.rb index 66abcf65adf..61a2ea2a411 100644 --- a/app/graphql/types/ci/runner_setup_type.rb +++ b/app/graphql/types/ci/runner_setup_type.rb @@ -7,9 +7,9 @@ module Types graphql_name 'RunnerSetup' field :install_instructions, GraphQL::STRING_TYPE, null: false, - description: 'Instructions for installing the runner on the specified architecture' + description: 'Instructions for installing the runner on the specified architecture.' field :register_instructions, GraphQL::STRING_TYPE, null: true, - description: 'Instructions for registering the runner' + description: 'Instructions for registering the runner.' end end end diff --git a/app/graphql/types/ci/stage_type.rb b/app/graphql/types/ci/stage_type.rb index 695e7c61bd9..836f2430890 100644 --- a/app/graphql/types/ci/stage_type.rb +++ b/app/graphql/types/ci/stage_type.rb @@ -7,12 +7,12 @@ module Types graphql_name 'CiStage' field :name, GraphQL::STRING_TYPE, null: true, - description: 'Name of the stage' + description: 'Name of the stage.' field :groups, Ci::GroupType.connection_type, null: true, extras: [:lookahead], - description: 'Group of jobs for the stage' + description: 'Group of jobs for the stage.' field :detailed_status, Types::Ci::DetailedStatusType, null: true, - description: 'Detailed status of the stage' + description: 'Detailed status of the stage.' def detailed_status object.detailed_status(context[:current_user]) diff --git a/app/graphql/types/ci/status_action_type.rb b/app/graphql/types/ci/status_action_type.rb index 08cbb6d3b59..9f7299c0270 100644 --- a/app/graphql/types/ci/status_action_type.rb +++ b/app/graphql/types/ci/status_action_type.rb @@ -6,16 +6,16 @@ module Types graphql_name 'StatusAction' field :button_title, GraphQL::STRING_TYPE, null: true, - description: 'Title for the button, for example: Retry this job' + description: 'Title for the button, for example: Retry this job.' field :icon, GraphQL::STRING_TYPE, null: true, - description: 'Icon used in the action button' + description: 'Icon used in the action button.' field :method, GraphQL::STRING_TYPE, null: true, - description: 'Method for the action, for example: :post', + description: 'Method for the action, for example: :post.', resolver_method: :action_method field :path, GraphQL::STRING_TYPE, null: true, - description: 'Path for the action' + description: 'Path for the action.' field :title, GraphQL::STRING_TYPE, null: true, - description: 'Title for the action, for example: Retry' + description: 'Title for the action, for example: Retry.' def action_method object[:method] |