summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-06 03:08:47 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-06 03:08:47 +0000
commitcfbaef3f1c28cdb9b15615215b87167181cb210f (patch)
tree8713f67e889a9b6d89fd35584ec7405f5a379565
parenta97acfe57aac7d8206e99e5ffdfe9c5fb5b69544 (diff)
downloadgitlab-ce-cfbaef3f1c28cdb9b15615215b87167181cb210f.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/controllers/profiles/notifications_controller.rb3
-rw-r--r--app/models/notification_setting.rb2
-rw-r--r--app/services/audit_event_service.rb2
-rw-r--r--changelogs/unreleased/196250.yml5
-rw-r--r--changelogs/unreleased/geo-spike-self-service-framework.yml5
-rw-r--r--config/application.rb2
-rw-r--r--config/initializers/0_inflections.rb1
-rw-r--r--config/initializers/rails_host_authorization.rb2
-rw-r--r--db/migrate/20200121192942_create_geo_events.rb14
-rw-r--r--db/migrate/20200121194000_add_geo_event_id_to_geo_event_log.rb9
-rw-r--r--db/migrate/20200121194048_add_geo_event_id_index_to_geo_event_log.rb20
-rw-r--r--db/migrate/20200121194154_add_geo_events_foreign_key.rb20
-rw-r--r--db/schema.rb10
-rw-r--r--doc/administration/index.md3
-rw-r--r--doc/administration/troubleshooting/group_saml_scim.md57
-rw-r--r--doc/administration/troubleshooting/img/AzureAD-basic_SAML.pngbin0 -> 137104 bytes
-rw-r--r--doc/administration/troubleshooting/img/AzureAD-claims.pngbin0 -> 55574 bytes
-rw-r--r--doc/administration/troubleshooting/img/AzureAD-scim_attribute_mapping.pngbin0 -> 34642 bytes
-rw-r--r--doc/administration/troubleshooting/img/OneLogin-SSOsettings.pngbin0 -> 85242 bytes
-rw-r--r--doc/administration/troubleshooting/img/OneLogin-app_details.pngbin0 -> 61390 bytes
-rw-r--r--doc/administration/troubleshooting/img/OneLogin-encryption.pngbin0 -> 34245 bytes
-rw-r--r--doc/administration/troubleshooting/img/OneLogin-parameters.pngbin0 -> 17139 bytes
-rw-r--r--doc/administration/troubleshooting/img/OneLogin-userAdd.pngbin0 -> 32711 bytes
-rw-r--r--doc/ci/yaml/README.md142
-rw-r--r--doc/topics/autodevops/index.md10
-rw-r--r--doc/user/analytics/cycle_analytics.md2
-rw-r--r--doc/user/group/saml_sso/index.md4
-rw-r--r--doc/user/profile/img/notification_group_settings.pngbin54362 -> 0 bytes
-rw-r--r--doc/user/profile/img/notification_group_settings_v12_8.pngbin0 -> 36922 bytes
-rw-r--r--doc/user/profile/img/notification_project_settings.pngbin58864 -> 0 bytes
-rw-r--r--doc/user/profile/img/notification_project_settings_v12_8.pngbin0 -> 39303 bytes
-rw-r--r--doc/user/profile/notifications.md4
-rw-r--r--doc/user/project/import/github.md2
-rw-r--r--lib/quality/test_level.rb1
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb4
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb4
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/issue/mentions_spec.rb6
-rw-r--r--spec/controllers/profiles/notifications_controller_spec.rb1
-rw-r--r--spec/frontend/diffs/components/diff_line_gutter_content_spec.js (renamed from spec/javascripts/diffs/components/diff_line_gutter_content_spec.js)2
-rw-r--r--spec/frontend/diffs/mock_data/diff_file.js244
-rw-r--r--spec/javascripts/diffs/mock_data/diff_file.js249
-rw-r--r--spec/lib/quality/test_level_spec.rb4
-rw-r--r--spec/requests/profiles/notifications_controller_spec.rb42
43 files changed, 546 insertions, 330 deletions
diff --git a/app/controllers/profiles/notifications_controller.rb b/app/controllers/profiles/notifications_controller.rb
index d295b64082c..064b2a2cc12 100644
--- a/app/controllers/profiles/notifications_controller.rb
+++ b/app/controllers/profiles/notifications_controller.rb
@@ -4,13 +4,14 @@ class Profiles::NotificationsController < Profiles::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def show
@user = current_user
- @group_notifications = current_user.notification_settings.for_groups.order(:id)
+ @group_notifications = current_user.notification_settings.preload_source_route.for_groups.order(:id)
@group_notifications += GroupsFinder.new(
current_user,
all_available: false,
exclude_group_ids: @group_notifications.select(:source_id)
).execute.map { |group| current_user.notification_settings_for(group, inherit: true) }
@project_notifications = current_user.notification_settings.for_projects.order(:id)
+ .preload_source_route
.select { |notification| current_user.can?(:read_project, notification.source) }
@global_notification_setting = current_user.global_notification_setting
end
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb
index 1447f822513..e2c362538eb 100644
--- a/app/models/notification_setting.rb
+++ b/app/models/notification_setting.rb
@@ -27,6 +27,8 @@ class NotificationSetting < ApplicationRecord
.where.not(projects: { pending_delete: true })
end
+ scope :preload_source_route, -> { preload(source: [:route]) }
+
EMAIL_EVENTS = [
:new_release,
:new_note,
diff --git a/app/services/audit_event_service.rb b/app/services/audit_event_service.rb
index 40761ee97d2..9fd892ead82 100644
--- a/app/services/audit_event_service.rb
+++ b/app/services/audit_event_service.rb
@@ -44,6 +44,8 @@ class AuditEventService
end
def log_security_event_to_database
+ return if Gitlab::Database.read_only?
+
SecurityEvent.create(base_payload.merge(details: @details))
end
end
diff --git a/changelogs/unreleased/196250.yml b/changelogs/unreleased/196250.yml
new file mode 100644
index 00000000000..adbe449cc84
--- /dev/null
+++ b/changelogs/unreleased/196250.yml
@@ -0,0 +1,5 @@
+---
+title: Remove N+1 query for profile notifications
+merge_request: 22845
+author: Ohad Dahan
+type: performance
diff --git a/changelogs/unreleased/geo-spike-self-service-framework.yml b/changelogs/unreleased/geo-spike-self-service-framework.yml
new file mode 100644
index 00000000000..409bc8a9298
--- /dev/null
+++ b/changelogs/unreleased/geo-spike-self-service-framework.yml
@@ -0,0 +1,5 @@
+---
+title: 'Geo: Add tables to prepare to replicate package files'
+merge_request: 23447
+author:
+type: added
diff --git a/config/application.rb b/config/application.rb
index e8cc35aed2a..be7d366c927 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -55,6 +55,8 @@ module Gitlab
memo << ee_path.to_s
end
+ ee_paths << "#{config.root}/ee/app/replicators"
+
# Eager load should load CE first
config.eager_load_paths.push(*ee_paths)
config.helpers_paths.push "#{config.root}/ee/app/helpers"
diff --git a/config/initializers/0_inflections.rb b/config/initializers/0_inflections.rb
index 7690eafdc6b..5c38859a667 100644
--- a/config/initializers/0_inflections.rb
+++ b/config/initializers/0_inflections.rb
@@ -19,6 +19,7 @@ ActiveSupport::Inflector.inflections do |inflect|
group_view
job_artifact_registry
lfs_object_registry
+ package_file_registry
project_auto_devops
project_registry
project_statistics
diff --git a/config/initializers/rails_host_authorization.rb b/config/initializers/rails_host_authorization.rb
index 6afcec374db..3be2de47812 100644
--- a/config/initializers/rails_host_authorization.rb
+++ b/config/initializers/rails_host_authorization.rb
@@ -3,5 +3,5 @@
# This file requires config/initializers/1_settings.rb
if Rails.env.development?
- Rails.application.config.hosts << Gitlab.config.gitlab.host
+ Rails.application.config.hosts += [Gitlab.config.gitlab.host, 'unix']
end
diff --git a/db/migrate/20200121192942_create_geo_events.rb b/db/migrate/20200121192942_create_geo_events.rb
new file mode 100644
index 00000000000..6dbe131051f
--- /dev/null
+++ b/db/migrate/20200121192942_create_geo_events.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class CreateGeoEvents < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ def change
+ create_table :geo_events do |t|
+ t.string :replicable_name, limit: 255, null: false
+ t.string :event_name, limit: 255, null: false
+ t.jsonb :payload, default: {}, null: false
+ t.datetime_with_timezone :created_at, null: false
+ end
+ end
+end
diff --git a/db/migrate/20200121194000_add_geo_event_id_to_geo_event_log.rb b/db/migrate/20200121194000_add_geo_event_id_to_geo_event_log.rb
new file mode 100644
index 00000000000..720995164b2
--- /dev/null
+++ b/db/migrate/20200121194000_add_geo_event_id_to_geo_event_log.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddGeoEventIdToGeoEventLog < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ def change
+ add_column :geo_event_log, :geo_event_id, :integer
+ end
+end
diff --git a/db/migrate/20200121194048_add_geo_event_id_index_to_geo_event_log.rb b/db/migrate/20200121194048_add_geo_event_id_index_to_geo_event_log.rb
new file mode 100644
index 00000000000..9b0ec12c959
--- /dev/null
+++ b/db/migrate/20200121194048_add_geo_event_id_index_to_geo_event_log.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddGeoEventIdIndexToGeoEventLog < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :geo_event_log, :geo_event_id,
+ where: "(geo_event_id IS NOT NULL)",
+ using: :btree,
+ name: 'index_geo_event_log_on_geo_event_id'
+ end
+
+ def down
+ remove_concurrent_index :geo_event_log, :geo_event_id, name: 'index_geo_event_log_on_geo_event_id'
+ end
+end
diff --git a/db/migrate/20200121194154_add_geo_events_foreign_key.rb b/db/migrate/20200121194154_add_geo_events_foreign_key.rb
new file mode 100644
index 00000000000..b5e16e22989
--- /dev/null
+++ b/db/migrate/20200121194154_add_geo_events_foreign_key.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddGeoEventsForeignKey < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :geo_event_log, :geo_events,
+ column: :geo_event_id,
+ name: 'fk_geo_event_log_on_geo_event_id',
+ on_delete: :cascade
+ end
+
+ def down
+ remove_foreign_key_without_error :geo_event_log, column: :geo_event_id, name: 'fk_geo_event_log_on_geo_event_id'
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index c69be4844ff..1c96e4eefcf 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1665,8 +1665,10 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do
t.bigint "reset_checksum_event_id"
t.bigint "cache_invalidation_event_id"
t.bigint "container_repository_updated_event_id"
+ t.integer "geo_event_id"
t.index ["cache_invalidation_event_id"], name: "index_geo_event_log_on_cache_invalidation_event_id", where: "(cache_invalidation_event_id IS NOT NULL)"
t.index ["container_repository_updated_event_id"], name: "index_geo_event_log_on_container_repository_updated_event_id"
+ t.index ["geo_event_id"], name: "index_geo_event_log_on_geo_event_id", where: "(geo_event_id IS NOT NULL)"
t.index ["hashed_storage_attachments_event_id"], name: "index_geo_event_log_on_hashed_storage_attachments_event_id", where: "(hashed_storage_attachments_event_id IS NOT NULL)"
t.index ["hashed_storage_migrated_event_id"], name: "index_geo_event_log_on_hashed_storage_migrated_event_id", where: "(hashed_storage_migrated_event_id IS NOT NULL)"
t.index ["job_artifact_deleted_event_id"], name: "index_geo_event_log_on_job_artifact_deleted_event_id", where: "(job_artifact_deleted_event_id IS NOT NULL)"
@@ -1680,6 +1682,13 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do
t.index ["upload_deleted_event_id"], name: "index_geo_event_log_on_upload_deleted_event_id", where: "(upload_deleted_event_id IS NOT NULL)"
end
+ create_table "geo_events", force: :cascade do |t|
+ t.string "replicable_name", limit: 255, null: false
+ t.string "event_name", limit: 255, null: false
+ t.jsonb "payload", default: {}, null: false
+ t.datetime_with_timezone "created_at", null: false
+ end
+
create_table "geo_hashed_storage_attachments_events", force: :cascade do |t|
t.integer "project_id", null: false
t.text "old_attachments_path", null: false
@@ -4650,6 +4659,7 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do
add_foreign_key "geo_container_repository_updated_events", "container_repositories", name: "fk_212c89c706", on_delete: :cascade
add_foreign_key "geo_event_log", "geo_cache_invalidation_events", column: "cache_invalidation_event_id", name: "fk_42c3b54bed", on_delete: :cascade
add_foreign_key "geo_event_log", "geo_container_repository_updated_events", column: "container_repository_updated_event_id", name: "fk_6ada82d42a", on_delete: :cascade
+ add_foreign_key "geo_event_log", "geo_events", name: "fk_geo_event_log_on_geo_event_id", on_delete: :cascade
add_foreign_key "geo_event_log", "geo_hashed_storage_migrated_events", column: "hashed_storage_migrated_event_id", name: "fk_27548c6db3", on_delete: :cascade
add_foreign_key "geo_event_log", "geo_job_artifact_deleted_events", column: "job_artifact_deleted_event_id", name: "fk_176d3fbb5d", on_delete: :cascade
add_foreign_key "geo_event_log", "geo_lfs_object_deleted_events", column: "lfs_object_deleted_event_id", name: "fk_d5af95fcd9", on_delete: :cascade
diff --git a/doc/administration/index.md b/doc/administration/index.md
index dbe4a351dce..fcfdcfdf6c8 100644
--- a/doc/administration/index.md
+++ b/doc/administration/index.md
@@ -228,3 +228,6 @@ who are aware of the risks.
- [Repairing and recovering broken Git repositories](https://git.seveas.net/repairing-and-recovering-broken-git-repositories.html)
- [Testing with OpenSSL](https://www.feistyduck.com/library/openssl-cookbook/online/ch-testing-with-openssl.html)
- [Strace zine](https://wizardzines.com/zines/strace/)
+- GitLab.com-specific resources:
+ - [Group SAML/SCIM setup](troubleshooting/group_saml_scim.md)
+ \ No newline at end of file
diff --git a/doc/administration/troubleshooting/group_saml_scim.md b/doc/administration/troubleshooting/group_saml_scim.md
new file mode 100644
index 00000000000..109379f98ca
--- /dev/null
+++ b/doc/administration/troubleshooting/group_saml_scim.md
@@ -0,0 +1,57 @@
+---
+type: reference
+---
+
+# Group SAML and SCIM troubleshooting **(SILVER ONLY)**
+
+These are notes and screenshots regarding Group SAML and SCIM that the GitLab Support Team sometimes uses while troubleshooting, but which do not fit into the official documentation. GitLab is making this public, so that anyone can make use of the Support team’s collected knowledge.
+
+Please refer to GitLab's [Group SAML](../../user/group/saml_sso/index.md) docs for information on the feature and how to set it up.
+
+When troubleshooting a SAML configuration, GitLab team members will frequently start with the [SAML troubleshooting section](../../user/group/saml_sso/index.md#troubleshooting).
+
+They may then set up a test configuration of the desired identity provider. We include example screenshots in this section.
+
+## SAML and SCIM screenshots
+
+This section includes relevant screenshots of the following example configurations of [Group SAML](../../user/group/saml_sso/index.md) and [Group SCIM](../../user/group/saml_sso/scim_setup.md):
+
+- [Azure Active Directory](#azure-active-directory)
+- [OneLogin](#onelogin)
+
+CAUTION: **Caution:**
+These screenshots are updated only as needed by GitLab Support. They are **not** official documentation.
+
+If you are currently having an issue with GitLab, you may want to check your [support options](https://about.gitlab.com/support/).
+
+## Azure Active Directory
+
+Basic SAML app configuration:
+
+![Azure AD basic SAML](img/AzureAD-basic_SAML.png)
+
+User claims and attributes:
+
+![Azure AD user claims](img/AzureAD-claims.png)
+
+SCIM mapping:
+
+![Azure AD SCIM](img/AzureAD-scim_attribute_mapping.png)
+
+## OneLogin
+
+Application details:
+
+![OneLogin application details](img/OneLogin-app_details.png)
+
+Parameters:
+
+![OneLogin application details](img/OneLogin-parameters.png)
+
+Adding a user:
+
+![OneLogin user add](img/OneLogin-userAdd.png)
+
+SSO settings:
+
+![OneLogin SSO settings](img/OneLogin-SSOsettings.png)
diff --git a/doc/administration/troubleshooting/img/AzureAD-basic_SAML.png b/doc/administration/troubleshooting/img/AzureAD-basic_SAML.png
new file mode 100644
index 00000000000..be420b1a3de
--- /dev/null
+++ b/doc/administration/troubleshooting/img/AzureAD-basic_SAML.png
Binary files differ
diff --git a/doc/administration/troubleshooting/img/AzureAD-claims.png b/doc/administration/troubleshooting/img/AzureAD-claims.png
new file mode 100644
index 00000000000..ef594390ce0
--- /dev/null
+++ b/doc/administration/troubleshooting/img/AzureAD-claims.png
Binary files differ
diff --git a/doc/administration/troubleshooting/img/AzureAD-scim_attribute_mapping.png b/doc/administration/troubleshooting/img/AzureAD-scim_attribute_mapping.png
new file mode 100644
index 00000000000..933d8fb6f36
--- /dev/null
+++ b/doc/administration/troubleshooting/img/AzureAD-scim_attribute_mapping.png
Binary files differ
diff --git a/doc/administration/troubleshooting/img/OneLogin-SSOsettings.png b/doc/administration/troubleshooting/img/OneLogin-SSOsettings.png
new file mode 100644
index 00000000000..72737b9a017
--- /dev/null
+++ b/doc/administration/troubleshooting/img/OneLogin-SSOsettings.png
Binary files differ
diff --git a/doc/administration/troubleshooting/img/OneLogin-app_details.png b/doc/administration/troubleshooting/img/OneLogin-app_details.png
new file mode 100644
index 00000000000..3e36a001d1b
--- /dev/null
+++ b/doc/administration/troubleshooting/img/OneLogin-app_details.png
Binary files differ
diff --git a/doc/administration/troubleshooting/img/OneLogin-encryption.png b/doc/administration/troubleshooting/img/OneLogin-encryption.png
new file mode 100644
index 00000000000..a1b90873a5a
--- /dev/null
+++ b/doc/administration/troubleshooting/img/OneLogin-encryption.png
Binary files differ
diff --git a/doc/administration/troubleshooting/img/OneLogin-parameters.png b/doc/administration/troubleshooting/img/OneLogin-parameters.png
new file mode 100644
index 00000000000..c9ff4f8f018
--- /dev/null
+++ b/doc/administration/troubleshooting/img/OneLogin-parameters.png
Binary files differ
diff --git a/doc/administration/troubleshooting/img/OneLogin-userAdd.png b/doc/administration/troubleshooting/img/OneLogin-userAdd.png
new file mode 100644
index 00000000000..c7187fe5dd6
--- /dev/null
+++ b/doc/administration/troubleshooting/img/OneLogin-userAdd.png
Binary files differ
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index cd6ee05f873..6b1a0e4ffe6 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -172,6 +172,8 @@ job:
script: "bundle exec rspec"
```
+[YAML anchors for scripts](#yaml-anchors-for-script) are available.
+
This parameter can also contain several commands using an array:
```yaml
@@ -199,25 +201,6 @@ job:
- if [ $exit_code -ne 0 ]; then echo "Previous command failed"; fi;
```
-#### YAML anchors for `script`
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/23005) in GitLab 12.5.
-
-You can use [YAML anchors](#anchors) with scripts, which makes it possible to
-include a predefined list of commands in multiple jobs.
-
-For example:
-
-```yaml
-.something: &something
-- echo 'something'
-
-job_name:
- script:
- - *something
- - echo 'this is the script'
-```
-
### `image`
Used to specify [a Docker image](../docker/using_docker_images.md#what-is-an-image) to use for the job.
@@ -317,32 +300,7 @@ job:
- execute this after my script
```
-#### YAML anchors for `before_script` and `after_script`
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/23005) in GitLab 12.5.
-
-You can use [YAML anchors](#anchors) with `before_script` and `after_script`,
-which makes it possible to include a predefined list of commands in multiple
-jobs.
-
-Example:
-
-```yaml
-.something_before: &something_before
-- echo 'something before'
-
-.something_after: &something_after
-- echo 'something after'
-
-
-job_name:
- before_script:
- - *something_before
- script:
- - echo 'this is the script'
- after_script:
- - *something_after
-```
+[YAML anchors for `before_script` and `after_script`](#yaml-anchors-for-before_script-and-after_script) are available.
### `stages`
@@ -3378,30 +3336,9 @@ you can set in `.gitlab-ci.yml`, there are also the so called
[Variables](../variables/README.md#gitlab-cicd-environment-variables)
which can be set in GitLab's UI.
-Learn more about [variables and their priority][variables].
-
-#### YAML anchors for variables
-
-[YAML anchors](#anchors) can be used with `variables`, to easily repeat assignment
-of variables across multiple jobs. It can also enable more flexibility when a job
-requires a specific `variables` block that would otherwise override the global variables.
+[YAML anchors for variables](#yaml-anchors-for-variables) are available.
-In the example below, we will override the `GIT_STRATEGY` variable without affecting
-the use of the `SAMPLE_VARIABLE` variable:
-
-```yaml
-# global variables
-variables: &global-variables
- SAMPLE_VARIABLE: sample_variable_value
-
-# a job that needs to set the GIT_STRATEGY variable, yet depend on global variables
-job_no_git_strategy:
- stage: cleanup
- variables:
- <<: *global-variables
- GIT_STRATEGY: none
- script: echo $SAMPLE_VARIABLE
-```
+Learn more about [variables and their priority][variables].
#### Git strategy
@@ -3880,6 +3817,75 @@ NOTE: **Note:**
You can't use YAML anchors across multiple files when leveraging the [`include`](#include)
feature. Anchors are only valid within the file they were defined in.
+#### YAML anchors for `before_script` and `after_script`
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/23005) in GitLab 12.5.
+
+You can use [YAML anchors](#anchors) with `before_script` and `after_script`,
+which makes it possible to include a predefined list of commands in multiple
+jobs.
+
+Example:
+
+```yaml
+.something_before: &something_before
+- echo 'something before'
+
+.something_after: &something_after
+- echo 'something after'
+
+
+job_name:
+ before_script:
+ - *something_before
+ script:
+ - echo 'this is the script'
+ after_script:
+ - *something_after
+```
+
+#### YAML anchors for `script`
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/23005) in GitLab 12.5.
+
+You can use [YAML anchors](#anchors) with scripts, which makes it possible to
+include a predefined list of commands in multiple jobs.
+
+For example:
+
+```yaml
+.something: &something
+- echo 'something'
+
+job_name:
+ script:
+ - *something
+ - echo 'this is the script'
+```
+
+#### YAML anchors for variables
+
+[YAML anchors](#anchors) can be used with `variables`, to easily repeat assignment
+of variables across multiple jobs. It can also enable more flexibility when a job
+requires a specific `variables` block that would otherwise override the global variables.
+
+In the example below, we will override the `GIT_STRATEGY` variable without affecting
+the use of the `SAMPLE_VARIABLE` variable:
+
+```yaml
+# global variables
+variables: &global-variables
+ SAMPLE_VARIABLE: sample_variable_value
+
+# a job that needs to set the GIT_STRATEGY variable, yet depend on global variables
+job_no_git_strategy:
+ stage: cleanup
+ variables:
+ <<: *global-variables
+ GIT_STRATEGY: none
+ script: echo $SAMPLE_VARIABLE
+```
+
## Triggers
Triggers can be used to force a rebuild of a specific branch, tag or commit,
diff --git a/doc/topics/autodevops/index.md b/doc/topics/autodevops/index.md
index 1c8162a49e7..4268e386425 100644
--- a/doc/topics/autodevops/index.md
+++ b/doc/topics/autodevops/index.md
@@ -171,6 +171,16 @@ To make full use of Auto DevOps, you will need:
To get response metrics (in addition to system metrics), you need to
[configure Prometheus to monitor NGINX](../../user/project/integrations/prometheus_library/nginx_ingress.md#configuring-nginx-ingress-monitoring).
+- **cert-manager** (optional, for TLS/HTTPS)
+
+ To enable HTTPS endpoints for your application, you need to install cert-manager,
+ a native Kubernetes certificate management controller that helps with issuing certificates.
+ Installing cert-manager on your cluster will issue a certificate by
+ [Let’s Encrypt](https://letsencrypt.org/) and ensure that certificates are valid and up-to-date.
+ If you have configured GitLab's Kubernetes integration, you can deploy it to
+ your cluster by installing the
+ [GitLab-managed app for cert-manager](../../user/clusters/applications.md#cert-manager).
+
If you do not have Kubernetes or Prometheus installed, then Auto Review Apps,
Auto Deploy, and Auto Monitoring will be silently skipped.
diff --git a/doc/user/analytics/cycle_analytics.md b/doc/user/analytics/cycle_analytics.md
index 8d3eaade759..04897f0fc8a 100644
--- a/doc/user/analytics/cycle_analytics.md
+++ b/doc/user/analytics/cycle_analytics.md
@@ -183,7 +183,7 @@ Feature.disable(:cycle_analytics_scatterplot_enabled)
### Disabling chart median line
-This chart median line is enabled by default. If you have a self-managed instance, an
+This chart's median line is enabled by default. If you have a self-managed instance, an
administrator can open a Rails console and disable it with the following command:
```ruby
diff --git a/doc/user/group/saml_sso/index.md b/doc/user/group/saml_sso/index.md
index e0028e7124d..99749ccf2ae 100644
--- a/doc/user/group/saml_sso/index.md
+++ b/doc/user/group/saml_sso/index.md
@@ -265,6 +265,10 @@ Specific attention should be paid to:
- The presence of a `X509Certificate`, which we require to verify the response signature.
- The `SubjectConfirmation` and `Conditions`, which can cause errors if misconfigured.
+### Verifying configuration
+
+For convenience, we've included some [example resources](../../../administration/troubleshooting/group_saml_scim.md) used by our Support Team. While they may help you verify the SAML app configuration, they are not guaranteed to reflect the current state of third-party products.
+
### Verifying NameID
In troubleshooting the Group SAML setup, any authenticated user can use the API to verify the NameID GitLab already has linked to the user by visiting [https://gitlab.com/api/v4/user](https://gitlab.com/api/v4/user) and checking the `extern_uid` under identities.
diff --git a/doc/user/profile/img/notification_group_settings.png b/doc/user/profile/img/notification_group_settings.png
deleted file mode 100644
index ed5e9459216..00000000000
--- a/doc/user/profile/img/notification_group_settings.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/profile/img/notification_group_settings_v12_8.png b/doc/user/profile/img/notification_group_settings_v12_8.png
new file mode 100644
index 00000000000..4aa4c32a260
--- /dev/null
+++ b/doc/user/profile/img/notification_group_settings_v12_8.png
Binary files differ
diff --git a/doc/user/profile/img/notification_project_settings.png b/doc/user/profile/img/notification_project_settings.png
deleted file mode 100644
index e2db2037d94..00000000000
--- a/doc/user/profile/img/notification_project_settings.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/profile/img/notification_project_settings_v12_8.png b/doc/user/profile/img/notification_project_settings_v12_8.png
new file mode 100644
index 00000000000..9b8837a4ef4
--- /dev/null
+++ b/doc/user/profile/img/notification_project_settings_v12_8.png
Binary files differ
diff --git a/doc/user/profile/notifications.md b/doc/user/profile/notifications.md
index 42ed3fb36a2..d3444b9aa13 100644
--- a/doc/user/profile/notifications.md
+++ b/doc/user/profile/notifications.md
@@ -68,7 +68,7 @@ Notification scope is applied in order of precedence (highest to lowest):
You can select a notification level for each project. This can be useful if you need to closely monitor activity in select projects.
-![notification settings](img/notification_project_settings.png)
+![notification settings](img/notification_project_settings_v12_8.png)
To select a notification level for a project, use either of these methods:
@@ -87,7 +87,7 @@ Or:
You can select a notification level and email address for each group.
-![notification settings](img/notification_group_settings.png)
+![notification settings](img/notification_group_settings_v12_8.png)
##### Group notification level
diff --git a/doc/user/project/import/github.md b/doc/user/project/import/github.md
index b8e774c57a1..175110cd535 100644
--- a/doc/user/project/import/github.md
+++ b/doc/user/project/import/github.md
@@ -42,7 +42,7 @@ assignees in the database of the GitLab instance (note that pull requests are ca
For this association to succeed, prior to the import, each GitHub author and assignee in the repository must
have either previously logged in to a GitLab account using the GitHub icon **or** have a GitHub account with
-a [public email address](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address) that
+a [primary email address](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address) that
matches their GitLab account's email address.
If a user referenced in the project is not found in GitLab's database, the project creator (typically the user
diff --git a/lib/quality/test_level.rb b/lib/quality/test_level.rb
index 84470a73b1b..022b42e489d 100644
--- a/lib/quality/test_level.rb
+++ b/lib/quality/test_level.rb
@@ -27,6 +27,7 @@ module Quality
policies
presenters
rack_servers
+ replicators
routing
rubocop
serializers
diff --git a/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb
index bbe0770444a..17ede14db37 100644
--- a/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb
+++ b/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb
@@ -8,8 +8,8 @@ module QA
end
let(:project) do
- Resource::Project.fabricate_via_api! do |resource|
- resource.name = 'email-notification-test'
+ Resource::Project.fabricate_via_api! do |project|
+ project.name = 'email-notification-test'
end
end
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb
index 381606e1648..6c7f80705e2 100644
--- a/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb
+++ b/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb
@@ -21,8 +21,8 @@ module QA
Flow::Login.sign_in
- project = Resource::Project.fabricate_via_api! do |resource|
- resource.name = 'xss-test-for-mentions-project'
+ project = Resource::Project.fabricate_via_api! do |project|
+ project.name = 'xss-test-for-mentions-project'
end
Flow::Project.add_member(project: project, username: user.username)
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/mentions_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/mentions_spec.rb
index 8760f5cac04..a76cb57b4a7 100644
--- a/qa/qa/specs/features/browser_ui/2_plan/issue/mentions_spec.rb
+++ b/qa/qa/specs/features/browser_ui/2_plan/issue/mentions_spec.rb
@@ -8,9 +8,9 @@ module QA
@user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
- project = Resource::Project.fabricate_via_api! do |resource|
- resource.name = 'project-to-test-mention'
- resource.visibility = 'private'
+ project = Resource::Project.fabricate_via_api! do |project|
+ project.name = 'project-to-test-mention'
+ project.visibility = 'private'
end
project.add_member(@user)
diff --git a/spec/controllers/profiles/notifications_controller_spec.rb b/spec/controllers/profiles/notifications_controller_spec.rb
index ede68744ac6..ba85c781a93 100644
--- a/spec/controllers/profiles/notifications_controller_spec.rb
+++ b/spec/controllers/profiles/notifications_controller_spec.rb
@@ -24,7 +24,6 @@ describe Profiles::NotificationsController do
context 'with groups that do not have notification preferences' do
set(:group) { create(:group) }
set(:subgroup) { create(:group, parent: group) }
-
before do
group.add_developer(user)
end
diff --git a/spec/javascripts/diffs/components/diff_line_gutter_content_spec.js b/spec/frontend/diffs/components/diff_line_gutter_content_spec.js
index 8d20be9971d..e1c03983ab5 100644
--- a/spec/javascripts/diffs/components/diff_line_gutter_content_spec.js
+++ b/spec/frontend/diffs/components/diff_line_gutter_content_spec.js
@@ -1,5 +1,5 @@
import Vue from 'vue';
-import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
+import { createComponentWithStore } from 'helpers/vue_mount_component_helper';
import DiffLineGutterContent from '~/diffs/components/diff_line_gutter_content.vue';
import { createStore } from '~/mr_notes/stores';
import discussionsMockData from '../mock_data/diff_discussions';
diff --git a/spec/frontend/diffs/mock_data/diff_file.js b/spec/frontend/diffs/mock_data/diff_file.js
new file mode 100644
index 00000000000..27428197c1c
--- /dev/null
+++ b/spec/frontend/diffs/mock_data/diff_file.js
@@ -0,0 +1,244 @@
+export default {
+ submodule: false,
+ submodule_link: null,
+ blob: {
+ id: '9e10516ca50788acf18c518a231914a21e5f16f7',
+ path: 'CHANGELOG',
+ name: 'CHANGELOG',
+ mode: '100644',
+ readable_text: true,
+ icon: 'file-text-o',
+ },
+ blob_path: 'CHANGELOG',
+ blob_name: 'CHANGELOG',
+ blob_icon: '<i aria-hidden="true" data-hidden="true" class="fa fa-file-text-o fa-fw"></i>',
+ file_hash: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a',
+ file_path: 'CHANGELOG',
+ new_file: false,
+ deleted_file: false,
+ renamed_file: false,
+ old_path: 'CHANGELOG',
+ new_path: 'CHANGELOG',
+ mode_changed: false,
+ a_mode: '100644',
+ b_mode: '100644',
+ text: true,
+ viewer: {
+ name: 'text',
+ error: null,
+ collapsed: false,
+ },
+ added_lines: 2,
+ removed_lines: 0,
+ diff_refs: {
+ base_sha: 'e63f41fe459e62e1228fcef60d7189127aeba95a',
+ start_sha: 'd9eaefe5a676b820c57ff18cf5b68316025f7962',
+ head_sha: 'c48ee0d1bf3b30453f5b32250ce03134beaa6d13',
+ },
+ content_sha: 'c48ee0d1bf3b30453f5b32250ce03134beaa6d13',
+ stored_externally: null,
+ external_storage: null,
+ old_path_html: 'CHANGELOG',
+ new_path_html: 'CHANGELOG',
+ edit_path: '/gitlab-org/gitlab-test/edit/spooky-stuff/CHANGELOG',
+ view_path: '/gitlab-org/gitlab-test/blob/spooky-stuff/CHANGELOG',
+ replaced_view_path: null,
+ collapsed: false,
+ renderIt: false,
+ too_large: false,
+ context_lines_path:
+ '/gitlab-org/gitlab-test/blob/c48ee0d1bf3b30453f5b32250ce03134beaa6d13/CHANGELOG/diff',
+ highlighted_diff_lines: [
+ {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_1',
+ type: 'new',
+ old_line: null,
+ new_line: 1,
+ discussions: [],
+ text: '+<span id="LC1" class="line" lang="plaintext"> - Bad dates</span>\n',
+ rich_text: '+<span id="LC1" class="line" lang="plaintext"> - Bad dates</span>\n',
+ meta_data: null,
+ },
+ {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_2',
+ type: 'new',
+ old_line: null,
+ new_line: 2,
+ discussions: [],
+ text: '+<span id="LC2" class="line" lang="plaintext"></span>\n',
+ rich_text: '+<span id="LC2" class="line" lang="plaintext"></span>\n',
+ meta_data: null,
+ },
+ {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_3',
+ type: null,
+ old_line: 1,
+ new_line: 3,
+ discussions: [],
+ text: ' <span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
+ rich_text: ' <span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
+ meta_data: null,
+ },
+ {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_2_4',
+ type: null,
+ old_line: 2,
+ new_line: 4,
+ discussions: [],
+ text: ' <span id="LC4" class="line" lang="plaintext"></span>\n',
+ rich_text: ' <span id="LC4" class="line" lang="plaintext"></span>\n',
+ meta_data: null,
+ },
+ {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_3_5',
+ type: null,
+ old_line: 3,
+ new_line: 5,
+ discussions: [],
+ text: ' <span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
+ rich_text: ' <span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
+ meta_data: null,
+ },
+ {
+ line_code: null,
+ type: 'match',
+ old_line: null,
+ new_line: null,
+ discussions: [],
+ text: '',
+ rich_text: '',
+ meta_data: {
+ old_pos: 3,
+ new_pos: 5,
+ },
+ },
+ ],
+ parallel_diff_lines: [
+ {
+ left: {
+ type: 'empty-cell',
+ },
+ right: {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_1',
+ type: 'new',
+ old_line: null,
+ new_line: 1,
+ discussions: [],
+ text: '+<span id="LC1" class="line" lang="plaintext"> - Bad dates</span>\n',
+ rich_text: '<span id="LC1" class="line" lang="plaintext"> - Bad dates</span>\n',
+ meta_data: null,
+ },
+ },
+ {
+ left: {
+ type: 'empty-cell',
+ },
+ right: {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_2',
+ type: 'new',
+ old_line: null,
+ new_line: 2,
+ discussions: [],
+ text: '+<span id="LC2" class="line" lang="plaintext"></span>\n',
+ rich_text: '<span id="LC2" class="line" lang="plaintext"></span>\n',
+ meta_data: null,
+ },
+ },
+ {
+ left: {
+ line_Code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_3',
+ type: null,
+ old_line: 1,
+ new_line: 3,
+ discussions: [],
+ text: ' <span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
+ rich_text: '<span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
+ meta_data: null,
+ },
+ right: {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_3',
+ type: null,
+ old_line: 1,
+ new_line: 3,
+ discussions: [],
+ text: ' <span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
+ rich_text: '<span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
+ meta_data: null,
+ },
+ },
+ {
+ left: {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_2_4',
+ type: null,
+ old_line: 2,
+ new_line: 4,
+ discussions: [],
+ text: ' <span id="LC4" class="line" lang="plaintext"></span>\n',
+ rich_text: '<span id="LC4" class="line" lang="plaintext"></span>\n',
+ meta_data: null,
+ },
+ right: {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_2_4',
+ type: null,
+ old_line: 2,
+ new_line: 4,
+ discussions: [],
+ text: ' <span id="LC4" class="line" lang="plaintext"></span>\n',
+ rich_text: '<span id="LC4" class="line" lang="plaintext"></span>\n',
+ meta_data: null,
+ },
+ },
+ {
+ left: {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_3_5',
+ type: null,
+ old_line: 3,
+ new_line: 5,
+ discussions: [],
+ text: ' <span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
+ rich_text: '<span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
+ meta_data: null,
+ },
+ right: {
+ line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_3_5',
+ type: null,
+ old_line: 3,
+ new_line: 5,
+ discussions: [],
+ text: ' <span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
+ rich_text: '<span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
+ meta_data: null,
+ },
+ },
+ {
+ left: {
+ line_code: null,
+ type: 'match',
+ old_line: null,
+ new_line: null,
+ discussions: [],
+ text: '',
+ rich_text: '',
+ meta_data: {
+ old_pos: 3,
+ new_pos: 5,
+ },
+ },
+ right: {
+ line_code: null,
+ type: 'match',
+ old_line: null,
+ new_line: null,
+ discussions: [],
+ text: '',
+ rich_text: '',
+ meta_data: {
+ old_pos: 3,
+ new_pos: 5,
+ },
+ },
+ },
+ ],
+ discussions: [],
+ renderingLines: false,
+};
diff --git a/spec/javascripts/diffs/mock_data/diff_file.js b/spec/javascripts/diffs/mock_data/diff_file.js
index 531686efff1..9dc365b7403 100644
--- a/spec/javascripts/diffs/mock_data/diff_file.js
+++ b/spec/javascripts/diffs/mock_data/diff_file.js
@@ -1,246 +1,5 @@
-// Copied to ee/spec/frontend/diffs/mock_data/diff_file.js
+// No new code should be added to this file. Instead, modify the
+// file this one re-exports from. For more detail about why, see:
+// https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/31349
-export default {
- submodule: false,
- submodule_link: null,
- blob: {
- id: '9e10516ca50788acf18c518a231914a21e5f16f7',
- path: 'CHANGELOG',
- name: 'CHANGELOG',
- mode: '100644',
- readable_text: true,
- icon: 'file-text-o',
- },
- blob_path: 'CHANGELOG',
- blob_name: 'CHANGELOG',
- blob_icon: '<i aria-hidden="true" data-hidden="true" class="fa fa-file-text-o fa-fw"></i>',
- file_hash: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a',
- file_path: 'CHANGELOG',
- new_file: false,
- deleted_file: false,
- renamed_file: false,
- old_path: 'CHANGELOG',
- new_path: 'CHANGELOG',
- mode_changed: false,
- a_mode: '100644',
- b_mode: '100644',
- text: true,
- viewer: {
- name: 'text',
- error: null,
- collapsed: false,
- },
- added_lines: 2,
- removed_lines: 0,
- diff_refs: {
- base_sha: 'e63f41fe459e62e1228fcef60d7189127aeba95a',
- start_sha: 'd9eaefe5a676b820c57ff18cf5b68316025f7962',
- head_sha: 'c48ee0d1bf3b30453f5b32250ce03134beaa6d13',
- },
- content_sha: 'c48ee0d1bf3b30453f5b32250ce03134beaa6d13',
- stored_externally: null,
- external_storage: null,
- old_path_html: 'CHANGELOG',
- new_path_html: 'CHANGELOG',
- edit_path: '/gitlab-org/gitlab-test/edit/spooky-stuff/CHANGELOG',
- view_path: '/gitlab-org/gitlab-test/blob/spooky-stuff/CHANGELOG',
- replaced_view_path: null,
- collapsed: false,
- renderIt: false,
- too_large: false,
- context_lines_path:
- '/gitlab-org/gitlab-test/blob/c48ee0d1bf3b30453f5b32250ce03134beaa6d13/CHANGELOG/diff',
- highlighted_diff_lines: [
- {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_1',
- type: 'new',
- old_line: null,
- new_line: 1,
- discussions: [],
- text: '+<span id="LC1" class="line" lang="plaintext"> - Bad dates</span>\n',
- rich_text: '+<span id="LC1" class="line" lang="plaintext"> - Bad dates</span>\n',
- meta_data: null,
- },
- {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_2',
- type: 'new',
- old_line: null,
- new_line: 2,
- discussions: [],
- text: '+<span id="LC2" class="line" lang="plaintext"></span>\n',
- rich_text: '+<span id="LC2" class="line" lang="plaintext"></span>\n',
- meta_data: null,
- },
- {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_3',
- type: null,
- old_line: 1,
- new_line: 3,
- discussions: [],
- text: ' <span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
- rich_text: ' <span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
- meta_data: null,
- },
- {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_2_4',
- type: null,
- old_line: 2,
- new_line: 4,
- discussions: [],
- text: ' <span id="LC4" class="line" lang="plaintext"></span>\n',
- rich_text: ' <span id="LC4" class="line" lang="plaintext"></span>\n',
- meta_data: null,
- },
- {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_3_5',
- type: null,
- old_line: 3,
- new_line: 5,
- discussions: [],
- text: ' <span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
- rich_text: ' <span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
- meta_data: null,
- },
- {
- line_code: null,
- type: 'match',
- old_line: null,
- new_line: null,
- discussions: [],
- text: '',
- rich_text: '',
- meta_data: {
- old_pos: 3,
- new_pos: 5,
- },
- },
- ],
- parallel_diff_lines: [
- {
- left: {
- type: 'empty-cell',
- },
- right: {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_1',
- type: 'new',
- old_line: null,
- new_line: 1,
- discussions: [],
- text: '+<span id="LC1" class="line" lang="plaintext"> - Bad dates</span>\n',
- rich_text: '<span id="LC1" class="line" lang="plaintext"> - Bad dates</span>\n',
- meta_data: null,
- },
- },
- {
- left: {
- type: 'empty-cell',
- },
- right: {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_2',
- type: 'new',
- old_line: null,
- new_line: 2,
- discussions: [],
- text: '+<span id="LC2" class="line" lang="plaintext"></span>\n',
- rich_text: '<span id="LC2" class="line" lang="plaintext"></span>\n',
- meta_data: null,
- },
- },
- {
- left: {
- line_Code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_3',
- type: null,
- old_line: 1,
- new_line: 3,
- discussions: [],
- text: ' <span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
- rich_text: '<span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
- meta_data: null,
- },
- right: {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_3',
- type: null,
- old_line: 1,
- new_line: 3,
- discussions: [],
- text: ' <span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
- rich_text: '<span id="LC3" class="line" lang="plaintext">v6.8.0</span>\n',
- meta_data: null,
- },
- },
- {
- left: {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_2_4',
- type: null,
- old_line: 2,
- new_line: 4,
- discussions: [],
- text: ' <span id="LC4" class="line" lang="plaintext"></span>\n',
- rich_text: '<span id="LC4" class="line" lang="plaintext"></span>\n',
- meta_data: null,
- },
- right: {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_2_4',
- type: null,
- old_line: 2,
- new_line: 4,
- discussions: [],
- text: ' <span id="LC4" class="line" lang="plaintext"></span>\n',
- rich_text: '<span id="LC4" class="line" lang="plaintext"></span>\n',
- meta_data: null,
- },
- },
- {
- left: {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_3_5',
- type: null,
- old_line: 3,
- new_line: 5,
- discussions: [],
- text: ' <span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
- rich_text: '<span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
- meta_data: null,
- },
- right: {
- line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_3_5',
- type: null,
- old_line: 3,
- new_line: 5,
- discussions: [],
- text: ' <span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
- rich_text: '<span id="LC5" class="line" lang="plaintext">v6.7.0</span>\n',
- meta_data: null,
- },
- },
- {
- left: {
- line_code: null,
- type: 'match',
- old_line: null,
- new_line: null,
- discussions: [],
- text: '',
- rich_text: '',
- meta_data: {
- old_pos: 3,
- new_pos: 5,
- },
- },
- right: {
- line_code: null,
- type: 'match',
- old_line: null,
- new_line: null,
- discussions: [],
- text: '',
- rich_text: '',
- meta_data: {
- old_pos: 3,
- new_pos: 5,
- },
- },
- },
- ],
- discussions: [],
- renderingLines: false,
-};
+export { default } from '../../../frontend/diffs/mock_data/diff_file';
diff --git a/spec/lib/quality/test_level_spec.rb b/spec/lib/quality/test_level_spec.rb
index 13817bdcc72..621a426a18d 100644
--- a/spec/lib/quality/test_level_spec.rb
+++ b/spec/lib/quality/test_level_spec.rb
@@ -21,7 +21,7 @@ RSpec.describe Quality::TestLevel do
context 'when level is unit' do
it 'returns a pattern' do
expect(subject.pattern(:unit))
- .to eq("spec/{bin,config,db,dependencies,factories,finders,frontend,graphql,haml_lint,helpers,initializers,javascripts,lib,models,policies,presenters,rack_servers,routing,rubocop,serializers,services,sidekiq,tasks,uploaders,validators,views,workers,elastic_integration}{,/**/}*_spec.rb")
+ .to eq("spec/{bin,config,db,dependencies,factories,finders,frontend,graphql,haml_lint,helpers,initializers,javascripts,lib,models,policies,presenters,rack_servers,replicators,routing,rubocop,serializers,services,sidekiq,tasks,uploaders,validators,views,workers,elastic_integration}{,/**/}*_spec.rb")
end
end
@@ -82,7 +82,7 @@ RSpec.describe Quality::TestLevel do
context 'when level is unit' do
it 'returns a regexp' do
expect(subject.regexp(:unit))
- .to eq(%r{spec/(bin|config|db|dependencies|factories|finders|frontend|graphql|haml_lint|helpers|initializers|javascripts|lib|models|policies|presenters|rack_servers|routing|rubocop|serializers|services|sidekiq|tasks|uploaders|validators|views|workers|elastic_integration)})
+ .to eq(%r{spec/(bin|config|db|dependencies|factories|finders|frontend|graphql|haml_lint|helpers|initializers|javascripts|lib|models|policies|presenters|rack_servers|replicators|routing|rubocop|serializers|services|sidekiq|tasks|uploaders|validators|views|workers|elastic_integration)})
end
end
diff --git a/spec/requests/profiles/notifications_controller_spec.rb b/spec/requests/profiles/notifications_controller_spec.rb
new file mode 100644
index 00000000000..41349d6c12d
--- /dev/null
+++ b/spec/requests/profiles/notifications_controller_spec.rb
@@ -0,0 +1,42 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe 'view user notifications' do
+ let(:user) do
+ create(:user) do |user|
+ user.emails.create(email: 'original@example.com')
+ user.emails.create(email: 'new@example.com')
+ user.notification_email = 'original@example.com'
+ user.save!
+ end
+ end
+
+ before do
+ login_as(user)
+
+ create_list(:group, 2) do |group|
+ group.add_developer(user)
+ end
+ end
+
+ def get_profile_notifications
+ get profile_notifications_path
+ end
+
+ describe 'GET /profile/notifications' do
+ it 'avoid N+1 due to an additional groups (with no parent group)' do
+ get_profile_notifications
+
+ control = ActiveRecord::QueryRecorder.new do
+ get_profile_notifications
+ end
+
+ create_list(:group, 2) { |group| group.add_developer(user) }
+
+ expect do
+ get_profile_notifications
+ end.not_to exceed_query_limit(control)
+ end
+ end
+end