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
91cbf9db
Commit
91cbf9db
authored
Oct 26, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add allow_failure field to commit status API
Closes #3196
parent
482a1708
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
+9
-4
CHANGELOG
CHANGELOG
+1
-0
doc/api/commits.md
doc/api/commits.md
+4
-2
lib/api/entities.rb
lib/api/entities.rb
+1
-1
spec/requests/api/commit_status_spec.rb
spec/requests/api/commit_status_spec.rb
+3
-1
No files found.
CHANGELOG
View file @
91cbf9db
...
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.2.0 (unreleased)
v 8.2.0 (unreleased)
- Force update refs/merge-requests/X/head upon a push to the source branch of a merge request (Stan Hu)
- Force update refs/merge-requests/X/head upon a push to the source branch of a merge request (Stan Hu)
- Improved performance of finding users by one of their Email addresses
- Improved performance of finding users by one of their Email addresses
- Add allow_failure field to commit status API (Stan Hu)
- Improved performance of replacing references in comments
- Improved performance of replacing references in comments
- Show last project commit to default branch on project home page
- Show last project commit to default branch on project home page
- Highlight comment based on anchor in URL
- Highlight comment based on anchor in URL
...
...
doc/api/commits.md
View file @
91cbf9db
...
@@ -22,7 +22,8 @@ Parameters:
...
@@ -22,7 +22,8 @@ Parameters:
"author_name"
:
"Dmitriy Zaporozhets"
,
"author_name"
:
"Dmitriy Zaporozhets"
,
"author_email"
:
"dzaporozhets@sphereconsultinginc.com"
,
"author_email"
:
"dzaporozhets@sphereconsultinginc.com"
,
"created_at"
:
"2012-09-20T11:50:22+03:00"
,
"created_at"
:
"2012-09-20T11:50:22+03:00"
,
"message"
:
"Replace sanitize with escape once"
"message"
:
"Replace sanitize with escape once"
,
"allow_failure"
:
false
},
},
{
{
"id"
:
"6104942438c14ec7bd21c6cd5bd995272b3faff6"
,
"id"
:
"6104942438c14ec7bd21c6cd5bd995272b3faff6"
,
...
@@ -31,7 +32,8 @@ Parameters:
...
@@ -31,7 +32,8 @@ Parameters:
"author_name"
:
"randx"
,
"author_name"
:
"randx"
,
"author_email"
:
"dmitriy.zaporozhets@gmail.com"
,
"author_email"
:
"dmitriy.zaporozhets@gmail.com"
,
"created_at"
:
"2012-09-20T09:06:12+03:00"
,
"created_at"
:
"2012-09-20T09:06:12+03:00"
,
"message"
:
"Sanitize for network graph"
"message"
:
"Sanitize for network graph"
,
"allow_failure"
:
false
}
}
]
]
```
```
...
...
lib/api/entities.rb
View file @
91cbf9db
...
@@ -231,7 +231,7 @@ module API
...
@@ -231,7 +231,7 @@ module API
class
CommitStatus
<
Grape
::
Entity
class
CommitStatus
<
Grape
::
Entity
expose
:id
,
:sha
,
:ref
,
:status
,
:name
,
:target_url
,
:description
,
expose
:id
,
:sha
,
:ref
,
:status
,
:name
,
:target_url
,
:description
,
:created_at
,
:started_at
,
:finished_at
:created_at
,
:started_at
,
:finished_at
,
:allow_failure
expose
:author
,
using:
Entities
::
UserBasic
expose
:author
,
using:
Entities
::
UserBasic
end
end
...
...
spec/requests/api/commit_status_spec.rb
View file @
91cbf9db
...
@@ -18,7 +18,7 @@ describe API::API, api: true do
...
@@ -18,7 +18,7 @@ describe API::API, api: true do
before
do
before
do
@status1
=
create
(
:commit_status
,
commit:
ci_commit
,
status:
'running'
)
@status1
=
create
(
:commit_status
,
commit:
ci_commit
,
status:
'running'
)
@status2
=
create
(
:commit_status
,
commit:
ci_commit
,
name:
'coverage'
,
status:
'pending'
)
@status2
=
create
(
:commit_status
,
commit:
ci_commit
,
name:
'coverage'
,
status:
'pending'
)
@status3
=
create
(
:commit_status
,
commit:
ci_commit
,
name:
'coverage'
,
ref:
'develop'
,
status:
'running'
)
@status3
=
create
(
:commit_status
,
commit:
ci_commit
,
name:
'coverage'
,
ref:
'develop'
,
status:
'running'
,
allow_failure:
true
)
@status4
=
create
(
:commit_status
,
commit:
ci_commit
,
name:
'coverage'
,
status:
'success'
)
@status4
=
create
(
:commit_status
,
commit:
ci_commit
,
name:
'coverage'
,
status:
'success'
)
@status5
=
create
(
:commit_status
,
commit:
ci_commit
,
ref:
'develop'
,
status:
'success'
)
@status5
=
create
(
:commit_status
,
commit:
ci_commit
,
ref:
'develop'
,
status:
'success'
)
@status6
=
create
(
:commit_status
,
commit:
ci_commit
,
status:
'success'
)
@status6
=
create
(
:commit_status
,
commit:
ci_commit
,
status:
'success'
)
...
@@ -30,6 +30,8 @@ describe API::API, api: true do
...
@@ -30,6 +30,8 @@ describe API::API, api: true do
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
expect
(
statuses_id
).
to
contain_exactly
(
@status3
.
id
,
@status4
.
id
,
@status5
.
id
,
@status6
.
id
)
expect
(
statuses_id
).
to
contain_exactly
(
@status3
.
id
,
@status4
.
id
,
@status5
.
id
,
@status6
.
id
)
json_response
.
sort_by!
{
|
status
|
status
[
'id'
]
}
expect
(
json_response
.
map
{
|
status
|
status
[
'allow_failure'
]
}).
to
eq
([
true
,
false
,
false
,
false
])
end
end
it
"should return all commit statuses"
do
it
"should return all commit statuses"
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