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
Boxiang Sun
gitlab-ce
Commits
46317b7d
Commit
46317b7d
authored
Jun 05, 2018
by
Jacopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes variables from pipelines api
parent
3871ea33
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
doc/api/pipelines.md
doc/api/pipelines.md
+1
-2
lib/api/entities.rb
lib/api/entities.rb
+0
-1
spec/requests/api/pipelines_spec.rb
spec/requests/api/pipelines_spec.rb
+13
-2
No files found.
doc/api/pipelines.md
View file @
46317b7d
...
...
@@ -133,8 +133,7 @@ Example of response
"finished_at"
:
null
,
"committed_at"
:
null
,
"duration"
:
null
,
"coverage"
:
null
,
"variables"
:
[]
"coverage"
:
null
}
```
...
...
lib/api/entities.rb
View file @
46317b7d
...
...
@@ -1067,7 +1067,6 @@ module API
expose
:created_at
,
:updated_at
,
:started_at
,
:finished_at
,
:committed_at
expose
:duration
expose
:coverage
expose
:variables
,
using:
Entities
::
Variable
end
class
PipelineSchedule
<
Grape
::
Entity
...
...
spec/requests/api/pipelines_spec.rb
View file @
46317b7d
...
...
@@ -285,6 +285,15 @@ describe API::Pipelines do
end
describe
'POST /projects/:id/pipeline '
do
def
expect_variables
(
variables
,
expected_variables
)
variables
.
each_with_index
do
|
variable
,
index
|
expected_variable
=
expected_variables
[
index
]
expect
(
variable
.
key
).
to
eq
(
expected_variable
[
'key'
])
expect
(
variable
.
value
).
to
eq
(
expected_variable
[
'value'
])
end
end
context
'authorized user'
do
context
'with gitlab-ci.yml'
do
before
do
...
...
@@ -308,11 +317,12 @@ describe API::Pipelines do
expect
do
post
api
(
"/projects/
#{
project
.
id
}
/pipeline"
,
user
),
ref:
project
.
default_branch
,
variables:
variables
end
.
to
change
{
project
.
pipelines
.
count
}.
by
(
1
)
expect_variables
(
project
.
pipelines
.
last
.
variables
,
variables
)
expect
(
response
).
to
have_gitlab_http_status
(
201
)
expect
(
json_response
).
to
be_a
Hash
expect
(
json_response
[
'sha'
]).
to
eq
project
.
commit
.
id
expect
(
json_response
[
'variables'
]).
to
eq
variables
expect
(
json_response
).
not_to
have_key
(
'variables'
)
end
end
...
...
@@ -328,11 +338,12 @@ describe API::Pipelines do
expect
do
post
api
(
"/projects/
#{
project
.
id
}
/pipeline"
,
user
),
ref:
project
.
default_branch
,
variables:
variables
end
.
to
change
{
project
.
pipelines
.
count
}.
by
(
1
)
expect_variables
(
project
.
pipelines
.
last
.
variables
,
variables
)
expect
(
response
).
to
have_gitlab_http_status
(
201
)
expect
(
json_response
).
to
be_a
Hash
expect
(
json_response
[
'sha'
]).
to
eq
project
.
commit
.
id
expect
(
json_response
[
'variables'
]).
to
eq
variables
expect
(
json_response
).
not_to
have_key
(
'variables'
)
end
context
'condition unmatch'
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