Add pages multiple version toggle
What does this MR do and why?
Create a kill-switch for the multi-version feature, so if someone wants to keep using pages as a single-version, without any concerns of multiple versions being introduced by other contributors, they would be able to configure that.
This feature is GitLab Premium.
Related to: #416487 (closed)
Migration
bundle exec rails db:migrate:up:main VERSION=20230811144601
main: == [advisory_lock_connection] object_id: 225460, pg_backend_pid: 35806
main: == 20230811144601 AddPagesMultipleVersionsEnabledToProjectSettings: migrating =
main: -- add_column(:project_settings, :pages_multiple_versions_enabled, :boolean, {:default=>false, :null=>false})
main: -> 0.0080s
main: == 20230811144601 AddPagesMultipleVersionsEnabledToProjectSettings: migrated (0.0139s)
main: == [advisory_lock_connection] object_id: 225460, pg_backend_pid: 35806
bundle exec rails db:migrate:up:ci VERSION=20230811144601
ci: == [advisory_lock_connection] object_id: 225540, pg_backend_pid: 41174
ci: == 20230811144601 AddPagesMultipleVersionsEnabledToProjectSettings: migrating =
ci: -- add_column(:project_settings, :pages_multiple_versions_enabled, :boolean, {:default=>false, :null=>false})
ci: -> 0.0059s
ci: == 20230811144601 AddPagesMultipleVersionsEnabledToProjectSettings: migrated (0.0214s)
ci: == [advisory_lock_connection] object_id: 225540, pg_backend_pid: 41174
bundle exec rails db:migrate:down:main VERSION=20230811144601
main: == [advisory_lock_connection] object_id: 225540, pg_backend_pid: 55998
main: == 20230811144601 AddPagesMultipleVersionsEnabledToProjectSettings: reverting =
main: -- remove_column(:project_settings, :pages_multiple_versions_enabled, :boolean, {:default=>false, :null=>false})
main: -> 0.0034s
main: == 20230811144601 AddPagesMultipleVersionsEnabledToProjectSettings: reverted (0.0117s)
main: == [advisory_lock_connection] object_id: 225540, pg_backend_pid: 55998
bundle exec rails db:migrate:down:ci VERSION=20230811144601
ci: == [advisory_lock_connection] object_id: 225480, pg_backend_pid: 60661
ci: == 20230811144601 AddPagesMultipleVersionsEnabledToProjectSettings: reverting =
ci: -- remove_column(:project_settings, :pages_multiple_versions_enabled, :boolean, {:default=>false, :null=>false})
ci: -> 0.0021s
ci: == 20230811144601 AddPagesMultipleVersionsEnabledToProjectSettings: reverted (0.0130s)
ci: == [advisory_lock_connection] object_id: 225480, pg_backend_pid: 60661
Screenshots or screen recordings
How to set up and validate locally
- You need an Premium license
- Enable the
pages_multiple_versions
feature flag - Run the migrations
- Create a project with Pages enabled
- Navigate to the pages settings:
example.com/namespace/project/pages
- You should be able to see the
Multiple Versions
toggle
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Kassio Borges