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
e8a675d3
Commit
e8a675d3
authored
Dec 13, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the project_cleanup feature flag
parent
0b74b863
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
55 deletions
+14
-55
app/controllers/projects/settings/repository_controller.rb
app/controllers/projects/settings/repository_controller.rb
+0
-5
app/views/projects/cleanup/_show.html.haml
app/views/projects/cleanup/_show.html.haml
+0
-2
spec/controllers/projects/settings/repository_controller_spec.rb
...ntrollers/projects/settings/repository_controller_spec.rb
+5
-25
spec/features/projects/settings/repository_settings_spec.rb
spec/features/projects/settings/repository_settings_spec.rb
+9
-23
No files found.
app/controllers/projects/settings/repository_controller.rb
View file @
e8a675d3
...
@@ -5,7 +5,6 @@ module Projects
...
@@ -5,7 +5,6 @@ module Projects
class
RepositoryController
<
Projects
::
ApplicationController
class
RepositoryController
<
Projects
::
ApplicationController
before_action
:authorize_admin_project!
before_action
:authorize_admin_project!
before_action
:remote_mirror
,
only:
[
:show
]
before_action
:remote_mirror
,
only:
[
:show
]
before_action
:check_cleanup_feature_flag!
,
only: :cleanup
def
show
def
show
render_show
render_show
...
@@ -37,10 +36,6 @@ module Projects
...
@@ -37,10 +36,6 @@ module Projects
private
private
def
check_cleanup_feature_flag!
render_404
unless
::
Feature
.
enabled?
(
:project_cleanup
,
project
)
end
def
render_show
def
render_show
@deploy_keys
=
DeployKeysPresenter
.
new
(
@project
,
current_user:
current_user
)
@deploy_keys
=
DeployKeysPresenter
.
new
(
@project
,
current_user:
current_user
)
@deploy_tokens
=
@project
.
deploy_tokens
.
active
@deploy_tokens
=
@project
.
deploy_tokens
.
active
...
...
app/views/projects/cleanup/_show.html.haml
View file @
e8a675d3
-
return
unless
Feature
.
enabled?
(
:project_cleanup
,
@project
)
-
expanded
=
Rails
.
env
.
test?
-
expanded
=
Rails
.
env
.
test?
%section
.settings.no-animate
#cleanup
{
class:
(
'expanded'
if
expanded
)
}
%section
.settings.no-animate
#cleanup
{
class:
(
'expanded'
if
expanded
)
}
...
...
spec/controllers/projects/settings/repository_controller_spec.rb
View file @
e8a675d3
...
@@ -19,35 +19,15 @@ describe Projects::Settings::RepositoryController do
...
@@ -19,35 +19,15 @@ describe Projects::Settings::RepositoryController do
end
end
describe
'PUT cleanup'
do
describe
'PUT cleanup'
do
before
do
let
(
:object_map
)
{
fixture_file_upload
(
'spec/fixtures/bfg_object_map.txt'
)
}
allow
(
RepositoryCleanupWorker
).
to
receive
(
:perform_async
)
end
def
do_put!
it
'enqueues a RepositoryCleanupWorker'
do
object_map
=
fixture_file_upload
(
'spec/fixtures/bfg_object_map.txt'
)
allow
(
RepositoryCleanupWorker
).
to
receive
(
:perform_async
)
put
:cleanup
,
namespace_id:
project
.
namespace
,
project_id:
project
,
project:
{
object_map:
object_map
}
put
:cleanup
,
namespace_id:
project
.
namespace
,
project_id:
project
,
project:
{
object_map:
object_map
}
end
context
'feature enabled'
do
it
'enqueues a RepositoryCleanupWorker'
do
stub_feature_flags
(
project_cleanup:
true
)
do_put!
expect
(
response
).
to
redirect_to
project_settings_repository_path
(
project
)
expect
(
RepositoryCleanupWorker
).
to
have_received
(
:perform_async
).
once
end
end
context
'feature disabled'
do
it
'shows a 404 error'
do
stub_feature_flags
(
project_cleanup:
false
)
do_put!
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
response
).
to
redirect_to
project_settings_repository_path
(
project
)
e
nd
e
xpect
(
RepositoryCleanupWorker
).
to
have_received
(
:perform_async
).
once
end
end
end
end
end
end
spec/features/projects/settings/repository_settings_spec.rb
View file @
e8a675d3
...
@@ -200,35 +200,21 @@ describe 'Projects > Settings > Repository settings' do
...
@@ -200,35 +200,21 @@ describe 'Projects > Settings > Repository settings' do
context
'repository cleanup settings'
do
context
'repository cleanup settings'
do
let
(
:object_map_file
)
{
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'bfg_object_map.txt'
)
}
let
(
:object_map_file
)
{
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'bfg_object_map.txt'
)
}
context
'feature enabled'
do
it
'uploads an object map file'
,
:js
do
it
'uploads an object map file'
,
:js
do
visit
project_settings_repository_path
(
project
)
stub_feature_flags
(
project_cleanup:
true
)
visit
project_settings_repository_path
(
project
)
expect
(
page
).
to
have_content
(
'Repository cleanup'
)
expect
(
page
).
to
have_content
(
'Repository cleanup'
)
page
.
within
(
'#cleanup'
)
do
page
.
within
(
'#cleanup'
)
do
attach_file
(
'project[bfg_object_map]'
,
object_map_file
,
visible:
false
)
attach_file
(
'project[bfg_object_map]'
,
object_map_file
,
visible:
false
)
Sidekiq
::
Testing
.
fake!
do
Sidekiq
::
Testing
.
fake!
do
click_button
'Start cleanup'
click_button
'Start cleanup'
end
end
end
expect
(
page
).
to
have_content
(
'Repository cleanup has started'
)
expect
(
RepositoryCleanupWorker
.
jobs
.
count
).
to
eq
(
1
)
end
end
end
context
'feature disabled'
do
expect
(
page
).
to
have_content
(
'Repository cleanup has started'
)
it
'does not show the settings'
do
expect
(
RepositoryCleanupWorker
.
jobs
.
count
).
to
eq
(
1
)
stub_feature_flags
(
project_cleanup:
false
)
visit
project_settings_repository_path
(
project
)
expect
(
page
).
not_to
have_content
(
'Repository cleanup'
)
end
end
end
end
end
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