Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-08-24 21:09:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-08-24 21:09:54 +0300
commitdc900fdc5f4c353ff2e261fc64fbbb0d87af1735 (patch)
tree62e1b6c93128a67b8dff2045c65342f8f7b03949
parent8d98d0dd3abaacdeaf183b9ea39a292ea52cae45 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--Gemfile6
-rw-r--r--Gemfile.checksum2
-rw-r--r--Gemfile.lock8
-rw-r--r--app/assets/javascripts/ci/runner/components/runner_create_form.vue2
-rw-r--r--app/assets/javascripts/ci/runner/components/runner_form_fields.vue15
-rw-r--r--app/assets/javascripts/ci/runner/components/runner_update_form.vue2
-rw-r--r--app/assets/javascripts/issues/show/components/description.vue3
-rw-r--r--app/assets/javascripts/issues/show/components/task_list_item_actions.vue17
-rw-r--r--app/assets/javascripts/service_desk/components/service_desk_list_app.vue17
-rw-r--r--app/helpers/ci/status_helper.rb28
-rw-r--r--app/models/concerns/issuable.rb4
-rw-r--r--app/models/merge_request.rb6
-rw-r--r--app/services/issuable_base_service.rb6
-rw-r--r--app/services/merge_requests/base_service.rb3
-rw-r--r--app/services/merge_requests/build_service.rb2
-rw-r--r--config/initializers/licensee_license_patch.rb14
-rw-r--r--db/migrate/20230802205051_add_admin_merge_request_to_member_roles.rb17
-rw-r--r--db/schema_migrations/202308022050511
-rw-r--r--db/structure.sql1
-rw-r--r--doc/api/branches.md63
-rw-r--r--doc/api/member_roles.md11
-rw-r--r--doc/development/testing_guide/end_to_end/beginners_guide.md2
-rw-r--r--doc/security/two_factor_authentication.md43
-rw-r--r--doc/update/background_migrations.md215
-rw-r--r--doc/update/versions/gitlab_15_changes.md2
-rw-r--r--doc/user/group/manage.md6
-rw-r--r--doc/user/group/saml_sso/scim_setup.md3
-rw-r--r--doc/user/permissions.md4
-rw-r--r--doc/user/project/repository/code_suggestions.md442
-rw-r--r--doc/user/project/repository/code_suggestions/index.md192
-rw-r--r--doc/user/project/repository/code_suggestions/saas.md63
-rw-r--r--doc/user/project/repository/code_suggestions/self_managed.md176
-rw-r--r--doc/user/project/repository/code_suggestions/troubleshooting.md69
-rw-r--r--spec/features/admin/admin_runners_spec.rb2
-rw-r--r--spec/features/groups/group_runners_spec.rb2
-rw-r--r--spec/features/runners_spec.rb5
-rw-r--r--spec/frontend/ci/runner/components/runner_create_form_spec.js1
-rw-r--r--spec/frontend/ci/runner/components/runner_form_fields_spec.js3
-rw-r--r--spec/frontend/ci/runner/components/runner_update_form_spec.js2
-rw-r--r--spec/frontend/issues/show/components/task_list_item_actions_spec.js52
-rw-r--r--spec/frontend/service_desk/components/service_desk_list_app_spec.js23
-rw-r--r--spec/helpers/ci/status_helper_spec.rb23
-rw-r--r--spec/lib/gitlab/middleware/webhook_recursion_detection_spec.rb2
-rw-r--r--spec/models/concerns/issuable_spec.rb16
-rw-r--r--spec/models/merge_request_spec.rb26
-rw-r--r--spec/support/shared_examples/features/runners_shared_examples.rb7
46 files changed, 913 insertions, 696 deletions
diff --git a/Gemfile b/Gemfile
index 4c99c7d1e90..b1bcdacfff5 100644
--- a/Gemfile
+++ b/Gemfile
@@ -308,10 +308,8 @@ gem 'babosa', '~> 2.0'
# Sanitizes SVG input
gem 'loofah', '~> 2.21.3'
-# Working with license
-# Detects the open source license the repository includes
-# This version needs to be in sync with gitlab-org/gitaly
-gem 'licensee', '~> 9.15'
+# Used to provide license templates
+gem 'licensee', '~> 9.16'
# Detect and convert string character encoding
gem 'charlock_holmes', '~> 0.7.7'
diff --git a/Gemfile.checksum b/Gemfile.checksum
index f4f55bbea71..976fa3a14c4 100644
--- a/Gemfile.checksum
+++ b/Gemfile.checksum
@@ -336,7 +336,7 @@
{"name":"letter_opener_web","version":"2.0.0","platform":"ruby","checksum":"33860ad41e1785d75456500e8ca8bba8ed71ee6eaf08a98d06bbab67c5577b6f"},
{"name":"libyajl2","version":"1.2.0","platform":"ruby","checksum":"1117cd1e48db013b626e36269bbf1cef210538ca6d2e62d3fa3db9ded005b258"},
{"name":"license_finder","version":"7.0.1","platform":"ruby","checksum":"0b22c9567e2a8b102c7245da49ebeddaec60f66d237d2bb91b9feddf5d242f6a"},
-{"name":"licensee","version":"9.15.2","platform":"ruby","checksum":"4b6959b544da88499d3be0d9f486179c90b93d5049ef500ae340ac1420493ded"},
+{"name":"licensee","version":"9.16.0","platform":"ruby","checksum":"7b1693639019dbb1d3e020d72c4470ca84da3cfc67e4d6da1d1cdcb736d09044"},
{"name":"listen","version":"3.7.1","platform":"ruby","checksum":"3b80caa7aa77fae836916c2f9e3fbcafbd15f5d695dd487c1f5b5e7e465efe29"},
{"name":"llhttp-ffi","version":"0.4.0","platform":"ruby","checksum":"e5f7327db3cf8007e648342ef76347d6e0ae545a8402e519cca9c886eb37b001"},
{"name":"locale","version":"2.1.3","platform":"ruby","checksum":"b6ddee011e157817cb98e521b3ce7cb626424d5882f1e844aafdee3e8b212725"},
diff --git a/Gemfile.lock b/Gemfile.lock
index c266e3a5d75..fd4ce6feee0 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -959,10 +959,10 @@ GEM
tomlrb (>= 1.3, < 2.1)
with_env (= 1.1.0)
xml-simple (~> 1.1.9)
- licensee (9.15.2)
+ licensee (9.16.0)
dotenv (~> 2.0)
- octokit (~> 4.20)
- reverse_markdown (~> 1.0)
+ octokit (>= 4.20, < 7.0)
+ reverse_markdown (>= 1, < 3)
rugged (>= 0.24, < 2.0)
thor (>= 0.19, < 2.0)
listen (3.7.1)
@@ -1882,7 +1882,7 @@ DEPENDENCIES
lefthook (~> 1.4.7)
letter_opener_web (~> 2.0.0)
license_finder (~> 7.0)
- licensee (~> 9.15)
+ licensee (~> 9.16)
listen (~> 3.7)
lockbox (~> 1.1.1)
lograge (~> 0.5)
diff --git a/app/assets/javascripts/ci/runner/components/runner_create_form.vue b/app/assets/javascripts/ci/runner/components/runner_create_form.vue
index 1b363174d28..adaed77055a 100644
--- a/app/assets/javascripts/ci/runner/components/runner_create_form.vue
+++ b/app/assets/javascripts/ci/runner/components/runner_create_form.vue
@@ -120,7 +120,7 @@ export default {
</script>
<template>
<gl-form @submit.prevent="onSubmit">
- <runner-form-fields v-model="runner" />
+ <runner-form-fields v-model="runner" :runner-type="runnerType" />
<div class="gl-display-flex gl-mt-6">
<gl-button type="submit" variant="confirm" class="js-no-auto-disable" :loading="saving">
diff --git a/app/assets/javascripts/ci/runner/components/runner_form_fields.vue b/app/assets/javascripts/ci/runner/components/runner_form_fields.vue
index d090a562ff7..38e36733045 100644
--- a/app/assets/javascripts/ci/runner/components/runner_form_fields.vue
+++ b/app/assets/javascripts/ci/runner/components/runner_form_fields.vue
@@ -10,7 +10,12 @@ import {
GlSkeletonLoader,
} from '@gitlab/ui';
import { helpPagePath } from '~/helpers/help_page_helper';
-import { ACCESS_LEVEL_NOT_PROTECTED, ACCESS_LEVEL_REF_PROTECTED, PROJECT_TYPE } from '../constants';
+import {
+ ACCESS_LEVEL_NOT_PROTECTED,
+ ACCESS_LEVEL_REF_PROTECTED,
+ PROJECT_TYPE,
+ RUNNER_TYPES,
+} from '../constants';
export default {
name: 'RunnerFormFields',
@@ -26,6 +31,12 @@ export default {
import('ee_component/ci/runner/components/runner_maintenance_note_field.vue'),
},
props: {
+ runnerType: {
+ type: String,
+ required: false,
+ default: null,
+ validator: (t) => RUNNER_TYPES.includes(t),
+ },
value: {
type: Object,
default: null,
@@ -44,7 +55,7 @@ export default {
},
computed: {
canBeLockedToProject() {
- return this.value?.runnerType === PROJECT_TYPE;
+ return this.runnerType === PROJECT_TYPE;
},
},
watch: {
diff --git a/app/assets/javascripts/ci/runner/components/runner_update_form.vue b/app/assets/javascripts/ci/runner/components/runner_update_form.vue
index 6b94e594f1c..4278615ba66 100644
--- a/app/assets/javascripts/ci/runner/components/runner_update_form.vue
+++ b/app/assets/javascripts/ci/runner/components/runner_update_form.vue
@@ -96,7 +96,7 @@ export default {
</script>
<template>
<gl-form @submit.prevent="onSubmit">
- <runner-form-fields v-model="model" :loading="loading" />
+ <runner-form-fields v-model="model" :loading="loading" :runner-type="runnerType" />
<runner-update-cost-factor-fields v-model="model" :runner-type="runnerType" />
<div class="gl-mt-6">
diff --git a/app/assets/javascripts/issues/show/components/description.vue b/app/assets/javascripts/issues/show/components/description.vue
index 90f01603f96..acbba216601 100644
--- a/app/assets/javascripts/issues/show/components/description.vue
+++ b/app/assets/javascripts/issues/show/components/description.vue
@@ -307,7 +307,8 @@ export default {
);
taskListItems?.forEach((item) => {
- const dropdown = this.createTaskListItemActions({ canUpdate: this.canUpdate });
+ const provide = { canUpdate: this.canUpdate, issuableType: this.issuableType };
+ const dropdown = this.createTaskListItemActions(provide);
this.insertNextToTaskListItemText(dropdown, item);
this.addPointerEventListeners(item, '.task-list-item-actions');
this.hasTaskListItemActions = true;
diff --git a/app/assets/javascripts/issues/show/components/task_list_item_actions.vue b/app/assets/javascripts/issues/show/components/task_list_item_actions.vue
index 64b916caddb..55e2e857050 100644
--- a/app/assets/javascripts/issues/show/components/task_list_item_actions.vue
+++ b/app/assets/javascripts/issues/show/components/task_list_item_actions.vue
@@ -1,5 +1,6 @@
<script>
import { GlDisclosureDropdown, GlDisclosureDropdownItem } from '@gitlab/ui';
+import { TYPE_INCIDENT, TYPE_ISSUE } from '~/issues/constants';
import { __, s__ } from '~/locale';
import eventHub from '../event_hub';
@@ -13,7 +14,12 @@ export default {
GlDisclosureDropdown,
GlDisclosureDropdownItem,
},
- inject: ['canUpdate'],
+ inject: ['canUpdate', 'issuableType'],
+ computed: {
+ showConvertToTaskItem() {
+ return [TYPE_INCIDENT, TYPE_ISSUE].includes(this.issuableType);
+ },
+ },
methods: {
convertToTask() {
eventHub.$emit('convert-task-list-item', this.$el.closest('li').dataset.sourcepos);
@@ -37,12 +43,17 @@ export default {
text-sr-only
toggle-class="task-list-item-actions gl-opacity-0 gl-p-2! "
>
- <gl-disclosure-dropdown-item class="gl-ml-2!" @action="convertToTask">
+ <gl-disclosure-dropdown-item
+ v-if="showConvertToTaskItem"
+ class="gl-ml-2!"
+ data-testid="convert"
+ @action="convertToTask"
+ >
<template #list-item>
{{ $options.i18n.convertToTask }}
</template>
</gl-disclosure-dropdown-item>
- <gl-disclosure-dropdown-item class="gl-ml-2!" @action="deleteTaskListItem">
+ <gl-disclosure-dropdown-item class="gl-ml-2!" data-testid="delete" @action="deleteTaskListItem">
<template #list-item>
<span class="gl-text-red-500!">{{ $options.i18n.delete }}</span>
</template>
diff --git a/app/assets/javascripts/service_desk/components/service_desk_list_app.vue b/app/assets/javascripts/service_desk/components/service_desk_list_app.vue
index 51e632d36a9..8782d7792cc 100644
--- a/app/assets/javascripts/service_desk/components/service_desk_list_app.vue
+++ b/app/assets/javascripts/service_desk/components/service_desk_list_app.vue
@@ -121,7 +121,7 @@ export default {
sortKey: CREATED_DESC,
state: STATUS_OPEN,
pageSize: DEFAULT_PAGE_SIZE,
- issuesError: null,
+ issuesError: '',
};
},
apollo: {
@@ -234,11 +234,14 @@ export default {
page_before: this.pageParams.beforeCursor ?? undefined,
};
},
+ hasAnyServiceDeskIssue() {
+ return this.hasSearch || Boolean(this.tabCounts.all);
+ },
isInfoBannerVisible() {
- return this.isServiceDeskSupported && this.hasAnyServiceDeskIssues;
+ return this.isServiceDeskSupported && this.hasAnyServiceDeskIssue;
},
- hasAnyServiceDeskIssues() {
- return this.hasSearch || Boolean(this.tabCounts.all);
+ canShowIssuesList() {
+ return this.isLoading || this.issuesError.length || this.hasAnyServiceDeskIssue;
},
hasOrFeature() {
return this.glFeatures.orIssuableQueries;
@@ -415,6 +418,9 @@ export default {
this.$router.push({ query: this.urlParams });
},
+ handleDismissAlert() {
+ this.issuesError = '';
+ },
handleNextPage() {
this.pageParams = {
afterCursor: this.pageInfo.endCursor,
@@ -553,7 +559,7 @@ export default {
<section>
<info-banner v-if="isInfoBannerVisible" />
<issuable-list
- v-if="isLoading || hasAnyServiceDeskIssues"
+ v-if="canShowIssuesList"
namespace="service-desk"
recent-searches-storage-key="service-desk-issues"
:error="issuesError"
@@ -576,6 +582,7 @@ export default {
sync-filter-and-sort
use-keyset-pagination
@click-tab="handleClickTab"
+ @dismiss-alert="handleDismissAlert"
@filter="handleFilter"
@sort="handleSort"
@reorder="handleReorder"
diff --git a/app/helpers/ci/status_helper.rb b/app/helpers/ci/status_helper.rb
index ea5b613cb78..73aec454f1d 100644
--- a/app/helpers/ci/status_helper.rb
+++ b/app/helpers/ci/status_helper.rb
@@ -30,34 +30,6 @@ module Ci
s_(translation)
end
- def ci_text_for_status(status)
- if detailed_status?(status)
- return status.text
- end
-
- case status
- when 'success'
- s_('CiStatusText|passed')
- when 'success-with-warnings'
- s_('CiStatusText|passed')
- when 'manual'
- s_('CiStatusText|blocked')
- when 'scheduled'
- s_('CiStatusText|delayed')
- else
- # All states are already being translated inside the detailed statuses:
- # :running => Gitlab::Ci::Status::Running
- # :skipped => Gitlab::Ci::Status::Skipped
- # :failed => Gitlab::Ci::Status::Failed
- # :success => Gitlab::Ci::Status::Success
- # :canceled => Gitlab::Ci::Status::Canceled
- # The following states are customized above:
- # :manual => Gitlab::Ci::Status::Manual
- status_translation = "CiStatusText|#{status}"
- s_(status_translation)
- end
- end
-
def ci_status_for_statuseable(subject)
status = subject.try(:status) || 'not found'
status.humanize
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb
index 9a513ea0e5b..fbd1f1115ca 100644
--- a/app/models/concerns/issuable.rb
+++ b/app/models/concerns/issuable.rb
@@ -225,6 +225,10 @@ module Issuable
false
end
+ def supports_lock_on_merge?
+ false
+ end
+
def severity
return IssuableSeverity::DEFAULT unless supports_severity?
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index d157b65c78e..484af2d0217 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -734,6 +734,12 @@ class MergeRequest < ApplicationRecord
true
end
+ def supports_lock_on_merge?
+ return false unless merged?
+
+ Feature.enabled?(:enforce_locked_labels_on_merge, project, type: :ops)
+ end
+
# Calls `MergeWorker` to proceed with the merge process and
# updates `merge_jid` with the MergeWorker#jid.
# This helps tracking enqueued and ongoing merge jobs.
diff --git a/app/services/issuable_base_service.rb b/app/services/issuable_base_service.rb
index 3b007d4dba7..6c229dca58c 100644
--- a/app/services/issuable_base_service.rb
+++ b/app/services/issuable_base_service.rb
@@ -169,7 +169,7 @@ class IssuableBaseService < ::BaseContainerService
params[:incident_management_issuable_escalation_status_attributes] = result[:escalation_status]
end
- def process_label_ids(attributes, existing_label_ids: nil, extra_label_ids: [])
+ def process_label_ids(attributes, issuable:, existing_label_ids: nil, extra_label_ids: []) # rubocop:disable Lint/UnusedMethodArgument
label_ids = attributes.delete(:label_ids)
add_label_ids = attributes.delete(:add_label_ids)
remove_label_ids = attributes.delete(:remove_label_ids)
@@ -221,7 +221,7 @@ class IssuableBaseService < ::BaseContainerService
params.delete(:state_event)
params[:author] ||= current_user
- params[:label_ids] = process_label_ids(params, extra_label_ids: issuable.label_ids.to_a)
+ params[:label_ids] = process_label_ids(params, issuable: issuable, extra_label_ids: issuable.label_ids.to_a)
if issuable.respond_to?(:assignee_ids)
params[:assignee_ids] = process_assignee_ids(params, extra_assignee_ids: issuable.assignee_ids.to_a)
@@ -469,7 +469,7 @@ class IssuableBaseService < ::BaseContainerService
# rubocop: enable CodeReuse/ActiveRecord
def assign_requested_labels(issuable)
- label_ids = process_label_ids(params, existing_label_ids: issuable.label_ids)
+ label_ids = process_label_ids(params, issuable: issuable, existing_label_ids: issuable.label_ids)
return unless ids_changing?(issuable.label_ids, label_ids)
params[:label_ids] = label_ids
diff --git a/app/services/merge_requests/base_service.rb b/app/services/merge_requests/base_service.rb
index 0fc85675e49..a50a15c888e 100644
--- a/app/services/merge_requests/base_service.rb
+++ b/app/services/merge_requests/base_service.rb
@@ -185,8 +185,7 @@ module MergeRequests
# Only supported for merged MRs.
def filter_locked_labels(merge_request)
return unless params[:remove_label_ids].present?
- return unless merge_request.merged?
- return unless Feature.enabled?(:enforce_locked_labels_on_merge, merge_request.project, type: :ops)
+ return unless merge_request.supports_lock_on_merge?
params[:remove_label_ids] -= labels_service.filter_locked_labels_ids_in_param(:remove_label_ids)
end
diff --git a/app/services/merge_requests/build_service.rb b/app/services/merge_requests/build_service.rb
index b8853e8bcbc..b24bbe1b9d9 100644
--- a/app/services/merge_requests/build_service.rb
+++ b/app/services/merge_requests/build_service.rb
@@ -74,7 +74,7 @@ module MergeRequests
# IssuableBaseService#process_label_ids and
# IssuableBaseService#process_assignee_ids take care
# of the removal.
- params[:label_ids] = process_label_ids(params, extra_label_ids: merge_request.label_ids.to_a)
+ params[:label_ids] = process_label_ids(params, issuable: merge_request, extra_label_ids: merge_request.label_ids.to_a)
params[:assignee_ids] = process_assignee_ids(params, extra_assignee_ids: merge_request.assignee_ids.to_a)
diff --git a/config/initializers/licensee_license_patch.rb b/config/initializers/licensee_license_patch.rb
deleted file mode 100644
index d4680db5071..00000000000
--- a/config/initializers/licensee_license_patch.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-require 'licensee/license'
-
-module Licensee
- module LicensePatch
- # Patch from https://github.com/licensee/licensee/pull/589
- def ==(other)
- other.is_a?(self.class) && key == other.key
- end
- end
-
- License.prepend LicensePatch
-end
diff --git a/db/migrate/20230802205051_add_admin_merge_request_to_member_roles.rb b/db/migrate/20230802205051_add_admin_merge_request_to_member_roles.rb
new file mode 100644
index 00000000000..52560621c9a
--- /dev/null
+++ b/db/migrate/20230802205051_add_admin_merge_request_to_member_roles.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddAdminMergeRequestToMemberRoles < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ return if column_exists?(:member_roles, :admin_merge_request)
+
+ add_column :member_roles, :admin_merge_request, :boolean, default: false, null: false
+ end
+
+ def down
+ return unless column_exists?(:member_roles, :admin_merge_request)
+
+ remove_column :member_roles, :admin_merge_request
+ end
+end
diff --git a/db/schema_migrations/20230802205051 b/db/schema_migrations/20230802205051
new file mode 100644
index 00000000000..3f09a569f68
--- /dev/null
+++ b/db/schema_migrations/20230802205051
@@ -0,0 +1 @@
+f682f6c1dd19fa508282bfcd30e61197652bf14b4f0717ef2313a920f0eb3516 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index d6c098d143b..63023ead1ab 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -18143,6 +18143,7 @@ CREATE TABLE member_roles (
read_dependency boolean DEFAULT false NOT NULL,
name text DEFAULT 'Custom'::text NOT NULL,
description text,
+ admin_merge_request boolean DEFAULT false NOT NULL,
CONSTRAINT check_4364846f58 CHECK ((char_length(description) <= 255)),
CONSTRAINT check_9907916995 CHECK ((char_length(name) <= 255))
);
diff --git a/doc/api/branches.md b/doc/api/branches.md
index b925d3ddadf..dc269664c59 100644
--- a/doc/api/branches.md
+++ b/doc/api/branches.md
@@ -50,19 +50,22 @@ Example response:
"can_push": true,
"web_url": "https://gitlab.example.com/my-group/my-project/-/tree/main",
"commit": {
- "author_email": "john@example.com",
- "author_name": "John Smith",
- "authored_date": "2012-06-27T05:51:39-07:00",
- "committed_date": "2012-06-28T03:44:20-07:00",
- "committer_email": "john@example.com",
- "committer_name": "John Smith",
"id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
"short_id": "7b5c3cc",
- "title": "add projects API",
- "message": "add projects API",
+ "created_at": "2012-06-28T03:44:20-07:00",
"parent_ids": [
"4ad91d3c1144c406e50c7b33bae684bd6837faf8"
- ]
+ ],
+ "title": "add projects API",
+ "message": "add projects API",
+ "author_name": "John Smith",
+ "author_email": "john@example.com",
+ "authored_date": "2012-06-27T05:51:39-07:00",
+ "committer_name": "John Smith",
+ "committer_email": "john@example.com",
+ "committed_date": "2012-06-28T03:44:20-07:00",
+ "trailers": {},
+ "web_url": "https://gitlab.example.com/my-group/my-project/-/commit/7b5c3cc8be40ee161ae89a06bba6229da1032a0c"
}
},
...
@@ -106,19 +109,22 @@ Example response:
"can_push": true,
"web_url": "https://gitlab.example.com/my-group/my-project/-/tree/main",
"commit": {
- "author_email": "john@example.com",
- "author_name": "John Smith",
- "authored_date": "2012-06-27T05:51:39-07:00",
- "committed_date": "2012-06-28T03:44:20-07:00",
- "committer_email": "john@example.com",
- "committer_name": "John Smith",
"id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
"short_id": "7b5c3cc",
- "title": "add projects API",
- "message": "add projects API",
+ "created_at": "2012-06-28T03:44:20-07:00",
"parent_ids": [
"4ad91d3c1144c406e50c7b33bae684bd6837faf8"
- ]
+ ],
+ "title": "add projects API",
+ "message": "add projects API",
+ "author_name": "John Smith",
+ "author_email": "john@example.com",
+ "authored_date": "2012-06-27T05:51:39-07:00",
+ "committer_name": "John Smith",
+ "committer_email": "john@example.com",
+ "committed_date": "2012-06-28T03:44:20-07:00",
+ "trailers": {},
+ "web_url": "https://gitlab.example.com/my-group/my-project/-/commit/7b5c3cc8be40ee161ae89a06bba6229da1032a0c"
}
}
```
@@ -160,19 +166,22 @@ Example response:
```json
{
"commit": {
- "author_email": "john@example.com",
- "author_name": "John Smith",
- "authored_date": "2012-06-27T05:51:39-07:00",
- "committed_date": "2012-06-28T03:44:20-07:00",
- "committer_email": "john@example.com",
- "committer_name": "John Smith",
"id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
"short_id": "7b5c3cc",
- "title": "add projects API",
- "message": "add projects API",
+ "created_at": "2012-06-28T03:44:20-07:00",
"parent_ids": [
"4ad91d3c1144c406e50c7b33bae684bd6837faf8"
- ]
+ ],
+ "title": "add projects API",
+ "message": "add projects API",
+ "author_name": "John Smith",
+ "author_email": "john@example.com",
+ "authored_date": "2012-06-27T05:51:39-07:00",
+ "committer_name": "John Smith",
+ "committer_email": "john@example.com",
+ "committed_date": "2012-06-28T03:44:20-07:00",
+ "trailers": {},
+ "web_url": "https://gitlab.example.com/my-group/my-project/-/commit/7b5c3cc8be40ee161ae89a06bba6229da1032a0c"
},
"name": "newbranch",
"merged": false,
diff --git a/doc/api/member_roles.md b/doc/api/member_roles.md
index 9d3e51efabd..311f43bcebf 100644
--- a/doc/api/member_roles.md
+++ b/doc/api/member_roles.md
@@ -12,6 +12,11 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - [Admin vulnerability added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121534) in GitLab 16.1.
> - [Read dependency added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126247) in GitLab 16.3.
> - [Name and description fields added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126423) in GitLab 16.3.
+> - [Admin merge request introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128302) in GitLab 16.4 [with a flag](../administration/feature_flags.md) named `admin_merge_request`. Disabled by default.
+
+FLAG:
+On self-managed GitLab, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../administration/feature_flags.md) named `admin_merge_request`.
+On GitLab.com, this feature is not available.
## List all member roles of a group
@@ -34,6 +39,7 @@ If successful, returns [`200`](rest/index.md#status-codes) and the following res
| `[].description` | string | The description of the member role. |
| `[].group_id` | integer | The ID of the group that the member role belongs to. |
| `[].base_access_level` | integer | Base access level for member role. Valid values are 10 (Guest), 20 (Reporter), 30 (Developer), 40 (Maintainer), or 50 (Owner).|
+| `[].admin_merge_request` | boolean | Permission to admin project merge requests and enables the ability to `download_code`. |
| `[].admin_vulnerability` | boolean | Permission to admin project vulnerabilities. |
| `[].read_code` | boolean | Permission to read project code. |
| `[].read_dependency` | boolean | Permission to read project dependencies. |
@@ -55,6 +61,7 @@ Example response:
"description: "Custom guest that can read code",
"group_id": 84,
"base_access_level": 10,
+ "admin_merge_request": false,
"admin_vulnerability": false,
"read_code": true,
"read_dependency": false,
@@ -66,6 +73,7 @@ Example response:
"description: "Custom guest that read and admin security entities",
"group_id": 84,
"base_access_level": 10,
+ "admin_merge_request": false,
"admin_vulnerability": true,
"read_code": false,
"read_dependency": true,
@@ -92,6 +100,7 @@ To add a member role to a group, the group must be at root-level (have no parent
| `name` | string | yes | The name of the member role. |
| `description` | string | no | The description of the member role. |
| `base_access_level` | integer | yes | Base access level for configured role. Valid values are 10 (Guest), 20 (Reporter), 30 (Developer), 40 (Maintainer), or 50 (Owner).|
+| `admin_merge_request` | boolean | no | Permission to admin project merge requests. |
| `admin_vulnerability` | boolean | no | Permission to admin project vulnerabilities. |
| `read_code` | boolean | no | Permission to read project code. |
| `read_dependency` | boolean | no | Permission to read project dependencies. |
@@ -106,6 +115,7 @@ If successful, returns [`201`](rest/index.md#status-codes) and the following att
| `description` | string | The description of the member role. |
| `group_id` | integer | The ID of the group that the member role belongs to. |
| `base_access_level` | integer | Base access level for member role. |
+| `admin_merge_request` | boolean | Permission to admin project merge requests. |
| `admin_vulnerability` | boolean | Permission to admin project vulnerabilities. |
| `read_code` | boolean | Permission to read project code. |
| `read_dependency` | boolean | Permission to read project dependencies. |
@@ -126,6 +136,7 @@ Example response:
"description": null,
"group_id": 84,
"base_access_level": 10,
+ "admin_merge_requests": false,
"admin_vulnerability": false,
"read_code": true,
"read_dependency": false,
diff --git a/doc/development/testing_guide/end_to_end/beginners_guide.md b/doc/development/testing_guide/end_to_end/beginners_guide.md
index 3f372f64b2c..12f90e0d88c 100644
--- a/doc/development/testing_guide/end_to_end/beginners_guide.md
+++ b/doc/development/testing_guide/end_to_end/beginners_guide.md
@@ -266,7 +266,7 @@ ensuring we now sign in at the beginning of each test.
Next, let's test something other than Login. Let's test Issues, which are owned by the Plan
stage and the Project Management Group, so [create a file](#identify-the-devops-stage) in
-`qa/specs/features/browser_ui/3_create/issues` called `issues_spec.rb`.
+`qa/specs/features/browser_ui/2_plan/issue` called `issues_spec.rb`.
```ruby
# frozen_string_literal: true
diff --git a/doc/security/two_factor_authentication.md b/doc/security/two_factor_authentication.md
index 26b723840c2..a7bb83b8ee5 100644
--- a/doc/security/two_factor_authentication.md
+++ b/doc/security/two_factor_authentication.md
@@ -25,7 +25,9 @@ Administrators can enforce 2FA for all users in two different ways:
After the configured grace period has elapsed, users can sign in but
cannot leave the 2FA configuration area at `/-/profile/two_factor_auth`.
-To enable 2FA for all users:
+You can use the UI or the API to enforce 2FA for all users.
+
+### Use the UI
1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
1. Select **Admin Area**.
@@ -35,14 +37,14 @@ To enable 2FA for all users:
- In **Two-factor grace period**, enter a number of hours. If you want to
enforce 2FA on next sign-in attempt, enter `0`.
-### Disable 2FA enforcement through Rails console
+### Use the API
-Using the [Rails console](../administration/operations/rails_console.md), enforcing 2FA for
-all user can be disabled. Connect to the Rails console and run:
+Use the [application settings API](../api/settings.md) to modify the following settings:
-```ruby
-Gitlab::CurrentSettings.update!('require_two_factor_authentication': false)
-```
+- `require_two_factor_authentication`.
+- `two_factor_grace_period`.
+
+For more information, see the [list of settings that can be accessed through API calls](../api/settings.md#list-of-settings-that-can-be-accessed-via-api-calls).
## Enforce 2FA for all users in a group **(FREE ALL)**
@@ -90,23 +92,22 @@ The following are important notes about 2FA:
## Disable 2FA **(FREE SELF)**
+You can disable 2FA for a single user or all users.
+
+This is a permanent and irreversible action. Users must reactivate 2FA to use it again.
+
WARNING:
Disabling 2FA for users does not disable the [enforce 2FA for all users](#enforce-2fa-for-all-users)
or [enforce 2FA for all users in a group](#enforce-2fa-for-all-users-in-a-group)
settings. You must also disable any enforced 2FA settings so users aren't asked to set up 2FA again
when they next sign in to GitLab.
-WARNING:
-This is a permanent and irreversible action. Users must reactivate 2FA to use it again.
-
### For a single user
-To disable 2FA for non-administrator users, you should use the [API endpoint](../api/users.md#disable-two-factor-authentication)
-instead of the Rails console.
-Using the [Rails console](../administration/operations/rails_console.md), 2FA for a single user can be disabled.
-Connect to the Rails console and run:
+#### Administrators
-**In GitLab 13.5 and later:**
+In GitLab 13.5 and later, use the [Rails console](../administration/operations/rails_console.md)
+to disable 2FA for a single administrator:
```ruby
admin = User.find_by_username('<USERNAME>')
@@ -115,7 +116,17 @@ user_to_disable = User.find_by_username('<USERNAME>')
TwoFactor::DestroyService.new(admin, user: user_to_disable).execute
```
-The target user is notified that 2FA has been disabled.
+The administrator is notified that 2FA has been disabled.
+
+#### Non-administrators
+
+In GitLab 15.2 and later, you can use either the Rails console or the
+[API endpoint](../api/users.md#disable-two-factor-authentication) to disable 2FA
+for a non-administrator.
+
+You can disable 2FA for your own account.
+
+You cannot use the API endpoint to disable 2FA for administrators.
### For all users
diff --git a/doc/update/background_migrations.md b/doc/update/background_migrations.md
index a95a39cc8d6..df843e6e047 100644
--- a/doc/update/background_migrations.md
+++ b/doc/update/background_migrations.md
@@ -190,20 +190,28 @@ the number of batched background migrations executed in parallel:
ApplicationSetting.update_all(database_max_running_batched_background_migrations: 4)
```
-### Fix and retry failed batched background migrations
+### Resolve failed batched background migrations
+
+If a batched background migration fails, [fix and retry](#fix-and-retry-the-migration) it.
+If the migration continues to fail with an error, either:
+
+- [Finish the failed migration manually](#finish-a-failed-migration-manually)
+- [Mark the failed migration finished](#mark-a-failed-migration-finished)
+
+#### Fix and retry the migration
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67504) in GitLab 14.3.
-If you [check the status](#check-the-status-of-batched-background-migrations) of batched background migrations,
-some migrations might display in the **Failed** tab with a **failed** status:
+All failed batched background migrations must be resolved to upgrade to a newer
+version of GitLab. If you [check the status](#check-the-status-of-batched-background-migrations)
+of batched background migrations, some migrations might display in the **Failed** tab
+with a **failed** status:
![failed batched background migrations table](img/batched_background_migrations_failed_v14_3.png)
-You must resolve all failed batched background migrations to upgrade to a newer
-version of GitLab.
-
To determine why the batched background migration failed,
-[view the failure error logs](../development/database/batched_background_migrations.md#viewing-failure-error-logs) or:
+[view the failure error logs](../development/database/batched_background_migrations.md#viewing-failure-error-logs)
+or view error information in the UI.
Prerequisites:
@@ -219,7 +227,7 @@ Prerequisites:
If you are a GitLab customer, consider opening a [Support Request](https://support.gitlab.com/hc/en-us/requests/new)
to debug why the batched background migrations failed.
-To correct the problem, you can retry the failed batched background migrations:
+To correct the problem, you can retry the failed migration.
Prerequisites:
@@ -235,6 +243,107 @@ To monitor the retried batched background migrations, you can
[check the status of batched background migrations](#check-the-status-of-batched-background-migrations)
on a regular interval.
+#### Finish a failed migration manually
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62634) in GitLab 14.1.
+
+To manually finish a batched background migration that failed with an error,
+use the information in the failure error logs or the database:
+
+::Tabs
+
+:::TabTitle From the failure error logs
+
+1. [View the failure error logs](../development/database/batched_background_migrations.md#viewing-failure-error-logs)
+ and look for an `An error has occurred, all later migrations canceled` error message, like this:
+
+ ```plaintext
+ StandardError: An error has occurred, all later migrations canceled:
+
+ Expected batched background migration for the given configuration to be marked as
+ 'finished', but it is 'active':
+ {:job_class_name=>"CopyColumnUsingBackgroundMigrationJob",
+ :table_name=>"push_event_payloads",
+ :column_name=>"event_id",
+ :job_arguments=>[["event_id"],
+ ["event_id_convert_to_bigint"]]
+ }
+ ```
+
+1. Run the following command, replacing the values in angle brackets with the correct arguments:
+
+ ```shell
+ sudo gitlab-rake gitlab:background_migrations:finalize[<job_class_name>,<table_name>,<column_name>,'<job_arguments>']
+ ```
+
+ For example, to finish the migration from the previous step:
+
+ ```shell
+ sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,push_event_payloads,event_id,'[["event_id"]\, ["event_id_convert_to_bigint"]]']
+ ```
+
+:::TabTitle From the database
+
+ 1. [Check the status](#check-the-status-of-batched-background-migrations) of the
+ migration in the database.
+ 1. Use the query results to construct a migration command, replacing the values
+ in angle brackets with the correct arguments:
+
+ ```shell
+ sudo gitlab-rake gitlab:background_migrations:finalize[<job_class_name>,<table_name>,<column_name>,'<job_arguments>']
+ ```
+
+ For example, if the query returns this data:
+
+ - `job_class_name`: `CopyColumnUsingBackgroundMigrationJob`
+ - `table_name`: `events`
+ - `column_name`: `id`
+ - `job_arguments`: `[["id"], ["id_convert_to_bigint"]]`
+
+ The command should be:
+
+ ```shell
+ sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,events,id,'[["id"]\, ["id_convert_to_bigint"]]']
+ ```
+
+::EndTabs
+
+#### Mark a failed migration finished
+
+WARNING:
+[Contact GitLab Support](https://about.gitlab.com/support/#contact-support) before using
+these instructions. This action can cause data loss, and make your instance fail
+in ways that are difficult to recover from.
+
+There can be cases where the background migration fails: when jumping too many version upgrades,
+or backward-incompatible database schema changes. (For an example, see [issue 393216](https://gitlab.com/gitlab-org/gitlab/-/issues/393216)).
+Failed background migrations prevent further application upgrades.
+
+When the background migration is determined to be "safe" to skip, the migration can be manually marked finished:
+
+WARNING:
+Make sure you create a backup before proceeding.
+
+```ruby
+# Start the rails console
+
+connection = ApplicationRecord.connection # or Ci::ApplicationRecord.connection, depending on which DB was the migration scheduled
+
+Gitlab::Database::SharedModel.using_connection(connection) do
+ migration = Gitlab::Database::BackgroundMigration::BatchedMigration.find_for_configuration(
+ Gitlab::Database.gitlab_schemas_for_connection(connection),
+ 'BackfillUserDetailsFields',
+ :users,
+ :id,
+ []
+ )
+
+ # mark all jobs completed
+ migration.batched_jobs.update_all(status: Gitlab::Database::BackgroundMigration::BatchedJob.state_machine.states['succeeded'].value)
+ migration.update_attribute(:status, Gitlab::Database::BackgroundMigration::BatchedMigration.state_machine.states[:finished].value)
+end
+```
+
## Background migrations
In GitLab 13, background migrations were not batched. In GitLab 14 and later, this
@@ -303,6 +412,8 @@ sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::Database::Ba
## Troubleshooting
+<!-- Linked from lib/gitlab/database/migrations/batched_background_migration_helpers.rb -->
+
### Database migrations failing because of batched background migration not finished
When updating to GitLab version 14.2 or later, database migrations might fail with a message like:
@@ -320,7 +431,7 @@ Expected batched background migration for the given configuration to be marked a
```
First, check if you have followed the [version-specific upgrade instructions for 14.2](../update/versions/gitlab_14_changes.md#1420).
-If you have, you can [manually finish the batched background migration](#manually-finishing-a-batched-background-migration).
+If you have, you can [manually finish the batched background migration](#finish-a-failed-migration-manually)).
If you haven't, choose one of the following methods:
1. [Rollback and upgrade](#roll-back-and-follow-the-required-upgrade-path) through one of the required
@@ -334,7 +445,7 @@ version and manually ensuring that the batched migrations complete successfully.
1. Update to either 14.0.5 or 14.1 **before** updating to 14.2+
1. [Check the status](#check-the-status-of-batched-background-migrations) of the batched background migrations and
make sure they are all marked as finished before attempting to upgrade again. If any remain marked as active,
-you can [manually finish them](#manually-finishing-a-batched-background-migration).
+you can [manually finish them](#finish-a-failed-migration-manually).
#### Roll forward and finish the migrations on the upgraded version
@@ -344,7 +455,7 @@ To run all the batched background migrations, it can take a significant amount o
depending on the size of your GitLab installation.
1. [Check the status](#check-the-status-of-batched-background-migrations) of the batched background migrations in the
-database, and [manually run them](#manually-finishing-a-batched-background-migration) with the appropriate
+database, and [manually run them](#finish-a-failed-migration-manually) with the appropriate
arguments until the status query returns no rows.
1. When the status of all of all them is marked as complete, re-run migrations for your installation.
1. [Complete the database migrations](../administration/raketasks/maintenance.md#run-incomplete-database-migrations) from your GitLab upgrade:
@@ -368,89 +479,9 @@ version and wait for the batched background migrations to finish.
1. [Check the status](#check-the-status-of-batched-background-migrations) of the batched background migration from
the error message, and make sure it is listed as finished. If it is still active, either wait until it is done,
-or [manually finish it](#manually-finishing-a-batched-background-migration).
+or [manually finish it](#finish-a-failed-migration-manually).
1. Re-run migrations for your installation, so the remaining post-deployment migrations finish.
-### Manually finishing a batched background migration
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62634) in GitLab 14.1
-
-If you need to manually finish a batched background migration due to an
-error, you can run:
-
-```shell
-sudo gitlab-rake gitlab:background_migrations:finalize[<job_class_name>,<table_name>,<column_name>,'<job_arguments>']
-```
-
-Replace the values in angle brackets with the correct
-arguments. For example, if you receive an error similar to this:
-
-```plaintext
-StandardError: An error has occurred, all later migrations canceled:
-
-Expected batched background migration for the given configuration to be marked as
-'finished', but it is 'active':
- {:job_class_name=>"CopyColumnUsingBackgroundMigrationJob",
- :table_name=>"push_event_payloads",
- :column_name=>"event_id",
- :job_arguments=>[["event_id"],
- ["event_id_convert_to_bigint"]]
- }
-```
-
-Plug the arguments from the error message into the command:
-
-```shell
-sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,push_event_payloads,event_id,'[["event_id"]\, ["event_id_convert_to_bigint"]]']
-```
-
-If you need to manually run a batched background migration to continue an upgrade, you can
-[check the status](#check-the-status-of-batched-background-migrations) in the database and get the
-arguments from the query results. For example, if the query returns this:
-
-```plaintext
- job_class_name | table_name | column_name | job_arguments
----------------------------------------+------------+-------------+------------------------------------
- CopyColumnUsingBackgroundMigrationJob | events | id | [["id"], ["id_convert_to_bigint"]]
- ```
-
-The results from the query can be plugged into the command:
-
-```shell
-sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,events,id,'[["id"]\, ["id_convert_to_bigint"]]']
-```
-
-#### Mark a batched migration finished
-
-There can be cases where the background migration fails: when jumping too many version upgrades,
-or backward-incompatible database schema changes. (For an example, see [issue 393216](https://gitlab.com/gitlab-org/gitlab/-/issues/393216)).
-Failed background migrations prevent further application upgrades.
-
-When the background migration is determined to be "safe" to skip, the migration can be manually marked finished:
-
-WARNING:
-Make sure you create a backup before proceeding.
-
-```ruby
-# Start the rails console
-
-connection = ApplicationRecord.connection # or Ci::ApplicationRecord.connection, depending on which DB was the migration scheduled
-
-Gitlab::Database::SharedModel.using_connection(connection) do
- migration = Gitlab::Database::BackgroundMigration::BatchedMigration.find_for_configuration(
- Gitlab::Database.gitlab_schemas_for_connection(connection),
- 'BackfillUserDetailsFields',
- :users,
- :id,
- []
- )
-
- # mark all jobs completed
- migration.batched_jobs.update_all(status: Gitlab::Database::BackgroundMigration::BatchedJob.state_machine.states['succeeded'].value)
- migration.update_attribute(:status, Gitlab::Database::BackgroundMigration::BatchedMigration.state_machine.states[:finished].value)
-end
-```
-
### The `BackfillNamespaceIdForNamespaceRoute` batched migration job fails
In GitLab 14.8, the `BackfillNamespaceIdForNamespaceRoute` batched background migration job
diff --git a/doc/update/versions/gitlab_15_changes.md b/doc/update/versions/gitlab_15_changes.md
index f343f306490..dea8657de19 100644
--- a/doc/update/versions/gitlab_15_changes.md
+++ b/doc/update/versions/gitlab_15_changes.md
@@ -86,7 +86,7 @@ For more information about upgrading GitLab Helm Chart, see [the release notes f
```
This error is caused by a [batched background migration introduced in GitLab 14.9](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/81410)
- not being finalized before upgrading to GitLab 15.10 or later. To resolve this error, it is safe to [mark the migration as complete](../background_migrations.md#mark-a-batched-migration-finished):
+ not being finalized before upgrading to GitLab 15.10 or later. To resolve this error, it is safe to [mark the migration as complete](../background_migrations.md#mark-a-failed-migration-finished):
```ruby
# Start the rails console
diff --git a/doc/user/group/manage.md b/doc/user/group/manage.md
index 025a689fe49..f2e9f769d3b 100644
--- a/doc/user/group/manage.md
+++ b/doc/user/group/manage.md
@@ -444,15 +444,15 @@ for the ability to set merge request approval rules for groups is tracked in
WARNING:
This feature is in [Beta](../../policy/experiment-beta-support.md#beta).
-Beta users should read about the [known limitations](../project/repository/code_suggestions.md#known-limitations).
-We look forward to hearing your [feedback](../project/repository/code_suggestions.md#feedback).
+Beta users should read about the [known limitations](../project/repository/code_suggestions/index.md#known-limitations).
+We look forward to hearing your [feedback](../project/repository/code_suggestions/index.md#feedback).
You can give all users in a group and its subgroups access to [Code Suggestions](../project/repository/code_suggestions.md).
- This setting
[cascades to all projects](../project/merge_requests/approvals/settings.md#settings-cascading) in the group.
- Each user can
- [enable or disable Code Suggestions for themselves](../project/repository/code_suggestions.md#enable-code-suggestions-for-an-individual-user).
+ [enable or disable Code Suggestions for themselves](../project/repository/code_suggestions/saas.md#enable-code-suggestions-for-an-individual-user).
To enable Code Suggestions for a group:
diff --git a/doc/user/group/saml_sso/scim_setup.md b/doc/user/group/saml_sso/scim_setup.md
index 9096824cc2c..9b342d806ff 100644
--- a/doc/user/group/saml_sso/scim_setup.md
+++ b/doc/user/group/saml_sso/scim_setup.md
@@ -16,6 +16,7 @@ GitLab SAML SSO SCIM doesn't support updating users.
When SCIM is enabled for a GitLab group, membership of that group is synchronized between GitLab and an identity provider.
The [internal GitLab group SCIM API](../../../development/internal_api/index.md#group-scim-api) implements part of [the RFC7644 protocol](https://www.rfc-editor.org/rfc/rfc7644).
+Identity providers can use the [internal GitLab group SCIM API](../../../development/internal_api/index.md#group-scim-api) to develop a SCIM app.
## Configure GitLab
@@ -40,7 +41,7 @@ You can configure one of the following as an identity provider:
- [Okta](#configure-okta).
NOTE:
-Other providers can work with GitLab but they have not been tested and are not supported.
+Other providers can work with GitLab but they have not been tested and are not supported. You should contact the provider for support. GitLab support can assist by reviewing related log entries.
### Configure Azure Active Directory
diff --git a/doc/user/permissions.md b/doc/user/permissions.md
index d19f98b98ed..ba186bf883c 100644
--- a/doc/user/permissions.md
+++ b/doc/user/permissions.md
@@ -488,6 +488,8 @@ The following custom roles are available:
- The Guest+1 role, which allows users with the Guest role to view code.
- In GitLab 16.1 and later, you can create a custom role that can view vulnerability reports and change the status of the vulnerabilities.
+- In GitLab 16.3 and later, you can create a custom role that can view the dependency list.
+- In GitLab 16.4 and later, you can create a custom role that can approve merge requests.
You can discuss individual custom role and permission requests in [issue 391760](https://gitlab.com/gitlab-org/gitlab/-/issues/391760).
@@ -518,7 +520,9 @@ You can see the required minimal access levels and abilities requirements in the
| Ability | Minimal access level | Required ability |
| -- | -- | -- |
| `read_code` | Guest | - |
+| `read_dependency` | Guest | - |
| `read_vulnerability` | Guest | - |
+| `admin_merge_request` | Guest | - |
| `admin_vulnerability` | Guest | `read_vulnerability` |
### Associate a custom role with an existing group member
diff --git a/doc/user/project/repository/code_suggestions.md b/doc/user/project/repository/code_suggestions.md
index 0f75b0bd3f6..8bcfcd0e5c2 100644
--- a/doc/user/project/repository/code_suggestions.md
+++ b/doc/user/project/repository/code_suggestions.md
@@ -1,439 +1,11 @@
---
-stage: AI-powered
-group: AI Model Validation
-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
-type: index, reference
+redirect_to: 'code_suggestions/index.md'
+remove_date: '2021-11-25'
---
-# Code Suggestions (Beta) **(FREE ALL)**
+This document was moved to [another location](code_suggestions/index.md).
-> - [Introduced](https://about.gitlab.com/releases/2023/02/22/gitlab-15-9-released/#code-suggestions-available-in-closed-beta) in GitLab 15.9 as [Beta](../../../policy/experiment-beta-support.md#beta) for early access Ultimate customers on GitLab.com.
-> - [Enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/408104) as opt-in with GitLab 15.11 as [Beta](../../../policy/experiment-beta-support.md#beta).
-> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/408158) from GitLab Ultimate to GitLab Premium in 16.0.
-> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/410801) from GitLab Premium to GitLab Free in 16.0.
-> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121079) in GitLab 16.1.
-> - [Introduced support for Google Vertex AI Codey APIs](https://gitlab.com/groups/gitlab-org/-/epics/10562) in GitLab 16.1.
-> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10653) in GitLab 16.1 as [Beta](../../../policy/experiment-beta-support.md#beta) on self-managed GitLab.
-> - Code suggestions in the GitLab WebIDE enabled for all GitLab-hosted customers.
-> - [Removed support for GitLab native model](https://gitlab.com/groups/gitlab-org/-/epics/10752) in GitLab 16.2.
-
-WARNING:
-This feature is in [Beta](../../../policy/experiment-beta-support.md#beta).
-Beta users should read about the [known limitations](#known-limitations). We look forward to hearing your [feedback](#feedback).
-
-Write code more efficiently by using generative AI to suggest code while you're developing.
-
-Code Suggestions are available:
-
-- To users of:
- - GitLab SaaS (by default).
- - Self-managed GitLab Enterprise Edition. Cloud licensing is required:
- - Only Premium and Ultimate tiers support cloud licensing.
- Code Suggestions are not available for GitLab Community Edition.
-- In VS Code, Microsoft Visual Studio, JetBrains IDEs, and Neovim. You must have the corresponding GitLab extension installed.
-- In the GitLab WebIDE.
-
-WARNING:
-Self-managed customers on GitLab 16.2 and earlier with a GitLab Free subscription will lose access to Code Suggestions when they [update to GitLab 16.3 or later](#update-gitlab).
-
-<div class="video-fallback">
- <a href="https://www.youtube.com/watch?v=WnxBYxN2-p4">View an end-to-end demo of Code Suggestions in VS Code</a>.
-</div>
-<figure class="video-container">
- <iframe src="https://www.youtube-nocookie.com/embed/WnxBYxN2-p4" frameborder="0" allowfullscreen> </iframe>
-</figure>
-
-Usage of Code Suggestions is governed by the [GitLab Testing Agreement](https://about.gitlab.com/handbook/legal/testing-agreement/).
-Learn about [data usage when using Code Suggestions](#code-suggestions-data-usage).
-
-## Supported languages
-
-The best results from Code Suggestions are expected [for languages the Google Vertex AI Codey APIs](https://cloud.google.com/vertex-ai/docs/generative-ai/code/code-models-overview#supported_coding_languages) directly support:
-
-- C++
-- C#
-- Go
-- Google SQL
-- Java
-- JavaScript
-- Kotlin
-- PHP
-- Python
-- Ruby
-- Rust
-- Scala
-- Swift
-- TypeScript
-
-### Supported code infrastructure interfaces
-
-Code Suggestions includes [Google Vertex AI Codey APIs](https://cloud.google.com/vertex-ai/docs/generative-ai/code/code-models-overview#supported_code_infrastructure_interfaces) support for the following infrastructure as code interfaces:
-
-- Google Cloud CLI
-- Kubernetes Resource Model (KRM)
-- Terraform
-
-Suggestion quality for other languages and using natural language code comments to request completions may not yet result in high-quality suggestions.
-
-### Supported languages in IDEs
-
-Editor support for languages is documented in the following table.
-
-| Language | VS Code | JetBrains IDEs | Visual Studio | Neovim |
-|---------------------------------|--------------------------------------------------------------|------------------------------|---------------|--------|
-| C++ | ✓ | | ✓ | |
-| C# | ✓ | ✓ | ✓ | |
-| Go | ✓ | ✓ (IDEA Ultimate / GoLand) | ✓ | |
-| Google SQL | | | ✓ | |
-| Java | ✓ | ✓ | ✓ | |
-| JavaScript | ✓ | ✓ | ✓ | |
-| Kotlin | ✓ | ✓ | ✓ | |
-| PHP | ✓ | ✓ (IDEA Ultimate) | ✓ | |
-| Python | ✓ | ✓ | ✓ | ✓ |
-| Ruby | ✓ | ✓ (IDEA Ultimate / RubyMine) | ✓ | ✓ |
-| Rust | ✓ | ✓ | ✓ | |
-| Scala | ✓ | ✓ | ✓ | |
-| Swift | ✓ | ✓ | ✓ | |
-| TypeScript | ✓ | ✓ | ✓ | |
-| Google Cloud CLI | | | | |
-| Kubernetes Resource Model (KRM) | | | | |
-| Terraform | ✓ (Requires 3rd party extension providing Terraform support) | | | |
-
-## Supported editor extensions
-
-Code Suggestions supports a variety of popular editors including:
-
-- VS Code, using [the VS Code GitLab Workflow extension](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow).
-- [GitLab WebIDE (VS Code in the Cloud)](../../project/web_ide/index.md), with no additional configuration.
-- Microsoft Visual Studio, using the [Visual Studio GitLab extension](https://marketplace.visualstudio.com/items?itemName=GitLab.GitLabExtensionForVisualStudio).
-- JetBrains IDEs, using the [GitLab plugin](https://plugins.jetbrains.com/plugin/22325-gitlab).
-- Neovim, using the [`gitlab.vim` plugin](https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim).
-
-A [GitLab Language Server for Code Suggestions](https://gitlab.com/gitlab-org/editor-extensions/gitlab-language-server-for-code-suggestions)
-is also in process.
-This improvement should result in:
-
-- Faster iteration and standardization of the IDE extensions.
-- The ability to use Code Suggestions even when an official editor extension isn't available.
-
-## Enable Code Suggestions on GitLab SaaS **(FREE SAAS)**
-
-Code Suggestions can be enabled [for all members of a group](../../group/manage.md#enable-code-suggestions).
-
-Each individual user must also choose to enable Code Suggestions.
-
-### Enable Code Suggestions for an individual user
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121079) in GitLab 16.1 as [Beta](../../../policy/experiment-beta-support.md#beta).
-
-Each user can enable Code Suggestions for themselves:
-
-1. On the left sidebar, select your avatar.
-1. Select **Preferences**.
-1. In the **Code Suggestions** section, select the **Enable Code Suggestions** checkbox.
-1. Select **Save changes**.
-
-If Code Suggestions is enabled for the group, the group setting overrides the user setting.
-
-NOTE:
-This setting controls Code Suggestions for all IDEs. Support for [more granular control per IDE](https://gitlab.com/groups/gitlab-org/-/epics/10624) is proposed.
-
-## Enable Code Suggestions on self-managed GitLab **(FREE SELF)**
-
-> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10653) in GitLab 16.1 as [Beta](../../../policy/experiment-beta-support.md#beta).
-
-When you enable Code Suggestions for your self-managed instance, you:
-
-- Agree to the [GitLab testing agreement](https://about.gitlab.com/handbook/legal/testing-agreement/).
-- Acknowledge that GitLab sends data from the instance, including personal data, to GitLab.com infrastructure.
-
-How you enable Code Suggestions differs depending on your version of GitLab.
-
-### GitLab 16.3 and later
-
-Prerequisites:
-
-- You are a new Code Suggestions customer as of GitLab 16.3.
-- All of the users in your instance have the latest version of their IDE extension.
-- You are an administrator.
-
-To enable Code Suggestions for your self-managed GitLab instance:
-
-1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
-1. Select **Admin Area**.
-1. On the left sidebar, select **Settings > General**.
-1. Expand **Code Suggestions** and select **Turn on Code Suggestions for this instance**.
- You do not need to enter anything into the **Personal access token** field.
-1. Select **Save changes**.
-
-This setting is visible only in self-managed GitLab instances.
-
-WARNING:
-In GitLab 16.2 and earlier, if you clear the **Turn on code suggestions for this instance** checkbox, the users in your instance can still use Code Suggestions for up to one hour, until the issued JSON web token (JWT) expires.
-
-To make sure Code Suggestions works immediately, you must [manually synchronize your subscription](#manually-synchronize-your-subscription).
-
-The users in your instance can now use Code Suggestions.
-
-### GitLab 16.2 and earlier
-
-Prerequisites:
-
-- You are an administrator.
-- You have a [GitLab SaaS account](https://gitlab.com/users/sign_up). You do not need to have a GitLab SaaS subscription.
-
-Then, you will:
-
-1. Enable Code Suggestions for your SaaS account.
-1. Enable Code Suggestions for the instance.
-1. [Request early access](#request-access-to-code-suggestions) to the Code Suggestions Beta.
-
-#### Enable Code Suggestions for your SaaS account
-
-To enable Code Suggestions for your GitLab SaaS account:
-
-1. Create a [personal access token](../../profile/personal_access_tokens.md#create-a-personal-access-token)
- with the `api` scope.
-1. On the left sidebar, select your avatar.
-1. Select **Preferences**.
-1. In the **Code Suggestions** section, select **Enable Code Suggestions**.
-1. Select **Save changes**.
-
-#### Enable Code Suggestions for the instance
-
-To enable Code Suggestions for your self-managed GitLab instance:
-
-1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
-1. Select **Admin Area**.
-1. On the left sidebar, select **Settings > General**.
-1. Expand **Code Suggestions** and:
- - Select **Turn on Code Suggestions for this instance**.
- - In **Personal access token**, enter your GitLab SaaS personal access token.
-1. Select **Save changes**.
-
-This setting is visible only in self-managed GitLab instances.
-
-WARNING:
-If you clear the **Turn on code suggestions for this instance** checkbox, the users in your instance can still use Code Suggestions for up to one hour, until the issued JSON web token (JWT) expires.
-
-#### Request access to Code Suggestions
-
-GitLab provisions access on a customer-by-customer basis for Code Suggestions
-on self-managed instances. To request access:
-
-1. Sign into your GitLab SaaS account.
-1. Comment on [issue 415393](https://gitlab.com/gitlab-org/gitlab/-/issues/415393)
- and tag your customer success manager.
-
-After GitLab has provisioned access to Code Suggestions for your instance,
-the users in your instance can now enable Code Suggestions.
-
-### Update GitLab
-
-In GitLab 16.3 and later, GitLab is enforcing the cloud licensing requirement for Code Suggestions:
-
-- The Premium and Ultimate subscription tiers support cloud Licensing.
-- GitLab Free does not have cloud licensing support.
-
-If you have a GitLab Free subscription and update to GitLab 16.3 or later,
-to continue having early access to Code Suggestions, you must:
-
-1. Have a [subscription that supports cloud licensing](https://about.gitlab.com/pricing/).
-1. Make sure you have the latest version of your [IDE extension](#supported-editor-extensions).
-1. [Manually synchronize your subscription](#manually-synchronize-your-subscription).
-
-#### Manually synchronize your subscription
-
-You must [manually synchronize your subscription](../../../subscriptions/self_managed/index.md#manually-synchronize-your-subscription-details) if either:
-
-- You have already updated to GitLab 16.3 and have just bought a Premium or Ultimate tier subscription.
-- You already have a Premium or Ultimate tier subscription and have just updated to GitLab 16.3.
-
-Without the manual synchronization, it might take up to 24 hours to active Code Suggestions on your instance.
-
-## Use Code Suggestions
-
-Prerequisites:
-
-- For self-managed GitLab, Code Suggestions must be enabled [for the instance](#enable-code-suggestions-on-self-managed-gitlab).
-- For GitLab SaaS, Code Suggestions must be enabled [for the top-level group](../../group/manage.md#enable-code-suggestions) and [for your user account](#enable-code-suggestions-for-an-individual-user).
-- Install and configure a [supported IDE editor extension](#supported-editor-extensions).
-To use Code Suggestions:
-
-1. Author your code. As you type, suggestions are displayed. Depending on the cursor position, the extension either:
-
- - Provides entire code snippets, like generating functions.
- - Completes the current line.
-
-1. To accept a suggestion, press <kbd>Tab</kbd>.
-
-Suggestions are best when writing new code. Editing existing functions or 'fill in the middle' of a function may not perform as expected.
-
-GitLab is making improvements to the Code Suggestions to improve the quality. AI is non-deterministic, so you may not get the same suggestion every time with the same input.
-
-This feature is currently in [Beta](../../../policy/experiment-beta-support.md#beta).
-Code Suggestions depends on both Google Vertex AI Codey APIs and the GitLab Code Suggestions service. We have built this feature to gracefully degrade and have controls in place to allow us to
-mitigate abuse or misuse. GitLab may disable this feature for any or all customers at any time at our discretion.
-
-## Code Suggestions data usage
-
-Code Suggestions is a generative artificial intelligence (AI) model.
-
-Your personal access token enables a secure API connection to GitLab.com.
-This API connection securely transmits a context window from your IDE/editor to the Code Suggestions GitLab hosted service which calls Google Vertex AI Codey APIs,
-and the generated suggestion is transmitted back to your IDE/editor.
-
-GitLab currently leverages [Google Cloud's Vertex AI Codey API models](https://cloud.google.com/vertex-ai/docs/generative-ai/code/code-models-overview). Learn more about Google Vertex AI Codey APIs [Data Governance](https://cloud.google.com/vertex-ai/docs/generative-ai/data-governance).
-
-### Telemetry
-
-For self-managed instances that have enabled Code Suggestions and SaaS accounts, we collect aggregated or de-identified first-party usage data through our [Snowplow collector](https://about.gitlab.com/handbook/business-technology/data-team/platform/snowplow/). This usage data includes the following metrics:
-
-- Language the code suggestion was in (for example, Python)
-- Editor being used (for example, VS Code)
-- Number of suggestions shown, accepted, rejected, or that had errors
-- Duration of time that a suggestion was shown
-- Prompt and suffix lengths
-- Model used
-- Number of unique users
-- Number of unique instances
-
-### Inference window context
-
-Code Suggestions currently inferences against the currently opened file and has a context window of 2,048 tokens and 8,192 character limits. This limit includes content before and after the cursor, the file name, and the extension type.
-Learn more about Google Vertex AI [code-gecko](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models).
-
-The maximum number of tokens that is generated in the response is default 64. A token is approximately four characters. 100 tokens correspond to roughly 60-80 words.
-Learn more about Google Vertex AI [`code-gecko`](https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/code-completion).
-
-### Self-managed instance data privacy
-
-A self-managed GitLab instance does not generate the code suggestion. After successful
-authentication to the self-managed instance, a token is generated.
-
-The IDE/editor then uses this token to securely transmit data directly to
-GitLab.com's Code Suggestions service for processing.
-
-The Code Suggestion service then securely returns an AI-generated code suggestion.
-
-Neither GitLab nor Google Vertex AI Codey APIs have any visibility into a self-managed customer's code other than
-what is sent to generate the code suggestion.
-
-### Training data
-
-Code suggestions are routed through Google Vertex AI Codey APIs. Learn more about Google Vertex AI Codey APIs [Data Governance](https://cloud.google.com/vertex-ai/docs/generative-ai/data-governance) and [Responsible AI](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/responsible-ai).
-
-Google Vertex AI Codey APIs are not trained on private non-public GitLab customer or user data.
-
-Google has [shared the following](https://ai.google/discover/foundation-models/) about the data Codey models are trained on:
-
-> Codey is our family of foundational coding models built on PaLM 2. Codey was fine-tuned on a large dataset of high quality, permissively licensed code from external sources
-
-## Progressive enhancement
-
-This feature is designed as a progressive enhancement to developer's IDEs.
-Code Suggestions offer a completion if the machine learning engine can generate a recommendation.
-In the event of a connection issue or model inference failure, the feature gracefully degrades.
-Code Suggestions do not prevent you from writing code in your IDE.
-
-### Internet connectivity
-
-Code Suggestions does not work with offline environments.
-
-To use Code Suggestions:
-
-- On GitLab.com, you must have an internet connection and be able to access GitLab.
-- In GitLab 16.1 and later, on self-managed GitLab, you must have an internet connection.
-
-### Model accuracy and quality
-
-Code Suggestions can generate low-quality, incomplete, and possibly insecure code.
-We strongly encourage all beta users to leverage GitLab native
-[Code Quality Scanning](../../../ci/testing/code_quality.md) and
-[Security Scanning](../../application_security/index.md) capabilities.
-
-GitLab currently does not retrain Google Vertex AI Codey APIs. GitLab makes no claims
-to the accuracy or quality of code suggestions generated by Google Vertex AI Codey API.
-Read more about [Google Vertex AI foundation model capabilities](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models).
-
-## Known limitations
-
-While in Beta, we are working on improving the accuracy of overall generated content.
-However, Code Suggestions may generate suggestions that are:
-
-- Low-quality
-- Incomplete
-- Produce failed pipelines
-- Insecure code
-- Offensive or insensitive
-
-We are also aware of specific situations that can produce unexpected or incoherent results including:
-
-- Suggestions written in the middle of existing functions, or "fill in the middle."
-- Suggestions based on natural language code comments.
-- Suggestions that mixed programming languages in unexpected ways.
-
-## Feedback
-
-Report issues in the [feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/405152).
-
-## Troubleshooting
-
-### Code Suggestions aren't displayed
-
-If Code Suggestions are not displayed, try the following troubleshooting steps.
-
-In GitLab, ensure Code Suggestions is enabled:
-
-- [For your user account](#enable-code-suggestions-for-an-individual-user).
-- [For *all* top-level groups your account belongs to](../../group/manage.md#enable-code-suggestions). If you don't have a role that lets you view the top-level group's settings, contact a group owner.
-
-To confirm that your account is enabled, go to [https://gitlab.com/api/v4/ml/ai-assist](https://gitlab.com/api/v4/ml/ai-assist). A response of `user_is_allowed` should return `true`.
-
-#### Code Suggestions not displayed in VS Code or GitLab WebIDE
-
-Check all the steps in [Code Suggestions aren't displayed](#code-suggestions-arent-displayed) first.
-
-If you are a self-managed user, ensure that Code Suggestions for the [GitLab WebIDE](../../project/web_ide/index.md) are enabled. The same settings apply to VS Code as local IDE.
-
-1. On the left sidebar, select **Extensions > GitLab Workflow**.
-1. Select **Settings** (**{settings}**), and then select **Extension Settings**.
-1. In **GitLab > AI Assisted Code Suggestions**, select the **Enable code completion (Beta)**
- checkbox.
-
-If the settings are enabled, but Code Suggestions are still not displayed, try the following steps:
-
-1. Enable the `Debug` checkbox in the GitLab Workflow **Extension Settings**.
-1. Open the extension log in **View > Output** and change the dropdown list to **GitLab Workflow** as the log filter. The command palette command is `GitLab: Show Extension Logs`.
-1. Disable and re-enable the **Enable code completion (Beta)** checkbox.
-1. Verify that the debug log contains similar output:
-
-```shell
-2023-07-14T17:29:00:763 [debug]: Disabling code completion
-2023-07-14T17:29:01:802 [debug]: Enabling code completion
-2023-07-14T17:29:01:802 [debug]: AI Assist: Using server: https://codesuggestions.gitlab.com/v2/completions
-```
-
-#### Code Suggestions not displayed in Microsoft Visual Studio
-
-Check all the steps in [Code Suggestions aren't displayed](#code-suggestions-arent-displayed) first.
-
-1. Ensure you have properly [set up the extension](https://gitlab.com/gitlab-org/editor-extensions/gitlab-visual-studio-extension#setup).
-1. From the **Tools > Options** menu, find the **GitLab** option. Ensure **Log Level** is set to **Debug**.
-1. Open the extension log in **View > Output** and change the dropdown list to **GitLab Extension** as the log filter.
-1. Verify that the debug log contains similar output:
-
-```shell
-14:48:21:344 GitlabProposalSource.GetCodeSuggestionAsync
-14:48:21:344 LsClient.SendTextDocumentCompletionAsync("GitLab.Extension.Test\TestData.cs", 34, 0)
-14:48:21:346 LS(55096): time="2023-07-17T14:48:21-05:00" level=info msg="update context"
-```
-
-### Authentication troubleshooting
-
-If the above steps do not solve your issue, the problem may be related to the recent changes in authentication,
-specifically the token system. To resolve the issue:
-
-1. Remove the existing personal access token from your GitLab account settings.
-1. Reauthorize your GitLab account in VS Code using OAuth.
-1. Test the code suggestions feature with different file extensions to verify if the issue is resolved.
+<!-- This redirect file can be deleted after <2021-11-25>. -->
+<!-- Redirects that point to other docs in the same project expire in three months. -->
+<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
+<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
diff --git a/doc/user/project/repository/code_suggestions/index.md b/doc/user/project/repository/code_suggestions/index.md
new file mode 100644
index 00000000000..7e0fbea59c8
--- /dev/null
+++ b/doc/user/project/repository/code_suggestions/index.md
@@ -0,0 +1,192 @@
+---
+stage: AI-powered
+group: AI Model Validation
+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
+type: index, reference
+---
+
+# Code Suggestions (Beta) **(FREE ALL)**
+
+> - [Introduced support for Google Vertex AI Codey APIs](https://gitlab.com/groups/gitlab-org/-/epics/10562) in GitLab 16.1.
+> - [Removed support for GitLab native model](https://gitlab.com/groups/gitlab-org/-/epics/10752) in GitLab 16.2.
+
+WARNING:
+This feature is in [Beta](../../../../policy/experiment-beta-support.md#beta).
+Beta users should read about the [known limitations](#known-limitations). We look forward to hearing your [feedback](#feedback).
+
+Write code more efficiently by using generative AI to suggest code while you're developing.
+
+Code Suggestions are available:
+
+- On [self-managed](self_managed.md) and [SaaS](saas.md).
+- In VS Code, Microsoft Visual Studio, JetBrains IDEs, and Neovim. You must have the corresponding GitLab extension installed.
+- In the GitLab WebIDE.
+
+<div class="video-fallback">
+ <a href="https://www.youtube.com/watch?v=WnxBYxN2-p4">View an end-to-end demo of Code Suggestions in VS Code</a>.
+</div>
+<figure class="video-container">
+ <iframe src="https://www.youtube-nocookie.com/embed/WnxBYxN2-p4" frameborder="0" allowfullscreen> </iframe>
+</figure>
+
+Usage of Code Suggestions is governed by the [GitLab Testing Agreement](https://about.gitlab.com/handbook/legal/testing-agreement/).
+Learn about [data usage when using Code Suggestions](#code-suggestions-data-usage).
+
+## Supported languages
+
+The best results from Code Suggestions are expected [for languages the Google Vertex AI Codey APIs](https://cloud.google.com/vertex-ai/docs/generative-ai/code/code-models-overview#supported_coding_languages) directly support:
+
+- C++
+- C#
+- Go
+- Google SQL
+- Java
+- JavaScript
+- Kotlin
+- PHP
+- Python
+- Ruby
+- Rust
+- Scala
+- Swift
+- TypeScript
+
+### Supported code infrastructure interfaces
+
+Code Suggestions includes [Google Vertex AI Codey APIs](https://cloud.google.com/vertex-ai/docs/generative-ai/code/code-models-overview#supported_code_infrastructure_interfaces) support for the following infrastructure as code interfaces:
+
+- Google Cloud CLI
+- Kubernetes Resource Model (KRM)
+- Terraform
+
+Suggestion quality for other languages and using natural language code comments to request completions may not yet result in high-quality suggestions.
+
+### Supported languages in IDEs
+
+Editor support for languages is documented in the following table.
+
+| Language | VS Code | JetBrains IDEs | Visual Studio | Neovim |
+|---------------------------------|--------------------------------------------------------------|------------------------------|---------------|--------|
+| C++ | ✓ | | ✓ | |
+| C# | ✓ | ✓ | ✓ | |
+| Go | ✓ | ✓ (IDEA Ultimate / GoLand) | ✓ | |
+| Google SQL | | | ✓ | |
+| Java | ✓ | ✓ | ✓ | |
+| JavaScript | ✓ | ✓ | ✓ | |
+| Kotlin | ✓ | ✓ | ✓ | |
+| PHP | ✓ | ✓ (IDEA Ultimate) | ✓ | |
+| Python | ✓ | ✓ | ✓ | ✓ |
+| Ruby | ✓ | ✓ (IDEA Ultimate / RubyMine) | ✓ | ✓ |
+| Rust | ✓ | ✓ | ✓ | |
+| Scala | ✓ | ✓ | ✓ | |
+| Swift | ✓ | ✓ | ✓ | |
+| TypeScript | ✓ | ✓ | ✓ | |
+| Google Cloud CLI | | | | |
+| Kubernetes Resource Model (KRM) | | | | |
+| Terraform | ✓ (Requires 3rd party extension providing Terraform support) | | | |
+
+## Supported editor extensions
+
+Code Suggestions supports a variety of popular editors including:
+
+- VS Code, using [the VS Code GitLab Workflow extension](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow).
+- [GitLab WebIDE (VS Code in the Cloud)](../../../project/web_ide/index.md), with no additional configuration.
+- Microsoft Visual Studio, using the [Visual Studio GitLab extension](https://marketplace.visualstudio.com/items?itemName=GitLab.GitLabExtensionForVisualStudio).
+- JetBrains IDEs, using the [GitLab plugin](https://plugins.jetbrains.com/plugin/22325-gitlab).
+- Neovim, using the [`gitlab.vim` plugin](https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim).
+
+A [GitLab Language Server for Code Suggestions](https://gitlab.com/gitlab-org/editor-extensions/gitlab-language-server-for-code-suggestions)
+is also in process.
+This improvement should result in:
+
+- Faster iteration and standardization of the IDE extensions.
+- The ability to use Code Suggestions even when an official editor extension isn't available.
+
+## Code Suggestions data usage
+
+Code Suggestions is a generative artificial intelligence (AI) model.
+
+Your personal access token enables a secure API connection to GitLab.com.
+This API connection securely transmits a context window from your IDE/editor to the Code Suggestions GitLab hosted service which calls Google Vertex AI Codey APIs,
+and the generated suggestion is transmitted back to your IDE/editor.
+
+GitLab currently leverages [Google Cloud's Vertex AI Codey API models](https://cloud.google.com/vertex-ai/docs/generative-ai/code/code-models-overview). Learn more about Google Vertex AI Codey APIs [Data Governance](https://cloud.google.com/vertex-ai/docs/generative-ai/data-governance).
+
+### Telemetry
+
+For self-managed instances that have enabled Code Suggestions and SaaS accounts, we collect aggregated or de-identified first-party usage data through our [Snowplow collector](https://about.gitlab.com/handbook/business-technology/data-team/platform/snowplow/). This usage data includes the following metrics:
+
+- Language the code suggestion was in (for example, Python)
+- Editor being used (for example, VS Code)
+- Number of suggestions shown, accepted, rejected, or that had errors
+- Duration of time that a suggestion was shown
+- Prompt and suffix lengths
+- Model used
+- Number of unique users
+- Number of unique instances
+
+### Inference window context
+
+Code Suggestions currently inferences against the currently opened file and has a context window of 2,048 tokens and 8,192 character limits. This limit includes content before and after the cursor, the file name, and the extension type.
+Learn more about Google Vertex AI [code-gecko](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models).
+
+The maximum number of tokens that is generated in the response is default 64. A token is approximately four characters. 100 tokens correspond to roughly 60-80 words.
+Learn more about Google Vertex AI [`code-gecko`](https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/code-completion).
+
+### Training data
+
+Code suggestions are routed through Google Vertex AI Codey APIs. Learn more about Google Vertex AI Codey APIs [Data Governance](https://cloud.google.com/vertex-ai/docs/generative-ai/data-governance) and [Responsible AI](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/responsible-ai).
+
+Google Vertex AI Codey APIs are not trained on private non-public GitLab customer or user data.
+
+Google has [shared the following](https://ai.google/discover/foundation-models/) about the data Codey models are trained on:
+
+> Codey is our family of foundational coding models built on PaLM 2. Codey was fine-tuned on a large dataset of high quality, permissively licensed code from external sources
+
+## Progressive enhancement
+
+This feature is designed as a progressive enhancement to developer's IDEs.
+Code Suggestions offer a completion if the machine learning engine can generate a recommendation.
+In the event of a connection issue or model inference failure, the feature gracefully degrades.
+Code Suggestions do not prevent you from writing code in your IDE.
+
+### Internet connectivity
+
+Code Suggestions does not work with offline environments.
+
+To use Code Suggestions:
+
+- On GitLab.com, you must have an internet connection and be able to access GitLab.
+- In GitLab 16.1 and later, on self-managed GitLab, you must have an internet connection.
+
+### Model accuracy and quality
+
+Code Suggestions can generate low-quality, incomplete, and possibly insecure code.
+We strongly encourage all beta users to leverage GitLab native
+[Code Quality Scanning](../../../../ci/testing/code_quality.md) and
+[Security Scanning](../../../application_security/index.md) capabilities.
+
+GitLab currently does not retrain Google Vertex AI Codey APIs. GitLab makes no claims
+to the accuracy or quality of code suggestions generated by Google Vertex AI Codey API.
+Read more about [Google Vertex AI foundation model capabilities](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models).
+
+## Known limitations
+
+While in Beta, we are working on improving the accuracy of overall generated content.
+However, Code Suggestions may generate suggestions that are:
+
+- Low-quality
+- Incomplete
+- Produce failed pipelines
+- Insecure code
+- Offensive or insensitive
+
+We are also aware of specific situations that can produce unexpected or incoherent results including:
+
+- Suggestions written in the middle of existing functions, or "fill in the middle."
+- Suggestions based on natural language code comments.
+- Suggestions that mixed programming languages in unexpected ways.
+
+## Feedback
+
+Report issues in the [feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/405152).
diff --git a/doc/user/project/repository/code_suggestions/saas.md b/doc/user/project/repository/code_suggestions/saas.md
new file mode 100644
index 00000000000..6210786259a
--- /dev/null
+++ b/doc/user/project/repository/code_suggestions/saas.md
@@ -0,0 +1,63 @@
+---
+stage: AI-powered
+group: AI Model Validation
+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
+type: index, reference
+---
+
+# Code Suggestions on GitLab SaaS (Beta) **(FREE SAAS)**
+
+> - [Introduced](https://about.gitlab.com/releases/2023/02/22/gitlab-15-9-released/#code-suggestions-available-in-closed-beta) in GitLab 15.9 as [Beta](../../../../policy/experiment-beta-support.md#beta) for early access Ultimate customers on GitLab.com.
+> - [Enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/408104) as opt-in with GitLab 15.11 as [Beta](../../../../policy/experiment-beta-support.md#beta).
+> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/408158) from GitLab Ultimate to GitLab Premium in 16.0.
+> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/410801) from GitLab Premium to GitLab Free in 16.0.
+> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121079) in GitLab 16.1.
+
+Write code more efficiently by using generative AI to suggest code while you're developing.
+
+Usage of Code Suggestions is governed by the [GitLab Testing Agreement](https://about.gitlab.com/handbook/legal/testing-agreement/).
+Learn about [data usage when using Code Suggestions](index.md#code-suggestions-data-usage).
+
+## Enable Code Suggestions for a group
+
+You can enable Code Suggestions [for all members of a group](../../../group/manage.md#enable-code-suggestions).
+
+## Enable Code Suggestions for an individual user
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121079) in GitLab 16.1 as [Beta](../../../../policy/experiment-beta-support.md#beta).
+
+If Code Suggestions is not enabled for the group, each user can still enable Code Suggestions for themselves:
+
+1. On the left sidebar, select your avatar.
+1. Select **Preferences**.
+1. In the **Code Suggestions** section, select the **Enable Code Suggestions** checkbox.
+1. Select **Save changes**.
+
+If Code Suggestions is enabled for the group, the group setting overrides the user setting.
+
+NOTE:
+This setting controls Code Suggestions for all IDEs. Support for [more granular control per IDE](https://gitlab.com/groups/gitlab-org/-/epics/10624) is proposed.
+
+## Use Code Suggestions
+
+Prerequisites:
+
+- Code Suggestions must be enabled [for the top-level group](../../../group/manage.md#enable-code-suggestions) and [for your user account](#enable-code-suggestions-for-an-individual-user).
+- You must have installed and configured a [supported IDE editor extension](index.md#supported-editor-extensions).
+
+To use Code Suggestions:
+
+1. Author your code. As you type, suggestions are displayed. Depending on the cursor position, the extension either:
+
+ - Provides entire code snippets, like generating functions.
+ - Completes the current line.
+
+1. To accept a suggestion, press <kbd>Tab</kbd>.
+
+Suggestions are best when writing new code. Editing existing functions or 'fill in the middle' of a function may not perform as expected.
+
+GitLab is making improvements to the Code Suggestions to improve the quality. AI is non-deterministic, so you may not get the same suggestion every time with the same input.
+
+This feature is currently in [Beta](../../../../policy/experiment-beta-support.md#beta).
+Code Suggestions depends on both Google Vertex AI Codey APIs and the GitLab Code Suggestions service. We have built this feature to gracefully degrade and have controls in place to allow us to
+mitigate abuse or misuse. GitLab may disable this feature for any or all customers at any time at our discretion.
diff --git a/doc/user/project/repository/code_suggestions/self_managed.md b/doc/user/project/repository/code_suggestions/self_managed.md
new file mode 100644
index 00000000000..4797baeacd3
--- /dev/null
+++ b/doc/user/project/repository/code_suggestions/self_managed.md
@@ -0,0 +1,176 @@
+---
+stage: AI-powered
+group: AI Model Validation
+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
+type: index, reference
+---
+
+# Code Suggestions on self-managed GitLab (Beta) **(PREMIUM SELF)**
+
+> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10653) in GitLab 16.1 as [Beta](../../../../policy/experiment-beta-support.md#beta) on self-managed GitLab.
+> - [Introduced support for Google Vertex AI Codey APIs](https://gitlab.com/groups/gitlab-org/-/epics/10562) in GitLab 16.1.
+> - [Removed support for GitLab native model](https://gitlab.com/groups/gitlab-org/-/epics/10752) in GitLab 16.2.
+> - Code Suggestions in the GitLab WebIDE enabled for all GitLab-hosted customers.
+
+Write code more efficiently by using generative AI to suggest code while you're developing.
+
+Code Suggestions are available on GitLab Enterprise Edition.
+Cloud licensing is required for Premium and Ultimate subscription tiers.
+
+Code Suggestions are not available for GitLab Community Edition.
+
+WARNING:
+In GitLab 16.3 and later, only Premium and Ultimate customers can participate in the free trial of Code Suggestions on self-managed GitLab.
+
+Usage of Code Suggestions is governed by the [GitLab Testing Agreement](https://about.gitlab.com/handbook/legal/testing-agreement/).
+Learn about [data usage when using Code Suggestions](index.md#code-suggestions-data-usage).
+
+## Enable Code Suggestions on self-managed GitLab **(FREE SELF)**
+
+> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10653) in GitLab 16.1 as [Beta](../../../../policy/experiment-beta-support.md#beta).
+
+When you enable Code Suggestions for your self-managed instance, you:
+
+- Agree to the [GitLab testing agreement](https://about.gitlab.com/handbook/legal/testing-agreement/).
+- Acknowledge that GitLab sends data from the instance, including personal data, to GitLab.com infrastructure.
+
+How you enable Code Suggestions differs depending on your version of GitLab.
+
+### GitLab 16.3 and later
+
+Prerequisites:
+
+- You are a new Code Suggestions customer as of GitLab 16.3.
+- All of the users in your instance have the latest version of their IDE extension.
+- You are an administrator.
+
+To enable Code Suggestions for your self-managed GitLab instance:
+
+1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
+1. Select **Admin Area**.
+1. On the left sidebar, select **Settings > General**.
+1. Expand **Code Suggestions** and select **Turn on Code Suggestions for this instance**.
+ You do not need to enter anything into the **Personal access token** field.
+1. Select **Save changes**.
+
+This setting is visible only in self-managed GitLab instances.
+
+WARNING:
+In GitLab 16.2 and earlier, if you clear the **Turn on code suggestions for this instance** checkbox, the users in your instance can still use Code Suggestions for up to one hour, until the issued JSON web token (JWT) expires.
+
+To make sure Code Suggestions works immediately, you must [manually synchronize your subscription](#manually-synchronize-your-subscription).
+
+The users in your instance can now use Code Suggestions.
+
+### GitLab 16.2 and earlier
+
+Prerequisites:
+
+- You are an administrator.
+- You have a [GitLab SaaS account](https://gitlab.com/users/sign_up). You do not need to have a GitLab SaaS subscription.
+
+Then, you will:
+
+1. Enable Code Suggestions for your SaaS account.
+1. Enable Code Suggestions for the instance.
+1. [Request early access](#request-access-to-code-suggestions) to the Code Suggestions Beta.
+
+#### Enable Code Suggestions for your SaaS account
+
+To enable Code Suggestions for your GitLab SaaS account:
+
+1. Create a [personal access token](../../../profile/personal_access_tokens.md#create-a-personal-access-token)
+ with the `api` scope.
+1. On the left sidebar, select your avatar.
+1. Select **Preferences**.
+1. In the **Code Suggestions** section, select **Enable Code Suggestions**.
+1. Select **Save changes**.
+
+#### Enable Code Suggestions for the instance
+
+To enable Code Suggestions for your self-managed GitLab instance:
+
+1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
+1. Select **Admin Area**.
+1. On the left sidebar, select **Settings > General**.
+1. Expand **Code Suggestions** and:
+ - Select **Turn on Code Suggestions for this instance**.
+ - In **Personal access token**, enter your GitLab SaaS personal access token.
+1. Select **Save changes**.
+
+This setting is visible only in self-managed GitLab instances.
+
+WARNING:
+If you clear the **Turn on code suggestions for this instance** checkbox, the users in your instance can still use Code Suggestions for up to one hour, until the issued JSON web token (JWT) expires.
+
+#### Request access to Code Suggestions
+
+GitLab provisions access on a customer-by-customer basis for Code Suggestions
+on self-managed instances. To request access:
+
+1. Sign into your GitLab SaaS account.
+1. Comment on [issue 415393](https://gitlab.com/gitlab-org/gitlab/-/issues/415393)
+ and tag your customer success manager.
+
+After GitLab has provisioned access to Code Suggestions for your instance,
+the users in your instance can now enable Code Suggestions.
+
+### Update GitLab
+
+In GitLab 16.3 and later, GitLab is enforcing the cloud licensing requirement for Code Suggestions:
+
+- The Premium and Ultimate subscription tiers support cloud Licensing.
+- GitLab Free does not have cloud licensing support.
+
+If you have a GitLab Free subscription and update to GitLab 16.3 or later,
+to continue having early access to Code Suggestions, you must:
+
+1. Have a [subscription that supports cloud licensing](https://about.gitlab.com/pricing/).
+1. Make sure you have the latest version of your [IDE extension](index.md#supported-editor-extensions).
+1. [Manually synchronize your subscription](#manually-synchronize-your-subscription).
+
+#### Manually synchronize your subscription
+
+You must [manually synchronize your subscription](../../../../subscriptions/self_managed/index.md#manually-synchronize-your-subscription-details) if either:
+
+- You have already updated to GitLab 16.3 and have just bought a Premium or Ultimate tier subscription.
+- You already have a Premium or Ultimate tier subscription and have just updated to GitLab 16.3.
+
+Without the manual synchronization, it might take up to 24 hours to active Code Suggestions on your instance.
+
+## Use Code Suggestions
+
+Prerequisites:
+
+- Code Suggestions must be enabled [for the instance](#enable-code-suggestions-on-self-managed-gitlab).
+- You must have installed and configured a [supported IDE editor extension](index.md#supported-editor-extensions).
+
+To use Code Suggestions:
+
+1. Author your code. As you type, suggestions are displayed. Depending on the cursor position, the extension either:
+
+ - Provides entire code snippets, like generating functions.
+ - Completes the current line.
+
+1. To accept a suggestion, press <kbd>Tab</kbd>.
+
+Suggestions are best when writing new code. Editing existing functions or 'fill in the middle' of a function may not perform as expected.
+
+GitLab is making improvements to the Code Suggestions to improve the quality. AI is non-deterministic, so you may not get the same suggestion every time with the same input.
+
+This feature is currently in [Beta](../../../../policy/experiment-beta-support.md#beta).
+Code Suggestions depends on both Google Vertex AI Codey APIs and the GitLab Code Suggestions service. We have built this feature to gracefully degrade and have controls in place to allow us to
+mitigate abuse or misuse. GitLab may disable this feature for any or all customers at any time at our discretion.
+
+### Data privacy
+
+A self-managed GitLab instance does not generate the code suggestion. After successful
+authentication to the self-managed instance, a token is generated.
+
+The IDE/editor then uses this token to securely transmit data directly to
+GitLab.com's Code Suggestions service for processing.
+
+The Code Suggestion service then securely returns an AI-generated code suggestion.
+
+Neither GitLab nor Google Vertex AI Codey APIs have any visibility into a self-managed customer's code other than
+what is sent to generate the code suggestion.
diff --git a/doc/user/project/repository/code_suggestions/troubleshooting.md b/doc/user/project/repository/code_suggestions/troubleshooting.md
new file mode 100644
index 00000000000..b4764c7ad75
--- /dev/null
+++ b/doc/user/project/repository/code_suggestions/troubleshooting.md
@@ -0,0 +1,69 @@
+---
+stage: AI-powered
+group: AI Model Validation
+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
+type: index, reference
+---
+
+# Troubleshooting Code Suggestions (Beta) **(FREE ALL)**
+
+When working with Code Suggestions, you might encounter the following issues.
+
+## Code Suggestions aren't displayed
+
+If Code Suggestions are not displayed, try the following troubleshooting steps.
+
+In GitLab, ensure Code Suggestions is enabled:
+
+- [For your user account](saas.md#enable-code-suggestions-for-an-individual-user).
+- [For *all* top-level groups your account belongs to](../../../group/manage.md#enable-code-suggestions). If you don't have a role that lets you view the top-level group's settings, contact a group owner.
+
+To confirm that your account is enabled, go to [https://gitlab.com/api/v4/ml/ai-assist](https://gitlab.com/api/v4/ml/ai-assist). A response of `user_is_allowed` should return `true`.
+
+### Code Suggestions not displayed in VS Code or GitLab WebIDE
+
+Check all the steps in [Code Suggestions aren't displayed](#code-suggestions-arent-displayed) first.
+
+If you are a self-managed user, ensure that Code Suggestions for the [GitLab WebIDE](../../../project/web_ide/index.md) are enabled. The same settings apply to VS Code as local IDE.
+
+1. On the left sidebar, select **Extensions > GitLab Workflow**.
+1. Select **Settings** (**{settings}**), and then select **Extension Settings**.
+1. In **GitLab > AI Assisted Code Suggestions**, select the **Enable code completion (Beta)**
+ checkbox.
+
+If the settings are enabled, but Code Suggestions are still not displayed, try the following steps:
+
+1. Enable the `Debug` checkbox in the GitLab Workflow **Extension Settings**.
+1. Open the extension log in **View > Output** and change the dropdown list to **GitLab Workflow** as the log filter. The command palette command is `GitLab: Show Extension Logs`.
+1. Disable and re-enable the **Enable code completion (Beta)** checkbox.
+1. Verify that the debug log contains similar output:
+
+```shell
+2023-07-14T17:29:00:763 [debug]: Disabling code completion
+2023-07-14T17:29:01:802 [debug]: Enabling code completion
+2023-07-14T17:29:01:802 [debug]: AI Assist: Using server: https://codesuggestions.gitlab.com/v2/completions
+```
+
+### Code Suggestions not displayed in Microsoft Visual Studio
+
+Check all the steps in [Code Suggestions aren't displayed](#code-suggestions-arent-displayed) first.
+
+1. Ensure you have properly [set up the extension](https://gitlab.com/gitlab-org/editor-extensions/gitlab-visual-studio-extension#setup).
+1. From the **Tools > Options** menu, find the **GitLab** option. Ensure **Log Level** is set to **Debug**.
+1. Open the extension log in **View > Output** and change the dropdown list to **GitLab Extension** as the log filter.
+1. Verify that the debug log contains similar output:
+
+```shell
+14:48:21:344 GitlabProposalSource.GetCodeSuggestionAsync
+14:48:21:344 LsClient.SendTextDocumentCompletionAsync("GitLab.Extension.Test\TestData.cs", 34, 0)
+14:48:21:346 LS(55096): time="2023-07-17T14:48:21-05:00" level=info msg="update context"
+```
+
+## Authentication troubleshooting
+
+If the above steps do not solve your issue, the problem may be related to the recent changes in authentication,
+specifically the token system. To resolve the issue:
+
+1. Remove the existing personal access token from your GitLab account settings.
+1. Reauthorize your GitLab account in VS Code using OAuth.
+1. Test the code suggestions feature with different file extensions to verify if the issue is resolved.
diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb
index 705279ee947..e0f4473c80c 100644
--- a/spec/features/admin/admin_runners_spec.rb
+++ b/spec/features/admin/admin_runners_spec.rb
@@ -580,6 +580,8 @@ RSpec.describe "Admin Runners", feature_category: :runner_fleet do
let(:runner_page_path) { admin_runner_path(project_runner) }
end
+ it_behaves_like 'shows locked field'
+
describe 'breadcrumbs' do
it 'contains the current runner id and token' do
page.within '[data-testid="breadcrumb-links"]' do
diff --git a/spec/features/groups/group_runners_spec.rb b/spec/features/groups/group_runners_spec.rb
index e15374a8629..4e5d7c6f8e8 100644
--- a/spec/features/groups/group_runners_spec.rb
+++ b/spec/features/groups/group_runners_spec.rb
@@ -308,6 +308,8 @@ RSpec.describe "Group Runners", feature_category: :runner_fleet do
let(:runner) { project_runner }
let(:runner_page_path) { group_runner_path(group, project_runner) }
end
+
+ it_behaves_like 'shows locked field'
end
end
end
diff --git a/spec/features/runners_spec.rb b/spec/features/runners_spec.rb
index 2b60fc1f1b9..091c318459b 100644
--- a/spec/features/runners_spec.rb
+++ b/spec/features/runners_spec.rb
@@ -36,10 +36,7 @@ RSpec.describe 'Runners', feature_category: :runner_fleet do
let(:register_path_pattern) { register_project_runner_path(project, '.*') }
end
- it 'shows the locked field' do
- expect(page).to have_selector('input[type="checkbox"][name="locked"]')
- expect(page).to have_content(_('Lock to current projects'))
- end
+ it_behaves_like 'shows locked field'
end
end
diff --git a/spec/frontend/ci/runner/components/runner_create_form_spec.js b/spec/frontend/ci/runner/components/runner_create_form_spec.js
index c452e32b0e4..3c5f8c4d6a9 100644
--- a/spec/frontend/ci/runner/components/runner_create_form_spec.js
+++ b/spec/frontend/ci/runner/components/runner_create_form_spec.js
@@ -61,6 +61,7 @@ describe('RunnerCreateForm', () => {
createComponent();
expect(findRunnerFormFields().props('value')).toEqual(defaultRunnerModel);
+ expect(findRunnerFormFields().props('runnerType')).toEqual(INSTANCE_TYPE);
});
it('shows a submit button', () => {
diff --git a/spec/frontend/ci/runner/components/runner_form_fields_spec.js b/spec/frontend/ci/runner/components/runner_form_fields_spec.js
index 93be4d9d35e..7e39a6b72f9 100644
--- a/spec/frontend/ci/runner/components/runner_form_fields_spec.js
+++ b/spec/frontend/ci/runner/components/runner_form_fields_spec.js
@@ -132,8 +132,8 @@ describe('RunnerFormFields', () => {
it('when runner is of project type, locked checkbox can be checked', async () => {
createComponent({
+ runnerType: PROJECT_TYPE,
value: {
- runnerType: PROJECT_TYPE,
locked: false,
},
});
@@ -144,7 +144,6 @@ describe('RunnerFormFields', () => {
expect(wrapper.emitted('input').at(-1)).toEqual([
{
- runnerType: PROJECT_TYPE,
locked: true,
},
]);
diff --git a/spec/frontend/ci/runner/components/runner_update_form_spec.js b/spec/frontend/ci/runner/components/runner_update_form_spec.js
index 5851078a8d3..2ba1c31fe52 100644
--- a/spec/frontend/ci/runner/components/runner_update_form_spec.js
+++ b/spec/frontend/ci/runner/components/runner_update_form_spec.js
@@ -15,6 +15,7 @@ import RunnerUpdateForm from '~/ci/runner/components/runner_update_form.vue';
import runnerUpdateMutation from '~/ci/runner/graphql/edit/runner_update.mutation.graphql';
import { captureException } from '~/ci/runner/sentry_utils';
import { saveAlertToLocalStorage } from '~/ci/runner/local_storage_alert/save_alert_to_local_storage';
+import { INSTANCE_TYPE } from '~/ci/runner/constants';
import { runnerFormData } from '../mock_data';
jest.mock('~/ci/runner/local_storage_alert/save_alert_to_local_storage');
@@ -119,6 +120,7 @@ describe('RunnerUpdateForm', () => {
it('shows runner fields', () => {
expect(findRunnerFormFields().props('value')).toEqual(runnerToModel(mockRunner));
+ expect(findRunnerFormFields().props('runnerType')).toEqual(INSTANCE_TYPE);
});
it('form has not been submitted', () => {
diff --git a/spec/frontend/issues/show/components/task_list_item_actions_spec.js b/spec/frontend/issues/show/components/task_list_item_actions_spec.js
index 93cb7b5ae16..b2e57bf49d0 100644
--- a/spec/frontend/issues/show/components/task_list_item_actions_spec.js
+++ b/spec/frontend/issues/show/components/task_list_item_actions_spec.js
@@ -1,5 +1,6 @@
-import { GlDisclosureDropdown, GlDisclosureDropdownItem } from '@gitlab/ui';
-import { shallowMount } from '@vue/test-utils';
+import { GlDisclosureDropdown } from '@gitlab/ui';
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
+import { TYPE_EPIC, TYPE_INCIDENT, TYPE_ISSUE } from '~/issues/constants';
import TaskListItemActions from '~/issues/show/components/task_list_item_actions.vue';
import eventHub from '~/issues/show/event_hub';
@@ -9,26 +10,24 @@ describe('TaskListItemActions component', () => {
let wrapper;
const findGlDisclosureDropdown = () => wrapper.findComponent(GlDisclosureDropdown);
- const findConvertToTaskItem = () => wrapper.findAllComponents(GlDisclosureDropdownItem).at(0);
- const findDeleteItem = () => wrapper.findAllComponents(GlDisclosureDropdownItem).at(1);
+ const findConvertToTaskItem = () => wrapper.findByTestId('convert');
+ const findDeleteItem = () => wrapper.findByTestId('delete');
- const mountComponent = () => {
+ const mountComponent = ({ issuableType = TYPE_ISSUE } = {}) => {
const li = document.createElement('li');
li.dataset.sourcepos = '3:1-3:10';
li.appendChild(document.createElement('div'));
document.body.appendChild(li);
- wrapper = shallowMount(TaskListItemActions, {
- provide: { canUpdate: true },
+ wrapper = shallowMountExtended(TaskListItemActions, {
+ provide: { canUpdate: true, issuableType },
attachTo: document.querySelector('div'),
});
};
- beforeEach(() => {
+ it('renders dropdown', () => {
mountComponent();
- });
- it('renders dropdown', () => {
expect(findGlDisclosureDropdown().props()).toMatchObject({
category: 'tertiary',
icon: 'ellipsis_v',
@@ -38,15 +37,36 @@ describe('TaskListItemActions component', () => {
});
});
- it('emits event when `Convert to task` dropdown item is clicked', () => {
- findConvertToTaskItem().vm.$emit('action');
+ describe('"Convert to task" dropdown item', () => {
+ describe.each`
+ issuableType | exists
+ ${TYPE_EPIC} | ${false}
+ ${TYPE_INCIDENT} | ${true}
+ ${TYPE_ISSUE} | ${true}
+ `(`when $issuableType`, ({ issuableType, exists }) => {
+ it(`${exists ? 'renders' : 'does not render'}`, () => {
+ mountComponent({ issuableType });
- expect(eventHub.$emit).toHaveBeenCalledWith('convert-task-list-item', '3:1-3:10');
+ expect(findConvertToTaskItem().exists()).toBe(exists);
+ });
+ });
});
- it('emits event when `Delete` dropdown item is clicked', () => {
- findDeleteItem().vm.$emit('action');
+ describe('events', () => {
+ beforeEach(() => {
+ mountComponent();
+ });
+
+ it('emits event when `Convert to task` dropdown item is clicked', () => {
+ findConvertToTaskItem().vm.$emit('action');
+
+ expect(eventHub.$emit).toHaveBeenCalledWith('convert-task-list-item', '3:1-3:10');
+ });
- expect(eventHub.$emit).toHaveBeenCalledWith('delete-task-list-item', '3:1-3:10');
+ it('emits event when `Delete` dropdown item is clicked', () => {
+ findDeleteItem().vm.$emit('action');
+
+ expect(eventHub.$emit).toHaveBeenCalledWith('delete-task-list-item', '3:1-3:10');
+ });
});
});
diff --git a/spec/frontend/service_desk/components/service_desk_list_app_spec.js b/spec/frontend/service_desk/components/service_desk_list_app_spec.js
index 89245b289e6..7e57521c15c 100644
--- a/spec/frontend/service_desk/components/service_desk_list_app_spec.js
+++ b/spec/frontend/service_desk/components/service_desk_list_app_spec.js
@@ -655,10 +655,10 @@ describe('CE ServiceDeskListApp', () => {
describe('Errors', () => {
describe.each`
- error | responseHandler
- ${'fetching issues'} | ${'serviceDeskIssuesQueryResponseHandler'}
- ${'fetching issue counts'} | ${'serviceDeskIssuesCountsQueryResponseHandler'}
- `('when there is an error $error', ({ responseHandler }) => {
+ error | responseHandler | message
+ ${'fetching issues'} | ${'serviceDeskIssuesQueryResponseHandler'} | ${'An error occurred while loading issues'}
+ ${'fetching issue counts'} | ${'serviceDeskIssuesCountsQueryResponseHandler'} | ${'An error occurred while getting issue counts'}
+ `('when there is an error $error', ({ responseHandler, message }) => {
beforeEach(() => {
wrapper = createComponent({
[responseHandler]: jest.fn().mockRejectedValue(new Error('ERROR')),
@@ -667,9 +667,24 @@ describe('CE ServiceDeskListApp', () => {
});
it('shows an error message', () => {
+ expect(findIssuableList().props('error')).toBe(message);
+ });
+
+ it('is captured with Sentry', () => {
expect(Sentry.captureException).toHaveBeenCalledWith(new Error('ERROR'));
});
});
+
+ it('clears error message when "dismiss-alert" event is emitted from IssuableList', async () => {
+ wrapper = createComponent({
+ serviceDeskIssuesQueryResponseHandler: jest.fn().mockRejectedValue(new Error()),
+ });
+ await waitForPromises();
+ findIssuableList().vm.$emit('dismiss-alert');
+ await nextTick();
+
+ expect(findIssuableList().props('error')).toBe('');
+ });
});
describe('When providing token for labels', () => {
diff --git a/spec/helpers/ci/status_helper_spec.rb b/spec/helpers/ci/status_helper_spec.rb
index 0af396149ef..66c821df8f1 100644
--- a/spec/helpers/ci/status_helper_spec.rb
+++ b/spec/helpers/ci/status_helper_spec.rb
@@ -20,29 +20,6 @@ RSpec.describe Ci::StatusHelper do
end
end
- describe '#ci_text_for_status' do
- context 'when status is manual' do
- it 'changes the status to blocked' do
- expect(helper.ci_text_for_status('manual'))
- .to eq 'blocked'
- end
- end
-
- context 'when status is success' do
- it 'changes the status to passed' do
- expect(helper.ci_text_for_status('success'))
- .to eq 'passed'
- end
- end
-
- context 'when status is something else' do
- it 'returns status unchanged' do
- expect(helper.ci_text_for_status('some-status'))
- .to eq 'some-status'
- end
- end
- end
-
describe "#pipeline_status_cache_key" do
it "builds a cache key for pipeline status" do
pipeline_status = Gitlab::Cache::Ci::ProjectPipelineStatus.new(
diff --git a/spec/lib/gitlab/middleware/webhook_recursion_detection_spec.rb b/spec/lib/gitlab/middleware/webhook_recursion_detection_spec.rb
index 5394cea64af..b85256f32c5 100644
--- a/spec/lib/gitlab/middleware/webhook_recursion_detection_spec.rb
+++ b/spec/lib/gitlab/middleware/webhook_recursion_detection_spec.rb
@@ -3,7 +3,7 @@
require 'fast_spec_helper'
require 'action_dispatch'
require 'rack'
-require 'request_store'
+require 'gitlab/safe_request_store'
RSpec.describe Gitlab::Middleware::WebhookRecursionDetection do
let(:app) { double(:app) }
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb
index e4af778b967..c6f3cfc7b8a 100644
--- a/spec/models/concerns/issuable_spec.rb
+++ b/spec/models/concerns/issuable_spec.rb
@@ -1023,6 +1023,22 @@ RSpec.describe Issuable, feature_category: :team_planning do
end
end
+ describe '#supports_lock_on_merge?' do
+ where(:issuable_type, :supports_lock_on_merge) do
+ :issue | false
+ :merge_request | false
+ :incident | false
+ end
+
+ with_them do
+ let(:issuable) { build_stubbed(issuable_type) }
+
+ subject { issuable.supports_lock_on_merge? }
+
+ it { is_expected.to eq(supports_lock_on_merge) }
+ end
+ end
+
describe '#severity' do
subject { issuable.severity }
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
index 425b3b12086..bc6cb0a22eb 100644
--- a/spec/models/merge_request_spec.rb
+++ b/spec/models/merge_request_spec.rb
@@ -5807,4 +5807,30 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
it { is_expected.to eq(false) }
end
end
+
+ describe '#supports_lock_on_merge?' do
+ let(:merge_request) { build_stubbed(:merge_request) }
+
+ subject { merge_request.supports_lock_on_merge? }
+
+ context 'when MR is open' do
+ it { is_expected.to eq(false) }
+ end
+
+ context 'when MR is merged' do
+ before do
+ merge_request.state = :merged
+ end
+
+ it { is_expected.to eq(true) }
+
+ context 'when feature flag is disabled' do
+ before do
+ stub_feature_flags(enforce_locked_labels_on_merge: false)
+ end
+
+ it { is_expected.to eq(false) }
+ end
+ end
+ end
end
diff --git a/spec/support/shared_examples/features/runners_shared_examples.rb b/spec/support/shared_examples/features/runners_shared_examples.rb
index 7dec5ce78b0..861c205337a 100644
--- a/spec/support/shared_examples/features/runners_shared_examples.rb
+++ b/spec/support/shared_examples/features/runners_shared_examples.rb
@@ -202,6 +202,13 @@ RSpec.shared_examples 'shows runner jobs tab' do
end
end
+RSpec.shared_examples 'shows locked field' do
+ it 'shows locked checkbox with description', :js do
+ expect(page).to have_selector('input[type="checkbox"][name="locked"]')
+ expect(page).to have_content(_('Lock to current projects'))
+ end
+end
+
RSpec.shared_examples 'submits edit runner form' do
it 'breadcrumb contains runner id and token' do
page.within '[data-testid="breadcrumb-links"]' do