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
4cf58d9d
Commit
4cf58d9d
authored
Jul 04, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
3b3a851c
9a4b5f08
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
3 deletions
+55
-3
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
changelogs/unreleased/sh-fix-issue-63349.yml
changelogs/unreleased/sh-fix-issue-63349.yml
+5
-0
lib/api/projects.rb
lib/api/projects.rb
+1
-1
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+47
-0
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+1
-1
No files found.
app/controllers/projects_controller.rb
View file @
4cf58d9d
...
...
@@ -182,7 +182,7 @@ class ProjectsController < Projects::ApplicationController
end
def
housekeeping
::
Projects
::
HousekeepingService
.
new
(
@project
).
execute
::
Projects
::
HousekeepingService
.
new
(
@project
,
:gc
).
execute
redirect_to
(
project_path
(
@project
),
...
...
changelogs/unreleased/sh-fix-issue-63349.yml
0 → 100644
View file @
4cf58d9d
---
title
:
Make Housekeeping button do a full garbage collection
merge_request
:
30289
author
:
type
:
fixed
lib/api/projects.rb
View file @
4cf58d9d
...
...
@@ -474,7 +474,7 @@ module API
authorize_admin_project
begin
::
Projects
::
HousekeepingService
.
new
(
user_project
).
execute
::
Projects
::
HousekeepingService
.
new
(
user_project
,
:gc
).
execute
rescue
::
Projects
::
HousekeepingService
::
LeaseTaken
=>
error
conflict!
(
error
.
message
)
end
...
...
spec/controllers/projects_controller_spec.rb
View file @
4cf58d9d
...
...
@@ -318,6 +318,53 @@ describe ProjectsController do
end
end
describe
'#housekeeping'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
let
(
:housekeeping
)
{
Projects
::
HousekeepingService
.
new
(
project
)
}
context
'when authenticated as owner'
do
before
do
group
.
add_owner
(
user
)
sign_in
(
user
)
allow
(
Projects
::
HousekeepingService
).
to
receive
(
:new
).
with
(
project
,
:gc
).
and_return
(
housekeeping
)
end
it
'forces a full garbage collection'
do
expect
(
housekeeping
).
to
receive
(
:execute
).
once
post
:housekeeping
,
params:
{
namespace_id:
project
.
namespace
.
path
,
id:
project
.
path
}
expect
(
response
).
to
have_gitlab_http_status
(
302
)
end
end
context
'when authenticated as developer'
do
let
(
:developer
)
{
create
(
:user
)
}
before
do
group
.
add_developer
(
developer
)
end
it
'does not execute housekeeping'
do
expect
(
housekeeping
).
not_to
receive
(
:execute
)
post
:housekeeping
,
params:
{
namespace_id:
project
.
namespace
.
path
,
id:
project
.
path
}
expect
(
response
).
to
have_gitlab_http_status
(
302
)
end
end
end
describe
"#update"
do
render_views
...
...
spec/requests/api/projects_spec.rb
View file @
4cf58d9d
...
...
@@ -2428,7 +2428,7 @@ describe API::Projects do
let
(
:housekeeping
)
{
Projects
::
HousekeepingService
.
new
(
project
)
}
before
do
allow
(
Projects
::
HousekeepingService
).
to
receive
(
:new
).
with
(
project
).
and_return
(
housekeeping
)
allow
(
Projects
::
HousekeepingService
).
to
receive
(
:new
).
with
(
project
,
:gc
).
and_return
(
housekeeping
)
end
context
'when authenticated as owner'
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