BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
b2508cbd
Unverified
Commit
b2508cbd
authored
Dec 15, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve performance of Pipelines API
parent
9eed507d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
pipelines_finder.rb
app/finders/pipelines_finder.rb
+1
-0
pipeline.rb
app/models/ci/pipeline.rb
+6
-2
pipeline_entity.rb
app/serializers/pipeline_entity.rb
+1
-3
No files found.
app/finders/pipelines_finder.rb
View file @
b2508cbd
...
...
@@ -20,6 +20,7 @@ class PipelinesFinder
end
scoped_pipelines
.
order
(
id: :desc
)
.
includes
(
project:
[
:namespace
])
end
private
...
...
app/models/ci/pipeline.rb
View file @
b2508cbd
...
...
@@ -124,7 +124,7 @@ module Ci
end
def
artifacts
builds
.
latest
.
with_artifacts_not_expired
builds
.
latest
.
with_artifacts_not_expired
.
includes
(
project:
[
:namespace
])
end
def
project_id
...
...
@@ -173,7 +173,11 @@ module Ci
end
def
manual_actions
builds
.
latest
.
manual_actions
builds
.
latest
.
manual_actions
.
includes
(
project:
[
:namespace
])
end
def
stuck?
builds
.
pending
.
any?
(
&
:stuck?
)
end
def
retryable?
...
...
app/serializers/pipeline_entity.rb
View file @
b2508cbd
...
...
@@ -33,9 +33,7 @@ class PipelineEntity < Grape::Entity
pipeline
.
yaml_errors
.
present?
end
expose
:stuck?
,
as: :stuck
do
|
pipeline
|
pipeline
.
builds
.
any?
(
&
:stuck?
)
end
expose
:stuck?
,
as: :stuck
end
expose
:ref
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment