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
b3daa3e5
Commit
b3daa3e5
authored
Feb 03, 2021
by
Vladimir Shushlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop deleting pages from legacy storage if it's disabled
parent
066610c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
app/models/project.rb
app/models/project.rb
+2
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+9
-0
No files found.
app/models/project.rb
View file @
b3daa3e5
...
...
@@ -1792,6 +1792,8 @@ class Project < ApplicationRecord
# answer: we should just remove all of this
# rubocop: disable CodeReuse/ServiceClass
def
remove_pages
return
unless
Feature
.
enabled?
(
:pages_update_legacy_storage
,
default_enabled:
true
)
# Projects with a missing namespace cannot have their pages removed
return
unless
namespace
...
...
spec/models/project_spec.rb
View file @
b3daa3e5
...
...
@@ -4139,6 +4139,15 @@ RSpec.describe Project, factory_default: :keep do
expect
{
project
.
remove_pages
}.
to
change
{
pages_metadatum
.
reload
.
deployed
}.
from
(
true
).
to
(
false
)
end
it
'does nothing if updates on legacy storage are disabled'
do
stub_feature_flags
(
pages_update_legacy_storage:
false
)
expect
(
Gitlab
::
PagesTransfer
).
not_to
receive
(
:new
)
expect
(
PagesWorker
).
not_to
receive
(
:perform_in
)
project
.
remove_pages
end
it
'is run when the project is destroyed'
do
expect
(
project
).
to
receive
(
:remove_pages
).
and_call_original
...
...
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