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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
94b8f283
Commit
94b8f283
authored
Feb 01, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose upstream/downstream pipelines
parent
7f944ed8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
11 deletions
+24
-11
ee/app/serializers/dashboard_operations_project_entity.rb
ee/app/serializers/dashboard_operations_project_entity.rb
+24
-11
No files found.
ee/app/serializers/dashboard_operations_project_entity.rb
View file @
94b8f283
...
...
@@ -10,20 +10,18 @@ class DashboardOperationsProjectEntity < Grape::Entity
end
expose
:last_pipeline
,
if:
->
(
*
)
{
last_pipeline
}
do
|
dashboard_project
,
options
|
new_request
=
EntityRequest
.
new
(
current_user:
request
.
current_user
,
project:
dashboard_project
.
project
)
PipelineEntity
.
represent
(
last_pipeline
,
options
.
merge
(
request:
new_request
))
end
expose
:last_deployment
,
if:
->
(
*
)
{
last_deployment?
}
do
|
dashboard_project
,
options
|
new_request
=
EntityRequest
.
new
(
current_user:
request
.
current_user
,
project:
dashboard_project
.
project
)
expose
:upstream_pipeline
,
if:
->
(
*
)
{
upstream_pipeline
}
do
|
dashboard_project
,
options
|
PipelineEntity
.
represent
(
upstream_pipeline
,
options
.
merge
(
request:
new_request
))
end
expose
:downstream_pipelines
,
if:
->
(
*
)
{
downstream_pipelines
}
do
|
dashboard_project
,
options
|
PipelineEntity
.
represent
(
downstream_pipelines
,
options
.
merge
(
request:
new_request
))
end
expose
:last_deployment
,
if:
->
(
*
)
{
last_deployment?
}
do
|
dashboard_project
,
options
|
DeploymentEntity
.
represent
(
dashboard_project
.
last_deployment
,
options
.
merge
(
request:
new_request
))
end
...
...
@@ -41,8 +39,23 @@ class DashboardOperationsProjectEntity < Grape::Entity
alias_method
:dashboard_project
,
:object
def
new_request
EntityRequest
.
new
(
current_user:
request
.
current_user
,
project:
dashboard_project
.
project
)
end
def
upstream_pipeline
last_pipeline
&
.
source_pipeline
&
.
source_pipeline
end
def
downstream_pipelines
last_pipeline
&
.
sourced_pipelines
&
.
map
(
&
:source_pipeline
)
end
def
last_pipeline
dashboard_project
.
project
.
commit
.
last_pipeline
dashboard_project
.
project
.
commit
&
.
last_pipeline
end
def
last_deployment?
...
...
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