Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
b2508cbd
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
app/finders/pipelines_finder.rb
app/finders/pipelines_finder.rb
+1
-0
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+6
-2
app/serializers/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