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
iv
gitlab-ce
Commits
73c9d80b
Commit
73c9d80b
authored
Feb 16, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Record user that erased a build through API
parent
fb62196f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
lib/api/builds.rb
lib/api/builds.rb
+1
-1
spec/requests/api/builds_spec.rb
spec/requests/api/builds_spec.rb
+5
-0
No files found.
lib/api/builds.rb
View file @
73c9d80b
...
...
@@ -138,7 +138,7 @@ module API
return
not_found!
(
build
)
unless
build
return
forbidden!
(
'Build is not erasable!'
)
unless
build
.
erasable?
build
.
erase
build
.
erase
(
erased_by:
current_user
)
present
build
,
with:
Entities
::
Build
,
user_can_download_artifacts:
can?
(
current_user
,
:download_build_artifacts
,
user_project
)
end
...
...
spec/requests/api/builds_spec.rb
View file @
73c9d80b
...
...
@@ -184,6 +184,11 @@ describe API::API, api: true do
expect
(
build
.
artifacts_file
.
exists?
).
to
be_falsy
expect
(
build
.
artifacts_metadata
.
exists?
).
to
be_falsy
end
it
'should update build'
do
expect
(
build
.
reload
.
erased_at
).
to
be_truthy
expect
(
build
.
reload
.
erased_by
).
to
eq
user
end
end
context
'build is not erasable'
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