summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-05 19:40:33 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-05 19:40:33 +0000
commitd7c5be92af9c10cf20e78363c188c1a707a6bb90 (patch)
treedf2d354bc4277c7a0324fb8240bd4e24d58007f2
parentb28d1361dd1ec63053dbfae475097928c6d01116 (diff)
downloadgitlab-ce-d7c5be92af9c10cf20e78363c188c1a707a6bb90.tar.gz
Add latest changes from gitlab-org/gitlab@15-6-stable-ee
-rw-r--r--Gemfile3
-rw-r--r--Gemfile.checksum2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/assets/javascripts/branches/components/delete_branch_modal.vue7
-rw-r--r--app/assets/javascripts/header.js2
-rw-r--r--app/helpers/application_helper.rb3
-rw-r--r--app/services/resource_access_tokens/create_service.rb9
-rw-r--r--app/views/layouts/header/_default.html.haml21
-rw-r--r--db/post_migrate/20221002234454_finalize_group_member_namespace_id_migration.rb22
-rw-r--r--db/post_migrate/20221019194751_disable_fastupdate_on_issues_title_gin_index.rb4
-rw-r--r--db/post_migrate/20221019195754_disable_fastupdate_on_issues_description_gin_index.rb4
-rw-r--r--db/post_migrate/20221019200033_disable_fastupdate_on_merge_requests_title_gin_index.rb4
-rw-r--r--db/post_migrate/20221019200206_disable_fastupdate_on_merge_requests_description_gin_index.rb4
-rw-r--r--db/schema_migrations/202210022344541
-rw-r--r--doc/operations/incident_management/linked_resources.md2
-rw-r--r--doc/user/discussions/index.md2
-rw-r--r--doc/user/group/import/index.md9
-rw-r--r--doc/user/tasks.md29
-rw-r--r--lib/gitlab/background_migration/destroy_invalid_members.rb2
-rw-r--r--lib/gitlab/memory/watchdog/configurator.rb2
-rw-r--r--spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb3
-rw-r--r--spec/features/profiles/user_edit_profile_spec.rb2
-rw-r--r--spec/features/user_sees_marketing_header_spec.rb31
-rw-r--r--spec/frontend/branches/components/delete_branch_modal_spec.js21
-rw-r--r--spec/helpers/application_helper_spec.rb16
-rw-r--r--spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb2
-rw-r--r--spec/lib/gitlab/fips_spec.rb2
-rw-r--r--spec/lib/gitlab/memory/watchdog/configurator_spec.rb4
-rw-r--r--spec/migrations/20221002234454_finalize_group_member_namespace_id_migration_spec.rb72
-rw-r--r--spec/support/database_cleaner.rb10
-rw-r--r--spec/support/migration.rb2
31 files changed, 215 insertions, 86 deletions
diff --git a/Gemfile b/Gemfile
index 4dd695e69d1..c0af288c39e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -336,8 +336,7 @@ gem 'pg_query', '~> 2.2'
gem 'premailer-rails', '~> 1.10.3'
-# LabKit: Tracing and Correlation
-gem 'gitlab-labkit', '~> 0.28.0'
+gem 'gitlab-labkit', '~> 0.29.0'
gem 'thrift', '>= 0.16.0'
# I18n
diff --git a/Gemfile.checksum b/Gemfile.checksum
index a8ae702878f..9f19cf6b67f 100644
--- a/Gemfile.checksum
+++ b/Gemfile.checksum
@@ -205,7 +205,7 @@
{"name":"gitlab-dangerfiles","version":"3.6.2","platform":"ruby","checksum":"88585532bbb5c0e862ad0776b3804a32129eab06c6a8a7bc96b577baa7aac6c5"},
{"name":"gitlab-experiment","version":"0.7.1","platform":"ruby","checksum":"166dddb3aa83428bcaa93c35684ed01dc4d61f321fd2ae40b020806dc54a7824"},
{"name":"gitlab-fog-azure-rm","version":"1.4.0","platform":"ruby","checksum":"af4163c32b028aa5208814a3f4765a5817d50527e6c61931f766bf18a2e0eb7e"},
-{"name":"gitlab-labkit","version":"0.28.0","platform":"ruby","checksum":"a7ebf52336566f7607d280056acd64f390c9991f152fc3d6b1dd966a372d5654"},
+{"name":"gitlab-labkit","version":"0.29.0","platform":"ruby","checksum":"eb19ac5c11698683775ab847a3441d7af87d72fbaec38d635149fb65c5d9b427"},
{"name":"gitlab-license","version":"2.2.1","platform":"ruby","checksum":"39fcf6be8b2887df8afe01b5dcbae8d08b7c5d937ff56b0fb40484a8c4f02d30"},
{"name":"gitlab-mail_room","version":"0.0.9","platform":"ruby","checksum":"6700374b5c0aa9d9ad4e711aeb677f0b7d415a6d01d3baa699efab25349d851c"},
{"name":"gitlab-markup","version":"1.8.1","platform":"ruby","checksum":"ab1f9fd016977497c2af25b76341dea670533014f406861834a0bd99f646707b"},
diff --git a/Gemfile.lock b/Gemfile.lock
index 183f99e66fa..019ed103508 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -575,7 +575,7 @@ GEM
fog-json (~> 1.2.0)
mime-types
ms_rest_azure (~> 0.12.0)
- gitlab-labkit (0.28.0)
+ gitlab-labkit (0.29.0)
actionpack (>= 5.0.0, < 8.0.0)
activesupport (>= 5.0.0, < 8.0.0)
grpc (>= 1.37)
@@ -1668,7 +1668,7 @@ DEPENDENCIES
gitlab-dangerfiles (~> 3.6.2)
gitlab-experiment (~> 0.7.1)
gitlab-fog-azure-rm (~> 1.4.0)
- gitlab-labkit (~> 0.28.0)
+ gitlab-labkit (~> 0.29.0)
gitlab-license (~> 2.2.1)
gitlab-mail_room (~> 0.0.9)
gitlab-markup (~> 1.8.0)
diff --git a/app/assets/javascripts/branches/components/delete_branch_modal.vue b/app/assets/javascripts/branches/components/delete_branch_modal.vue
index 383fa5f7512..d5631337cec 100644
--- a/app/assets/javascripts/branches/components/delete_branch_modal.vue
+++ b/app/assets/javascripts/branches/components/delete_branch_modal.vue
@@ -76,7 +76,9 @@ export default {
this.$refs.modal.show();
},
submitForm() {
- this.$refs.form.submit();
+ if (!this.deleteButtonDisabled) {
+ this.$refs.form.submit();
+ }
},
closeModal() {
this.$refs.modal.hide();
@@ -127,7 +129,7 @@ export default {
</div>
</gl-alert>
- <form ref="form" :action="deletePath" method="post">
+ <form ref="form" :action="deletePath" method="post" @submit.prevent>
<div v-if="isProtectedBranch" class="gl-mt-4">
<p>
<gl-sprintf :message="undoneWarning">
@@ -150,6 +152,7 @@ export default {
class="gl-mt-4"
aria-labelledby="input-label"
autocomplete="off"
+ @keyup.enter="submitForm"
/>
</p>
</div>
diff --git a/app/assets/javascripts/header.js b/app/assets/javascripts/header.js
index 9b6113c7444..4d03a523486 100644
--- a/app/assets/javascripts/header.js
+++ b/app/assets/javascripts/header.js
@@ -84,6 +84,8 @@ function initStatusTriggers() {
})
.catch(() => {});
});
+
+ setStatusModalTriggerEl.classList.add('ready');
}
}
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ce6900d1779..340f3d45365 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -315,7 +315,8 @@ module ApplicationHelper
class_names << 'epic-boards-page gl-overflow-auto' if current_controller?(:epic_boards)
class_names << 'with-performance-bar' if performance_bar_enabled?
class_names << system_message_class
- class_names << 'logged-out-marketing-header' unless current_user
+ class_names << 'logged-out-marketing-header' if !current_user && ::Gitlab.com?
+
class_names
end
diff --git a/app/services/resource_access_tokens/create_service.rb b/app/services/resource_access_tokens/create_service.rb
index b8a210c0a95..c6948536053 100644
--- a/app/services/resource_access_tokens/create_service.rb
+++ b/app/services/resource_access_tokens/create_service.rb
@@ -13,6 +13,7 @@ module ResourceAccessTokens
return error("User does not have permission to create #{resource_type} access token") unless has_permission_to_create?
access_level = params[:access_level] || Gitlab::Access::MAINTAINER
+ return error("Could not provision owner access to project access token") if do_not_allow_owner_access_level_for_project_bot?(access_level)
user = create_user
@@ -107,7 +108,7 @@ module ResourceAccessTokens
end
def create_membership(resource, user, access_level)
- resource.add_member(user, access_level, current_user: current_user, expires_at: params[:expires_at])
+ resource.add_member(user, access_level, expires_at: params[:expires_at])
end
def log_event(token)
@@ -121,6 +122,12 @@ module ResourceAccessTokens
def success(access_token)
ServiceResponse.success(payload: { access_token: access_token })
end
+
+ def do_not_allow_owner_access_level_for_project_bot?(access_level)
+ resource.is_a?(Project) &&
+ access_level == Gitlab::Access::OWNER &&
+ !current_user.can?(:manage_owners, resource)
+ end
end
end
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
index 42ffd155647..47d8f5a447f 100644
--- a/app/views/layouts/header/_default.html.haml
+++ b/app/views/layouts/header/_default.html.haml
@@ -19,7 +19,11 @@
.gl-display-none.gl-sm-display-block
= render "layouts/nav/top_nav"
- else
- = render 'layouts/header/marketing_links'
+ - if Gitlab.com?
+ = render 'layouts/header/marketing_links'
+ - else
+ .gl-display-none.gl-sm-display-block
+ = render "layouts/nav/top_nav"
- if top_nav_show_search
.navbar-collapse.gl-transition-medium.collapse.gl-mr-auto.global-search-container.hide-when-top-nav-responsive-open
@@ -102,7 +106,7 @@
= sprite_icon('chevron-down', css_class: 'caret-down')
.dropdown-menu.dropdown-menu-right
= render 'layouts/header/help_dropdown'
- - unless current_user
+ - if !current_user && Gitlab.com?
%li.nav-item.gl-display-none.gl-sm-display-block
= render "layouts/nav/top_nav"
- if header_link?(:user_dropdown)
@@ -118,11 +122,14 @@
= link_to admin_impersonation_path, class: 'nav-link impersonation-btn', method: :delete, title: _('Stop impersonation'), aria: { label: _('Stop impersonation') }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body', qa_selector: 'stop_impersonation_link' } do
= sprite_icon('incognito', size: 18)
- if header_link?(:sign_in)
- %li.nav-item.gl-display-none.gl-sm-display-block
- = link_to _('Sign up now'), new_user_registration_path, class: 'gl-button btn btn-default btn-sign-in'
- %li.nav-item.gl-display-none.gl-sm-display-block
- = link_to _('Login'), new_session_path(:user, redirect_to_referer: 'yes')
- = render 'layouts/header/sign_in_register_button', class: 'gl-sm-display-none'
+ - if Gitlab.com?
+ %li.nav-item.gl-display-none.gl-sm-display-block
+ = link_to _('Sign up now'), new_user_registration_path, class: 'gl-button btn btn-default btn-sign-in'
+ %li.nav-item.gl-display-none.gl-sm-display-block
+ = link_to _('Login'), new_session_path(:user, redirect_to_referer: 'yes')
+ = render 'layouts/header/sign_in_register_button', class: 'gl-sm-display-none'
+ - else
+ = render 'layouts/header/sign_in_register_button'
%button.navbar-toggler.d-block.d-sm-none{ type: 'button', class: 'gl-border-none!', data: { testid: 'top-nav-responsive-toggle', qa_selector: 'mobile_navbar_button' } }
%span.sr-only= _('Toggle navigation')
diff --git a/db/post_migrate/20221002234454_finalize_group_member_namespace_id_migration.rb b/db/post_migrate/20221002234454_finalize_group_member_namespace_id_migration.rb
new file mode 100644
index 00000000000..9c5ca6cbb42
--- /dev/null
+++ b/db/post_migrate/20221002234454_finalize_group_member_namespace_id_migration.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class FinalizeGroupMemberNamespaceIdMigration < Gitlab::Database::Migration[2.0]
+ MIGRATION = 'BackfillMemberNamespaceForGroupMembers'
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ ensure_batched_background_migration_is_finished(
+ job_class_name: MIGRATION,
+ table_name: :members,
+ column_name: :id,
+ job_arguments: [],
+ finalize: true
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20221019194751_disable_fastupdate_on_issues_title_gin_index.rb b/db/post_migrate/20221019194751_disable_fastupdate_on_issues_title_gin_index.rb
index 6ad846dda1c..64d935489c2 100644
--- a/db/post_migrate/20221019194751_disable_fastupdate_on_issues_title_gin_index.rb
+++ b/db/post_migrate/20221019194751_disable_fastupdate_on_issues_title_gin_index.rb
@@ -6,6 +6,8 @@ class DisableFastupdateOnIssuesTitleGinIndex < Gitlab::Database::Migration[2.0]
INDEX_NAME = 'index_issues_on_title_trigram'
def up
+ return unless index_exists_by_name?(:issues, INDEX_NAME)
+
with_lock_retries do
execute <<~SQL
ALTER INDEX #{INDEX_NAME} SET ( fastupdate = false ) ;
@@ -14,6 +16,8 @@ class DisableFastupdateOnIssuesTitleGinIndex < Gitlab::Database::Migration[2.0]
end
def down
+ return unless index_exists_by_name?(:issues, INDEX_NAME)
+
with_lock_retries do
execute <<~SQL
ALTER INDEX #{INDEX_NAME} RESET ( fastupdate ) ;
diff --git a/db/post_migrate/20221019195754_disable_fastupdate_on_issues_description_gin_index.rb b/db/post_migrate/20221019195754_disable_fastupdate_on_issues_description_gin_index.rb
index ce09a48833f..8822cb3b414 100644
--- a/db/post_migrate/20221019195754_disable_fastupdate_on_issues_description_gin_index.rb
+++ b/db/post_migrate/20221019195754_disable_fastupdate_on_issues_description_gin_index.rb
@@ -6,6 +6,8 @@ class DisableFastupdateOnIssuesDescriptionGinIndex < Gitlab::Database::Migration
INDEX_NAME = 'index_issues_on_description_trigram'
def up
+ return unless index_exists_by_name?(:issues, INDEX_NAME)
+
with_lock_retries do
execute <<~SQL
ALTER INDEX #{INDEX_NAME} SET ( fastupdate = false ) ;
@@ -14,6 +16,8 @@ class DisableFastupdateOnIssuesDescriptionGinIndex < Gitlab::Database::Migration
end
def down
+ return unless index_exists_by_name?(:issues, INDEX_NAME)
+
with_lock_retries do
execute <<~SQL
ALTER INDEX #{INDEX_NAME} RESET ( fastupdate ) ;
diff --git a/db/post_migrate/20221019200033_disable_fastupdate_on_merge_requests_title_gin_index.rb b/db/post_migrate/20221019200033_disable_fastupdate_on_merge_requests_title_gin_index.rb
index eb4c413a5a9..3e1124dc2bb 100644
--- a/db/post_migrate/20221019200033_disable_fastupdate_on_merge_requests_title_gin_index.rb
+++ b/db/post_migrate/20221019200033_disable_fastupdate_on_merge_requests_title_gin_index.rb
@@ -6,6 +6,8 @@ class DisableFastupdateOnMergeRequestsTitleGinIndex < Gitlab::Database::Migratio
INDEX_NAME = 'index_merge_requests_on_title_trigram'
def up
+ return unless index_exists_by_name?(:merge_requests, INDEX_NAME)
+
with_lock_retries do
execute <<~SQL
ALTER INDEX #{INDEX_NAME} SET ( fastupdate = false ) ;
@@ -14,6 +16,8 @@ class DisableFastupdateOnMergeRequestsTitleGinIndex < Gitlab::Database::Migratio
end
def down
+ return unless index_exists_by_name?(:merge_requests, INDEX_NAME)
+
with_lock_retries do
execute <<~SQL
ALTER INDEX #{INDEX_NAME} RESET ( fastupdate ) ;
diff --git a/db/post_migrate/20221019200206_disable_fastupdate_on_merge_requests_description_gin_index.rb b/db/post_migrate/20221019200206_disable_fastupdate_on_merge_requests_description_gin_index.rb
index 2e55937db36..7ab6f40e206 100644
--- a/db/post_migrate/20221019200206_disable_fastupdate_on_merge_requests_description_gin_index.rb
+++ b/db/post_migrate/20221019200206_disable_fastupdate_on_merge_requests_description_gin_index.rb
@@ -6,6 +6,8 @@ class DisableFastupdateOnMergeRequestsDescriptionGinIndex < Gitlab::Database::Mi
INDEX_NAME = 'index_merge_requests_on_description_trigram'
def up
+ return unless index_exists_by_name?(:merge_requests, INDEX_NAME)
+
with_lock_retries do
execute <<~SQL
ALTER INDEX #{INDEX_NAME} SET ( fastupdate = false ) ;
@@ -14,6 +16,8 @@ class DisableFastupdateOnMergeRequestsDescriptionGinIndex < Gitlab::Database::Mi
end
def down
+ return unless index_exists_by_name?(:merge_requests, INDEX_NAME)
+
with_lock_retries do
execute <<~SQL
ALTER INDEX #{INDEX_NAME} RESET ( fastupdate ) ;
diff --git a/db/schema_migrations/20221002234454 b/db/schema_migrations/20221002234454
new file mode 100644
index 00000000000..d01230136be
--- /dev/null
+++ b/db/schema_migrations/20221002234454
@@ -0,0 +1 @@
+781ed5eaf05091e5d01ec23a9f66f3722c41b4a87ecdabe48158ce82c5cbb325 \ No newline at end of file
diff --git a/doc/operations/incident_management/linked_resources.md b/doc/operations/incident_management/linked_resources.md
index a7be867608b..40b2bbdc757 100644
--- a/doc/operations/incident_management/linked_resources.md
+++ b/doc/operations/incident_management/linked_resources.md
@@ -63,7 +63,7 @@ You can also submit a short description with the link.
The description shows instead of the URL in the **Linked resources** section of the incident:
```plaintext
-/link https://example.link.us/j/123456789, multiple alerts firing
+/link https://example.link.us/j/123456789 multiple alerts firing
```
### Link Zoom meetings from an incident **(PREMIUM)**
diff --git a/doc/user/discussions/index.md b/doc/user/discussions/index.md
index d9cacb6395d..1e791662a45 100644
--- a/doc/user/discussions/index.md
+++ b/doc/user/discussions/index.md
@@ -173,7 +173,7 @@ If you don't see this action on the right sidebar, your project or instance migh
> - [Renamed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/87403) from "confidential comments" to "internal notes" in GitLab 15.0.
> - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/87383) in GitLab 15.0.
> - [Feature flag `confidential_notes`](https://gitlab.com/gitlab-org/gitlab/-/issues/362712) removed in GitLab 15.2.
-> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/363045) permissions in GitLab 15.5 to at least the Reporter role. In GitLab 15.4 and earlier, issue or epic authors and assignees could also read and create internal notes.
+> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/363045) permissions in GitLab 15.6 to at least the Reporter role. In GitLab 15.5 and earlier, issue or epic authors and assignees could also read and create internal notes.
You can add an internal note **to an issue or an epic**. It's then visible only to project members who have at least the Reporter role.
diff --git a/doc/user/group/import/index.md b/doc/user/group/import/index.md
index 6dcc01242c2..49515dd8a11 100644
--- a/doc/user/group/import/index.md
+++ b/doc/user/group/import/index.md
@@ -9,14 +9,14 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/249160) in GitLab 13.7 for group resources [with a flag](../../feature_flags.md) named `bulk_import`. Disabled by default.
> - Group items [enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/338985) in GitLab 14.3.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/267945) in GitLab 14.4 for project resources [with a flag](../../feature_flags.md) named `bulk_import_projects`. Disabled by default.
+> - [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/339941) in GitLab 15.6.
FLAG:
On self-managed GitLab, by default [migrating group items](#migrated-group-items) is available. To hide the
feature, ask an administrator to [disable the feature flag](../../../administration/feature_flags.md) named `bulk_import`.
On self-managed GitLab, by default [migrating project items](#migrated-project-items) is not available. To show
this feature, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named
-`bulk_import_projects`. On GitLab.com, migrating group resources is available but migrating project resources is not
-available.
+`bulk_import_projects`. On GitLab.com, migration of both groups and projects is available.
Users with the Owner role on a top-level group can use GitLab Migration to migrate the group to:
@@ -116,10 +116,11 @@ Any other items are **not** migrated.
## Migrated project items
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/267945) in GitLab 14.4 [with a flag](../../feature_flags.md) named `bulk_import_projects`. Disabled by default.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/267945) in GitLab 14.4 [with a flag](../../feature_flags.md) named `bulk_import_projects`. Disabled by default.
+> - [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/339941) in GitLab 15.6.
FLAG:
-On self-managed GitLab, migrating project resources are not available by default. To make them available, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `bulk_import_projects`. On GitLab.com, migrating project resources are not available.
+On self-managed GitLab, migrating project resources are not available by default. To make them available, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `bulk_import_projects`. On GitLab.com, migration of project resources is available.
The [`import_export.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/import_export/project/import_export.yml)
file for projects lists many of the items migrated when migrating projects using group migration. View this file in the branch
diff --git a/doc/user/tasks.md b/doc/user/tasks.md
index 5c9290e57cb..5fed887ca74 100644
--- a/doc/user/tasks.md
+++ b/doc/user/tasks.md
@@ -41,6 +41,10 @@ View tasks in issues, in the **Tasks** section.
You can also [filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
for `Type = task`.
+If you select a task from an issue, it opens in a modal window.
+If you select a task to open in a new browser tab, or select it from the issue list,
+the task opens in a full-page view.
+
## Create a task
Prerequisites:
@@ -85,6 +89,31 @@ To edit a task:
select **Save**.
1. Select the close icon (**{close}**).
+### Using the rich text editor
+
+> - Rich text editing in the modal view [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/363007) in GitLab 15.6 [with a flag](../administration/feature_flags.md) named `work_items_mvc`. Disabled by default.
+> - Rich text editing in the full page view [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104533) in GitLab 15.7.
+
+FLAG:
+On self-managed GitLab, by default the rich text feature is not available. To make it available per group, ask an
+administrator
+to [enable the feature flag](../administration/feature_flags.md) named `work_items_mvc`. On GitLab.com, this feature
+is not available. The feature is not ready for production use.
+
+Use a rich text editor to edit a task's description.
+
+Prerequisites:
+
+- You must have at least the Reporter role for the project.
+
+To edit the description of a task:
+
+1. In the **Tasks** section, select the title of the task you want to edit.
+ The task window opens.
+1. Next to **Description**, select the edit icon (**{pencil}**). The description text box appears.
+1. Above the text box, select **Rich text**.
+1. Make your changes, and select **Save**.
+
## Remove a task from an issue
Prerequisites:
diff --git a/lib/gitlab/background_migration/destroy_invalid_members.rb b/lib/gitlab/background_migration/destroy_invalid_members.rb
index 17a141860ec..b274c71f24f 100644
--- a/lib/gitlab/background_migration/destroy_invalid_members.rb
+++ b/lib/gitlab/background_migration/destroy_invalid_members.rb
@@ -9,7 +9,7 @@ module Gitlab
def perform
each_sub_batch do |sub_batch|
deleted_members_data = sub_batch.map do |m|
- { id: m.id, source_id: m.source_id, source_type: m.source_type }
+ { id: m.id, source_id: m.source_id, source_type: m.source_type, access_level: m.access_level }
end
deleted_count = sub_batch.delete_all
diff --git a/lib/gitlab/memory/watchdog/configurator.rb b/lib/gitlab/memory/watchdog/configurator.rb
index 6d6f97dc8ba..82b1b02b63f 100644
--- a/lib/gitlab/memory/watchdog/configurator.rb
+++ b/lib/gitlab/memory/watchdog/configurator.rb
@@ -47,7 +47,7 @@ module Gitlab
memory_limit = ENV.fetch('PUMA_WORKER_MAX_MEMORY', 1200).to_i
stack.push Gitlab::Memory::Watchdog::Monitor::RssMemoryLimit,
- memory_limit: memory_limit,
+ memory_limit: memory_limit.megabytes,
max_strikes: max_strikes
end
end
diff --git a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb
index 332426de07e..99f1b1ab1ad 100644
--- a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb
+++ b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb
@@ -449,8 +449,11 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do
page.within '.diff-content' do
find('button[data-testid="resolve-discussion-button"]').click
+ wait_for_requests
+
find_field('Reply…').click
+ find('.js-unresolve-checkbox')
find('.js-note-text').set 'testing'
click_button 'Add comment now'
diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb
index 56a70f37779..1d99f7a8511 100644
--- a/spec/features/profiles/user_edit_profile_spec.rb
+++ b/spec/features/profiles/user_edit_profile_spec.rb
@@ -301,6 +301,8 @@ RSpec.describe 'User edit profile' do
find('.header-user-dropdown-toggle').click
page.within ".header-user" do
+ find('.js-set-status-modal-trigger.ready')
+
click_button button_text
end
end
diff --git a/spec/features/user_sees_marketing_header_spec.rb b/spec/features/user_sees_marketing_header_spec.rb
deleted file mode 100644
index eae964cec02..00000000000
--- a/spec/features/user_sees_marketing_header_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-require "spec_helper"
-
-RSpec.describe 'User sees experimental lmarketing header' do
- let_it_be(:project) { create(:project, :public) }
-
- context 'when not logged in' do
- it 'shows marketing header links', :aggregate_failures do
- visit project_path(project)
-
- expect(page).to have_text "About GitLab"
- expect(page).to have_text "Pricing"
- expect(page).to have_text "Talk to an expert"
- expect(page).to have_text "Sign up now"
- expect(page).to have_text "Login"
- end
- end
-
- context 'when logged in' do
- it 'does not show marketing header links', :aggregate_failures do
- sign_in(create(:user))
-
- visit project_path(project)
-
- expect(page).not_to have_text "About GitLab"
- expect(page).not_to have_text "Pricing"
- expect(page).not_to have_text "Talk to an expert"
- end
- end
-end
diff --git a/spec/frontend/branches/components/delete_branch_modal_spec.js b/spec/frontend/branches/components/delete_branch_modal_spec.js
index 2b8c8d408c4..c977868ca93 100644
--- a/spec/frontend/branches/components/delete_branch_modal_spec.js
+++ b/spec/frontend/branches/components/delete_branch_modal_spec.js
@@ -46,6 +46,7 @@ const findDeleteButton = () => wrapper.findByTestId('delete-branch-confirmation-
const findCancelButton = () => wrapper.findByTestId('delete-branch-cancel-button');
const findFormInput = () => wrapper.findComponent(GlFormInput);
const findForm = () => wrapper.find('form');
+const submitFormSpy = () => jest.spyOn(wrapper.vm.$refs.form, 'submit');
describe('Delete branch modal', () => {
const expectedUnmergedWarning =
@@ -73,12 +74,10 @@ describe('Delete branch modal', () => {
});
it('submits the form when the delete button is clicked', () => {
- const submitFormSpy = jest.spyOn(wrapper.vm.$refs.form, 'submit');
-
findDeleteButton().trigger('click');
expect(findForm().attributes('action')).toBe(deletePath);
- expect(submitFormSpy).toHaveBeenCalled();
+ expect(submitFormSpy()).toHaveBeenCalled();
});
it('calls show on the modal when a `openModal` event is received through the event hub', async () => {
@@ -136,7 +135,18 @@ describe('Delete branch modal', () => {
});
});
- it('opens with the delete button disabled and enables it when branch name is confirmed', async () => {
+ it('opens with the delete button disabled and doesn`t fire submit when clicked or pressed enter', async () => {
+ expect(findDeleteButton().props('disabled')).toBe(true);
+
+ findFormInput().vm.$emit('input', 'hello');
+
+ await waitForPromises();
+
+ findDeleteButton().trigger('click');
+ expect(submitFormSpy()).not.toHaveBeenCalled();
+ });
+
+ it('opens with the delete button disabled and enables it when branch name is confirmed and fires submit', async () => {
expect(findDeleteButton().props('disabled')).toBe(true);
findFormInput().vm.$emit('input', branchName);
@@ -144,6 +154,9 @@ describe('Delete branch modal', () => {
await waitForPromises();
expect(findDeleteButton().props('disabled')).not.toBe(true);
+
+ findDeleteButton().trigger('click');
+ expect(submitFormSpy()).toHaveBeenCalled();
});
});
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index 7f838167bd2..261d8c8c302 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -533,25 +533,15 @@ RSpec.describe ApplicationHelper do
end
describe '#page_class' do
- let_it_be(:expected_class) { 'logged-out-marketing-header' }
-
- let(:current_user) { nil }
-
- subject do
+ subject(:page_class) do
helper.page_class.flatten
end
before do
- allow(helper).to receive(:current_user) { current_user }
+ allow(helper).to receive(:current_user).and_return(nil)
end
- it { is_expected.to include(expected_class) }
-
- context 'when a user is logged in' do
- let(:current_user) { create(:user) }
-
- it { is_expected.not_to include(expected_class) }
- end
+ it { is_expected.not_to include('logged-out-marketing-header') }
end
describe '#dispensable_render' do
diff --git a/spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb b/spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb
index 9b0cb96b30b..5059ad620aa 100644
--- a/spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb
+++ b/spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb
@@ -103,7 +103,7 @@ RSpec.describe Gitlab::BackgroundMigration::DestroyInvalidMembers, :migration, s
members = create_members
member_data = members.map do |m|
- { id: m.id, source_id: m.source_id, source_type: m.source_type }
+ { id: m.id, source_id: m.source_id, source_type: m.source_type, access_level: m.access_level }
end
expect(Gitlab::AppLogger).to receive(:info).with({ message: 'Removing invalid member records',
diff --git a/spec/lib/gitlab/fips_spec.rb b/spec/lib/gitlab/fips_spec.rb
index 4d19a44f617..50ab2889ccf 100644
--- a/spec/lib/gitlab/fips_spec.rb
+++ b/spec/lib/gitlab/fips_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe Gitlab::FIPS do
let(:fips_mode_env_var) { nil }
before do
- expect(OpenSSL).to receive(:fips_mode).and_return(openssl_fips_mode)
+ allow(OpenSSL).to receive(:fips_mode).and_return(openssl_fips_mode)
stub_env("FIPS_MODE", fips_mode_env_var)
end
diff --git a/spec/lib/gitlab/memory/watchdog/configurator_spec.rb b/spec/lib/gitlab/memory/watchdog/configurator_spec.rb
index e6f2d57e9e6..86cbb724cfd 100644
--- a/spec/lib/gitlab/memory/watchdog/configurator_spec.rb
+++ b/spec/lib/gitlab/memory/watchdog/configurator_spec.rb
@@ -165,7 +165,7 @@ RSpec.describe Gitlab::Memory::Watchdog::Configurator do
end
context 'when settings are set via environment variables' do
- let(:memory_limit) { 1300 }
+ let(:memory_limit) { 1300.megabytes }
let(:max_strikes) { 4 }
before do
@@ -177,7 +177,7 @@ RSpec.describe Gitlab::Memory::Watchdog::Configurator do
end
context 'when settings are not set via environment variables' do
- let(:memory_limit) { 1200 }
+ let(:memory_limit) { 1200.megabytes }
let(:max_strikes) { 5 }
it_behaves_like 'as monitor configurator'
diff --git a/spec/migrations/20221002234454_finalize_group_member_namespace_id_migration_spec.rb b/spec/migrations/20221002234454_finalize_group_member_namespace_id_migration_spec.rb
new file mode 100644
index 00000000000..9c27005065d
--- /dev/null
+++ b/spec/migrations/20221002234454_finalize_group_member_namespace_id_migration_spec.rb
@@ -0,0 +1,72 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_migration!
+
+RSpec.describe FinalizeGroupMemberNamespaceIdMigration, :migration do
+ let(:batched_migrations) { table(:batched_background_migrations) }
+
+ let_it_be(:migration) { described_class::MIGRATION }
+
+ describe '#up' do
+ shared_examples 'finalizes the migration' do
+ it 'finalizes the migration' do
+ allow_next_instance_of(Gitlab::Database::BackgroundMigration::BatchedMigrationRunner) do |runner|
+ expect(runner).to receive(:finalize).with('BackfillMemberNamespaceForGroupMembers', :members, :id, [])
+ end
+ end
+ end
+
+ context 'when migration is missing' do
+ it 'warns migration not found' do
+ expect(Gitlab::AppLogger)
+ .to receive(:warn).with(/Could not find batched background migration for the given configuration:/)
+
+ migrate!
+ end
+ end
+
+ context 'with migration present' do
+ let!(:group_member_namespace_id_backfill) do
+ batched_migrations.create!(
+ job_class_name: 'BackfillMemberNamespaceForGroupMembers',
+ table_name: :members,
+ column_name: :id,
+ job_arguments: [],
+ interval: 2.minutes,
+ min_value: 1,
+ max_value: 2,
+ batch_size: 1000,
+ sub_batch_size: 200,
+ gitlab_schema: :gitlab_main,
+ status: 3 # finished
+ )
+ end
+
+ context 'when migration finished successfully' do
+ it 'does not raise exception' do
+ expect { migrate! }.not_to raise_error
+ end
+ end
+
+ context 'with different migration statuses' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:status, :description) do
+ 0 | 'paused'
+ 1 | 'active'
+ 4 | 'failed'
+ 5 | 'finalizing'
+ end
+
+ with_them do
+ before do
+ group_member_namespace_id_backfill.update!(status: status)
+ end
+
+ it_behaves_like 'finalizes the migration'
+ end
+ end
+ end
+ end
+end
diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb
index 222cbe9feeb..7bd1f0c5dfa 100644
--- a/spec/support/database_cleaner.rb
+++ b/spec/support/database_cleaner.rb
@@ -22,14 +22,4 @@ RSpec.configure do |config|
self.class.use_transactional_tests = true
end
-
- config.around(:each, :migration) do |example|
- self.class.use_transactional_tests = false
-
- example.run
-
- delete_from_all_tables!(except: deletion_except_tables)
-
- self.class.use_transactional_tests = true
- end
end
diff --git a/spec/support/migration.rb b/spec/support/migration.rb
index 2a69630a29a..4d4a293e9ff 100644
--- a/spec/support/migration.rb
+++ b/spec/support/migration.rb
@@ -45,6 +45,8 @@ RSpec.configure do |config|
example.run
end
+ delete_from_all_tables!(except: deletion_except_tables)
+
self.class.use_transactional_tests = true
end