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
fa0c0bb0
Commit
fa0c0bb0
authored
Mar 02, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Narrow environment payload by using basic project details resource
parent
b63c41e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
3 deletions
+10
-3
changelogs/unreleased/28598-narrow-environment-payload-by-using-basic-project.yml
...598-narrow-environment-payload-by-using-basic-project.yml
+4
-0
doc/api/v3_to_v4.md
doc/api/v3_to_v4.md
+2
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-1
spec/requests/api/environments_spec.rb
spec/requests/api/environments_spec.rb
+3
-2
No files found.
changelogs/unreleased/28598-narrow-environment-payload-by-using-basic-project.yml
0 → 100644
View file @
fa0c0bb0
---
title
:
Narrow environment payload by using basic project details resource
merge_request
:
author
:
doc/api/v3_to_v4.md
View file @
fa0c0bb0
...
...
@@ -68,3 +68,5 @@ changes are in V4:
-
Rename Build Triggers to be Pipeline Triggers API
[
!9713
](
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9713
)
-
`POST /projects/:id/trigger/builds`
to
`POST /projects/:id/trigger/pipeline`
-
Require description when creating a new trigger
`POST /projects/:id/triggers`
-
Simplify project payload exposed on Environment endpoints
[
!9675
](
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9675
)
lib/api/entities.rb
View file @
fa0c0bb0
...
...
@@ -671,7 +671,7 @@ module API
end
class
Environment
<
EnvironmentBasic
expose
:project
,
using:
Entities
::
Project
expose
:project
,
using:
Entities
::
BasicProjectDetails
end
class
Deployment
<
Grape
::
Entity
...
...
spec/requests/api/environments_spec.rb
View file @
fa0c0bb0
...
...
@@ -15,6 +15,8 @@ describe API::Environments, api: true do
describe
'GET /projects/:id/environments'
do
context
'as member of the project'
do
it
'returns project environments'
do
project_data_keys
=
%w(id http_url_to_repo web_url name name_with_namespace path path_with_namespace)
get
api
(
"/projects/
#{
project
.
id
}
/environments"
,
user
)
expect
(
response
).
to
have_http_status
(
200
)
...
...
@@ -23,8 +25,7 @@ describe API::Environments, api: true do
expect
(
json_response
.
size
).
to
eq
(
1
)
expect
(
json_response
.
first
[
'name'
]).
to
eq
(
environment
.
name
)
expect
(
json_response
.
first
[
'external_url'
]).
to
eq
(
environment
.
external_url
)
expect
(
json_response
.
first
[
'project'
][
'id'
]).
to
eq
(
project
.
id
)
expect
(
json_response
.
first
[
'project'
][
'visibility'
]).
to
be_present
expect
(
json_response
.
first
[
'project'
].
keys
).
to
contain_exactly
(
*
project_data_keys
)
end
end
...
...
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