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
25ea3192
Commit
25ea3192
authored
Apr 22, 2021
by
Vladimir Shushlin
Committed by
Vladimir Shushlin
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove pages_serve_from_legacy_storage feature flag
It's superseeded by Settings.pages.local_storage.enabled
parent
130d2e1c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
21 deletions
+12
-21
app/models/pages/lookup_path.rb
app/models/pages/lookup_path.rb
+4
-5
app/models/pages/virtual_domain.rb
app/models/pages/virtual_domain.rb
+1
-3
changelogs/unreleased/297524-disable-serving-pages-from-legacy-storage-2.yml
...ed/297524-disable-serving-pages-from-legacy-storage-2.yml
+5
-0
config/feature_flags/development/pages_serve_from_legacy_storage.yml
...ure_flags/development/pages_serve_from_legacy_storage.yml
+0
-8
spec/models/pages/lookup_path_spec.rb
spec/models/pages/lookup_path_spec.rb
+2
-5
No files found.
app/models/pages/lookup_path.rb
View file @
25ea3192
...
@@ -62,17 +62,16 @@ module Pages
...
@@ -62,17 +62,16 @@ module Pages
}
}
end
end
# TODO: remove support for legacy storage in 14.3 https://gitlab.com/gitlab-org/gitlab/-/issues/328712
# we support this till 14.3 to allow people to still use legacy storage if something goes very wrong
# on self-hosted installations, and we'll need some time to fix it
def
legacy_source
def
legacy_source
r
aise
LegacyStorageDisabledError
unless
Feature
.
enabled?
(
:pages_serve_from_legacy_storage
,
default_enabled:
true
)
r
eturn
unless
::
Settings
.
pages
.
local_store
.
enabled
{
{
type:
'file'
,
type:
'file'
,
path:
File
.
join
(
project
.
full_path
,
'public/'
)
path:
File
.
join
(
project
.
full_path
,
'public/'
)
}
}
rescue
LegacyStorageDisabledError
=>
e
Gitlab
::
ErrorTracking
.
track_exception
(
e
,
project_id:
project
.
id
)
nil
end
end
end
end
end
end
app/models/pages/virtual_domain.rb
View file @
25ea3192
...
@@ -21,9 +21,7 @@ module Pages
...
@@ -21,9 +21,7 @@ module Pages
project
.
pages_lookup_path
(
trim_prefix:
trim_prefix
,
domain:
domain
)
project
.
pages_lookup_path
(
trim_prefix:
trim_prefix
,
domain:
domain
)
end
end
# TODO: remove in https://gitlab.com/gitlab-org/gitlab/-/issues/297524
# TODO: remove in https://gitlab.com/gitlab-org/gitlab/-/issues/328715
# source can only be nil if pages_serve_from_legacy_storage FF is disabled
# we can remove this filtering once we remove legacy storage
paths
=
paths
.
select
(
&
:source
)
paths
=
paths
.
select
(
&
:source
)
paths
.
sort_by
(
&
:prefix
).
reverse
paths
.
sort_by
(
&
:prefix
).
reverse
...
...
changelogs/unreleased/297524-disable-serving-pages-from-legacy-storage-2.yml
0 → 100644
View file @
25ea3192
---
title
:
Remove pages_serve_from_legacy_storage feature flag
merge_request
:
60010
author
:
type
:
added
config/feature_flags/development/pages_serve_from_legacy_storage.yml
deleted
100644 → 0
View file @
130d2e1c
---
name
:
pages_serve_from_legacy_storage
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/297228
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/297524
milestone
:
'
13.8'
type
:
development
group
:
group::release
default_enabled
:
true
spec/models/pages/lookup_path_spec.rb
View file @
25ea3192
...
@@ -52,11 +52,8 @@ RSpec.describe Pages::LookupPath do
...
@@ -52,11 +52,8 @@ RSpec.describe Pages::LookupPath do
expect
(
source
[
:path
]).
to
eq
(
project
.
full_path
+
"/public/"
)
expect
(
source
[
:path
]).
to
eq
(
project
.
full_path
+
"/public/"
)
end
end
it
'return nil when legacy storage is disabled and there is no deployment'
do
it
'return nil when local storage is disabled and there is no deployment'
do
stub_feature_flags
(
pages_serve_from_legacy_storage:
false
)
allow
(
Settings
.
pages
.
local_store
).
to
receive
(
:enabled
).
and_return
(
false
)
expect
(
Gitlab
::
ErrorTracking
).
to
receive
(
:track_exception
)
.
with
(
described_class
::
LegacyStorageDisabledError
,
project_id:
project
.
id
)
.
and_call_original
expect
(
source
).
to
eq
(
nil
)
expect
(
source
).
to
eq
(
nil
)
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