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
bc255110
Commit
bc255110
authored
Dec 21, 2020
by
Vladimir Shushlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only mark pages as not deployed if there is no deployment
parent
dd9193ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
app/services/pages/migrate_legacy_storage_to_deployment_service.rb
...ces/pages/migrate_legacy_storage_to_deployment_service.rb
+4
-1
spec/services/pages/migrate_legacy_storage_to_deployment_service_spec.rb
...ages/migrate_legacy_storage_to_deployment_service_spec.rb
+10
-0
No files found.
app/services/pages/migrate_legacy_storage_to_deployment_service.rb
View file @
bc255110
...
...
@@ -40,7 +40,10 @@ module Pages
rescue
::
Pages
::
ZipDirectoryService
::
InvalidArchiveError
=>
e
Gitlab
::
ErrorTracking
.
track_exception
(
e
,
project_id:
project
.
id
)
project
.
mark_pages_as_not_deployed
if
Feature
.
enabled?
(
:pages_migration_mark_as_not_deployed
,
project
)
if
!
project
.
pages_metadatum
&
.
reload
&
.
pages_deployment
&&
Feature
.
enabled?
(
:pages_migration_mark_as_not_deployed
,
project
)
project
.
mark_pages_as_not_deployed
end
end
end
end
spec/services/pages/migrate_legacy_storage_to_deployment_service_spec.rb
View file @
bc255110
...
...
@@ -14,6 +14,16 @@ RSpec.describe Pages::MigrateLegacyStorageToDeploymentService do
end
.
to
change
{
project
.
pages_metadatum
.
reload
.
deployed
}.
from
(
true
).
to
(
false
)
end
it
'does not mark pages as not deployed if public directory is absent but pages_deployment exists'
do
deployment
=
create
(
:pages_deployment
,
project:
project
)
project
.
update_pages_deployment!
(
deployment
)
project
.
mark_pages_as_deployed
expect
do
service
.
execute
end
.
not_to
change
{
project
.
pages_metadatum
.
reload
.
deployed
}.
from
(
true
)
end
it
'does not mark pages as not deployed if public directory is absent but feature is disabled'
do
stub_feature_flags
(
pages_migration_mark_as_not_deployed:
false
)
...
...
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