Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/resolvers/project_jobs_resolver.rb')
-rw-r--r--app/graphql/resolvers/project_jobs_resolver.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/graphql/resolvers/project_jobs_resolver.rb b/app/graphql/resolvers/project_jobs_resolver.rb
index 4d13a4a3fae..2bf71679dbf 100644
--- a/app/graphql/resolvers/project_jobs_resolver.rb
+++ b/app/graphql/resolvers/project_jobs_resolver.rb
@@ -14,10 +14,18 @@ module Resolvers
required: false,
description: 'Filter jobs by status.'
+ argument :with_artifacts, ::GraphQL::Types::Boolean,
+ required: false,
+ description: 'Filter by artifacts presence.'
+
alias_method :project, :object
- def resolve_with_lookahead(statuses: nil)
- jobs = ::Ci::JobsFinder.new(current_user: current_user, project: project, params: { scope: statuses }).execute
+ def resolve_with_lookahead(statuses: nil, with_artifacts: nil)
+ jobs = ::Ci::JobsFinder.new(
+ current_user: current_user, project: project, params: {
+ scope: statuses, with_artifacts: with_artifacts
+ }
+ ).execute
apply_lookahead(jobs)
end
@@ -26,7 +34,7 @@ module Resolvers
def preloads
{
- previous_stage_jobs_and_needs: [:needs, :pipeline],
+ previous_stage_jobs_or_needs: [:needs, :pipeline],
artifacts: [:job_artifacts],
pipeline: [:user]
}