From d229251151a3bdeb80a0d8004003700ac3f95893 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 11 Aug 2021 00:10:03 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- app/models/customer_relations/organization.rb | 31 +++ app/models/postgresql/detached_partition.rb | 7 + app/workers/all_queues.yml | 9 + .../drop_detached_partitions_worker.rb | 18 ++ .../development/drop_detached_partitions.yml | 8 + ...ning_dry_run.yml => partition_pruning.yml} | 8 +- ...testing_full_code_quality_report_total.yml | 8 - config/initializers/1_settings.rb | 3 + ...154900_create_detached_partitions_table.rb | 17 ++ ...create_customer_relations_organizations.rb | 27 +++ ...push_event_payloads_bigint_conversion_3.rb | 87 +++++++ db/schema_migrations/20210628154900 | 1 + db/schema_migrations/20210802043253 | 1 + db/schema_migrations/20210804200114 | 1 + db/structure.sql | 59 ++++- doc/.vale/gitlab/SubstitutionWarning.yml | 1 + .../geo/replication/location_aware_git_url.md | 2 +- doc/administration/index.md | 2 +- doc/public_access/public_access.md | 4 +- doc/user/admin_area/settings/help_page.md | 2 +- .../settings/img/clone_panel_v12_4.png | Bin 6771 -> 0 bytes doc/user/admin_area/settings/index.md | 2 +- .../visibility_and_access_controls.md | 224 +++++++++++------- doc/user/group/index.md | 8 +- doc/user/permissions.md | 2 +- doc/user/profile/index.md | 2 +- doc/user/project/import/phabricator.md | 2 +- doc/user/project/protected_branches.md | 2 +- doc/user/project/working_with_projects.md | 2 +- lib/gitlab/database/migration_helpers.rb | 6 +- .../detached_partition_dropper.rb | 56 +++++ .../database/partitioning/monthly_strategy.rb | 2 +- .../partitioning/partition_manager.rb | 34 ++- .../partitioning/partition_monitoring.rb | 5 + .../database/partitioning/time_partition.rb | 7 + lib/gitlab/database/postgres_partition.rb | 8 +- .../known_events/common.yml | 1 - .../customer_relations/organizations.rb | 9 + .../gitlab/database/migration_helpers_spec.rb | 66 +++--- .../detached_partition_dropper_spec.rb | 181 ++++++++++++++ .../partitioning/monthly_strategy_spec.rb | 20 -- .../partitioning/partition_manager_spec.rb | 143 ++++++++++- .../partitioning/partition_monitoring_spec.rb | 12 +- .../customer_relations/organization_spec.rb | 38 +++ .../postgresql/detached_partition_spec.rb | 18 ++ .../migration_helpers_shared_examples.rb | 4 +- .../drop_detached_partitions_worker_spec.rb | 29 +++ 47 files changed, 988 insertions(+), 191 deletions(-) create mode 100644 app/models/customer_relations/organization.rb create mode 100644 app/models/postgresql/detached_partition.rb create mode 100644 app/workers/database/drop_detached_partitions_worker.rb create mode 100644 config/feature_flags/development/drop_detached_partitions.yml rename config/feature_flags/development/{partition_pruning_dry_run.yml => partition_pruning.yml} (50%) delete mode 100644 config/feature_flags/development/usage_data_i_testing_full_code_quality_report_total.yml create mode 100644 db/migrate/20210628154900_create_detached_partitions_table.rb create mode 100644 db/migrate/20210804200114_create_customer_relations_organizations.rb create mode 100644 db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb create mode 100644 db/schema_migrations/20210628154900 create mode 100644 db/schema_migrations/20210802043253 create mode 100644 db/schema_migrations/20210804200114 delete mode 100644 doc/user/admin_area/settings/img/clone_panel_v12_4.png create mode 100644 lib/gitlab/database/partitioning/detached_partition_dropper.rb create mode 100644 spec/factories/customer_relations/organizations.rb create mode 100644 spec/lib/gitlab/database/partitioning/detached_partition_dropper_spec.rb create mode 100644 spec/models/customer_relations/organization_spec.rb create mode 100644 spec/models/postgresql/detached_partition_spec.rb create mode 100644 spec/workers/database/drop_detached_partitions_worker_spec.rb diff --git a/app/models/customer_relations/organization.rb b/app/models/customer_relations/organization.rb new file mode 100644 index 00000000000..caf1cd68cc5 --- /dev/null +++ b/app/models/customer_relations/organization.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class CustomerRelations::Organization < ApplicationRecord + self.table_name = "customer_relations_organizations" + + belongs_to :group, -> { where(type: 'Group') }, foreign_key: 'group_id' + + before_validation :strip_whitespace! + + enum state: { + inactive: 0, + active: 1 + } + + validates :group, presence: true + validates :name, presence: true + validates :name, uniqueness: { case_sensitive: false, scope: [:group_id] } + validates :name, length: { maximum: 255 } + validates :description, length: { maximum: 1024 } + + def self.find_by_name(group_id, name) + where(group: group_id) + .where('LOWER(name) = LOWER(?)', name) + end + + private + + def strip_whitespace! + name&.strip! + end +end diff --git a/app/models/postgresql/detached_partition.rb b/app/models/postgresql/detached_partition.rb new file mode 100644 index 00000000000..76b299ff9d4 --- /dev/null +++ b/app/models/postgresql/detached_partition.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Postgresql + class DetachedPartition < ApplicationRecord + scope :ready_to_drop, -> { where('drop_after < ?', Time.current) } + end +end diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 583da304048..fc46b9a6e45 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -247,6 +247,15 @@ :idempotent: true :tags: - :exclude_from_kubernetes +- :name: cronjob:database_drop_detached_partitions + :worker_name: Database::DropDetachedPartitionsWorker + :feature_category: :database + :has_external_dependencies: + :urgency: :low + :resource_boundary: :unknown + :weight: 1 + :idempotent: true + :tags: [] - :name: cronjob:database_partition_management :worker_name: Database::PartitionManagementWorker :feature_category: :database diff --git a/app/workers/database/drop_detached_partitions_worker.rb b/app/workers/database/drop_detached_partitions_worker.rb new file mode 100644 index 00000000000..f9c8ce57a36 --- /dev/null +++ b/app/workers/database/drop_detached_partitions_worker.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Database + class DropDetachedPartitionsWorker + include ApplicationWorker + include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + + feature_category :database + data_consistency :always + idempotent! + + def perform + Gitlab::Database::Partitioning::DetachedPartitionDropper.new.perform + ensure + Gitlab::Database::Partitioning::PartitionMonitoring.new.report_metrics + end + end +end diff --git a/config/feature_flags/development/drop_detached_partitions.yml b/config/feature_flags/development/drop_detached_partitions.yml new file mode 100644 index 00000000000..b49cf78d28c --- /dev/null +++ b/config/feature_flags/development/drop_detached_partitions.yml @@ -0,0 +1,8 @@ +--- +name: drop_detached_partitions +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67056 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/337155 +milestone: '14.2' +type: development +group: group::database +default_enabled: false diff --git a/config/feature_flags/development/partition_pruning_dry_run.yml b/config/feature_flags/development/partition_pruning.yml similarity index 50% rename from config/feature_flags/development/partition_pruning_dry_run.yml rename to config/feature_flags/development/partition_pruning.yml index 427afa5fc94..02f5dc968a4 100644 --- a/config/feature_flags/development/partition_pruning_dry_run.yml +++ b/config/feature_flags/development/partition_pruning.yml @@ -1,8 +1,8 @@ --- -name: partition_pruning_dry_run -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65093 -rollout_issue_url: -milestone: '14.1' +name: partition_pruning +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67056 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/337153 +milestone: '14.2' type: development group: group::database default_enabled: false diff --git a/config/feature_flags/development/usage_data_i_testing_full_code_quality_report_total.yml b/config/feature_flags/development/usage_data_i_testing_full_code_quality_report_total.yml deleted file mode 100644 index 38bce2529dd..00000000000 --- a/config/feature_flags/development/usage_data_i_testing_full_code_quality_report_total.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: usage_data_i_testing_full_code_quality_report_total -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49079 -rollout_issue_url: -milestone: '13.8' -type: development -group: group::testing -default_enabled: true diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 778bbd7b9d3..3c520515e8b 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -547,6 +547,9 @@ Settings.cron_jobs['update_container_registry_info_worker']['job_class'] = 'Upda Settings.cron_jobs['postgres_dynamic_partitions_manager'] ||= Settingslogic.new({}) Settings.cron_jobs['postgres_dynamic_partitions_manager']['cron'] ||= '21 */6 * * *' Settings.cron_jobs['postgres_dynamic_partitions_manager']['job_class'] ||= 'Database::PartitionManagementWorker' +Settings.cron_jobs['postgres_dynamic_partitions_dropper'] ||= Settingslogic.new({}) +Settings.cron_jobs['postgres_dynamic_partitions_dropper']['cron'] ||= '45 12 * * *' +Settings.cron_jobs['postgres_dynamic_partitions_dropper']['job_class'] ||= 'Database::DropDetachedPartitionsWorker' Settings.cron_jobs['ci_platform_metrics_update_cron_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['ci_platform_metrics_update_cron_worker']['cron'] ||= '47 9 * * *' Settings.cron_jobs['ci_platform_metrics_update_cron_worker']['job_class'] = 'CiPlatformMetricsUpdateCronWorker' diff --git a/db/migrate/20210628154900_create_detached_partitions_table.rb b/db/migrate/20210628154900_create_detached_partitions_table.rb new file mode 100644 index 00000000000..05290f4dfb9 --- /dev/null +++ b/db/migrate/20210628154900_create_detached_partitions_table.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateDetachedPartitionsTable < ActiveRecord::Migration[6.1] + include Gitlab::Database::MigrationHelpers + + def change + create_table_with_constraints :detached_partitions do |t| + t.timestamps_with_timezone null: false + t.datetime_with_timezone :drop_after, null: false + t.text :table_name, null: false + + # Postgres identifier names can be up to 63 bytes + # See https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS + t.text_limit :table_name, 63 + end + end +end diff --git a/db/migrate/20210804200114_create_customer_relations_organizations.rb b/db/migrate/20210804200114_create_customer_relations_organizations.rb new file mode 100644 index 00000000000..9936e97b9bf --- /dev/null +++ b/db/migrate/20210804200114_create_customer_relations_organizations.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class CreateCustomerRelationsOrganizations < ActiveRecord::Migration[6.1] + include Gitlab::Database::MigrationHelpers + + def up + create_table_with_constraints :customer_relations_organizations do |t| + t.references :group, index: false, null: false, foreign_key: { to_table: :namespaces, on_delete: :cascade } + t.timestamps_with_timezone null: false + t.integer :state, limit: 1, default: 1, null: false + t.decimal :default_rate, precision: 18, scale: 2 + t.text :name, null: false + t.text :description + + t.text_limit :name, 255 + t.text_limit :description, 1024 + + t.index 'group_id, LOWER(name)', unique: true, name: :index_customer_relations_organizations_on_unique_name_per_group + end + end + + def down + with_lock_retries do + drop_table :customer_relations_organizations + end + end +end diff --git a/db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb b/db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb new file mode 100644 index 00000000000..4b825ae72ba --- /dev/null +++ b/db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +class FinalizePushEventPayloadsBigintConversion3 < ActiveRecord::Migration[6.1] + include Gitlab::Database::MigrationHelpers + + disable_ddl_transaction! + + TABLE_NAME = 'push_event_payloads' + INDEX_NAME = 'index_push_event_payloads_on_event_id_convert_to_bigint' + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: TABLE_NAME, + column_name: 'event_id', + job_arguments: [["event_id"], ["event_id_convert_to_bigint"]] + ) + + return if already_swapped? + + swap_columns + end + + def down + swap_columns + end + + private + + def already_swapped? + push_event_payloads_columns = columns(TABLE_NAME) + event_id = push_event_payloads_columns.find {|c| c.name == 'event_id'} + event_id_convert_to_bigint = push_event_payloads_columns.find {|c| c.name == 'event_id_convert_to_bigint'} + + event_id.sql_type == 'bigint' && event_id_convert_to_bigint.sql_type == 'integer' + end + + def swap_columns + add_concurrent_index TABLE_NAME, :event_id_convert_to_bigint, unique: true, name: INDEX_NAME + + # Add a foreign key on `event_id_convert_to_bigint` before we swap the columns and drop the old FK (fk_36c74129da) + add_concurrent_foreign_key TABLE_NAME, :events, column: :event_id_convert_to_bigint, + on_delete: :cascade, reverse_lock_order: true + + with_lock_retries(raise_on_exhaustion: true) do + # We'll need ACCESS EXCLUSIVE lock on the related tables, + # lets make sure it can be acquired from the start. + # Lock order should be + # 1. events + # 2. push_event_payloads + # in order to match the order in EventCreateService#create_push_event, + # and avoid deadlocks. + execute "LOCK TABLE events, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + # Swap column names + temp_name = 'event_id_tmp' + execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:event_id)} TO #{quote_column_name(temp_name)}" + execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:event_id_convert_to_bigint)} TO #{quote_column_name(:event_id)}" + execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:event_id_convert_to_bigint)}" + + # We need to update the trigger function in order to make PostgreSQL to + # regenerate the execution plan for it. This is to avoid type mismatch errors like + # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)" + function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME).name(:event_id, :event_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + # Swap defaults + change_column_default TABLE_NAME, :event_id, nil + change_column_default TABLE_NAME, :event_id_convert_to_bigint, 0 + + # Swap PK constraint + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT push_event_payloads_pkey" + rename_index TABLE_NAME, INDEX_NAME, 'push_event_payloads_pkey' + execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT push_event_payloads_pkey PRIMARY KEY USING INDEX push_event_payloads_pkey" + + # Drop original FK on the old int4 `event_id` (fk_36c74129da) + remove_foreign_key TABLE_NAME, name: concurrent_foreign_key_name(TABLE_NAME, :event_id) + # We swapped the columns but the FK for event_id is still using the old name for the event_id_convert_to_bigint column + # So we have to also swap the FK name now that we dropped the other one with the same + rename_constraint( + TABLE_NAME, + concurrent_foreign_key_name(TABLE_NAME, :event_id_convert_to_bigint), + concurrent_foreign_key_name(TABLE_NAME, :event_id) + ) + end + end +end diff --git a/db/schema_migrations/20210628154900 b/db/schema_migrations/20210628154900 new file mode 100644 index 00000000000..5c0b60872b5 --- /dev/null +++ b/db/schema_migrations/20210628154900 @@ -0,0 +1 @@ +136a375fbd7e1faf25e7f53e0677b8525811bd917892efa1430d204453bf2a1d \ No newline at end of file diff --git a/db/schema_migrations/20210802043253 b/db/schema_migrations/20210802043253 new file mode 100644 index 00000000000..a8017b11b8a --- /dev/null +++ b/db/schema_migrations/20210802043253 @@ -0,0 +1 @@ +b844c7c56019fc984c2604ae11f6ee9eb587806b5c78e4beea4dda93e384f9b2 \ No newline at end of file diff --git a/db/schema_migrations/20210804200114 b/db/schema_migrations/20210804200114 new file mode 100644 index 00000000000..b4ac42657ba --- /dev/null +++ b/db/schema_migrations/20210804200114 @@ -0,0 +1 @@ +db62fb6413db4be5e1013bccf16b0c3a66c9aaf9f3d646f42442be16c511af5f \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 935c81eb530..47b6a6af331 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -12058,6 +12058,28 @@ CREATE SEQUENCE custom_emoji_id_seq ALTER SEQUENCE custom_emoji_id_seq OWNED BY custom_emoji.id; +CREATE TABLE customer_relations_organizations ( + id bigint NOT NULL, + group_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + state smallint DEFAULT 1 NOT NULL, + default_rate numeric(18,2), + name text NOT NULL, + description text, + CONSTRAINT check_2ba9ef1c4c CHECK ((char_length(name) <= 255)), + CONSTRAINT check_e476b6058e CHECK ((char_length(description) <= 1024)) +); + +CREATE SEQUENCE customer_relations_organizations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE customer_relations_organizations_id_seq OWNED BY customer_relations_organizations.id; + CREATE TABLE dast_profile_schedules ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -12521,6 +12543,24 @@ CREATE SEQUENCE design_user_mentions_id_seq ALTER SEQUENCE design_user_mentions_id_seq OWNED BY design_user_mentions.id; +CREATE TABLE detached_partitions ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + drop_after timestamp with time zone NOT NULL, + table_name text NOT NULL, + CONSTRAINT check_aecee24ba3 CHECK ((char_length(table_name) <= 63)) +); + +CREATE SEQUENCE detached_partitions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE detached_partitions_id_seq OWNED BY detached_partitions.id; + CREATE TABLE diff_note_positions ( id bigint NOT NULL, note_id bigint NOT NULL, @@ -17574,7 +17614,7 @@ ALTER SEQUENCE protected_tags_id_seq OWNED BY protected_tags.id; CREATE TABLE push_event_payloads ( commit_count bigint NOT NULL, - event_id integer NOT NULL, + event_id_convert_to_bigint integer DEFAULT 0 NOT NULL, action smallint NOT NULL, ref_type smallint NOT NULL, commit_from bytea, @@ -17582,7 +17622,7 @@ CREATE TABLE push_event_payloads ( ref text, commit_title character varying(70), ref_count integer, - event_id_convert_to_bigint bigint DEFAULT 0 NOT NULL + event_id bigint NOT NULL ); CREATE TABLE push_rules ( @@ -20179,6 +20219,8 @@ ALTER TABLE ONLY csv_issue_imports ALTER COLUMN id SET DEFAULT nextval('csv_issu ALTER TABLE ONLY custom_emoji ALTER COLUMN id SET DEFAULT nextval('custom_emoji_id_seq'::regclass); +ALTER TABLE ONLY customer_relations_organizations ALTER COLUMN id SET DEFAULT nextval('customer_relations_organizations_id_seq'::regclass); + ALTER TABLE ONLY dast_profile_schedules ALTER COLUMN id SET DEFAULT nextval('dast_profile_schedules_id_seq'::regclass); ALTER TABLE ONLY dast_profiles ALTER COLUMN id SET DEFAULT nextval('dast_profiles_id_seq'::regclass); @@ -20217,6 +20259,8 @@ ALTER TABLE ONLY design_management_versions ALTER COLUMN id SET DEFAULT nextval( ALTER TABLE ONLY design_user_mentions ALTER COLUMN id SET DEFAULT nextval('design_user_mentions_id_seq'::regclass); +ALTER TABLE ONLY detached_partitions ALTER COLUMN id SET DEFAULT nextval('detached_partitions_id_seq'::regclass); + ALTER TABLE ONLY diff_note_positions ALTER COLUMN id SET DEFAULT nextval('diff_note_positions_id_seq'::regclass); ALTER TABLE ONLY dora_daily_metrics ALTER COLUMN id SET DEFAULT nextval('dora_daily_metrics_id_seq'::regclass); @@ -21458,6 +21502,9 @@ ALTER TABLE ONLY csv_issue_imports ALTER TABLE ONLY custom_emoji ADD CONSTRAINT custom_emoji_pkey PRIMARY KEY (id); +ALTER TABLE ONLY customer_relations_organizations + ADD CONSTRAINT customer_relations_organizations_pkey PRIMARY KEY (id); + ALTER TABLE ONLY dast_profile_schedules ADD CONSTRAINT dast_profile_schedules_pkey PRIMARY KEY (id); @@ -21533,6 +21580,9 @@ ALTER TABLE ONLY design_management_versions ALTER TABLE ONLY design_user_mentions ADD CONSTRAINT design_user_mentions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY detached_partitions + ADD CONSTRAINT detached_partitions_pkey PRIMARY KEY (id); + ALTER TABLE ONLY diff_note_positions ADD CONSTRAINT diff_note_positions_pkey PRIMARY KEY (id); @@ -23557,6 +23607,8 @@ CREATE INDEX index_custom_emoji_on_creator_id ON custom_emoji USING btree (creat CREATE UNIQUE INDEX index_custom_emoji_on_namespace_id_and_name ON custom_emoji USING btree (namespace_id, name); +CREATE UNIQUE INDEX index_customer_relations_organizations_on_unique_name_per_group ON customer_relations_organizations USING btree (group_id, lower(name)); + CREATE UNIQUE INDEX index_cycle_analytics_stage_event_hashes_on_hash_sha_256 ON analytics_cycle_analytics_stage_event_hashes USING btree (hash_sha256); CREATE UNIQUE INDEX index_daily_build_group_report_results_unique_columns ON ci_daily_build_group_report_results USING btree (project_id, ref_path, date, group_name); @@ -27801,6 +27853,9 @@ ALTER TABLE ONLY jira_connect_subscriptions ALTER TABLE ONLY fork_network_members ADD CONSTRAINT fk_rails_a40860a1ca FOREIGN KEY (fork_network_id) REFERENCES fork_networks(id) ON DELETE CASCADE; +ALTER TABLE ONLY customer_relations_organizations + ADD CONSTRAINT fk_rails_a48597902f FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY operations_feature_flag_scopes ADD CONSTRAINT fk_rails_a50a04d0a4 FOREIGN KEY (feature_flag_id) REFERENCES operations_feature_flags(id) ON DELETE CASCADE; diff --git a/doc/.vale/gitlab/SubstitutionWarning.yml b/doc/.vale/gitlab/SubstitutionWarning.yml index 3bedc5837cf..885b58cc937 100644 --- a/doc/.vale/gitlab/SubstitutionWarning.yml +++ b/doc/.vale/gitlab/SubstitutionWarning.yml @@ -17,6 +17,7 @@ swap: file name: filename filesystem: file system info: information + need to: must repo: repository timezone: time zone utilize: use diff --git a/doc/administration/geo/replication/location_aware_git_url.md b/doc/administration/geo/replication/location_aware_git_url.md index a80c293149e..3fbe3be5f50 100644 --- a/doc/administration/geo/replication/location_aware_git_url.md +++ b/doc/administration/geo/replication/location_aware_git_url.md @@ -107,7 +107,7 @@ You can customize the: - SSH remote URL to use the location-aware `git.example.com`. To do so, change the SSH remote URL's host by setting `gitlab_rails['gitlab_ssh_host']` in `gitlab.rb` of web nodes. - HTTP remote URL as shown in - [Custom Git clone URL for HTTP(S)](../../../user/admin_area/settings/visibility_and_access_controls.md#custom-git-clone-url-for-https). + [Custom Git clone URL for HTTP(S)](../../../user/admin_area/settings/visibility_and_access_controls.md#customize-git-clone-url-for-https). ## Example Git request handling behavior diff --git a/doc/administration/index.md b/doc/administration/index.md index 6852092c2f7..46624ab39a3 100644 --- a/doc/administration/index.md +++ b/doc/administration/index.md @@ -121,7 +121,7 @@ Learn how to install, configure, update, and maintain your GitLab instance. - [Creating users](../user/profile/account/create_accounts.md): Create users manually or through authentication integrations. - [Libravatar](libravatar.md): Use Libravatar instead of Gravatar for user avatars. - [Sign-up restrictions](../user/admin_area/settings/sign_up_restrictions.md): block email addresses of specific domains, or whitelist only specific domains. -- [Access restrictions](../user/admin_area/settings/visibility_and_access_controls.md#enabled-git-access-protocols): Define which Git access protocols can be used to talk to GitLab (SSH, HTTP, HTTPS). +- [Access restrictions](../user/admin_area/settings/visibility_and_access_controls.md#configure-enabled-git-access-protocols): Define which Git access protocols can be used to talk to GitLab (SSH, HTTP, HTTPS). - [Authentication and Authorization](auth/index.md): Configure external authentication with LDAP, SAML, CAS, and additional providers. - [Sync LDAP](auth/ldap/index.md) - [Kerberos authentication](../integration/kerberos.md) diff --git a/doc/public_access/public_access.md b/doc/public_access/public_access.md index eca1d55c855..2cbcae31db3 100644 --- a/doc/public_access/public_access.md +++ b/doc/public_access/public_access.md @@ -28,7 +28,7 @@ They are listed in the public access directory (`/public`) for all users. NOTE: By default, `/public` is visible to unauthenticated users. However, if the -[**Public** visibility level](../user/admin_area/settings/visibility_and_access_controls.md#restricted-visibility-levels) +[**Public** visibility level](../user/admin_area/settings/visibility_and_access_controls.md#restrict-visibility-levels) is restricted, `/public` is visible only to signed-in users. ## Internal projects @@ -71,7 +71,7 @@ You can restrict the use of visibility levels for users when they create a proje This is useful to prevent users from publicly exposing their repositories by accident. The restricted visibility settings do not apply to admin users. -For details, see [Restricted visibility levels](../user/admin_area/settings/visibility_and_access_controls.md#restricted-visibility-levels). +For details, see [Restricted visibility levels](../user/admin_area/settings/visibility_and_access_controls.md#restrict-visibility-levels).