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
da472a03
Commit
da472a03
authored
Feb 01, 2021
by
Vladimir Shushlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop deploying to pages legacy storage if feature flag is disabled
parent
620bf1c9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
app/services/projects/update_pages_service.rb
app/services/projects/update_pages_service.rb
+4
-0
config/feature_flags/development/pages_update_legacy_storage.yml
...feature_flags/development/pages_update_legacy_storage.yml
+8
-0
spec/services/projects/update_pages_service_spec.rb
spec/services/projects/update_pages_service_spec.rb
+9
-0
No files found.
app/services/projects/update_pages_service.rb
View file @
da472a03
...
@@ -80,6 +80,10 @@ module Projects
...
@@ -80,6 +80,10 @@ module Projects
end
end
def
deploy_to_legacy_storage
(
artifacts_path
)
def
deploy_to_legacy_storage
(
artifacts_path
)
# path today used by one project can later be used by another
# so we can't really scope this feature flag by project or group
return
unless
Feature
.
enabled?
(
:pages_update_legacy_storage
,
default_enabled:
true
)
# Create temporary directory in which we will extract the artifacts
# Create temporary directory in which we will extract the artifacts
make_secure_tmp_dir
(
tmp_path
)
do
|
tmp_path
|
make_secure_tmp_dir
(
tmp_path
)
do
|
tmp_path
|
extract_archive!
(
artifacts_path
,
tmp_path
)
extract_archive!
(
artifacts_path
,
tmp_path
)
...
...
config/feature_flags/development/pages_update_legacy_storage.yml
0 → 100644
View file @
da472a03
---
name
:
pages_update_legacy_storage
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50683
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/296138
milestone
:
'
13.9'
type
:
development
group
:
group::release
default_enabled
:
true
spec/services/projects/update_pages_service_spec.rb
View file @
da472a03
...
@@ -55,6 +55,15 @@ RSpec.describe Projects::UpdatePagesService do
...
@@ -55,6 +55,15 @@ RSpec.describe Projects::UpdatePagesService do
end
end
end
end
it
"doesn't deploy to legacy storage if it's disabled"
do
stub_feature_flags
(
pages_update_legacy_storage:
false
)
expect
(
execute
).
to
eq
(
:success
)
expect
(
project
.
pages_deployed?
).
to
be_truthy
expect
(
File
.
exist?
(
File
.
join
(
project
.
pages_path
,
'public'
,
'index.html'
))).
to
eq
(
false
)
end
it
'creates pages_deployment and saves it in the metadata'
do
it
'creates pages_deployment and saves it in the metadata'
do
expect
do
expect
do
expect
(
execute
).
to
eq
(
:success
)
expect
(
execute
).
to
eq
(
:success
)
...
...
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