diff options
Diffstat (limited to 'app/graphql/types/ci')
-rw-r--r-- | app/graphql/types/ci/job_artifact_type.rb | 4 | ||||
-rw-r--r-- | app/graphql/types/ci/pipeline_scope_enum.rb | 21 | ||||
-rw-r--r-- | app/graphql/types/ci/pipeline_status_enum.rb | 22 | ||||
-rw-r--r-- | app/graphql/types/ci/pipeline_type.rb | 9 | ||||
-rw-r--r-- | app/graphql/types/ci/runner_setup_type.rb | 2 |
5 files changed, 53 insertions, 5 deletions
diff --git a/app/graphql/types/ci/job_artifact_type.rb b/app/graphql/types/ci/job_artifact_type.rb index f80681bcf36..69bb5325dba 100644 --- a/app/graphql/types/ci/job_artifact_type.rb +++ b/app/graphql/types/ci/job_artifact_type.rb @@ -12,6 +12,10 @@ module Types field :file_type, ::Types::Ci::JobArtifactFileTypeEnum, null: true, description: 'File type of the artifact.' + field :name, GraphQL::Types::String, null: true, + description: 'File name of the artifact.', + method: :filename + def download_path ::Gitlab::Routing.url_helpers.download_project_job_artifacts_path( object.project, diff --git a/app/graphql/types/ci/pipeline_scope_enum.rb b/app/graphql/types/ci/pipeline_scope_enum.rb new file mode 100644 index 00000000000..3ce81bc7bf3 --- /dev/null +++ b/app/graphql/types/ci/pipeline_scope_enum.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Types + module Ci + class PipelineScopeEnum < BaseEnum + SCOPES_DESCRIPTION = { + running: 'Pipeline is running.', + pending: 'Pipeline has not started running yet.', + finished: 'Pipeline has completed.', + branches: 'Branches.', + tags: 'Tags.' + }.freeze + + SCOPES_DESCRIPTION.each do |scope, description| + value scope.to_s.upcase, + description: description, + value: scope.to_s + end + end + end +end diff --git a/app/graphql/types/ci/pipeline_status_enum.rb b/app/graphql/types/ci/pipeline_status_enum.rb index 2800454a999..c8e031e18ea 100644 --- a/app/graphql/types/ci/pipeline_status_enum.rb +++ b/app/graphql/types/ci/pipeline_status_enum.rb @@ -3,10 +3,24 @@ module Types module Ci class PipelineStatusEnum < BaseEnum - ::Ci::Pipeline.all_state_names.each do |state_symbol| - value state_symbol.to_s.upcase, - description: "#{::Ci::Pipeline::STATUSES_DESCRIPTION[state_symbol]}.", - value: state_symbol.to_s + STATUSES_DESCRIPTION = { + created: 'Pipeline has been created.', + waiting_for_resource: 'A resource (for example, a runner) that the pipeline requires to run is unavailable.', + preparing: 'Pipeline is preparing to run.', + pending: 'Pipeline has not started running yet.', + running: 'Pipeline is running.', + failed: 'At least one stage of the pipeline failed.', + success: 'Pipeline completed successfully.', + canceled: 'Pipeline was canceled before completion.', + skipped: 'Pipeline was skipped.', + manual: 'Pipeline needs to be manually started.', + scheduled: 'Pipeline is scheduled to run.' + }.freeze + + STATUSES_DESCRIPTION.each do |state, description| + value state.to_s.upcase, + description: description, + value: state.to_s end end end diff --git a/app/graphql/types/ci/pipeline_type.rb b/app/graphql/types/ci/pipeline_type.rb index 493ce188d9b..da2f11be9e2 100644 --- a/app/graphql/types/ci/pipeline_type.rb +++ b/app/graphql/types/ci/pipeline_type.rb @@ -108,6 +108,11 @@ module Types description: 'Name of the job.' end + field :job_artifacts, + null: true, + description: 'Job artifacts of the pipeline.', + resolver: ::Resolvers::Ci::PipelineJobArtifactsResolver + field :source_job, type: Types::Ci::JobType, null: true, @@ -125,6 +130,10 @@ module Types field :path, GraphQL::Types::String, null: true, description: "Relative path to the pipeline's page." + field :commit, Types::CommitType, null: true, + description: "Git commit of the pipeline.", + calls_gitaly: true + field :commit_path, GraphQL::Types::String, null: true, description: 'Path to the commit that triggered the pipeline.' diff --git a/app/graphql/types/ci/runner_setup_type.rb b/app/graphql/types/ci/runner_setup_type.rb index 70f33cef8ad..b6b020db40e 100644 --- a/app/graphql/types/ci/runner_setup_type.rb +++ b/app/graphql/types/ci/runner_setup_type.rb @@ -9,7 +9,7 @@ module Types field :install_instructions, GraphQL::Types::String, null: false, description: 'Instructions for installing the runner on the specified architecture.' field :register_instructions, GraphQL::Types::String, null: true, - description: 'Instructions for registering the runner.' + description: 'Instructions for registering the runner. The actual registration tokens are not included in the commands. Instead, a placeholder `$REGISTRATION_TOKEN` is shown.' end end end |