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
17b9128b
Commit
17b9128b
authored
May 17, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
includes last_pipeline
parent
df6040bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
lib/api/entities.rb
lib/api/entities.rb
+1
-3
lib/api/pipeline_schedules.rb
lib/api/pipeline_schedules.rb
+1
-1
spec/requests/api/pipeline_schedules_spec.rb
spec/requests/api/pipeline_schedules_spec.rb
+3
-0
No files found.
lib/api/entities.rb
View file @
17b9128b
...
@@ -690,9 +690,7 @@ module API
...
@@ -690,9 +690,7 @@ module API
expose
:id
expose
:id
expose
:description
,
:ref
,
:cron
,
:cron_timezone
,
:next_run_at
,
:active
expose
:description
,
:ref
,
:cron
,
:cron_timezone
,
:next_run_at
,
:active
expose
:created_at
,
:updated_at
,
:deleted_at
expose
:created_at
,
:updated_at
,
:deleted_at
expose
:last_pipeline
,
using:
Entities
::
Pipeline
do
|
pipeline_schedule
|
expose
:last_pipeline
,
using:
Entities
::
Pipeline
pipeline_schedule
.
pipelines
&
.
last
end
expose
:owner
,
using:
Entities
::
UserBasic
expose
:owner
,
using:
Entities
::
UserBasic
end
end
...
...
lib/api/pipeline_schedules.rb
View file @
17b9128b
...
@@ -17,7 +17,7 @@ module API
...
@@ -17,7 +17,7 @@ module API
get
':id/pipeline_schedules'
do
get
':id/pipeline_schedules'
do
authorize!
:read_pipeline_schedule
,
user_project
authorize!
:read_pipeline_schedule
,
user_project
pipeline_schedules
=
user_project
.
pipeline_schedules
.
preload
(
:pipelines
)
pipeline_schedules
=
user_project
.
pipeline_schedules
.
includes
(
last_pipeline:
{
statuses: :latest
}
)
present
paginate
(
pipeline_schedules
),
with:
Entities
::
PipelineSchedule
present
paginate
(
pipeline_schedules
),
with:
Entities
::
PipelineSchedule
end
end
...
...
spec/requests/api/pipeline_schedules_spec.rb
View file @
17b9128b
...
@@ -31,6 +31,9 @@ describe API::PipelineSchedules do
...
@@ -31,6 +31,9 @@ describe API::PipelineSchedules do
end
.
count
end
.
count
create_list
(
:ci_pipeline_schedule
,
10
,
project:
project
,
owner:
developer
)
create_list
(
:ci_pipeline_schedule
,
10
,
project:
project
,
owner:
developer
)
.
each
do
|
pipeline_schedule
|
pipeline_schedule
.
pipelines
<<
build
(
:ci_pipeline
,
project:
project
)
end
expect
do
expect
do
get
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules"
,
developer
)
get
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules"
,
developer
)
...
...
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