From 1cfd8874ee6702184d5608f533b30bab722b4f9d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 25 Sep 2019 09:06:04 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../javascripts/lib/utils/datetime_utility.js | 10 ++ .../javascripts/lib/utils/number_utils.js | 11 ++ app/models/namespace.rb | 15 +++ app/models/pages/lookup_path.rb | 11 +- app/models/pages/virtual_domain.rb | 7 +- app/models/pages_domain.rb | 6 + app/models/project.rb | 33 +++++- app/models/project_pages_metadatum.rb | 9 ++ app/services/projects/update_pages_service.rb | 1 + .../28781-pages-namespaces-virtual-domain.yml | 5 + ...909045845_create_project_pages_metadata.rb | 14 +++ db/schema.rb | 8 ++ .../how_to_configure_ldap_gitlab_ce/index.md | 4 +- doc/administration/auth/ldap.md | 4 +- doc/administration/auth/smartcard.md | 2 +- doc/administration/merge_request_diffs.md | 2 +- doc/administration/uploads.md | 4 +- .../system_header_and_footer_messages.md | 2 +- doc/user/admin_area/index.md | 2 +- .../admin_area/monitoring/health_check.md | 2 +- .../visibility_and_access_controls.md | 2 +- doc/user/group/custom_project_templates.md | 2 +- doc/user/project/highlighting.md | 6 +- doc/user/project/index.md | 2 +- doc/user/project/merge_requests/index.md | 19 ++- .../merge_request_dependencies.md | 6 +- doc/user/project/protected_branches.md | 25 ++-- .../reducing_the_repo_size_using_git.md | 2 +- doc/user/reserved_names.md | 93 ++++++++------- lib/api/entities.rb | 21 ++-- lib/api/internal/pages.rb | 9 +- lib/gitlab/url_builder.rb | 2 + locale/gitlab.pot | 33 +++++- qa/qa.rb | 2 + qa/qa/fixtures/ldap/admin/1_add_nodes.ldif | 7 ++ qa/qa/fixtures/ldap/admin/2_add_users.ldif | 63 ++++++++++ qa/qa/fixtures/ldap/admin/3_add_groups.ldif | 16 +++ .../fixtures/ldap/non_admin/1_add_nodes.ldif | 7 ++ .../fixtures/ldap/non_admin/2_add_users.ldif | 61 ++++++++++ .../fixtures/ldap/non_admin/3_add_groups.ldif | 16 +++ qa/qa/page/main/login.rb | 2 +- qa/qa/page/main/menu.rb | 4 + .../test/integration/ldap_no_server.rb | 13 +++ qa/qa/service/ldap.rb | 64 +++++++++++ .../scenario/test/integration/ldap_spec.rb | 8 ++ .../application_controller_spec.rb | 14 ++- .../lib/utils/datetime_utility_spec.js | 10 ++ .../frontend/lib/utils/number_utility_spec.js | 13 +++ spec/lib/gitlab/import_export/all_models.yml | 1 + spec/models/namespace_spec.rb | 24 ++++ spec/models/pages/lookup_path_spec.rb | 12 +- spec/models/pages/virtual_domain_spec.rb | 26 ++++- spec/models/pages_domain_spec.rb | 24 +++- spec/models/project_spec.rb | 76 ++++++++++-- spec/requests/api/internal/pages_spec.rb | 108 ++++++++++++++++-- .../projects/update_pages_service_spec.rb | 15 +++ 56 files changed, 812 insertions(+), 148 deletions(-) create mode 100644 app/models/project_pages_metadatum.rb create mode 100644 changelogs/unreleased/28781-pages-namespaces-virtual-domain.yml create mode 100644 db/migrate/20190909045845_create_project_pages_metadata.rb create mode 100644 qa/qa/fixtures/ldap/admin/1_add_nodes.ldif create mode 100644 qa/qa/fixtures/ldap/admin/2_add_users.ldif create mode 100644 qa/qa/fixtures/ldap/admin/3_add_groups.ldif create mode 100644 qa/qa/fixtures/ldap/non_admin/1_add_nodes.ldif create mode 100644 qa/qa/fixtures/ldap/non_admin/2_add_users.ldif create mode 100644 qa/qa/fixtures/ldap/non_admin/3_add_groups.ldif create mode 100644 qa/qa/scenario/test/integration/ldap_no_server.rb create mode 100644 qa/qa/service/ldap.rb diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js index e0832ab535d..f0d39fa7149 100644 --- a/app/assets/javascripts/lib/utils/datetime_utility.js +++ b/app/assets/javascripts/lib/utils/datetime_utility.js @@ -547,3 +547,13 @@ export const calculateRemainingMilliseconds = endDate => { const remainingMilliseconds = new Date(endDate).getTime() - Date.now(); return Math.max(remainingMilliseconds, 0); }; + +/** + * Subtracts a given number of days from a given date and returns the new date. + * + * @param {Date} date the date that we will substract days from + * @param {number} daysInPast number of days that are subtracted from a given date + * @returns {String} Date string in ISO format + */ +export const getDateInPast = (date, daysInPast) => + new Date(date.setTime(date.getTime() - daysInPast * 24 * 60 * 60 * 1000)).toISOString(); diff --git a/app/assets/javascripts/lib/utils/number_utils.js b/app/assets/javascripts/lib/utils/number_utils.js index 61c8b8803d7..0f2cc57b1f9 100644 --- a/app/assets/javascripts/lib/utils/number_utils.js +++ b/app/assets/javascripts/lib/utils/number_utils.js @@ -106,3 +106,14 @@ export const sum = (a = 0, b = 0) => a + b; * @param {Int} number */ export const isOdd = (number = 0) => number % 2; + +/** + * Computes the median for a given array. + * @param {Array} arr An array of numbers + * @returns {Number} The median of the given array + */ +export const median = arr => { + const middle = Math.floor(arr.length / 2); + const sorted = arr.sort((a, b) => a - b); + return arr.length % 2 !== 0 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2; +}; diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 9a7c3dc03c3..fb90ddc1048 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -120,6 +120,13 @@ class Namespace < ApplicationRecord uniquify = Uniquify.new uniquify.string(path) { |s| Namespace.find_by_path_or_name(s) } end + + def find_by_pages_host(host) + gitlab_host = "." + Settings.pages.host.downcase + name = host.downcase.delete_suffix(gitlab_host) + + Namespace.find_by_full_path(name) + end end def visibility_level_field @@ -305,8 +312,16 @@ class Namespace < ApplicationRecord aggregation_schedule.present? end + def pages_virtual_domain + Pages::VirtualDomain.new(all_projects_with_pages, trim_prefix: full_path) + end + private + def all_projects_with_pages + all_projects.with_pages_deployed + end + def parent_changed? parent_id_changed? end diff --git a/app/models/pages/lookup_path.rb b/app/models/pages/lookup_path.rb index 1b3183a2a43..51c496c77d3 100644 --- a/app/models/pages/lookup_path.rb +++ b/app/models/pages/lookup_path.rb @@ -2,9 +2,10 @@ module Pages class LookupPath - def initialize(project, domain: nil) + def initialize(project, trim_prefix: nil, domain: nil) @project = project @domain = domain + @trim_prefix = trim_prefix || project.full_path end def project_id @@ -28,11 +29,15 @@ module Pages end def prefix - '/' + if project.pages_group_root? + '/' + else + project.full_path.delete_prefix(trim_prefix) + '/' + end end private - attr_reader :project, :domain + attr_reader :project, :trim_prefix, :domain end end diff --git a/app/models/pages/virtual_domain.rb b/app/models/pages/virtual_domain.rb index 3a876dc06a2..7e42b8e6ae2 100644 --- a/app/models/pages/virtual_domain.rb +++ b/app/models/pages/virtual_domain.rb @@ -2,8 +2,9 @@ module Pages class VirtualDomain - def initialize(projects, domain: nil) + def initialize(projects, trim_prefix: nil, domain: nil) @projects = projects + @trim_prefix = trim_prefix @domain = domain end @@ -17,12 +18,12 @@ module Pages def lookup_paths projects.map do |project| - project.pages_lookup_path(domain: domain) + project.pages_lookup_path(trim_prefix: trim_prefix, domain: domain) end.sort_by(&:prefix).reverse end private - attr_reader :projects, :domain + attr_reader :projects, :trim_prefix, :domain end end diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index 22a6bae7cf7..6be3053f637 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -186,11 +186,17 @@ class PagesDomain < ApplicationRecord end def pages_virtual_domain + return unless pages_deployed? + Pages::VirtualDomain.new([project], domain: self) end private + def pages_deployed? + project.pages_metadatum&.deployed? + end + def set_verification_code return if self.verification_code.present? diff --git a/app/models/project.rb b/app/models/project.rb index 18afccf7ddc..883df947ccb 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -104,6 +104,9 @@ class Project < ApplicationRecord unless: :ci_cd_settings, if: proc { ProjectCiCdSetting.available? } + after_create :create_pages_metadatum, + unless: :pages_metadatum + after_create :set_timestamps_for_create after_update :update_forks_visibility_level @@ -295,6 +298,8 @@ class Project < ApplicationRecord has_many :external_pull_requests, inverse_of: :project + has_one :pages_metadatum, class_name: 'ProjectPagesMetadatum', inverse_of: :project + accepts_nested_attributes_for :variables, allow_destroy: true accepts_nested_attributes_for :project_feature, update_only: true accepts_nested_attributes_for :import_data @@ -425,6 +430,10 @@ class Project < ApplicationRecord .where(project_ci_cd_settings: { group_runners_enabled: true }) end + scope :with_pages_deployed, -> do + joins(:pages_metadatum).merge(ProjectPagesMetadatum.deployed) + end + enum auto_cancel_pending_pipelines: { disabled: 0, enabled: 1 } chronic_duration_attr :build_timeout_human_readable, :build_timeout, @@ -1643,6 +1652,10 @@ class Project < ApplicationRecord "#{url}/#{url_path}" end + def pages_group_root? + pages_group_url == pages_url + end + def pages_subdomain full_path.partition('/').first end @@ -1681,6 +1694,7 @@ class Project < ApplicationRecord # Projects with a missing namespace cannot have their pages removed return unless namespace + mark_pages_as_not_deployed unless destroyed? ::Projects::UpdatePagesConfigurationService.new(self).execute # 1. We rename pages to temporary directory @@ -1694,6 +1708,14 @@ class Project < ApplicationRecord end # rubocop: enable CodeReuse/ServiceClass + def mark_pages_as_deployed + ensure_pages_metadatum.update!(deployed: true) + end + + def mark_pages_as_not_deployed + ensure_pages_metadatum.update!(deployed: false) + end + # rubocop:disable Gitlab/RailsLogger def write_repository_config(gl_full_path: full_path) # We'd need to keep track of project full path otherwise directory tree @@ -2213,8 +2235,8 @@ class Project < ApplicationRecord members.maintainers.order_recent_sign_in.limit(ACCESS_REQUEST_APPROVERS_TO_BE_NOTIFIED_LIMIT) end - def pages_lookup_path(domain: nil) - Pages::LookupPath.new(self, domain: domain) + def pages_lookup_path(trim_prefix: nil, domain: nil) + Pages::LookupPath.new(self, trim_prefix: trim_prefix, domain: domain) end private @@ -2342,6 +2364,13 @@ class Project < ApplicationRecord def services_templates @services_templates ||= Service.where(template: true) end + + def ensure_pages_metadatum + pages_metadatum || create_pages_metadatum! + rescue ActiveRecord::RecordNotUnique + reset + retry + end end Project.prepend_if_ee('EE::Project') diff --git a/app/models/project_pages_metadatum.rb b/app/models/project_pages_metadatum.rb new file mode 100644 index 00000000000..1fda388b1ae --- /dev/null +++ b/app/models/project_pages_metadatum.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class ProjectPagesMetadatum < ApplicationRecord + self.primary_key = :project_id + + belongs_to :project, inverse_of: :pages_metadatum + + scope :deployed, -> { where(deployed: true) } +end diff --git a/app/services/projects/update_pages_service.rb b/app/services/projects/update_pages_service.rb index fa7a4f0ed82..e8a87fc4320 100644 --- a/app/services/projects/update_pages_service.rb +++ b/app/services/projects/update_pages_service.rb @@ -53,6 +53,7 @@ module Projects def success @status.success + @project.mark_pages_as_deployed super end diff --git a/changelogs/unreleased/28781-pages-namespaces-virtual-domain.yml b/changelogs/unreleased/28781-pages-namespaces-virtual-domain.yml new file mode 100644 index 00000000000..6725d070440 --- /dev/null +++ b/changelogs/unreleased/28781-pages-namespaces-virtual-domain.yml @@ -0,0 +1,5 @@ +--- +title: Add project_pages_metadata DB table +merge_request: 17197 +author: +type: added diff --git a/db/migrate/20190909045845_create_project_pages_metadata.rb b/db/migrate/20190909045845_create_project_pages_metadata.rb new file mode 100644 index 00000000000..5fc8fc6e6c1 --- /dev/null +++ b/db/migrate/20190909045845_create_project_pages_metadata.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class CreateProjectPagesMetadata < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + create_table :project_pages_metadata, id: false do |t| + t.references :project, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade } + t.boolean :deployed, null: false, default: false + + t.index :project_id, name: 'index_project_pages_metadata_on_project_id_and_deployed_is_true', where: "deployed = TRUE" + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 392db66f5b6..7703628d433 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2774,6 +2774,13 @@ ActiveRecord::Schema.define(version: 2019_09_19_162036) do t.index ["status"], name: "index_project_mirror_data_on_status" end + create_table "project_pages_metadata", id: false, force: :cascade do |t| + t.bigint "project_id", null: false + t.boolean "deployed", default: false, null: false + t.index ["project_id"], name: "index_project_pages_metadata_on_project_id", unique: true + t.index ["project_id"], name: "index_project_pages_metadata_on_project_id_and_deployed_is_true", where: "(deployed = true)" + end + create_table "project_repositories", force: :cascade do |t| t.integer "shard_id", null: false t.string "disk_path", null: false @@ -4084,6 +4091,7 @@ ActiveRecord::Schema.define(version: 2019_09_19_162036) do add_foreign_key "project_incident_management_settings", "projects", on_delete: :cascade add_foreign_key "project_metrics_settings", "projects", on_delete: :cascade add_foreign_key "project_mirror_data", "projects", name: "fk_d1aad367d7", on_delete: :cascade + add_foreign_key "project_pages_metadata", "projects", on_delete: :cascade add_foreign_key "project_repositories", "projects", on_delete: :cascade add_foreign_key "project_repositories", "shards", on_delete: :restrict add_foreign_key "project_repository_states", "projects", on_delete: :cascade diff --git a/doc/administration/auth/how_to_configure_ldap_gitlab_ce/index.md b/doc/administration/auth/how_to_configure_ldap_gitlab_ce/index.md index ef35a2d5266..4b6dc803189 100644 --- a/doc/administration/auth/how_to_configure_ldap_gitlab_ce/index.md +++ b/doc/administration/auth/how_to_configure_ldap_gitlab_ce/index.md @@ -32,9 +32,9 @@ For example, [Active Directory](https://technet.microsoft.com/en-us/library/hh83 We won't cover the installation and configuration of Windows Server or Active Directory Domain Services in this tutorial. There are a number of resources online to guide you through this process: -- Install Windows Server 2012 - (_technet.microsoft.com_) - [Installing Windows Server 2012](https://technet.microsoft.com/en-us/library/jj134246(v=ws.11).aspx) +- Install Windows Server 2012 - (`technet.microsoft.com`) - [Installing Windows Server 2012](https://technet.microsoft.com/en-us/library/jj134246(v=ws.11).aspx) -- Install Active Directory Domain Services (AD DS) (_technet.microsoft.com_)- [Install Active Directory Domain Services](https://technet.microsoft.com/windows-server-docs/identity/ad-ds/deploy/install-active-directory-domain-services--level-100-#BKMK_PS) +- Install Active Directory Domain Services (AD DS) (`technet.microsoft.com`)- [Install Active Directory Domain Services](https://technet.microsoft.com/windows-server-docs/identity/ad-ds/deploy/install-active-directory-domain-services--level-100-#BKMK_PS) > **Shortcut:** You can quickly install AD DS via PowerShell using `Install-WindowsFeature AD-Domain-Services -IncludeManagementTools` diff --git a/doc/administration/auth/ldap.md b/doc/administration/auth/ldap.md index 728add05bd8..ee3a992cc72 100644 --- a/doc/administration/auth/ldap.md +++ b/doc/administration/auth/ldap.md @@ -413,7 +413,7 @@ nested members in the user filter should not be confused with [group sync nested groups support](ldap-ee.md#supported-ldap-group-typesattributes). **(STARTER ONLY)** Please note that GitLab does not support the custom filter syntax used by -omniauth-ldap. +OmniAuth LDAP. ### Escaping special characters @@ -536,7 +536,7 @@ ldapsearch -H ldaps://$host:$port -D "$bind_dn" -y bind_dn_password.txt -b "$ba - Variables beginning with a `$` refer to a variable from the LDAP section of your configuration file. -- Replace ldaps:// with ldap:// if you are using the plain authentication method. +- Replace `ldaps://` with `ldap://` if you are using the plain authentication method. Port `389` is the default `ldap://` port and `636` is the default `ldaps://` port. - We are assuming the password for the bind_dn user is in bind_dn_password.txt. diff --git a/doc/administration/auth/smartcard.md b/doc/administration/auth/smartcard.md index 2d2734096ed..eb63df6b482 100644 --- a/doc/administration/auth/smartcard.md +++ b/doc/administration/auth/smartcard.md @@ -206,7 +206,7 @@ attribute. As a prerequisite, you must use an LDAP server that: **For installations from source** -1. Add the `san_extensions` line to config/gitlab.yml` within the smartcard section: +1. Add the `san_extensions` line to `config/gitlab.yml` within the smartcard section: ```yaml smartcard: diff --git a/doc/administration/merge_request_diffs.md b/doc/administration/merge_request_diffs.md index db256728f4d..e09202e1d79 100644 --- a/doc/administration/merge_request_diffs.md +++ b/doc/administration/merge_request_diffs.md @@ -96,7 +96,7 @@ The connection settings match those provided by [Fog](https://github.com/fog), a | `enable_signature_v4_streaming` | Set to true to enable HTTP chunked transfers with [AWS v4 signatures](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html). Oracle Cloud S3 needs this to be false | true | | `region` | AWS region | us-east-1 | | `host` | S3 compatible host for when not using AWS, e.g. `localhost` or `storage.example.com` | s3.amazonaws.com | -| `endpoint` | Can be used when configuring an S3 compatible service such as [Minio](https://www.minio.io), by entering a URL such as `http://127.0.0.1:9000` | (optional) | +| `endpoint` | Can be used when configuring an S3 compatible service such as [MinIO](https://www.minio.io), by entering a URL such as `http://127.0.0.1:9000` | (optional) | | `path_style` | Set to true to use `host/bucket_name/object` style paths instead of `bucket_name.host/object`. Leave as false for AWS S3 | false | | `use_iam_profile` | Set to true to use IAM profile instead of access keys | false diff --git a/doc/administration/uploads.md b/doc/administration/uploads.md index c6dadbb500b..8a8c6202bf7 100644 --- a/doc/administration/uploads.md +++ b/doc/administration/uploads.md @@ -81,7 +81,7 @@ The connection settings match those provided by [Fog](https://github.com/fog), a | `enable_signature_v4_streaming` | Set to true to enable HTTP chunked transfers with [AWS v4 signatures](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html). Oracle Cloud S3 needs this to be false | true | | `region` | AWS region | us-east-1 | | `host` | S3 compatible host for when not using AWS, e.g. `localhost` or `storage.example.com` | s3.amazonaws.com | -| `endpoint` | Can be used when configuring an S3 compatible service such as [Minio](https://www.minio.io), by entering a URL such as `http://127.0.0.1:9000` | (optional) | +| `endpoint` | Can be used when configuring an S3 compatible service such as [MinIO](https://www.minio.io), by entering a URL such as `http://127.0.0.1:9000` | (optional) | | `path_style` | Set to true to use `host/bucket_name/object` style paths instead of `bucket_name.host/object`. Leave as false for AWS S3 | false | | `use_iam_profile` | Set to true to use IAM profile instead of access keys | false @@ -165,7 +165,7 @@ The connection settings match those provided by [Fog](https://github.com/fog), a |---------|-------------|---------| | `provider` | Always `OpenStack` for compatible hosts | OpenStack | | `openstack_username` | OpenStack username | | -| `openstack_api_key` | OpenStack api key | | +| `openstack_api_key` | OpenStack API key | | | `openstack_temp_url_key` | OpenStack key for generating temporary urls | | | `openstack_auth_url` | OpenStack authentication endpont | | | `openstack_region` | OpenStack region | | diff --git a/doc/customization/system_header_and_footer_messages.md b/doc/customization/system_header_and_footer_messages.md index b3aa48b1e2f..5db971d0c1e 100644 --- a/doc/customization/system_header_and_footer_messages.md +++ b/doc/customization/system_header_and_footer_messages.md @@ -14,7 +14,7 @@ Note that color settings will only be applied within the app interface and not t ![appearance](system_header_and_footer_messages/appearance.png) -After saving, all GitLab pages will contain the custom system header and/or footer messages: +After saving, all pages within GitLab will contain the custom system header and/or footer messages: ![custom_header_footer](system_header_and_footer_messages/custom_header_footer.png) diff --git a/doc/user/admin_area/index.md b/doc/user/admin_area/index.md index 9bc0f64b68d..043345093f5 100644 --- a/doc/user/admin_area/index.md +++ b/doc/user/admin_area/index.md @@ -27,7 +27,7 @@ The Admin Area is made up of the following sections: | Applications | Create system [OAuth applications](../../integration/oauth_provider.md) for integrations with other services. | | Abuse Reports | Manage [abuse reports](abuse_reports.md) submitted by your users. | | License **(STARTER ONLY)** | Upload, display, and remove [licenses](license.md). | -| Push Rules **(STARTER)** | Configure pre-defined git [push rules](../../push_rules/push_rules.md) for projects. | +| Push Rules **(STARTER)** | Configure pre-defined Git [push rules](../../push_rules/push_rules.md) for projects. | | Geo **(PREMIUM ONLY)** | Configure and maintain [Geo nodes](geo_nodes.md). | | Deploy Keys | Create instance-wide [SSH deploy keys](../../ssh/README.md#deploy-keys). | | Service Templates | Create [service templates](../project/integrations/services_templates.md) for projects. | diff --git a/doc/user/admin_area/monitoring/health_check.md b/doc/user/admin_area/monitoring/health_check.md index f5e812cad1b..ec043bcffdb 100644 --- a/doc/user/admin_area/monitoring/health_check.md +++ b/doc/user/admin_area/monitoring/health_check.md @@ -59,7 +59,7 @@ GitLab OK ## Readiness -The readiness probe checks whether the Gitlab instance is ready to use. It checks the dependent services (Database, Redis, Gitaly etc.) and gives a status for each. +The readiness probe checks whether the GitLab instance is ready to use. It checks the dependent services (Database, Redis, Gitaly etc.) and gives a status for each. ```text GET /-/readiness diff --git a/doc/user/admin_area/settings/visibility_and_access_controls.md b/doc/user/admin_area/settings/visibility_and_access_controls.md index ad08c852332..400cb59a7ba 100644 --- a/doc/user/admin_area/settings/visibility_and_access_controls.md +++ b/doc/user/admin_area/settings/visibility_and_access_controls.md @@ -58,7 +58,7 @@ not selected. CAUTION: **Important:** Starting with [GitLab 10.7][ce-18021], HTTP(s) protocol will be allowed for -git clone/fetch requests done by GitLab Runner from CI/CD Jobs, even if +Git clone/fetch requests done by GitLab Runner from CI/CD Jobs, even if _Only SSH_ was selected. > **Note:** Please keep in mind that disabling an access protocol does not actually diff --git a/doc/user/group/custom_project_templates.md b/doc/user/group/custom_project_templates.md index 094732e6a93..e47a281141d 100644 --- a/doc/user/group/custom_project_templates.md +++ b/doc/user/group/custom_project_templates.md @@ -7,7 +7,7 @@ type: reference > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/6861) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.6. When you create a new [project](../project/index.md), creating it based on custom project templates is -a convenient bootstrap option. +a convenient option. Users can configure a GitLab group that serves as template source under a group's **Settings > General > Custom project templates**. diff --git a/doc/user/project/highlighting.md b/doc/user/project/highlighting.md index 73a2d176b54..a715a313adf 100644 --- a/doc/user/project/highlighting.md +++ b/doc/user/project/highlighting.md @@ -1,8 +1,6 @@ -[Rouge]: https://rubygems.org/gems/rouge - # Syntax Highlighting -GitLab provides syntax highlighting on all files and snippets through the [Rouge][] rubygem. It will try to guess what language to use based on the file extension, which most of the time is sufficient. +GitLab provides syntax highlighting on all files and snippets through the [Rouge](https://rubygems.org/gems/rouge) rubygem. It will try to guess what language to use based on the file extension, which most of the time is sufficient. If GitLab is guessing wrong, you can override its choice of language using the `gitlab-language` attribute in `.gitattributes`. For example, if you are working in a Prolog project and using the `.pl` file extension (which would normally be highlighted as Perl), you can add the following to your `.gitattributes` file: @@ -12,7 +10,7 @@ If GitLab is guessing wrong, you can override its choice of language using the ` When you check in and push that change, all `*.pl` files in your project will be highlighted as Prolog. -The paths here are simply git's builtin [`.gitattributes` interface](https://git-scm.com/docs/gitattributes). So, if you were to invent a file format called a `Nicefile` at the root of your project that used ruby syntax, all you need is: +The paths here are simply Git's built-in [`.gitattributes` interface](https://git-scm.com/docs/gitattributes). So, if you were to invent a file format called a `Nicefile` at the root of your project that used ruby syntax, all you need is: ``` conf /Nicefile gitlab-language=ruby diff --git a/doc/user/project/index.md b/doc/user/project/index.md index a6e9ef8a7c0..de4db7c80ef 100644 --- a/doc/user/project/index.md +++ b/doc/user/project/index.md @@ -129,7 +129,7 @@ Read through the documentation on [project settings](settings/index.md). - [Import a project](import/index.md) from: - [GitHub to GitLab](import/github.md) - - [BitBucket to GitLab](import/bitbucket.md) + - [Bitbucket to GitLab](import/bitbucket.md) - [Gitea to GitLab](import/gitea.md) - [FogBugz to GitLab](import/fogbugz.md) - [Export a project from GitLab](settings/import_export.md#exporting-a-project-and-its-data) diff --git a/doc/user/project/merge_requests/index.md b/doc/user/project/merge_requests/index.md index 3f563d58287..a583ef45a76 100644 --- a/doc/user/project/merge_requests/index.md +++ b/doc/user/project/merge_requests/index.md @@ -311,7 +311,7 @@ as pushing changes: - Set the description of the merge request to a particular description. - Add or remove labels from the merge request. -### Create a new merge request using git push options +### Create a new merge request using Git push options To create a new merge request for a branch, use the `merge_request.create` push option: @@ -320,7 +320,7 @@ To create a new merge request for a branch, use the git push -o merge_request.create ``` -### Set the target branch of a merge request using git push options +### Set the target branch of a merge request using Git push options To update an existing merge request's target branch, use the `merge_request.target=` push option: @@ -336,7 +336,7 @@ same time using a `-o` flag per push option: git push -o merge_request.create -o merge_request.target=branch_name ``` -### Set merge when pipeline succeeds using git push options +### Set merge when pipeline succeeds using Git push options To set an existing merge request to [merge when its pipeline succeeds](merge_when_pipeline_succeeds.md), use @@ -353,7 +353,7 @@ pipeline succeeds at the same time using a `-o` flag per push option: git push -o merge_request.create -o merge_request.merge_when_pipeline_succeeds ``` -### Set removing the source branch using git push options +### Set removing the source branch using Git push options > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/64320) in GitLab 12.2. @@ -368,7 +368,7 @@ git push -o merge_request.remove_source_branch You can also use this push option in addition to the `merge_request.create` push option. -### Set merge request title using git push options +### Set merge request title using Git push options > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/64320) in GitLab 12.2. @@ -382,7 +382,7 @@ git push -o merge_request.title="The title I want" You can also use this push option in addition to the `merge_request.create` push option. -### Set merge request description using git push options +### Set merge request description using Git push options > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/64320) in GitLab 12.2. @@ -396,7 +396,7 @@ git push -o merge_request.description="The description I want" You can also use this push option in addition to the `merge_request.create` push option. -### Add or remove labels using git push options +### Add or remove labels using Git push options > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/31831) in GitLab 12.3. @@ -666,7 +666,7 @@ tricks to checkout a merge request locally. Please note that you can checkout a merge request locally even if the source project is a fork (even a private fork) of the target project. -#### Checkout locally by adding a git alias +#### Checkout locally by adding a Git alias Add the following alias to your `~/.gitconfig`: @@ -736,9 +736,8 @@ And to check out a particular merge request: git checkout origin/merge-requests/1 ``` -all the above can be done with [git-mr] script. +All the above can be done with the [`git-mr`](https://gitlab.com/glensc/git-mr) script. -[git-mr]: https://gitlab.com/glensc/git-mr [products]: https://about.gitlab.com/products/ "GitLab products page" [protected branches]: ../protected_branches.md [ci]: ../../../ci/README.md diff --git a/doc/user/project/merge_requests/merge_request_dependencies.md b/doc/user/project/merge_requests/merge_request_dependencies.md index 9daf42f5152..b9f229783f1 100644 --- a/doc/user/project/merge_requests/merge_request_dependencies.md +++ b/doc/user/project/merge_requests/merge_request_dependencies.md @@ -97,9 +97,9 @@ merge. ## Limitations -- API support: [gitlab#12551](https://gitlab.com/gitlab-org/gitlab/issues/12551) -- Dependencies are not preserved across project export/import: [gitlab#12549](https://gitlab.com/gitlab-org/gitlab/issues/12549) -- Complex merge order dependencies are not supported: [gitlab#11393](https://gitlab.com/gitlab-org/gitlab/issues/11393) +- API support: [issue #12551](https://gitlab.com/gitlab-org/gitlab/issues/12551) +- Dependencies are not preserved across project export/import: [issue #12549](https://gitlab.com/gitlab-org/gitlab/issues/12549) +- Complex merge order dependencies are not supported: [issue #11393](https://gitlab.com/gitlab-org/gitlab/issues/11393) The last item merits a little more explanation. Dependencies between merge requests can be described as a graph of relationships. The simplest possible diff --git a/doc/user/project/protected_branches.md b/doc/user/project/protected_branches.md index f909725f07e..9b08dd1dbb7 100644 --- a/doc/user/project/protected_branches.md +++ b/doc/user/project/protected_branches.md @@ -41,7 +41,7 @@ that the `master` branch is protected by default. ## Using the Allowed to merge and Allowed to push settings -> [Introduced][ce-5081] in GitLab 8.11. +> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/5081) in GitLab 8.11. Since GitLab 8.11, we added another layer of branch protection which provides more granular management of protected branches. The "Developers can push" @@ -71,7 +71,7 @@ they are set to "Maintainers" by default. ## Restricting push and merge access to certain users **(STARTER)** -> [Introduced][ce-5081] in [GitLab Starter][ee] 8.11. +> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/5081) in [GitLab Starter](https://about.gitlab.com/pricing/) 8.11. With GitLab Enterprise Edition you can restrict access to protected branches by choosing a role (Maintainers, Developers) as well as certain users. From the @@ -86,7 +86,7 @@ Click **Protect** and the branch will appear in the "Protected branch" list. ## Wildcard protected branches -> [Introduced][ce-4665] in GitLab 8.10. +> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/4665) in GitLab 8.10. You can specify a wildcard protected branch, which will protect all branches matching the wildcard. For example: @@ -131,12 +131,12 @@ To create a new branch through the user interface: ## Deleting a protected branch -> [Introduced][ce-21393] in GitLab 9.3. +> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/21393) in GitLab 9.3. From time to time, it may be required to delete or clean up branches that are protected. -User with [Maintainer permissions][perm] and up can manually delete protected +User with [Maintainer permissions](../permissions.md) and up can manually delete protected branches via GitLab's web interface: 1. Visit **Repository > Branches** @@ -166,23 +166,16 @@ for details about the pipelines security model. **9.2** -- Allow deletion of protected branches via the web interface [gitlab-org/gitlab-foss#21393][ce-21393] +- Allow deletion of protected branches via the web interface ([issue #21393](https://gitlab.com/gitlab-org/gitlab-foss/issues/21393)). **8.11** -- Allow creating protected branches that can't be pushed to [gitlab-org/gitlab-foss!5081][ce-5081] +- Allow creating protected branches that can't be pushed to ([merge request !5081](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/5081)). **8.10** -- Allow developers to merge into a protected branch without having push access [gitlab-org/gitlab-foss!4892][ce-4892] -- Allow specifying protected branches using wildcards [gitlab-org/gitlab-foss!4665][ce-4665] - -[ce-4665]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/4665 "Allow specifying protected branches using wildcards" -[ce-4892]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/4892 "Allow developers to merge into a protected branch without having push access" -[ce-5081]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/5081 "Allow creating protected branches that can't be pushed to" -[ce-21393]: https://gitlab.com/gitlab-org/gitlab-foss/issues/21393 -[perm]: ../permissions.md -[ee]: https://about.gitlab.com/pricing/ +- Allow developers without push access to merge into a protected branch ([merge request !4892](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/4892)). +- Allow specifying protected branches using wildcards ([merge request !4665](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/4665)).