diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /app/graphql/types/ci/job_type.rb | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'app/graphql/types/ci/job_type.rb')
-rw-r--r-- | app/graphql/types/ci/job_type.rb | 72 |
1 files changed, 34 insertions, 38 deletions
diff --git a/app/graphql/types/ci/job_type.rb b/app/graphql/types/ci/job_type.rb index 1320b96907e..83054553bd8 100644 --- a/app/graphql/types/ci/job_type.rb +++ b/app/graphql/types/ci/job_type.rb @@ -11,38 +11,38 @@ module Types expose_permissions Types::PermissionTypes::Ci::Job + field :allow_failure, ::GraphQL::Types::Boolean, null: false, + description: 'Whether the job is allowed to fail.' + field :duration, GraphQL::Types::Int, null: true, + description: 'Duration of the job in seconds.' field :id, ::Types::GlobalIDType[::CommitStatus].as('JobID'), null: true, description: 'ID of the job.' - field :pipeline, Types::Ci::PipelineType, null: true, - description: 'Pipeline the job belongs to.' 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.' + field :pipeline, Types::Ci::PipelineType, null: true, + description: 'Pipeline the job belongs to.' + field :stage, Types::Ci::StageType, null: true, + description: 'Stage of the job.' field :status, type: ::Types::Ci::JobStatusEnum, null: true, description: "Status of the job." - field :stage, Types::Ci::StageType, null: true, - description: 'Stage of the job.' - field :allow_failure, ::GraphQL::Types::Boolean, null: false, - description: 'Whether the job is allowed to fail.' - field :duration, GraphQL::Types::Int, null: true, - description: 'Duration of the job in seconds.' field :tags, [GraphQL::Types::String], null: true, description: 'Tags for the current job.' # Life-cycle timestamps: field :created_at, Types::TimeType, null: false, description: "When the job was created." - field :queued_at, Types::TimeType, null: true, - description: 'When the job was enqueued and marked as pending.' - field :started_at, Types::TimeType, null: true, - description: 'When the job was started.' field :finished_at, Types::TimeType, null: true, description: 'When a job has finished running.' + field :queued_at, Types::TimeType, null: true, + description: 'When the job was enqueued and marked as pending.' field :scheduled_at, Types::TimeType, null: true, description: 'Schedule for the build.' + field :started_at, Types::TimeType, null: true, + description: 'When the job was started.' # Life-cycle durations: field :queued_duration, @@ -50,40 +50,40 @@ module Types null: true, description: 'How long the job was enqueued before starting.' - field :downstream_pipeline, Types::Ci::PipelineType, null: true, - description: 'Downstream pipeline for a bridge.' - field :previous_stage_jobs_or_needs, Types::Ci::JobNeedUnion.connection_type, null: true, - description: 'Jobs that must complete before the job runs. Returns `BuildNeed`, which is the needed jobs if the job uses the `needs` keyword, or the previous stage jobs otherwise.' - field :detailed_status, Types::Ci::DetailedStatusType, null: true, - description: 'Detailed status of the job.' + field :active, GraphQL::Types::Boolean, null: false, method: :active?, + description: 'Indicates the job is active.' field :artifacts, Types::Ci::JobArtifactType.connection_type, null: true, description: 'Artifacts generated by the job.' - field :short_sha, type: GraphQL::Types::String, null: false, - description: 'Short SHA1 ID of the commit.' - 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 :cancelable, GraphQL::Types::Boolean, null: false, method: :cancelable?, + description: 'Indicates the job can be canceled.' field :commit_path, GraphQL::Types::String, null: true, description: 'Path to the commit that triggered the job.' + field :coverage, GraphQL::Types::Float, null: true, + description: 'Coverage level of the job.' + field :created_by_tag, GraphQL::Types::Boolean, null: false, + description: 'Whether the job was created by a tag.', method: :tag? + field :detailed_status, Types::Ci::DetailedStatusType, null: true, + description: 'Detailed status of the job.' + field :downstream_pipeline, Types::Ci::PipelineType, null: true, + description: 'Downstream pipeline for a bridge.' + field :manual_job, GraphQL::Types::Boolean, null: true, + description: 'Whether the job has a manual action.' + field :playable, GraphQL::Types::Boolean, null: false, method: :playable?, + description: 'Indicates the job can be played.' + field :previous_stage_jobs_or_needs, Types::Ci::JobNeedUnion.connection_type, null: true, + description: 'Jobs that must complete before the job runs. Returns `BuildNeed`, which is the needed jobs if the job uses the `needs` keyword, or the previous stage jobs otherwise.' field :ref_name, GraphQL::Types::String, null: true, description: 'Ref name of the job.' field :ref_path, GraphQL::Types::String, null: true, description: 'Path to the ref.' - field :playable, GraphQL::Types::Boolean, null: false, method: :playable?, - description: 'Indicates the job can be played.' field :retryable, GraphQL::Types::Boolean, null: false, method: :retryable?, description: 'Indicates the job can be retried.' - field :cancelable, GraphQL::Types::Boolean, null: false, method: :cancelable?, - description: 'Indicates the job can be canceled.' - field :active, GraphQL::Types::Boolean, null: false, method: :active?, - description: 'Indicates the job is active.' + 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 :short_sha, type: GraphQL::Types::String, null: false, + description: 'Short SHA1 ID of the commit.' field :stuck, GraphQL::Types::Boolean, null: false, method: :stuck?, description: 'Indicates the job is stuck.' - field :coverage, GraphQL::Types::Float, null: true, - description: 'Coverage level of the job.' - field :created_by_tag, GraphQL::Types::Boolean, null: false, - description: 'Whether the job was created by a tag.' - field :manual_job, GraphQL::Types::Boolean, null: true, - description: 'Whether the job has a manual action.' field :triggered, GraphQL::Types::Boolean, null: true, description: 'Whether the job was triggered.' @@ -173,10 +173,6 @@ module Types object&.coverage end - def created_by_tag - object.tag? - end - def manual_job object.try(:action?) end |