diff options
85 files changed, 437 insertions, 480 deletions
diff --git a/.gitignore b/.gitignore index 881e08d5a14..5660c387f5c 100644 --- a/.gitignore +++ b/.gitignore @@ -81,7 +81,6 @@ eslint-report.html /test_results/ /deprecations/ /knapsack/ -/query_recorder/ /rspec_flaky/ /rspec/ /locale/**/LC_MESSAGES diff --git a/.gitlab/ci/qa.gitlab-ci.yml b/.gitlab/ci/qa.gitlab-ci.yml index b61c7bc90c9..9ece789eb2a 100644 --- a/.gitlab/ci/qa.gitlab-ci.yml +++ b/.gitlab/ci/qa.gitlab-ci.yml @@ -149,6 +149,28 @@ follow-up-e2e:package-and-test-ee: QA_RUN_TYPE: e2e-package-and-test PIPELINE_NAME: E2E Omnibus GitLab EE +e2e:post-run-e2e-message: + extends: + - .predictive-job + - .qa:rules:determine-e2e-tests + stage: qa + variables: + ENV_FILE: $CI_PROJECT_DIR/qa_tests_vars.env + image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION} + before_script: + - source scripts/utils.sh + - install_gitlab_gem + script: + - scripts/generate-message-to-run-e2e-pipeline.rb + needs: + - e2e-test-pipeline-generate + - trigger-omnibus-env + - build-assets-image + artifacts: + expire_in: 1 day + paths: + - "${CI_PROJECT_DIR}/qa_tests_vars.env" + e2e:package-and-test-ce: extends: - e2e:package-and-test-ee diff --git a/.gitlab/ci/rails/shared.gitlab-ci.yml b/.gitlab/ci/rails/shared.gitlab-ci.yml index 8586723a26e..19eacd8c54c 100644 --- a/.gitlab/ci/rails/shared.gitlab-ci.yml +++ b/.gitlab/ci/rails/shared.gitlab-ci.yml @@ -101,7 +101,6 @@ include: - crystalball/ - deprecations/ - knapsack/ - - query_recorder/ - rspec/ - tmp/capybara/ - log/*.log diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml index 196a1eb341f..b652ac5e30b 100644 --- a/.gitlab/ci/setup.gitlab-ci.yml +++ b/.gitlab/ci/setup.gitlab-ci.yml @@ -167,9 +167,6 @@ e2e-test-pipeline-generate: script: - bundle exec rake "ci:detect_changes[$ENV_FILE]" - cd $CI_PROJECT_DIR && scripts/generate-e2e-pipeline - - source scripts/utils.sh - - install_gitlab_gem - - scripts/generate-message-to-run-e2e-pipeline.rb artifacts: expire_in: 1 day paths: diff --git a/app/assets/javascripts/admin/users/components/actions/ban.vue b/app/assets/javascripts/admin/users/components/actions/ban.vue index 36dcde619cf..98c964d3f1e 100644 --- a/app/assets/javascripts/admin/users/components/actions/ban.vue +++ b/app/assets/javascripts/admin/users/components/actions/ban.vue @@ -19,7 +19,7 @@ const messageHtml = ` <p>${sprintf( s__('AdminUsers|Learn more about %{link_start}banned users.%{link_end}'), { - link_start: `<a href="${helpPagePath('user/admin_area/moderate_users', { + link_start: `<a href="${helpPagePath('administration/moderate_users', { anchor: 'ban-a-user', })}" target="_blank">`, link_end: '</a>', diff --git a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue index ff9781385cd..b6ebcabd33c 100644 --- a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue +++ b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue @@ -277,7 +277,7 @@ export default { requestAccessEnabled: true, enforceAuthChecksOnUploads: true, highlightChangesClass: false, - emailsDisabled: false, + emailsEnabled: true, cveIdRequestEnabled: true, featureAccessLevelEveryone, featureAccessLevelMembers, @@ -1001,14 +1001,19 @@ export default { :full-path="confirmationPhrase" /> <project-setting-row v-if="canDisableEmails" ref="email-settings" class="mb-3"> - <label class="js-emails-disabled"> - <input :value="emailsDisabled" type="hidden" name="project[emails_disabled]" /> - <input v-model="emailsDisabled" type="checkbox" /> - {{ s__('ProjectSettings|Disable email notifications') }} + <label class="js-emails-enabled"> + <input + :value="emailsEnabled" + type="hidden" + name="project[project_setting_attributes][emails_enabled]" + /> + <gl-form-checkbox v-model="emailsEnabled"> + {{ s__('ProjectSettings|Enable email notifications') }} + <template #help>{{ + s__('ProjectSettings|Enable sending email notifications for this project') + }}</template> + </gl-form-checkbox> </label> - <span class="form-text text-muted">{{ - s__('ProjectSettings|Override user notification preferences for all project members.') - }}</span> </project-setting-row> <project-setting-row class="mb-3"> <input diff --git a/app/assets/javascripts/projects/settings/topics/components/topics_token_selector.vue b/app/assets/javascripts/projects/settings/topics/components/topics_token_selector.vue index 47477d39b8a..2f980e20c1e 100644 --- a/app/assets/javascripts/projects/settings/topics/components/topics_token_selector.vue +++ b/app/assets/javascripts/projects/settings/topics/components/topics_token_selector.vue @@ -60,7 +60,7 @@ export default { return this.selectedTokens.length ? '' : this.$options.i18n.placeholder; }, topicsHelpUrl() { - return helpPagePath('user/admin_area/index.html', { + return helpPagePath('administration/index', { anchor: 'administering-topics', }); }, diff --git a/app/controllers/profiles/notifications_controller.rb b/app/controllers/profiles/notifications_controller.rb index 1477f8e0aac..02f7dbf8e6f 100644 --- a/app/controllers/profiles/notifications_controller.rb +++ b/app/controllers/profiles/notifications_controller.rb @@ -45,7 +45,7 @@ class Profiles::NotificationsController < Profiles::ApplicationController projects = project_notifications.map(&:source) ActiveRecord::Associations::Preloader.new( records: projects, - associations: { namespace: [:route, :owner], group: [], creator: [] } + associations: { namespace: [:route, :owner], group: [], creator: [], project_setting: [] } ).call Preloaders::UserMaxAccessLevelInProjectsPreloader.new(projects, current_user).execute diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 51f6158d9c0..eb8b16d4e24 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -471,6 +471,7 @@ class ProjectsController < Projects::ApplicationController mr_default_target_self warn_about_potentially_unwanted_characters enforce_auth_checks_on_uploads + emails_enabled ] end @@ -483,7 +484,6 @@ class ProjectsController < Projects::ApplicationController :resolve_outdated_diff_discussions, :container_registry_enabled, :description, - :emails_disabled, :external_authorization_classification_label, :import_url, :issues_tracker, diff --git a/app/graphql/types/issue_type.rb b/app/graphql/types/issue_type.rb index 7b533a2b46e..4b7118d75a5 100644 --- a/app/graphql/types/issue_type.rb +++ b/app/graphql/types/issue_type.rb @@ -92,7 +92,13 @@ module Types field :emails_disabled, GraphQL::Types::Boolean, null: false, method: :project_emails_disabled?, - description: 'Indicates if a project has email notifications disabled: `true` if email notifications are disabled.' + description: 'Indicates if a project has email notifications disabled: `true` if email notifications are disabled.', + deprecated: { reason: 'Use `emails_enabled`', milestone: '16.3' } + + field :emails_enabled, GraphQL::Types::Boolean, null: false, + method: :project_emails_enabled?, + description: 'Indicates if a project has email notifications disabled: `false` if email notifications are disabled.' + field :human_time_estimate, GraphQL::Types::String, null: true, description: 'Human-readable time estimate of the issue.' field :human_total_time_spent, GraphQL::Types::String, null: true, diff --git a/app/helpers/integrations_helper.rb b/app/helpers/integrations_helper.rb index 4b5fadf3397..4026d6261c9 100644 --- a/app/helpers/integrations_helper.rb +++ b/app/helpers/integrations_helper.rb @@ -162,7 +162,7 @@ module IntegrationsHelper end def integrations_help_page_path - help_page_path('user/admin_area/settings/project_integration_management') + help_page_path('administration/settings/project_integration_management') end def project_jira_issues_integration? diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index e27ee1acb22..5bc64555f77 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -719,7 +719,7 @@ module ProjectsHelper analyticsAccessLevel: feature.analytics_access_level, containerRegistryEnabled: !!project.container_registry_enabled, lfsEnabled: !!project.lfs_enabled, - emailsDisabled: project.emails_disabled?, + emailsEnabled: project.emails_enabled?, monitorAccessLevel: feature.monitor_access_level, showDefaultAwardEmojis: project.show_default_award_emojis?, warnAboutPotentiallyUnwantedCharacters: project.warn_about_potentially_unwanted_characters?, diff --git a/app/models/project.rb b/app/models/project.rb index 8c5bb34d3f2..86121c99538 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -43,6 +43,9 @@ class Project < ApplicationRecord include Subquery include IssueParent include UpdatedAtFilterable + include IgnorableColumns + + ignore_column :emails_disabled, remove_with: '16.3', remove_after: '2023-08-22' extend Gitlab::Cache::RequestCache extend Gitlab::Utils::Override @@ -125,7 +128,6 @@ class Project < ApplicationRecord before_validation :remove_leading_spaces_on_name after_validation :check_pending_delete before_save :ensure_runners_token - before_save :update_new_emails_created_column, if: -> { emails_disabled_changed? } after_create -> { create_or_load_association(:project_feature) } after_create -> { create_or_load_association(:ci_cd_settings) } @@ -521,6 +523,7 @@ class Project < ApplicationRecord delegate :has_shimo? delegate :show_diff_preview_in_email, :show_diff_preview_in_email=, :show_diff_preview_in_email? delegate :runner_registration_enabled, :runner_registration_enabled=, :runner_registration_enabled? + delegate :emails_enabled, :emails_enabled=, :emails_enabled? delegate :squash_always?, :squash_never?, :squash_enabled_by_default?, :squash_readonly? delegate :mr_default_target_self, :mr_default_target_self= delegate :previous_default_branch, :previous_default_branch= @@ -1211,14 +1214,8 @@ class Project < ApplicationRecord end def emails_disabled? - strong_memoize(:emails_disabled) do - # disabling in the namespace overrides the project setting - super || namespace.emails_disabled? - end - end - - def emails_enabled? - !emails_disabled? + # disabling in the namespace overrides the project setting + !emails_enabled? end override :lfs_enabled? @@ -3510,17 +3507,6 @@ class Project < ApplicationRecord end end - def update_new_emails_created_column - return if project_setting.nil? - return if project_setting.emails_enabled == !emails_disabled - - if project_setting.persisted? - project_setting.update!(emails_enabled: !emails_disabled) - elsif project_setting - project_setting.emails_enabled = !emails_disabled - end - end - def runners_token_prefix RunnersTokenPrefixable::RUNNERS_TOKEN_PREFIX end diff --git a/app/models/project_setting.rb b/app/models/project_setting.rb index 7ca74d4e970..e8573d5c874 100644 --- a/app/models/project_setting.rb +++ b/app/models/project_setting.rb @@ -97,6 +97,11 @@ class ProjectSetting < ApplicationRecord Gitlab::CurrentSettings.valid_runner_registrars.include?('project') && read_attribute(:runner_registration_enabled) end + def emails_enabled? + super && project.namespace.emails_enabled? + end + strong_memoize_attr :emails_enabled? + private def validates_mr_default_target_self diff --git a/app/presenters/issue_presenter.rb b/app/presenters/issue_presenter.rb index 69d775d8125..42ecbc9988e 100644 --- a/app/presenters/issue_presenter.rb +++ b/app/presenters/issue_presenter.rb @@ -16,6 +16,10 @@ class IssuePresenter < Gitlab::View::Presenter::Delegated issue.project.emails_disabled? end + def project_emails_enabled? + issue.project.emails_enabled? + end + delegator_override :service_desk_reply_to def service_desk_reply_to return unless super.present? diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index ceafebddfcf..648067e3452 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -345,8 +345,12 @@ class NotificationService def review_requested_of_merge_request(merge_request, current_user, reviewer) recipients = NotificationRecipients::BuildService.build_requested_review_recipients(merge_request, current_user, reviewer) + deliver_option = review_request_deliver_options(merge_request.project, reviewer) + recipients.each do |recipient| - mailer.request_review_merge_request_email(recipient.user.id, merge_request.id, current_user.id, recipient.reason).deliver_later + mailer + .request_review_merge_request_email(recipient.user.id, merge_request.id, current_user.id, recipient.reason) + .deliver_later(deliver_option) end end @@ -960,6 +964,11 @@ class NotificationService # Overridden in EE {} end + + def review_request_deliver_options(project, user) + # Overridden in EE + {} + end end NotificationService.prepend_mod_with('NotificationService') diff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rb index 7f25ab5883f..c470cedf0b8 100644 --- a/app/services/projects/update_service.rb +++ b/app/services/projects/update_service.rb @@ -119,7 +119,7 @@ module Projects end def remove_unallowed_params - params.delete(:emails_disabled) unless can?(current_user, :set_emails_disabled, project) + params.delete(:emails_enabled) unless can?(current_user, :set_emails_disabled, project) params.delete(:runner_registration_enabled) if Gitlab::CurrentSettings.valid_runner_registrars.exclude?('project') end diff --git a/app/views/admin/application_settings/_external_authorization_service_form.html.haml b/app/views/admin/application_settings/_external_authorization_service_form.html.haml index 1b62083849b..db569750a48 100644 --- a/app/views/admin/application_settings/_external_authorization_service_form.html.haml +++ b/app/views/admin/application_settings/_external_authorization_service_form.html.haml @@ -6,7 +6,7 @@ = expanded ? _('Collapse') : _('Expand') %p = s_('ExternalAuthorization|External classification policy authorization.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/external_authorization'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/external_authorization'), target: '_blank', rel: 'noopener noreferrer' .settings-content = gitlab_ui_form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-external-auth-settings'), html: { class: 'fieldset-form', id: 'external-auth-settings' } do |f| diff --git a/app/views/admin/application_settings/_floc.html.haml b/app/views/admin/application_settings/_floc.html.haml index cb8b2d3dfcd..1b22398e869 100644 --- a/app/views/admin/application_settings/_floc.html.haml +++ b/app/views/admin/application_settings/_floc.html.haml @@ -7,7 +7,7 @@ = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do = expanded ? _('Collapse') : _('Expand') %p - - floc_link_url = help_page_path('user/admin_area/settings/floc.md') + - floc_link_url = help_page_path('administration/settings/floc.md') - floc_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: floc_link_url } = html_escape(s_('FloC|Configure whether you want to participate in FLoC. %{floc_link_start}What is FLoC?%{floc_link_end}')) % { floc_link_start: floc_link_start, floc_link_end: '</a>'.html_safe } diff --git a/app/views/admin/application_settings/_gitlab_shell_operation_limits.html.haml b/app/views/admin/application_settings/_gitlab_shell_operation_limits.html.haml index 4bd44b922fa..3bfdbeef42b 100644 --- a/app/views/admin/application_settings/_gitlab_shell_operation_limits.html.haml +++ b/app/views/admin/application_settings/_gitlab_shell_operation_limits.html.haml @@ -6,7 +6,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = s_('ShellOperations|Limit the number of Git operations a user can perform per minute, per repository.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/rate_limits_on_git_ssh_operations.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/rate_limits_on_git_ssh_operations.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = gitlab_ui_form_for @application_setting, url: network_admin_application_settings_path(anchor: 'js-gitlab-shell-operation-limits-settings'), html: { class: 'fieldset-form' } do |f| = form_errors(@application_setting) diff --git a/app/views/admin/application_settings/_projects_api_limits.html.haml b/app/views/admin/application_settings/_projects_api_limits.html.haml index 4efab4d77a9..8d3e9ac5387 100644 --- a/app/views/admin/application_settings/_projects_api_limits.html.haml +++ b/app/views/admin/application_settings/_projects_api_limits.html.haml @@ -6,7 +6,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Set the per-IP address rate limit applicable to unauthenticated requests for getting a list of projects via the API.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/rate_limit_on_projects_api.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/rate_limit_on_projects_api.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = gitlab_ui_form_for @application_setting, url: network_admin_application_settings_path(anchor: 'js-projects-api-limits-settings'), html: { class: 'fieldset-form' } do |f| = form_errors(@application_setting) diff --git a/app/views/admin/application_settings/_usage.html.haml b/app/views/admin/application_settings/_usage.html.haml index 91cd6fe7ca0..0455394444c 100644 --- a/app/views/admin/application_settings/_usage.html.haml +++ b/app/views/admin/application_settings/_usage.html.haml @@ -36,7 +36,7 @@ label_options: { id: 'service_ping_features_label' } .form-text.gl-text-gray-500.gl-pl-6 %p.gl-mb-3= s_('AdminSettings|Registration Features include:') - - email_from_gitlab_path = help_page_path('user/admin_area/email_from_gitlab') + - email_from_gitlab_path = help_page_path('administration/email_from_gitlab') - repo_size_limit_path = help_page_path('administration/settings/account_and_limit_settings', anchor: 'repository-size-limit') - restrict_ip_path = help_page_path('user/group/access_and_permissions', anchor: 'restrict-group-access-by-ip-address') - email_from_gitlab_link = link_start % { url: email_from_gitlab_path } diff --git a/app/views/admin/application_settings/general.html.haml b/app/views/admin/application_settings/general.html.haml index 2d56e9dd0dd..2cd94bc8416 100644 --- a/app/views/admin/application_settings/general.html.haml +++ b/app/views/admin/application_settings/general.html.haml @@ -57,7 +57,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Set sign-in restrictions for all users.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/sign_in_restrictions.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/sign_in_restrictions.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'signin' @@ -69,7 +69,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Add a Terms of Service agreement and Privacy Policy for users of this GitLab instance.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/terms.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/terms.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'terms' diff --git a/app/views/admin/application_settings/network.html.haml b/app/views/admin/application_settings/network.html.haml index 3b9fb930fd7..a01064579e2 100644 --- a/app/views/admin/application_settings/network.html.haml +++ b/app/views/admin/application_settings/network.html.haml @@ -22,7 +22,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Set limits for web and API requests.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/user_and_ip_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/user_and_ip_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'ip_limits' @@ -34,7 +34,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Set rate limits for package registry API requests that supersede the general user and IP rate limits.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/package_registry_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/package_registry_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render partial: 'network_rate_limits', locals: { anchor: 'js-packages-limits-settings', setting_fragment: 'packages_api' } @@ -68,7 +68,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Configure specific limits for deprecated API requests that supersede the general user and IP rate limits.') - = link_to _('Which API requests are affected?'), help_page_path('user/admin_area/settings/deprecated_api_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Which API requests are affected?'), help_page_path('administration/settings/deprecated_api_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render partial: 'network_rate_limits', locals: { anchor: 'js-deprecated-limits-settings', setting_fragment: 'deprecated_api' } @@ -80,7 +80,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Configure specific limits for Git LFS requests that supersede the general user and IP rate limits.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/git_lfs_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/git_lfs_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'git_lfs_limits' @@ -108,7 +108,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Rate limit access to specified paths.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/protected_paths.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/protected_paths.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'protected_paths' @@ -121,7 +121,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Limit the number of issues and epics per minute a user can create through web and API requests.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/rate_limit_on_issues_creation.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/rate_limit_on_issues_creation.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'issue_limits' @@ -133,7 +133,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Set the per-user rate limit for notes created by web or API requests.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/rate_limit_on_notes_creation.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/rate_limit_on_notes_creation.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'note_limits' @@ -145,7 +145,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Set the per-user rate limit for getting a user by ID via the API.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/rate_limit_on_users_api.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/rate_limit_on_users_api.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'users_api_limits' @@ -159,7 +159,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Set per-user rate limits for imports and exports of projects and groups.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/import_export_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/import_export_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'import_export_limits' @@ -171,7 +171,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Limit the number of pipeline creation requests per minute. This limit includes pipelines created through the UI, the API, and by background processing.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/rate_limit_on_pipelines_creation.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/rate_limit_on_pipelines_creation.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'pipeline_limits' diff --git a/app/views/admin/application_settings/preferences.html.haml b/app/views/admin/application_settings/preferences.html.haml index ab59e05c10f..20170b1525b 100644 --- a/app/views/admin/application_settings/preferences.html.haml +++ b/app/views/admin/application_settings/preferences.html.haml @@ -33,7 +33,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Additional text for the sign-in and Help page.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/help_page.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/help_page.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'help_page' @@ -69,7 +69,7 @@ %p = _('Configure Gitaly timeouts.') %span - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/gitaly_timeouts.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/gitaly_timeouts.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'gitaly' @@ -93,7 +93,7 @@ %p = _('Limit the size of Sidekiq jobs stored in Redis.') %span - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/sidekiq_job_limits.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/settings/sidekiq_job_limits.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'sidekiq_job_limits' @@ -106,6 +106,6 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = s_('TerraformLimits|Limits for Terraform features') - = link_to s_('TerraformLimits|Learn more about Terraform limits.'), help_page_path('user/admin_area/settings/terraform_limits.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to s_('TerraformLimits|Learn more about Terraform limits.'), help_page_path('administration/settings/terraform_limits.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'terraform_limits' diff --git a/app/views/admin/application_settings/reporting.html.haml b/app/views/admin/application_settings/reporting.html.haml index 6ea2fb80505..d0582ef4a4c 100644 --- a/app/views/admin/application_settings/reporting.html.haml +++ b/app/views/admin/application_settings/reporting.html.haml @@ -25,7 +25,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Receive notification of abuse reports by email.') - = link_to _('Learn more.'), help_page_path('user/admin_area/review_abuse_reports.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/review_abuse_reports.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'abuse' diff --git a/app/views/admin/health_check/show.html.haml b/app/views/admin/health_check/show.html.haml index 662234bf56a..728c748d01a 100644 --- a/app/views/admin/health_check/show.html.haml +++ b/app/views/admin/health_check/show.html.haml @@ -12,7 +12,7 @@ = _("Reset health check access token") %p.light #{ _('Health information can be retrieved from the following endpoints. More information is available') } - = link_to s_('More information is available|here'), help_page_path('user/admin_area/monitoring/health_check') + = link_to s_('More information is available|here'), help_page_path('administration/monitoring/health_check') %ul %li %code= readiness_url(token: Gitlab::CurrentSettings.health_check_access_token) diff --git a/app/views/notify/request_review_merge_request_email.html.haml b/app/views/notify/request_review_merge_request_email.html.haml index a8c7df79ff3..d5f5d155f3d 100644 --- a/app/views/notify/request_review_merge_request_email.html.haml +++ b/app/views/notify/request_review_merge_request_email.html.haml @@ -1,2 +1,3 @@ %p = html_escape(s_('Notify|%{name} requested a new review on %{mr_link}.')) % {name: sanitize_name(@updated_by.name), mr_link: merge_request_reference_link(@merge_request).html_safe} + = render_if_exists 'notify/diff_summary' diff --git a/app/views/notify/request_review_merge_request_email.text.erb b/app/views/notify/request_review_merge_request_email.text.erb index 9ab15332c51..dc1746d3a8c 100644 --- a/app/views/notify/request_review_merge_request_email.text.erb +++ b/app/views/notify/request_review_merge_request_email.text.erb @@ -1 +1,2 @@ <%= sanitize_name(@updated_by.name) %> requested a new review on <%= merge_request_reference_link(@merge_request) %>. +<%= render_if_exists 'notify/diff_summary' -%> diff --git a/app/views/shared/_service_ping_consent.html.haml b/app/views/shared/_service_ping_consent.html.haml index e0313710736..cfc0afb4646 100644 --- a/app/views/shared/_service_ping_consent.html.haml +++ b/app/views/shared/_service_ping_consent.html.haml @@ -1,7 +1,7 @@ - if session[:ask_for_usage_stats_consent] = render Pajamas::AlertComponent.new(alert_options: { class: 'service-ping-consent-message' }) do |c| - c.with_body do - - docs_link = link_to '', help_page_path('user/admin_area/settings/usage_statistics.md'), class: 'gl-link' + - docs_link = link_to '', help_page_path('administration/settings/usage_statistics.md'), class: 'gl-link' - settings_link = link_to '', metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings'), class: 'gl-link' = safe_format s_('ServicePing|To help improve GitLab, we would like to periodically %{link_start}collect usage information%{link_end}.'), tag_pair(docs_link, :link_start, :link_end) = safe_format s_('ServicePing|This can be changed at any time in %{link_start}your settings%{link_end}.'), tag_pair(settings_link, :link_start, :link_end) diff --git a/config/feature_flags/development/vsd_graphql_dora_and_flow_metrics.yml b/config/feature_flags/development/vsd_graphql_dora_and_flow_metrics.yml deleted file mode 100644 index c0588ce992d..00000000000 --- a/config/feature_flags/development/vsd_graphql_dora_and_flow_metrics.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: vsd_graphql_dora_and_flow_metrics -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116216 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/409499 -milestone: '16.1' -type: development -group: group::optimize -default_enabled: true diff --git a/config/initializers/database_query_analyzers.rb b/config/initializers/database_query_analyzers.rb index ad6ed20b94d..5c2f3caf89e 100644 --- a/config/initializers/database_query_analyzers.rb +++ b/config/initializers/database_query_analyzers.rb @@ -9,10 +9,7 @@ Gitlab::Database::QueryAnalyzer.instance.tap do |query_analyzer| analyzers.append(::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification) analyzers.append(::Gitlab::Database::QueryAnalyzers::Ci::PartitioningRoutingAnalyzer) - if Gitlab.dev_or_test_env? - analyzers.append(::Gitlab::Database::QueryAnalyzers::GitlabSchemasValidateConnection) - analyzers.append(::Gitlab::Database::QueryAnalyzers::QueryRecorder) - end + analyzers.append(::Gitlab::Database::QueryAnalyzers::GitlabSchemasValidateConnection) if Gitlab.dev_or_test_env? end end diff --git a/doc/.vale/gitlab/Wordy.yml b/doc/.vale/gitlab/Wordy.yml index 45546435ee9..808bedad35a 100644 --- a/doc/.vale/gitlab/Wordy.yml +++ b/doc/.vale/gitlab/Wordy.yml @@ -10,6 +10,7 @@ link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list. level: suggestion ignorecase: true swap: + as well as: "Use 'and' instead of 'as well as'." note that: "Remove the phrase 'note that'." please: "Use 'please' only if we've inconvenienced the user." respectively: "Remove 'respectively' and list each option instead." diff --git a/doc/administration/backup_restore/index.md b/doc/administration/backup_restore/index.md index 72a0176adc1..824fa56f443 100644 --- a/doc/administration/backup_restore/index.md +++ b/doc/administration/backup_restore/index.md @@ -60,7 +60,7 @@ To prepare the new server: 1. Install GitLab. 1. Configure by copying `/etc/gitlab` files from the old server to the new server, and update as necessary. Read the - [Omnibus configuration backup and restore instructions](https://docs.gitlab.com/omnibus/settings/backups.html) for more detail. + [Linux package installation backup and restore instructions](https://docs.gitlab.com/omnibus/settings/backups.html) for more detail. 1. If applicable, disable [incoming email](../incoming_email.md). 1. Block new CI/CD jobs from starting upon initial startup after the backup and restore. Edit `/etc/gitlab/gitlab.rb` and set the following: diff --git a/doc/administration/backup_restore/restore_gitlab.md b/doc/administration/backup_restore/restore_gitlab.md index 9e52cfd00ed..aa09bb9fea6 100644 --- a/doc/administration/backup_restore/restore_gitlab.md +++ b/doc/administration/backup_restore/restore_gitlab.md @@ -70,12 +70,12 @@ Read more about [configuring NFS mounts](../nfs.md) Restoring a backup from an instance using local storage restores to local storage even if the target instance uses object storage. Migrations to object storage must be done before or after restoration. -## Restore for Omnibus GitLab installations +## Restore for Linux package installations This procedure assumes that: - You have installed the **exact same version and type (CE/EE)** of GitLab - Omnibus with which the backup was created. + with which the backup was created. - You have run `sudo gitlab-ctl reconfigure` at least once. - GitLab is running. If not, start it using `sudo gitlab-ctl start`. @@ -293,17 +293,17 @@ During a restore from backup, the restore script may ask for confirmation before proceeding. If you wish to disable these prompts, you can set the `GITLAB_ASSUME_YES` environment variable to `1`. -For Omnibus GitLab packages: +- Linux package installations: -```shell -sudo GITLAB_ASSUME_YES=1 gitlab-backup restore -``` + ```shell + sudo GITLAB_ASSUME_YES=1 gitlab-backup restore + ``` -For installations from source: +- Self-compiled installations: -```shell -sudo -u git -H GITLAB_ASSUME_YES=1 bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` + ```shell + sudo -u git -H GITLAB_ASSUME_YES=1 bundle exec rake gitlab:backup:restore RAILS_ENV=production + ``` ### Excluding tasks on restore @@ -322,17 +322,19 @@ You can exclude specific tasks on restore by adding the environment variable `SK - `repositories` (Git repositories data) - `packages` (Packages) -For Omnibus GitLab packages: +To exclude specific tasks: -```shell -sudo gitlab-backup restore BACKUP=timestamp_of_backup SKIP=db,uploads -``` +- Linux package installations: -For installations from source: + ```shell + sudo gitlab-backup restore BACKUP=timestamp_of_backup SKIP=db,uploads + ``` -```shell -sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup SKIP=db,uploads RAILS_ENV=production -``` +- Self-compiled installations: + + ```shell + sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup SKIP=db,uploads RAILS_ENV=production + ``` ### Restore specific repository storages @@ -343,17 +345,19 @@ repositories from specific repository storages can be restored separately using the `REPOSITORIES_STORAGES` option. The option accepts a comma-separated list of storage names. -For example, for Omnibus GitLab installations: +For example: -```shell -sudo gitlab-backup restore BACKUP=timestamp_of_backup REPOSITORIES_STORAGES=storage1,storage2 -``` +- Linux package installations: -For example, for installations from source: + ```shell + sudo gitlab-backup restore BACKUP=timestamp_of_backup REPOSITORIES_STORAGES=storage1,storage2 + ``` -```shell -sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup REPOSITORIES_STORAGES=storage1,storage2 -``` +- Self-compiled installations: + + ```shell + sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup REPOSITORIES_STORAGES=storage1,storage2 + ``` ### Restore specific repositories @@ -367,13 +371,13 @@ descendent groups are included or skipped, depending on which option you used. T For example, to restore all repositories for all projects in **Group A** (`group-a`), the repository for **Project C** in **Group B** (`group-b/project-c`), and skip the **Project D** in **Group A** (`group-a/project-d`): -- Omnibus GitLab installations: +- Linux package installations: ```shell sudo gitlab-backup restore BACKUP=timestamp_of_backup REPOSITORIES_PATHS=group-a,group-b/project-c SKIP_REPOSITORIES_PATHS=group-a/project-d ``` -- Installations from source: +- Self-compiled installations: ```shell sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup REPOSITORIES_PATHS=group-a,group-b/project-c SKIP_REPOSITORIES_PATHS=group-a/project-d @@ -384,24 +388,26 @@ and skip the **Project D** in **Group A** (`group-a/project-d`): If an [untarred backup](backup_gitlab.md#skipping-tar-creation) (made with `SKIP=tar`) is found, and no backup is chosen with `BACKUP=<timestamp>`, the untarred backup is used. -For example, for Omnibus GitLab installations: +For example: -```shell -sudo gitlab-backup restore -``` +- Linux package installations: -For example, for installations from source: + ```shell + sudo gitlab-backup restore + ``` -```shell -sudo -u git -H bundle exec rake gitlab:backup:restore -``` +- Self-compiled installations: + + ```shell + sudo -u git -H bundle exec rake gitlab:backup:restore + ``` ## Troubleshooting The following are possible problems you might encounter, along with potential solutions. -### Restoring database backup using Omnibus packages outputs warnings +### Restoring database backup using output warnings from a Linux package installation If you're using backup restore procedures, you may encounter the following warning messages: diff --git a/doc/administration/logs/index.md b/doc/administration/logs/index.md index 449f33fbbef..30eb536f1c3 100644 --- a/doc/administration/logs/index.md +++ b/doc/administration/logs/index.md @@ -951,7 +951,7 @@ For example: ## `geo.log` **(PREMIUM SELF)** -Geo stores structured log messages in a `geo.log` file. For Omnibus GitLab +Geo stores structured log messages in a `geo.log` file. For Linux package installations, this file is at `/var/log/gitlab/gitlab-rails/geo.log`. This file contains information about when Geo attempts to sync repositories @@ -1127,7 +1127,7 @@ GitLab also tracks [Prometheus metrics for Praefect](../gitaly/monitoring.md#mon > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63832) in GitLab 14.1. -For Omnibus installations, the backup log is located at `/var/log/gitlab/gitlab-rails/backup_json.log`. +For Linux package installations, the backup log is located at `/var/log/gitlab/gitlab-rails/backup_json.log`. This log is populated when a [GitLab backup is created](../../administration/backup_restore/index.md). You can use this log to understand how the backup process performed. diff --git a/doc/administration/nfs.md b/doc/administration/nfs.md index 0273c4b03b1..119f757bfbc 100644 --- a/doc/administration/nfs.md +++ b/doc/administration/nfs.md @@ -60,10 +60,10 @@ options: a good security measure when NFS shares are accessed by many different users. However, in this case only GitLab uses the NFS share so it is safe. GitLab recommends the `no_root_squash` setting because we need to - manage file permissions automatically. Without the setting you may receive - errors when the Omnibus package tries to alter permissions. GitLab + manage file permissions automatically. Without the setting, you may receive + errors when the Linux package tries to alter permissions. GitLab and other bundled components do **not** run as `root` but as non-privileged - users. The recommendation for `no_root_squash` is to allow the Omnibus package + users. The recommendation for `no_root_squash` is to allow the Linux package to set ownership and permissions on files, as needed. In some cases where the `no_root_squash` option is not available, the `root` flag can achieve the same result. @@ -71,7 +71,7 @@ options: circumstances it could lead to data loss if a failure occurs before data has synced. -Due to the complexities of running Omnibus with LDAP and the complexities of +Due to the complexities of running the Linux package with LDAP and the complexities of maintaining ID mapping without LDAP, in most cases you should enable numeric UIDs and GIDs (which is off by default in some cases) for simplified permission management between systems: @@ -210,10 +210,10 @@ mountpoint └── uploads ``` -To do so, configure Omnibus with the paths to each directory nested +To do so, configure the Linux package with the paths to each directory nested in the mount point as follows: -Mount `/gitlab-nfs` then use the following Omnibus +Mount `/gitlab-nfs` then use the following Linux package configuration to move each data location to a subdirectory: ```ruby @@ -229,7 +229,7 @@ these new locations, and then restart GitLab. ### Bind mounts -Alternatively to changing the configuration in Omnibus, bind mounts can be used +Instead of changing the configuration in the Linux package, bind mounts can be used to store the data on an NFS mount. Bind mounts provide a way to specify just one NFS mount and then @@ -252,7 +252,7 @@ are empty before attempting a restore. Read more about the ### Multiple NFS mounts -When using default Omnibus configuration you need to share 4 data locations +When using default Linux package configuration, you need to share 4 data locations between all GitLab cluster nodes. No other locations should be shared. The following are the 4 locations need to be shared: @@ -265,8 +265,8 @@ following are the 4 locations need to be shared: Other GitLab directories should not be shared between nodes. They contain node-specific files and GitLab code that does not need to be shared. To ship -logs to a central location consider using remote syslog. Omnibus GitLab packages -provide configuration for [UDP log shipping](https://docs.gitlab.com/omnibus/settings/logs.html#udp-log-shipping-gitlab-enterprise-edition-only). +logs to a central location consider using remote syslog. The Linux package +provides configuration for [UDP log shipping](https://docs.gitlab.com/omnibus/settings/logs.html#udp-log-shipping-gitlab-enterprise-edition-only). Having multiple NFS mounts requires you to manually make sure the data directories are empty before attempting a restore. Read more about the diff --git a/doc/administration/sidekiq/extra_sidekiq_processes.md b/doc/administration/sidekiq/extra_sidekiq_processes.md index 3a522c7171d..d85eae7a7f6 100644 --- a/doc/administration/sidekiq/extra_sidekiq_processes.md +++ b/doc/administration/sidekiq/extra_sidekiq_processes.md @@ -11,7 +11,7 @@ at a higher rate on a single instance. By default, Sidekiq starts one worker process and only uses a single core. NOTE: -The information in this page applies only to Omnibus GitLab. +The information in this page applies only to Linux package installations. ## Start multiple processes diff --git a/doc/administration/sidekiq/index.md b/doc/administration/sidekiq/index.md index c3e1182cb05..f0b4d2ebf1d 100644 --- a/doc/administration/sidekiq/index.md +++ b/doc/administration/sidekiq/index.md @@ -82,7 +82,7 @@ By default, GitLab uses UNIX sockets and is not set up to communicate via TCP. T telnet <GitLab host> 6379 # Redis ``` -1. [Download and install](https://about.gitlab.com/install/) the Omnibus GitLab package +1. [Download and install](https://about.gitlab.com/install/) the Linux package using steps 1 and 2. **Do not complete any other steps.** 1. Copy the `/etc/gitlab/gitlab.rb` file from the GitLab instance and add the following settings. Make sure diff --git a/doc/administration/sidekiq/sidekiq_memory_killer.md b/doc/administration/sidekiq/sidekiq_memory_killer.md index 63d93919129..01eda32ded0 100644 --- a/doc/administration/sidekiq/sidekiq_memory_killer.md +++ b/doc/administration/sidekiq/sidekiq_memory_killer.md @@ -13,10 +13,9 @@ for a certain amount of time. We use the same approach to the Sidekiq processes used by GitLab to process background jobs. -GitLab monitors the available RSS limit by default only for installations using -the Linux packages (Omnibus) or Docker. The reason for this is that GitLab -relies on runit to restart Sidekiq after a memory-induced shutdown, and GitLab -self-compiled or Helm chart based installations don't use runit or an equivalent tool. +GitLab monitors the available RSS limit by default only for Linux package or Docker installations. The reason for this +is that GitLab relies on runit to restart Sidekiq after a memory-induced shutdown, and self-compiled and Helm chart +installations don't use runit or an equivalent tool. With the default settings, Sidekiq restarts no more often than once every 15 minutes, with the restart causing about one @@ -24,7 +23,7 @@ minute of delay for incoming background jobs. Some background jobs rely on long-running external processes. To ensure these are cleanly terminated when Sidekiq is restarted, each Sidekiq process should be -run as a process group leader (for example, using `chpst -P`). If using Omnibus or the +run as a process group leader (for example, using `chpst -P`). If using a Linux package installation or the `bin/background_jobs` script with `runit` installed, this is handled for you. ## Configuring the limits diff --git a/doc/administration/sidekiq/sidekiq_troubleshooting.md b/doc/administration/sidekiq/sidekiq_troubleshooting.md index 6802bb68b31..cce5feb83e5 100644 --- a/doc/administration/sidekiq/sidekiq_troubleshooting.md +++ b/doc/administration/sidekiq/sidekiq_troubleshooting.md @@ -63,7 +63,7 @@ and delays before CI pipelines start running. Potential causes include: -- The GitLab instance may need more Sidekiq workers. By default, a single-node Omnibus GitLab +- The GitLab instance may need more Sidekiq workers. By default, a single-node Linux package installation runs one worker, restricting the execution of Sidekiq jobs to a maximum of one CPU core. [Read more about running multiple Sidekiq workers](extra_sidekiq_processes.md). @@ -555,9 +555,9 @@ but if you want to clear the idempotency key immediately, follow the following s dj.delete! ``` -## Omnibus GitLab 14.0 and later: remove the `sidekiq-cluster` service +## GitLab 14.0 and later: remove the `sidekiq-cluster` service (Linux package installations) -Omnibus GitLab instances that were configured to run `sidekiq-cluster` prior to GitLab 14.0 +Linux package instances that were configured to run `sidekiq-cluster` prior to GitLab 14.0 might still have this service running along side `sidekiq` in later releases. The code to manage `sidekiq-cluster` was removed in GitLab 14.0. diff --git a/doc/administration/terraform_state.md b/doc/administration/terraform_state.md index 2b738f975ba..ec4bf3e16da 100644 --- a/doc/administration/terraform_state.md +++ b/doc/administration/terraform_state.md @@ -180,7 +180,9 @@ This section describes the earlier configuration format. See [the available connection settings for different providers](object_storage.md#configure-the-connection-settings). -**In Omnibus installations:** +::Tabs + +:::TabTitle Linux package (Omnibus) 1. Edit `/etc/gitlab/gitlab.rb` and add the following lines; replacing with the values you want: @@ -210,7 +212,7 @@ See [the available connection settings for different providers](object_storage.m 1. Save the file and [reconfigure GitLab](restart_gitlab.md#reconfigure-a-linux-package-installation) for the changes to take effect. 1. [Migrate any existing local states to the object storage](#migrate-to-object-storage) -**In installations from source:** +:::TabTitle Self-compiled (source) 1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following lines: @@ -230,3 +232,5 @@ See [the available connection settings for different providers](object_storage.m 1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) for the changes to take effect. 1. [Migrate any existing local states to the object storage](#migrate-to-object-storage) + +::EndTabs diff --git a/doc/administration/troubleshooting/postgresql.md b/doc/administration/troubleshooting/postgresql.md index 88e0d4e6c6b..42d4d9c6d8c 100644 --- a/doc/administration/troubleshooting/postgresql.md +++ b/doc/administration/troubleshooting/postgresql.md @@ -26,7 +26,7 @@ This section is for links to information elsewhere in the GitLab documentation. - [Connect to the PostgreSQL console](https://docs.gitlab.com/omnibus/settings/database.html#connecting-to-the-bundled-postgresql-database). -- [Omnibus database procedures](https://docs.gitlab.com/omnibus/settings/database.html) including: +- [Database procedures for Linux package installations](https://docs.gitlab.com/omnibus/settings/database.html) including: - SSL: enabling, disabling, and verifying. - Enabling Write Ahead Log (WAL) archiving. - Using an external (non-Omnibus) PostgreSQL installation; and backing it up. @@ -44,7 +44,7 @@ This section is for links to information elsewhere in the GitLab documentation. - Consuming PostgreSQL from [within CI runners](../../ci/services/postgres.md). -- Managing Omnibus PostgreSQL versions [from the development docs](https://docs.gitlab.com/omnibus/development/managing-postgresql-versions.html). +- Managing PostgreSQL versions on Linux package installations [from the development docs](https://docs.gitlab.com/omnibus/development/managing-postgresql-versions.html). - [PostgreSQL scaling](../postgresql/replication_and_failover.md) - Including [troubleshooting](../postgresql/replication_and_failover.md#troubleshooting) @@ -107,7 +107,7 @@ PostgreSQL defaults: Comments in issue [#30528](https://gitlab.com/gitlab-org/gitlab/-/issues/30528) indicate that these should both be set to at least a number of minutes for all -Omnibus GitLab installations (so they don't hang indefinitely). However, 15 s +Linux package installations (so they don't hang indefinitely). However, 15 s for `statement_timeout` is very short, and is only effective if the underlying infrastructure is very performant. @@ -138,7 +138,8 @@ postgresql['idle_in_transaction_session_timeout'] = '60s' Once saved, [reconfigure GitLab](../restart_gitlab.md#reconfigure-a-linux-package-installation) for the changes to take effect. NOTE: -These are Omnibus GitLab settings. If an external database, such as a customer's PostgreSQL installation or Amazon RDS is being used, these values don't get set, and would have to be set externally. +These are Linux package settings. If an external database, such as a customer's PostgreSQL installation +or Amazon RDS is being used, these values don't get set, and would have to be set externally. ### Temporarily changing the statement timeout diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 68808825b00..fdafe9200bf 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -15610,7 +15610,8 @@ Relationship between an epic and an issue. | <a id="epicissuediscussions"></a>`discussions` | [`DiscussionConnection!`](#discussionconnection) | All discussions on this noteable. (see [Connections](#connections)) | | <a id="epicissuedownvotes"></a>`downvotes` | [`Int!`](#int) | Number of downvotes the issue has received. | | <a id="epicissueduedate"></a>`dueDate` | [`Time`](#time) | Due date of the issue. | -| <a id="epicissueemailsdisabled"></a>`emailsDisabled` | [`Boolean!`](#boolean) | Indicates if a project has email notifications disabled: `true` if email notifications are disabled. | +| <a id="epicissueemailsdisabled"></a>`emailsDisabled` **{warning-solid}** | [`Boolean!`](#boolean) | **Deprecated** in 16.3. Use `emails_enabled`. | +| <a id="epicissueemailsenabled"></a>`emailsEnabled` | [`Boolean!`](#boolean) | Indicates if a project has email notifications disabled: `false` if email notifications are disabled. | | <a id="epicissueepic"></a>`epic` | [`Epic`](#epic) | Epic to which this issue belongs. | | <a id="epicissueepicissueid"></a>`epicIssueId` | [`ID!`](#id) | ID of the epic-issue relation. | | <a id="epicissueescalationpolicy"></a>`escalationPolicy` | [`EscalationPolicyType`](#escalationpolicytype) | Escalation policy associated with the issue. Available for issues which support escalation. | @@ -17714,7 +17715,8 @@ Describes an issuable resource link for incident issues. | <a id="issuediscussions"></a>`discussions` | [`DiscussionConnection!`](#discussionconnection) | All discussions on this noteable. (see [Connections](#connections)) | | <a id="issuedownvotes"></a>`downvotes` | [`Int!`](#int) | Number of downvotes the issue has received. | | <a id="issueduedate"></a>`dueDate` | [`Time`](#time) | Due date of the issue. | -| <a id="issueemailsdisabled"></a>`emailsDisabled` | [`Boolean!`](#boolean) | Indicates if a project has email notifications disabled: `true` if email notifications are disabled. | +| <a id="issueemailsdisabled"></a>`emailsDisabled` **{warning-solid}** | [`Boolean!`](#boolean) | **Deprecated** in 16.3. Use `emails_enabled`. | +| <a id="issueemailsenabled"></a>`emailsEnabled` | [`Boolean!`](#boolean) | Indicates if a project has email notifications disabled: `false` if email notifications are disabled. | | <a id="issueepic"></a>`epic` | [`Epic`](#epic) | Epic to which this issue belongs. | | <a id="issueescalationpolicy"></a>`escalationPolicy` | [`EscalationPolicyType`](#escalationpolicytype) | Escalation policy associated with the issue. Available for issues which support escalation. | | <a id="issueescalationstatus"></a>`escalationStatus` | [`IssueEscalationStatus`](#issueescalationstatus) | Escalation status of the issue. | diff --git a/doc/development/internal_analytics/index.md b/doc/development/internal_analytics/index.md index 8abea4c2b2f..c7cf907ca92 100644 --- a/doc/development/internal_analytics/index.md +++ b/doc/development/internal_analytics/index.md @@ -6,7 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w # Internal analytics -Learn how to implement internal analytics using: +Learn how to instrument your features on GitLab using: - [Service Ping](service_ping/index.md) - [Snowplow](snowplow/index.md) diff --git a/doc/development/internal_analytics/internal_event_tracking/architecture.md b/doc/development/internal_analytics/internal_event_tracking/architecture.md new file mode 100644 index 00000000000..de5672a4895 --- /dev/null +++ b/doc/development/internal_analytics/internal_event_tracking/architecture.md @@ -0,0 +1,11 @@ +--- +stage: Analytics +group: Analytics Instrumentation +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments +--- + +# Internal event tracking architecture + +This page is under construction. It serves as placeholder for the following information. + +- Detailed architecture and other technical details diff --git a/doc/development/internal_analytics/internal_event_tracking/event_definition_guide.md b/doc/development/internal_analytics/internal_event_tracking/event_definition_guide.md new file mode 100644 index 00000000000..7e4222ead2e --- /dev/null +++ b/doc/development/internal_analytics/internal_event_tracking/event_definition_guide.md @@ -0,0 +1,11 @@ +--- +stage: Analytics +group: Analytics Instrumentation +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments +--- + +# Internal event tracking definition guide + +This page is under construction. It serves as placeholder for the following information. + +- Explanation of all parts of an event definition diff --git a/doc/development/internal_analytics/internal_event_tracking/index.md b/doc/development/internal_analytics/internal_event_tracking/index.md new file mode 100644 index 00000000000..73e9e2d1a4c --- /dev/null +++ b/doc/development/internal_analytics/internal_event_tracking/index.md @@ -0,0 +1,17 @@ +--- +stage: Analytics +group: Analytics Instrumentation +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments +--- + +# Internal Event Tracking + +This page provides detailed guidelines on using the Internal Event Tracking system to instrument features on GitLab. + +This page is a work in progress. For any questions or clarifications, reach out to us in the Slack channel [#g_analyze_analytics_instrumentation](https://gitlab.slack.com/archives/CL3A7GFPF). + +- [Introduction to internal event tracking](introduction.md#internal-event-tracking) +- [Quick start guide](quick_start.md#quick-start-for-internal-event-tracking) +- [Event definition guide](event_definition_guide.md#internal-event-tracking-definition-guide) +- [Metrics dictionary guide](../service_ping/metrics_dictionary.md#metrics-dictionary-guide) +- [Architecture](architecture.md#internal-event-tracking-architecture) diff --git a/doc/development/internal_analytics/internal_event_tracking/introduction.md b/doc/development/internal_analytics/internal_event_tracking/introduction.md new file mode 100644 index 00000000000..ebb3caa198a --- /dev/null +++ b/doc/development/internal_analytics/internal_event_tracking/introduction.md @@ -0,0 +1,13 @@ +--- +stage: Analytics +group: Analytics Instrumentation +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments +--- + +# Internal event tracking + +This page is under construction. It serves as placeholder for the following information: + +- High level introduction +- Difference between Events and Metrics +- Basic overview of the architecture diff --git a/doc/development/internal_analytics/internal_event_tracking/quick_start.md b/doc/development/internal_analytics/internal_event_tracking/quick_start.md new file mode 100644 index 00000000000..806b2bc73ae --- /dev/null +++ b/doc/development/internal_analytics/internal_event_tracking/quick_start.md @@ -0,0 +1,12 @@ +--- +stage: Analytics +group: Analytics Instrumentation +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments +--- + +# Quick start for internal event tracking + +This page is under construction. It serves as placeholder for the following information: + +- Instructions on how to create a new Event or Metric using a generator +- Video guide of using the generator diff --git a/doc/install/aws/manual_install_aws.md b/doc/install/aws/manual_install_aws.md index 92ef08c2447..a952180674c 100644 --- a/doc/install/aws/manual_install_aws.md +++ b/doc/install/aws/manual_install_aws.md @@ -783,7 +783,7 @@ For GitLab 12.1 and earlier, use `gitlab-rake gitlab:backup:create`. To restore GitLab, first review the [restore documentation](../../administration/backup_restore/index.md#restore-gitlab), and primarily the restore prerequisites. Then, follow the steps under the -[Linux package installations section](../../administration/backup_restore/restore_gitlab.md#restore-for-omnibus-gitlab-installations). +[Linux package installations section](../../administration/backup_restore/restore_gitlab.md#restore-for-linux-package-installations). ## Updating GitLab diff --git a/doc/update/package/downgrade.md b/doc/update/package/downgrade.md index 14b9bd981fd..0e01a1bfcd8 100644 --- a/doc/update/package/downgrade.md +++ b/doc/update/package/downgrade.md @@ -79,5 +79,5 @@ Steps: sudo gitlab-ctl reconfigure ``` -1. [Restore GitLab](../../administration/backup_restore/restore_gitlab.md#restore-for-omnibus-gitlab-installations) +1. [Restore GitLab](../../administration/backup_restore/restore_gitlab.md#restore-for-linux-package-installations) to complete the downgrade. diff --git a/doc/user/analytics/contributor_statistics.md b/doc/user/analytics/contributor_statistics.md new file mode 100644 index 00000000000..138cd696af0 --- /dev/null +++ b/doc/user/analytics/contributor_statistics.md @@ -0,0 +1,48 @@ +--- +stage: Plan +group: Optimize +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments +--- + +# Contributor statistics **(FREE)** + +Contributor statistics give you an overview of the commits made by projects members to a project over time. + +## View contributor statistics + +The contributor statistics page displays a line chart with the number of commits to the selected project branch over time, +and line charts with the number of commits by each project member. + +To view contributor statistics for a project: + +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Analyze > Contributor statistics**. +1. From the **Branches** (**main**) dropdown list, select the branch you want to view commits for. +1. To view the number of commits made on a specific day, hover over the line chart. +1. Optional. To display commits only for a specific time period, select the pause icons (**{status-paused}**) and slide them along the horizontal axis: + + - To change the start date, slide the left pause icon to the left or right. + - To change the end date, slide the right pause icon to the left or right. + +## View project commit history + +To view a list of commits made by project members per day: + +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Analyze > Contributor statistics**. +1. Select **History**. +1. From the **Branches** (**main**) dropdown list, select the branch you want to view commits for. +1. To view the number of commits made by the members on a specific day, hover over the line chart. +1. Optional. Filter the results. + + - To filter by author, from the **Author** dropdown list, select the user whose commits you want to view. + - To filter by commit message, in the text box, enter your search criteria. + +## Retrieve project commits as an RSS feed + +To view the list of commits to the project as an RSS feed in Atom format: + +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Analyze > Contributor statistics**. +1. Select **History**. +1. In the upper-right corner, select the feed symbol (**{rss}**). diff --git a/doc/user/analytics/index.md b/doc/user/analytics/index.md index 50ba7ffc0e4..67714718db5 100644 --- a/doc/user/analytics/index.md +++ b/doc/user/analytics/index.md @@ -38,6 +38,7 @@ You can use GitLab to review analytics at the project level. Some of these featu - [Application Security](../application_security/security_dashboard/index.md) - [CI/CD & DORA](ci_cd_analytics.md) - [Code Review](code_review_analytics.md) +- [Contributor statistics](../../user/analytics/contributor_statistics.md) - [Insights](../project/insights/index.md) - [Issue](../../user/analytics/issue_analytics.md) - [Merge Request](merge_request_analytics.md), enabled with the `project_merge_request_analytics` diff --git a/doc/user/analytics/value_streams_dashboard.md b/doc/user/analytics/value_streams_dashboard.md index 32c0f4be689..5a44f013c9d 100644 --- a/doc/user/analytics/value_streams_dashboard.md +++ b/doc/user/analytics/value_streams_dashboard.md @@ -147,7 +147,6 @@ description: 'Custom description' # * issues # * issues_completed # * merge_request_throughput -# (This option is dependant on the `vsd_graphql_dora_and_flow_metrics` feature.) panels: - title: 'My Custom Project' data: diff --git a/doc/user/project/repository/img/contributors_graph.png b/doc/user/project/repository/img/contributors_graph.png Binary files differdeleted file mode 100644 index 83fdf1fc41f..00000000000 --- a/doc/user/project/repository/img/contributors_graph.png +++ /dev/null diff --git a/doc/user/project/repository/index.md b/doc/user/project/repository/index.md index 7383772a45b..69873fe2501 100644 --- a/doc/user/project/repository/index.md +++ b/doc/user/project/repository/index.md @@ -237,11 +237,7 @@ Administrators can set a [repository size limit](../../admin_area/settings/accou ## Repository contributor statistics -All code contributors are displayed under your project's **Analyze > Contributor statistics**. - -The graph shows the contributor with the most commits to the fewest. - -![contributors to code](img/contributors_graph.png) +You can view a list and charts of commits made by project members in [Contributor statistics](../../analytics/contributor_statistics.md). ## Repository history graph diff --git a/lefthook.yml b/lefthook.yml index 26b68f0a48f..bed3593ba3d 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -61,7 +61,7 @@ pre-push: files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD exclude: "doc/api/graphql/reference/index.md" glob: 'doc/*.md' - run: 'if [ $VALE_WARNINGS ]; then minWarnings=warning; else minWarnings=error; fi; if command -v vale > /dev/null 2>&1; then if ! vale --config .vale.ini --minAlertLevel $minWarnings {files}; then echo "ERROR: Fix any linting errors and make sure you are using the latest version of Vale."; exit 1; fi; else echo "ERROR: Vale not found. For more information, see https://docs.errata.ai/vale/install."; exit 1; fi' + run: 'if [ $VALE_WARNINGS ]; then minWarnings=warning; else minWarnings=error; fi; if command -v vale > /dev/null 2>&1; then if ! vale --config .vale.ini --minAlertLevel $minWarnings {files}; then echo "ERROR: Fix any linting errors and make sure you are using the latest version of Vale."; exit 1; fi; else echo "ERROR: Vale not found. For more information, see https://vale.sh/docs/vale-cli/installation/."; exit 1; fi' gettext: tags: backend frontend view haml files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD | while read file;do git diff --unified=1 $(git merge-base origin/master HEAD)..HEAD $file | grep -Fqe '_(' && echo $file;done; true diff --git a/lib/api/entities/project.rb b/lib/api/entities/project.rb index 6a826bcac33..0f947c85633 100644 --- a/lib/api/entities/project.rb +++ b/lib/api/entities/project.rb @@ -85,7 +85,9 @@ module API expose(:infrastructure_access_level, documentation: { type: 'string', example: 'enabled' }) { |project, options| project_feature_string_access_level(project, :infrastructure) } expose(:monitor_access_level, documentation: { type: 'string', example: 'enabled' }) { |project, options| project_feature_string_access_level(project, :monitor) } - expose :emails_disabled, documentation: { type: 'boolean' } + expose(:emails_disabled, documentation: { type: 'boolean' }) { |project, options| project.emails_disabled? } + expose :emails_enabled, documentation: { type: 'boolean' } + expose :shared_runners_enabled, documentation: { type: 'boolean' } expose :lfs_enabled?, as: :lfs_enabled, documentation: { type: 'boolean' } expose :creator_id, documentation: { type: 'integer', example: 1 } diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb index 46d629c1b21..c7ca3351125 100644 --- a/lib/api/helpers/projects_helpers.rb +++ b/lib/api/helpers/projects_helpers.rb @@ -40,7 +40,8 @@ module API optional :infrastructure_access_level, type: String, values: %w(disabled private enabled), desc: 'Infrastructure access level. One of `disabled`, `private` or `enabled`' optional :monitor_access_level, type: String, values: %w(disabled private enabled), desc: 'Monitor access level. One of `disabled`, `private` or `enabled`' - optional :emails_disabled, type: Boolean, desc: 'Disable email notifications' + optional :emails_disabled, type: Boolean, desc: 'Deprecated: Use emails_enabled instead.' + optional :emails_enabled, type: Boolean, desc: 'Enable email notifications' optional :show_default_award_emojis, type: Boolean, desc: 'Show default award emojis' optional :show_diff_preview_in_email, type: Boolean, desc: 'Include the code diff preview in merge request notification emails' optional :warn_about_potentially_unwanted_characters, type: Boolean, desc: 'Warn about Potentially Unwanted Characters' @@ -146,7 +147,7 @@ module API :container_expiration_policy_attributes, :default_branch, :description, - :emails_disabled, + :emails_enabled, :forking_access_level, :issues_access_level, :lfs_enabled, diff --git a/lib/gitlab/database/query_analyzers/query_recorder.rb b/lib/gitlab/database/query_analyzers/query_recorder.rb deleted file mode 100644 index 63b4fbb8c1d..00000000000 --- a/lib/gitlab/database/query_analyzers/query_recorder.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module Database - module QueryAnalyzers - class QueryRecorder < Base - LOG_PATH = 'query_recorder/' - LIST_PARAMETER_REGEX = %r{\$\d+(?:\s*,\s*\$\d+)+}.freeze - SINGLE_PARAMETER_REGEX = %r{\$\d+}.freeze - - class << self - def enabled? - # Only enable QueryRecorder in CI on database MRs or default branch - ENV['CI_MERGE_REQUEST_LABELS']&.include?('database') || - (ENV['CI_COMMIT_REF_NAME'].present? && ENV['CI_COMMIT_REF_NAME'] == ENV['CI_DEFAULT_BRANCH']) - end - - def analyze(parsed) - payload = { - normalized: normalize_query(parsed.sql) - } - - log_query(payload) - end - - def log_file - Rails.root.join(LOG_PATH, "#{ENV.fetch('CI_JOB_NAME_SLUG', 'rspec')}.ndjson") - end - - private - - def log_query(payload) - log_dir = Rails.root.join(LOG_PATH) - - # Create log directory if it does not exist since it is only created - # ahead of time by certain CI jobs - FileUtils.mkdir_p(log_dir) unless Dir.exist?(log_dir) - - log_line = "#{Gitlab::Json.dump(payload)}\n" - - File.write(log_file, log_line, mode: 'a') - end - - def normalize_query(query) - query - .gsub(LIST_PARAMETER_REGEX, '?,?,?') # Replace list parameters with ?,?,? - .gsub(SINGLE_PARAMETER_REGEX, '?') # Replace single parameters with ? - end - end - end - end - end -end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 4b557fd1aef..c186dc5ac60 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -7648,6 +7648,9 @@ msgstr "" msgid "Billing|Cannot remove user" msgstr "" +msgid "Billing|Code Suggestions add-on assigned" +msgstr "" + msgid "Billing|Direct memberships" msgstr "" @@ -17554,7 +17557,7 @@ msgstr "" msgid "Enhance security by storing service account keys in secret managers - learn more about %{docLinkStart}secret management with GitLab%{docLinkEnd}" msgstr "" -msgid "Enhance your coding experience with intelligent recommendations. %{linkStart}Code Suggestions%{linkEnd} uses generative AI to suggest code while you're developing. Not available for Guest roles." +msgid "Enhance your coding experience with intelligent recommendations. %{linkStart}Code Suggestions%{linkEnd} uses generative AI to suggest code while you're developing. Not available for users with the Guest role." msgstr "" msgid "Ensure your %{linkStart}environment is part of the deploy stage%{linkEnd} of your CI pipeline to track deployments to your cluster." @@ -36422,21 +36425,24 @@ msgstr "" msgid "ProjectSettings|Determine what happens to the commit history when you merge a merge request." msgstr "" -msgid "ProjectSettings|Disable email notifications" -msgstr "" - msgid "ProjectSettings|Do not allow" msgstr "" msgid "ProjectSettings|Enable \"Delete source branch\" option by default" msgstr "" +msgid "ProjectSettings|Enable email notifications" +msgstr "" + msgid "ProjectSettings|Enable merge trains" msgstr "" msgid "ProjectSettings|Enable merged results pipelines" msgstr "" +msgid "ProjectSettings|Enable sending email notifications for this project" +msgstr "" + msgid "ProjectSettings|Enable suggested reviewers" msgstr "" @@ -36590,9 +36596,6 @@ msgstr "" msgid "ProjectSettings|Override instance analytics configuration for this project" msgstr "" -msgid "ProjectSettings|Override user notification preferences for all project members." -msgstr "" - msgid "ProjectSettings|Package registry" msgstr "" diff --git a/scripts/generate-message-to-run-e2e-pipeline.rb b/scripts/generate-message-to-run-e2e-pipeline.rb index 0a0b7b3795b..bdb3a12e483 100755 --- a/scripts/generate-message-to-run-e2e-pipeline.rb +++ b/scripts/generate-message-to-run-e2e-pipeline.rb @@ -74,10 +74,11 @@ class GenerateMessageToRunE2ePipeline Please start the `trigger-omnibus-and-follow-up-e2e` job in the `qa` stage and ensure the tests in `follow-up-e2e:package-and-test-ee` pipeline are passing **before this MR is merged**. + (The E2E test pipeline is computationally intensive and we cannot afford running it automatically for all pushes/rebases. Therefore, this job must be triggered manually after significant changes at least once.) - If you would like to run all e2e tests, please apply the ~"pipeline:run-all-e2e" label and trigger a new pipeline. This will run all tests in `e2e:package-and-test` pipeline. + If you would like to run all E2E tests, please apply the ~"pipeline:run-all-e2e" label and trigger a new pipeline. This will run all tests in `e2e:package-and-test` pipeline. - For the list of known failures please refer to [the latest pipeline triage issue](https://gitlab.com/gitlab-org/quality/pipeline-triage/-/issues). + The E2E test jobs are allowed to fail due to [flakiness](https://about.gitlab.com/handbook/engineering/quality/quality-engineering/test-metrics-dashboards/#package-and-test). For the list of known failures please refer to [the latest pipeline triage issue](https://gitlab.com/gitlab-org/quality/pipeline-triage/-/issues). Once done, please apply the ✅ emoji on this comment. diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb index 46913cfa649..7d7bebb7106 100644 --- a/spec/controllers/projects_controller_spec.rb +++ b/spec/controllers/projects_controller_spec.rb @@ -974,7 +974,8 @@ RSpec.describe ProjectsController, feature_category: :groups_and_projects do project: { project_setting_attributes: { show_default_award_emojis: boolean_value, - enforce_auth_checks_on_uploads: boolean_value + enforce_auth_checks_on_uploads: boolean_value, + emails_enabled: boolean_value } } } @@ -983,6 +984,8 @@ RSpec.describe ProjectsController, feature_category: :groups_and_projects do expect(project.show_default_award_emojis?).to eq(result) expect(project.enforce_auth_checks_on_uploads?).to eq(result) + expect(project.emails_enabled?).to eq(result) + expect(project.emails_disabled?).to eq(!result) end end end diff --git a/spec/features/issues/user_toggles_subscription_spec.rb b/spec/features/issues/user_toggles_subscription_spec.rb index 00b04c10d33..0ddf49578a0 100644 --- a/spec/features/issues/user_toggles_subscription_spec.rb +++ b/spec/features/issues/user_toggles_subscription_spec.rb @@ -42,7 +42,7 @@ RSpec.describe "User toggles subscription", :js, feature_category: :team_plannin end context 'when project emails are disabled' do - let(:project) { create(:project_empty_repo, :public, emails_disabled: true) } + let_it_be(:project) { create(:project_empty_repo, :public, emails_enabled: false) } it 'is disabled' do expect(page).to have_content('Disabled by project owner') diff --git a/spec/features/profiles/user_visits_notifications_tab_spec.rb b/spec/features/profiles/user_visits_notifications_tab_spec.rb index 1295a0b6150..7d858e3c92c 100644 --- a/spec/features/profiles/user_visits_notifications_tab_spec.rb +++ b/spec/features/profiles/user_visits_notifications_tab_spec.rb @@ -30,7 +30,7 @@ RSpec.describe 'User visits the notifications tab', :js, feature_category: :user end context 'when project emails are disabled' do - let(:project) { create(:project, emails_disabled: true) } + let_it_be(:project) { create(:project, emails_enabled: false) } it 'notification button is disabled' do expect(page).to have_selector('[data-testid="notification-dropdown"] .disabled') diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index 25eddf64f99..f742ec3dfa6 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -818,7 +818,7 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do describe 'when the `ios_specific_templates` experiment is enabled and the "Set up a runner" button is clicked' do before do stub_experiments(ios_specific_templates: :candidate) - create(:project_setting, project: project, target_platforms: %w(ios)) + project.project_setting.update!(target_platforms: %w(ios)) visit project_pipelines_path(project) click_button 'Set up a runner' end diff --git a/spec/features/projects/settings/visibility_settings_spec.rb b/spec/features/projects/settings/visibility_settings_spec.rb index 7d41b60199c..890f514d3da 100644 --- a/spec/features/projects/settings/visibility_settings_spec.rb +++ b/spec/features/projects/settings/visibility_settings_spec.rb @@ -30,11 +30,11 @@ RSpec.describe 'Projects > Settings > Visibility settings', :js, feature_categor context 'disable email notifications' do it 'is visible' do - expect(page).to have_selector('.js-emails-disabled', visible: true) + expect(page).to have_selector('.js-emails-enabled', visible: true) end it 'accepts the changed state' do - find('.js-emails-disabled input[type="checkbox"]').click + find('.js-emails-enabled input[type="checkbox"]').click expect { save_permissions_group }.to change { updated_emails_disabled? }.to(true) end @@ -59,7 +59,7 @@ RSpec.describe 'Projects > Settings > Visibility settings', :js, feature_categor context 'disable email notifications' do it 'is not available' do - expect(page).not_to have_selector('.js-emails-disabled', visible: true) + expect(page).not_to have_selector('.js-emails-enabled', visible: true) end end end diff --git a/spec/features/projects/show/user_manages_notifications_spec.rb b/spec/features/projects/show/user_manages_notifications_spec.rb index 455b931e7f3..bbf31c1e1e1 100644 --- a/spec/features/projects/show/user_manages_notifications_spec.rb +++ b/spec/features/projects/show/user_manages_notifications_spec.rb @@ -77,7 +77,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js, feature_cate end context 'when project emails are disabled' do - let(:project) { create(:project, :public, :repository, emails_disabled: true) } + let_it_be(:project) { create(:project, :public, :repository, emails_enabled: false) } it 'is disabled' do visit project_path(project) diff --git a/spec/features/projects/user_changes_project_visibility_spec.rb b/spec/features/projects/user_changes_project_visibility_spec.rb index f27a659f65f..24f24229f9c 100644 --- a/spec/features/projects/user_changes_project_visibility_spec.rb +++ b/spec/features/projects/user_changes_project_visibility_spec.rb @@ -66,8 +66,8 @@ RSpec.describe 'User changes public project visibility', :js, feature_category: let(:project) { create(:project, :empty_repo, :public) } it 'saves without confirmation' do - expect(page).to have_selector('.js-emails-disabled', visible: true) - find('.js-emails-disabled input[type="checkbox"]').click + expect(page).to have_selector('.js-emails-enabled', visible: true) + find('.js-emails-enabled input[type="checkbox"]').click page.within('#js-shared-permissions') do click_button 'Save changes' diff --git a/spec/graphql/types/issue_type_spec.rb b/spec/graphql/types/issue_type_spec.rb index 7c4f2a06147..6c4e68fba6b 100644 --- a/spec/graphql/types/issue_type_spec.rb +++ b/spec/graphql/types/issue_type_spec.rb @@ -19,7 +19,7 @@ RSpec.describe GitlabSchema.types['Issue'] do it 'has specific fields' do fields = %i[id iid title description state reference author assignees updated_by participants labels milestone due_date confidential hidden discussion_locked upvotes downvotes merge_requests_count user_notes_count user_discussions_count web_path web_url relative_position - emails_disabled subscribed time_estimate total_time_spent human_time_estimate human_total_time_spent closed_at created_at updated_at task_completion_status + emails_disabled emails_enabled subscribed time_estimate total_time_spent human_time_estimate human_total_time_spent closed_at created_at updated_at task_completion_status design_collection alert_management_alert alert_management_alerts severity current_user_todos moved moved_to closed_as_duplicate_of create_note_email timelogs project_id customer_relations_contacts escalation_status] diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index 768038d8736..f450f46fefc 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -1006,7 +1006,7 @@ RSpec.describe ProjectsHelper, feature_category: :source_code_management do analyticsAccessLevel: project.project_feature.analytics_access_level, containerRegistryEnabled: !!project.container_registry_enabled, lfsEnabled: !!project.lfs_enabled, - emailsDisabled: project.emails_disabled?, + emailsEnabled: project.emails_enabled?, showDefaultAwardEmojis: project.show_default_award_emojis?, securityAndComplianceAccessLevel: project.security_and_compliance_access_level, containerRegistryAccessLevel: project.project_feature.container_registry_access_level, diff --git a/spec/lib/gitlab/database/query_analyzers/query_recorder_spec.rb b/spec/lib/gitlab/database/query_analyzers/query_recorder_spec.rb deleted file mode 100644 index 22ff66ff55e..00000000000 --- a/spec/lib/gitlab/database/query_analyzers/query_recorder_spec.rb +++ /dev/null @@ -1,114 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::Database::QueryAnalyzers::QueryRecorder, feature_category: :database, query_analyzers: false do - # We keep only the QueryRecorder analyzer running - around do |example| - described_class.with_suppressed(false) do - example.run - end - end - - context 'with query analyzer' do - let(:log_path) { Rails.root.join(described_class::LOG_PATH) } - let(:log_file) { described_class.log_file } - - after do - ::Gitlab::Database::QueryAnalyzer.instance.end!([described_class]) - end - - shared_examples_for 'an enabled query recorder' do - using RSpec::Parameterized::TableSyntax - - normalized_query = <<~SQL.strip.tr("\n", ' ') - SELECT \\\\"projects\\\\".\\\\"id\\\\" - FROM \\\\"projects\\\\" - WHERE \\\\"projects\\\\".\\\\"namespace_id\\\\" = \\? - AND \\\\"projects\\\\".\\\\"id\\\\" IN \\(\\?,\\?,\\?\\); - SQL - - where(:list_parameter, :bind_parameters) do - '$2, $3' | [1, 2, 3] - '$2, $3, $4' | [1, 2, 3, 4] - '$2 ,$3 ,$4 ,$5' | [1, 2, 3, 4, 5] - '$2 , $3 , $4 , $5, $6' | [1, 2, 3, 4, 5, 6] - '$2, $3 ,$4 , $5,$6,$7' | [1, 2, 3, 4, 5, 6, 7] - '$2,$3,$4,$5,$6,$7,$8' | [1, 2, 3, 4, 5, 6, 7, 8] - end - - with_them do - before do - allow(described_class).to receive(:analyze).and_call_original - allow(FileUtils).to receive(:mkdir_p) - .with(log_path) - end - - it 'logs normalized queries to a file' do - expect(File).to receive(:write) - .with(log_file, /^{"normalized":"#{normalized_query}/, mode: 'a') - - expect do - ApplicationRecord.connection.exec_query(<<~SQL.strip.tr("\n", ' '), 'SQL', bind_parameters) - SELECT "projects"."id" - FROM "projects" - WHERE "projects"."namespace_id" = $1 - AND "projects"."id" IN (#{list_parameter}); - SQL - end.not_to raise_error - end - end - end - - context 'on default branch' do - before do - stub_env('CI_MERGE_REQUEST_LABELS', nil) - stub_env('CI_DEFAULT_BRANCH', 'default_branch_name') - stub_env('CI_COMMIT_REF_NAME', 'default_branch_name') - - # This is needed to be able to stub_env the CI variable - ::Gitlab::Database::QueryAnalyzer.instance.begin!([described_class]) - end - - it_behaves_like 'an enabled query recorder' - end - - context 'on database merge requests' do - before do - stub_env('CI_MERGE_REQUEST_LABELS', 'database') - - # This is needed to be able to stub_env the CI variable - ::Gitlab::Database::QueryAnalyzer.instance.begin!([described_class]) - end - - it_behaves_like 'an enabled query recorder' - end - end - - describe '.log_file' do - let(:folder) { 'query_recorder' } - let(:extension) { 'ndjson' } - let(:default_name) { 'rspec' } - let(:job_name) { 'test-job-1' } - - subject { described_class.log_file.to_s } - - context 'when in CI' do - before do - stub_env('CI_JOB_NAME_SLUG', job_name) - end - - it { is_expected.to include("#{folder}/#{job_name}.#{extension}") } - it { is_expected.not_to include("#{folder}/#{default_name}.#{extension}") } - end - - context 'when not in CI' do - before do - stub_env('CI_JOB_NAME_SLUG', nil) - end - - it { is_expected.to include("#{folder}/#{default_name}.#{extension}") } - it { is_expected.not_to include("#{folder}/#{job_name}.#{extension}") } - end - end -end diff --git a/spec/lib/gitlab/pagination/keyset/in_operator_optimization/strategies/record_loader_strategy_spec.rb b/spec/lib/gitlab/pagination/keyset/in_operator_optimization/strategies/record_loader_strategy_spec.rb index 3fe858f33da..ddaf555dae6 100644 --- a/spec/lib/gitlab/pagination/keyset/in_operator_optimization/strategies/record_loader_strategy_spec.rb +++ b/spec/lib/gitlab/pagination/keyset/in_operator_optimization/strategies/record_loader_strategy_spec.rb @@ -32,6 +32,12 @@ RSpec.describe Gitlab::Pagination::Keyset::InOperatorOptimization::Strategies::R end end + let_it_be(:model_without_ignored_columns) do + Class.new(ApplicationRecord) do + self.table_name = 'projects' + end + end + subject(:strategy) { described_class.new(finder_query, model, order_by_columns) } describe '#initializer_columns' do @@ -70,6 +76,8 @@ RSpec.describe Gitlab::Pagination::Keyset::InOperatorOptimization::Strategies::R describe '#final_projections' do context 'when model does not have ignored columns' do + let(:model) { model_without_ignored_columns } + it 'does not specify the selected column names' do expect(strategy.final_projections).to contain_exactly("(#{described_class::RECORDS_COLUMN}).*") end diff --git a/spec/models/project_setting_spec.rb b/spec/models/project_setting_spec.rb index 6928cc8ba08..ba737813859 100644 --- a/spec/models/project_setting_spec.rb +++ b/spec/models/project_setting_spec.rb @@ -111,7 +111,7 @@ RSpec.describe ProjectSetting, type: :model, feature_category: :groups_and_proje end describe '#show_diff_preview_in_email?' do - context 'when a project is a top-level namespace' do + context 'when a project has no parent group' do let(:project_settings) { create(:project_setting, show_diff_preview_in_email: false) } let(:project) { create(:project, project_setting: project_settings) } @@ -133,75 +133,75 @@ RSpec.describe ProjectSetting, type: :model, feature_category: :groups_and_proje end end - describe '#emails_enabled?' do - context "when a project does not have a parent group" do - let(:project_settings) { create(:project_setting, emails_enabled: true) } - let(:project) { create(:project, project_setting: project_settings) } - - it "returns true" do - expect(project.emails_enabled?).to be_truthy - end + context 'when a parent group overrides project settings' do + let(:namespace_settings) { create(:namespace_settings, show_diff_preview_in_email: false) } + let(:project_settings) { create(:project_setting, show_diff_preview_in_email: true) } + let(:group) { create(:group, namespace_settings: namespace_settings) } + let(:project) { create(:project, namespace_id: group.id, project_setting: project_settings) } - it "returns false when updating project settings" do - project.update_attribute(:emails_disabled, false) - expect(project.emails_enabled?).to be_truthy + context 'when show_diff_preview_in_email is disabled for the parent group' do + it 'returns false' do + expect(project).not_to be_show_diff_preview_in_email end end - context "when a project has a parent group" do - let(:namespace_settings) { create(:namespace_settings, emails_enabled: true) } - let(:project_settings) { create(:project_setting, emails_enabled: true) } - let(:group) { create(:group, namespace_settings: namespace_settings) } - let(:project) do - create(:project, namespace_id: group.id, - project_setting: project_settings) - end - - context 'when emails have been disabled in parent group' do - it 'returns false' do - group.update_attribute(:emails_disabled, true) + context 'when all ancestors have enabled diff previews' do + let(:namespace_settings) { create(:namespace_settings, show_diff_preview_in_email: true) } - expect(project.emails_enabled?).to be_falsey - end + it 'returns true' do + expect(project).to be_show_diff_preview_in_email end + end + end + end - context 'when emails are enabled in parent group' do - before do - allow(project.namespace).to receive(:emails_enabled?).and_return(true) - end + describe '#emails_enabled?' do + context "when a project does not have a parent group" do + let_it_be(:project_settings) { create(:project_setting, emails_enabled: true) } + let_it_be(:project) { create(:project, project_setting: project_settings) } - it 'returns true' do - expect(project.emails_enabled?).to be_truthy - end + it "returns true" do + expect(project.emails_enabled?).to be_truthy + end - it 'returns false when disabled at the project' do - project.update_attribute(:emails_disabled, true) + it "returns false when project_settings are set to false" do + project.project_setting.clear_memoization(:emails_enabled?) + project.update_attribute(:emails_enabled, false) - expect(project.emails_enabled?).to be_falsey - end - end + expect(project.emails_enabled?).to be_falsey end end - context 'when a parent group has a parent group' do - let(:namespace_settings) { create(:namespace_settings, show_diff_preview_in_email: false) } - let(:project_settings) { create(:project_setting, show_diff_preview_in_email: true) } + context "when a project has a parent group" do + let(:namespace_settings) { create(:namespace_settings, emails_enabled: true) } + let(:project_settings) { create(:project_setting, emails_enabled: true) } let(:group) { create(:group, namespace_settings: namespace_settings) } - let!(:project) { create(:project, namespace_id: group.id, project_setting: project_settings) } + let(:project) do + create(:project, namespace_id: group.id, + project_setting: project_settings) + end - context 'when show_diff_preview_in_email is disabled for the parent group' do + context 'when emails have been disabled in parent group' do it 'returns false' do - expect(project).not_to be_show_diff_preview_in_email + group.update_attribute(:emails_disabled, true) + + expect(project.emails_enabled?).to be_falsey end end - context 'when all ancestors have enabled diff previews' do - let(:namespace_settings) { create(:namespace_settings, show_diff_preview_in_email: true) } + context 'when emails are enabled in parent group' do + before do + allow(project.namespace).to receive(:emails_disabled?).and_return(false) + end it 'returns true' do - group.update_attribute(:show_diff_preview_in_email, true) + expect(project.emails_enabled?).to be_truthy + end - expect(project).to be_show_diff_preview_in_email + it 'returns false when disabled at the project' do + project.update_attribute(:emails_enabled, false) + + expect(project.emails_enabled?).to be_falsey end end end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index e8b72a8d616..f57f0e5265f 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -3959,51 +3959,10 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr end describe '#emails_disabled?' do - let_it_be(:namespace) { create(:namespace) } - - let(:project) { build(:project, namespace: namespace, emails_disabled: false) } - - context 'emails disabled in group' do - it 'returns true' do - allow(project.namespace).to receive(:emails_disabled?) { true } - - expect(project.emails_disabled?).to be_truthy - end - end - - context 'emails enabled in group' do - before do - allow(project.namespace).to receive(:emails_disabled?) { false } - end - - it 'returns false' do - expect(project.emails_disabled?).to be_falsey - end + let(:project) { build(:project, emails_enabled: true) } - it 'returns true' do - project.update_attribute(:emails_disabled, true) - - expect(project.emails_disabled?).to be_truthy - end - end - end - - describe '#emails_enabled?' do - context 'without a persisted project_setting object' do - let(:project) { build(:project, emails_disabled: false) } - - it "is the opposite of emails_disabled" do - expect(project.emails_enabled?).to be_truthy - end - end - - context 'with a persisted project_setting object' do - let(:project_settings) { create(:project_setting, emails_enabled: true) } - let(:project) { build(:project, emails_disabled: false, project_setting: project_settings) } - - it "is the opposite of emails_disabled" do - expect(project.emails_enabled?).to be_truthy - end + it "is the opposite of emails_disabled" do + expect(project.emails_disabled?).to be_falsey end end diff --git a/spec/requests/api/project_attributes.yml b/spec/requests/api/project_attributes.yml index 123c7ae852f..aa8568d4951 100644 --- a/spec/requests/api/project_attributes.yml +++ b/spec/requests/api/project_attributes.yml @@ -60,6 +60,7 @@ itself: # project - container_registry_image_prefix - default_branch - empty_repo + - emails_disabled - forks_count - http_url_to_repo - import_status @@ -164,7 +165,6 @@ project_setting: - jitsu_key - mirror_branch_regex - allow_pipeline_trigger_approve_deployment - - emails_enabled - pages_unique_domain_enabled - pages_unique_domain - runner_registration_enabled diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index ea791379f01..ac28ce05463 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -2583,7 +2583,6 @@ RSpec.describe API::Projects, :aggregate_failures, feature_category: :groups_and link = create(:project_group_link, project: project, group: group) get api(path, admin, admin_mode: true) - expect(response).to have_gitlab_http_status(:ok) expect(json_response['id']).to eq(project.id) expect(json_response['description']).to eq(project.description) @@ -2634,6 +2633,8 @@ RSpec.describe API::Projects, :aggregate_failures, feature_category: :groups_and expect(json_response['feature_flags_access_level']).to be_present expect(json_response['infrastructure_access_level']).to be_present expect(json_response['monitor_access_level']).to be_present + expect(json_response).to have_key('emails_disabled') + expect(json_response).to have_key('emails_enabled') end it 'exposes all necessary attributes' do @@ -2707,7 +2708,6 @@ RSpec.describe API::Projects, :aggregate_failures, feature_category: :groups_and expect(json_response['feature_flags_access_level']).to be_present expect(json_response['infrastructure_access_level']).to be_present expect(json_response['monitor_access_level']).to be_present - expect(json_response).to have_key('emails_disabled') expect(json_response['resolve_outdated_diff_discussions']).to eq(project.resolve_outdated_diff_discussions) expect(json_response['remove_source_branch_after_merge']).to be_truthy expect(json_response['container_registry_enabled']).to be_present @@ -3940,7 +3940,7 @@ RSpec.describe API::Projects, :aggregate_failures, feature_category: :groups_and end it 'updates emails_disabled' do - project_param = { emails_disabled: true } + project_param = { emails_enabled: false } put api("/projects/#{project3.id}", user), params: project_param @@ -3949,6 +3949,16 @@ RSpec.describe API::Projects, :aggregate_failures, feature_category: :groups_and expect(json_response['emails_disabled']).to eq(true) end + it 'updates emails_enabled?' do + project_param = { emails_enabled: false } + + put api("/projects/#{project3.id}", user), params: project_param + + expect(response).to have_gitlab_http_status(:ok) + + expect(json_response['emails_enabled']).to eq(false) + end + it 'updates build_git_strategy' do project_param = { build_git_strategy: 'clone' } diff --git a/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb b/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb index b1e2d5932ba..2032a986f52 100644 --- a/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb +++ b/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb @@ -226,10 +226,11 @@ RSpec.describe GenerateMessageToRunE2ePipeline, feature_category: :tooling do Please start the `trigger-omnibus-and-follow-up-e2e` job in the `qa` stage and ensure the tests in `follow-up-e2e:package-and-test-ee` pipeline are passing **before this MR is merged**. + (The E2E test pipeline is computationally intensive and we cannot afford running it automatically for all pushes/rebases. Therefore, this job must be triggered manually after significant changes at least once.) - If you would like to run all e2e tests, please apply the ~"pipeline:run-all-e2e" label and trigger a new pipeline. This will run all tests in `e2e:package-and-test` pipeline. + If you would like to run all E2E tests, please apply the ~"pipeline:run-all-e2e" label and trigger a new pipeline. This will run all tests in `e2e:package-and-test` pipeline. - For the list of known failures please refer to [the latest pipeline triage issue](https://gitlab.com/gitlab-org/quality/pipeline-triage/-/issues). + The E2E test jobs are allowed to fail due to [flakiness](https://about.gitlab.com/handbook/engineering/quality/quality-engineering/test-metrics-dashboards/#package-and-test). For the list of known failures please refer to [the latest pipeline triage issue](https://gitlab.com/gitlab-org/quality/pipeline-triage/-/issues). Once done, please apply the ✅ emoji on this comment. diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index d3cc367649f..028c3ea6610 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -2895,6 +2895,7 @@ RSpec.describe NotificationService, :mailer, feature_category: :team_planning do describe '#review_requested_of_merge_request' do let(:merge_request) { create(:merge_request, author: author, source_project: project, reviewers: [reviewer]) } + let(:mailer) { double } let_it_be(:current_user) { create(:user) } let_it_be(:reviewer) { create(:user) } @@ -2917,8 +2918,16 @@ RSpec.describe NotificationService, :mailer, feature_category: :team_planning do should_not_email(@u_lazy_participant) end + it 'deliver email immediately' do + allow(Notify).to receive(:request_review_merge_request_email) + .with(Integer, Integer, Integer, String).and_return(mailer) + expect(mailer).to receive(:deliver_later).with({}) + + notification.review_requested_of_merge_request(merge_request, current_user, reviewer) + end + it 'adds "review requested" reason for new reviewer' do - notification.review_requested_of_merge_request(merge_request, current_user, [reviewer]) + notification.review_requested_of_merge_request(merge_request, current_user, reviewer) merge_request.reviewers.each do |reviewer| email = find_email_for(reviewer) diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb index 1f6408b28ed..2186e7aa06c 100644 --- a/spec/services/projects/update_service_spec.rb +++ b/spec/services/projects/update_service_spec.rb @@ -504,19 +504,19 @@ RSpec.describe Projects::UpdateService, feature_category: :groups_and_projects d end end - context 'when updating #emails_disabled' do + context 'when updating #emails_enabled' do it 'updates the attribute for the project owner' do - expect { update_project(project, user, emails_disabled: true) } - .to change { project.emails_disabled } - .to(true) + expect { update_project(project, user, emails_enabled: false) } + .to change { project.emails_enabled } + .to(false) end it 'does not update when not project owner' do maintainer = create(:user) project.add_member(maintainer, :maintainer) - expect { update_project(project, maintainer, emails_disabled: true) } - .not_to change { project.emails_disabled } + expect { update_project(project, maintainer, emails_enabled: false) } + .not_to change { project.emails_enabled } end end diff --git a/spec/support/database/query_recorder.rb b/spec/support/database/query_recorder.rb deleted file mode 100644 index c0736221af3..00000000000 --- a/spec/support/database/query_recorder.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -RSpec.configure do |config| - # Truncate the query_recorder log file before starting the suite - config.before(:suite) do - log_file = Rails.root.join(Gitlab::Database::QueryAnalyzers::QueryRecorder.log_file) - File.write(log_file, '') if File.exist?(log_file) - File.delete("#{log_file}.gz") if File.exist?("#{log_file}.gz") - end - - config.after(:suite) do - if ENV['CI'] - log_file = Rails.root.join(Gitlab::Database::QueryAnalyzers::QueryRecorder.log_file) - system("gzip #{log_file}") if File.exist?(log_file) - end - end -end diff --git a/spec/support/helpers/models/ci/partitioning_testing/rspec_hooks.rb b/spec/support/helpers/models/ci/partitioning_testing/rspec_hooks.rb index 3f0a2bb7f3b..8a1581d513a 100644 --- a/spec/support/helpers/models/ci/partitioning_testing/rspec_hooks.rb +++ b/spec/support/helpers/models/ci/partitioning_testing/rspec_hooks.rb @@ -1,23 +1,23 @@ # frozen_string_literal: true RSpec.configure do |config| - config.include Ci::PartitioningTesting::PartitionIdentifiers + config.include ::Ci::PartitioningTesting::PartitionIdentifiers config.around(:each, :ci_partitionable) do |example| - unless Ci::Build.table_name.to_s.starts_with?('p_') + unless ::Ci::Build.table_name.to_s.starts_with?('p_') skip 'Skipping partitioning tests until `ci_builds` is partitioned' end - Ci::PartitioningTesting::SchemaHelpers.with_routing_tables do + ::Ci::PartitioningTesting::SchemaHelpers.with_routing_tables do example.run end end config.before(:all) do - Ci::PartitioningTesting::SchemaHelpers.setup + ::Ci::PartitioningTesting::SchemaHelpers.setup end config.after(:all) do - Ci::PartitioningTesting::SchemaHelpers.teardown + ::Ci::PartitioningTesting::SchemaHelpers.teardown end end diff --git a/spec/support/shared_examples/features/sidebar_shared_examples.rb b/spec/support/shared_examples/features/sidebar_shared_examples.rb index c2c50e8762f..f402a1bc91a 100644 --- a/spec/support/shared_examples/features/sidebar_shared_examples.rb +++ b/spec/support/shared_examples/features/sidebar_shared_examples.rb @@ -100,7 +100,7 @@ RSpec.shared_examples 'issue boards sidebar' do context 'when notifications have been disabled' do before do - project.update_attribute(:emails_disabled, true) + project.update_attribute(:emails_enabled, false) refresh_and_click_first_card end diff --git a/spec/support/shared_examples/services/notification_service_shared_examples.rb b/spec/support/shared_examples/services/notification_service_shared_examples.rb index cfd674e3c43..df1ae67a590 100644 --- a/spec/support/shared_examples/services/notification_service_shared_examples.rb +++ b/spec/support/shared_examples/services/notification_service_shared_examples.rb @@ -8,16 +8,16 @@ RSpec.shared_examples 'project emails are disabled' do |check_delivery_jobs_queu before do reset_delivered_emails! - target_project.clear_memoization(:emails_disabled) + target_project.project_setting.clear_memoization(:emails_enabled?) end it 'sends no emails with project emails disabled' do - target_project.update_attribute(:emails_disabled, true) + target_project.project_setting.update_attribute(:emails_enabled, false) notification_trigger if check_delivery_jobs_queue - # Only check enqueud jobs, not delivered emails + # Only check enqueued jobs, not delivered emails expect_no_delivery_jobs else # Deprecated: Check actual delivered emails @@ -26,12 +26,12 @@ RSpec.shared_examples 'project emails are disabled' do |check_delivery_jobs_queu end it 'sends emails to someone' do - target_project.update_attribute(:emails_disabled, false) + target_project.project_setting.update_attribute(:emails_enabled, true) notification_trigger if check_delivery_jobs_queue - # Only check enqueud jobs, not delivered emails + # Only check enqueued jobs, not delivered emails expect_any_delivery_jobs else # Deprecated: Check actual delivered emails |