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/concerns/resolves_pipelines.rb')
-rw-r--r--app/graphql/resolvers/concerns/resolves_pipelines.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/graphql/resolvers/concerns/resolves_pipelines.rb b/app/graphql/resolvers/concerns/resolves_pipelines.rb
new file mode 100644
index 00000000000..9ec45378d8e
--- /dev/null
+++ b/app/graphql/resolvers/concerns/resolves_pipelines.rb
@@ -0,0 +1,23 @@
+module ResolvesPipelines
+ extend ActiveSupport::Concern
+
+ included do
+ type [Types::Ci::PipelineType], null: false
+ argument :status,
+ Types::Ci::PipelineStatusEnum,
+ required: false,
+ description: "Filter pipelines by their status"
+ argument :ref,
+ GraphQL::STRING_TYPE,
+ required: false,
+ description: "Filter pipelines by the ref they are run for"
+ argument :sha,
+ GraphQL::STRING_TYPE,
+ required: false,
+ description: "Filter pipelines by the sha of the commit they are run for"
+ end
+
+ def resolve_pipelines(project, params = {})
+ PipelinesFinder.new(project, context[:current_user], params).execute
+ end
+end