Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2025-03-10 21:07:36 +00:00
parent 0e89b9f2e0
commit c3193c368b
83 changed files with 807 additions and 104 deletions

View File

@ -23,7 +23,7 @@ retrieve-tests-metadata:
- apk add --no-cache --update curl # Not present in ruby-alpine, so we add it manually
- !reference [".fast-no-clone-job", before_script]
script:
- ruby scripts/setup/tests-metadata.rb retrieve
- run_with_custom_exit_code ruby scripts/setup/tests-metadata.rb retrieve
update-tests-metadata:
extends:
@ -49,10 +49,15 @@ update-tests-metadata:
script:
- source scripts/utils.sh
- source scripts/rspec_helpers.sh
- test -f "${FLAKY_RSPEC_SUITE_REPORT_PATH}" || echo -e "\e[31m" 'Consider add ~"pipeline:run-all-rspec" to run full rspec jobs' "\e[0m"
- run_timed_command "retry gem install fog-aws mime-types activesupport rspec_profiling postgres-copy --no-document"
- update_tests_metadata
- update_tests_mapping
- |
function update_metadata() {
test -f "${FLAKY_RSPEC_SUITE_REPORT_PATH}" || echo -e "\e[31m" 'Consider add ~"pipeline:run-all-rspec" to run full rspec jobs' "\e[0m"
run_timed_command "retry gem install fog-aws mime-types activesupport rspec_profiling postgres-copy --no-document"
update_tests_metadata
update_tests_mapping
}
run_with_custom_exit_code update_metadata
verify-tests-metadata:
extends:
@ -66,4 +71,4 @@ verify-tests-metadata:
- source scripts/utils.sh
- install_activesupport_gem
script:
- scripts/setup/tests-metadata.rb verify
- run_with_custom_exit_code scripts/setup/tests-metadata.rb verify

View File

@ -458,7 +458,7 @@
{"name":"omniauth-google-oauth2","version":"1.1.1","platform":"ruby","checksum":"4496f126e84eaf760f9c6a5c69e5e7511f98092d7f25ad79fd2c0ae5e09b5039"},
{"name":"omniauth-oauth2","version":"1.8.0","platform":"ruby","checksum":"b2f8e9559cc7e2d4efba57607691d6d2b634b879fc5b5b6ccfefa3da85089e78"},
{"name":"omniauth-oauth2-generic","version":"0.2.8","platform":"ruby","checksum":"ce6e8539019d5ebf2f48867072b9f248f148bb4cbe7166dee655865abfae7613"},
{"name":"omniauth-saml","version":"2.2.1","platform":"ruby","checksum":"8abb6bf8d38a50f52c7cc905d32877c7b2c79dbc9c225fcc3d3e56723411d602"},
{"name":"omniauth-saml","version":"2.2.2","platform":"ruby","checksum":"84cc650ac2d684fcd430a5a14dfbfa0f8677eebaf0bd9d86ab17b520edd0fbb3"},
{"name":"omniauth-shibboleth-redux","version":"2.0.0","platform":"ruby","checksum":"e9b353fd103405fcc8549e8510b9cad857acf0b286d764fac5dba8a93ab8ffe1"},
{"name":"omniauth_openid_connect","version":"0.8.0","platform":"ruby","checksum":"1f2f3890386e2a742221cee0d2e903b78d874e6fab9ea3bfa31c1462f4793d25"},
{"name":"open4","version":"1.3.4","platform":"ruby","checksum":"a1df037310624ecc1ea1d81264b11c83e96d0c3c1c6043108d37d396dcd0f4b1"},

View File

@ -1276,7 +1276,7 @@ GEM
omniauth-oauth2-generic (0.2.8)
omniauth-oauth2 (~> 1.0)
rake
omniauth-saml (2.2.1)
omniauth-saml (2.2.2)
omniauth (~> 2.1)
ruby-saml (~> 1.17)
omniauth-shibboleth-redux (2.0.0)

View File

@ -461,7 +461,7 @@
{"name":"omniauth-google-oauth2","version":"1.1.1","platform":"ruby","checksum":"4496f126e84eaf760f9c6a5c69e5e7511f98092d7f25ad79fd2c0ae5e09b5039"},
{"name":"omniauth-oauth2","version":"1.8.0","platform":"ruby","checksum":"b2f8e9559cc7e2d4efba57607691d6d2b634b879fc5b5b6ccfefa3da85089e78"},
{"name":"omniauth-oauth2-generic","version":"0.2.8","platform":"ruby","checksum":"ce6e8539019d5ebf2f48867072b9f248f148bb4cbe7166dee655865abfae7613"},
{"name":"omniauth-saml","version":"2.2.1","platform":"ruby","checksum":"8abb6bf8d38a50f52c7cc905d32877c7b2c79dbc9c225fcc3d3e56723411d602"},
{"name":"omniauth-saml","version":"2.2.2","platform":"ruby","checksum":"84cc650ac2d684fcd430a5a14dfbfa0f8677eebaf0bd9d86ab17b520edd0fbb3"},
{"name":"omniauth-shibboleth-redux","version":"2.0.0","platform":"ruby","checksum":"e9b353fd103405fcc8549e8510b9cad857acf0b286d764fac5dba8a93ab8ffe1"},
{"name":"omniauth_openid_connect","version":"0.8.0","platform":"ruby","checksum":"1f2f3890386e2a742221cee0d2e903b78d874e6fab9ea3bfa31c1462f4793d25"},
{"name":"open4","version":"1.3.4","platform":"ruby","checksum":"a1df037310624ecc1ea1d81264b11c83e96d0c3c1c6043108d37d396dcd0f4b1"},

View File

@ -1293,7 +1293,7 @@ GEM
omniauth-oauth2-generic (0.2.8)
omniauth-oauth2 (~> 1.0)
rake
omniauth-saml (2.2.1)
omniauth-saml (2.2.2)
omniauth (~> 2.1)
ruby-saml (~> 1.17)
omniauth-shibboleth-redux (2.0.0)

View File

@ -56,7 +56,7 @@ export default {
<gl-link
:href="editedBy.path"
:data-user-id="editedBy.id"
class="js-user-link author-link hover:gl-underline"
class="js-user-link author-link gl-text-default hover:gl-underline"
>
{{ editedBy.name }}
</gl-link>

View File

@ -53,7 +53,7 @@ export default {
<div
class="gl-flex gl-flex-col gl-justify-between gl-pb-3 gl-pt-5 sm:gl-flex-row sm:gl-items-center"
>
<h2 class="gl-m-0 gl-text-size-h1">{{ __('Activity') }}</h2>
<h2 class="gl-heading-2 gl-m-0">{{ __('Activity') }}</h2>
<div class="gl-mt-3 gl-flex gl-w-full gl-gap-3 sm:gl-mt-0 sm:gl-w-auto">
<ai-summarize-notes
v-if="showAiActions"

View File

@ -100,8 +100,9 @@ export default {
<note-edited-text
v-if="edited"
:edited-at="updatedNote.lastEditedAt"
:edited-by="updatedNote.lastEditedBy"
:action-text="editedText"
class-name="gl-text-subtle gl-text-sm gl-display-block gl-mt-4"
class-name="gl-text-subtle gl-text-sm gl-display-block gl-mt-5"
/>
</template>

View File

@ -131,6 +131,7 @@ export default {
</template>
<span v-else>{{ __('A deleted user') }}</span>
<span class="note-headline-light note-healine-meta">
<span class="gl-hidden sm:gl-inline">·</span>
<template v-if="createdAt">
<time-ago-tooltip ref="noteTimestamp" :time="createdAt" tooltip-placement="bottom" />
</template>

View File

@ -128,7 +128,7 @@ export default {
<template v-if="replies.length || isReplying" #note-footer>
<div
data-testid="wiki-note-footer"
class="gl-border-t-1 gl-border-t-[#dcdcde] gl-bg-subtle gl-border-t-solid"
class="gl-border-t gl-rounded-b-base gl-border-t-subtle gl-bg-subtle dark:gl-border-t-section"
>
<toggle-replies-widget
v-if="replies.length"
@ -139,7 +139,7 @@ export default {
<div
v-if="!collapsed"
class="note-footer discussion-reply-holder clearfix gl-px-5 gl-py-4"
class="note-footer discussion-reply-holder clearfix gl-px-5 gl-pb-4 gl-pt-2"
>
<div v-for="reply in replies" :key="reply.id">
<wiki-note

View File

@ -110,9 +110,9 @@ export default {
'internal-note': this.note.internal,
},
noteParent: {
card: !this.replyNote,
'gl-rounded-base gl-border gl-border-section': !this.replyNote,
'gl-ml-7': this.replyNote,
'gl-ml-8': !this.replyNote,
'gl-bg-section gl-ml-8': !this.replyNote,
},
};
},
@ -286,6 +286,7 @@ export default {
<span class="gl-hidden sm:gl-inline">&middot;</span>
</note-header>
<note-actions
:class="{ '-gl-mr-5': replyNote }"
:author-id="authorId"
:show-edit="canEdit"
:show-reply="canReply"
@ -325,7 +326,7 @@ export default {
/>
</div>
<slot name="note-footer"> </slot>
<slot name="note-footer"></slot>
</div>
</timeline-entry-item>
</template>

View File

@ -9,9 +9,7 @@ export default {
};
</script>
<template>
<div
class="gl-flex gl-flex-col gl-justify-between gl-pb-3 gl-pt-5 sm:gl-flex-row sm:gl-items-center"
>
<h2 class="gl-m-0 gl-text-size-h1">{{ $options.i18n.headerText }}</h2>
<div class="gl-flex gl-flex-col gl-justify-between gl-pt-5 sm:gl-flex-row sm:gl-items-center">
<h2 class="gl-heading-2 gl-mb-0 gl-mt-5">{{ $options.i18n.headerText }}</h2>
</div>
</template>

View File

@ -29,6 +29,7 @@ export default {
<div data-testid="dropdown-footer">
<gl-dropdown-item
v-if="allowLabelCreate"
role="button"
data-testid="create-label-button"
@click.capture.native.stop="$emit('toggleDropdownContentsCreateView')"
>
@ -36,6 +37,7 @@ export default {
</gl-dropdown-item>
<gl-dropdown-item
v-if="showManageLabelsItem"
role="button"
data-testid="manage-labels-button"
:href="labelsManagePath"
@click.capture.native.stop

View File

@ -9,6 +9,9 @@ fragment WikiPageNote on Note {
bodyHtml
createdAt
lastEditedAt
lastEditedBy {
...Author
}
url
awardEmoji {
nodes {

View File

@ -28,7 +28,7 @@ module Ci
return if status_groups.exclude?(:any)
all_query = query.select(query.count_pipelines_function.as('all'))
result[:any] = ::ClickHouse::Client.select(all_query.to_sql, :main).first['all']
result[:any] = ::ClickHouse::Client.select(all_query, :main).first['all']
end
def calculate_aggregate_status_group_counts(query, result)
@ -39,7 +39,7 @@ module Ci
.by_status(selected_statuses)
.group_by_status
result_by_status = ::ClickHouse::Client.select(query.to_sql, :main).map(&:values).to_h
result_by_status = ::ClickHouse::Client.select(query, :main).map(&:values).to_h
result_by_status.each_pair { |status, count| result[STATUS_TO_STATUS_GROUP[status]] += count }
end
@ -47,7 +47,7 @@ module Ci
return if duration_percentiles.empty?
duration_query = query.select(*duration_percentiles.map { |p| query.duration_quantile_function(p) })
duration_result = ::ClickHouse::Client.select(duration_query.to_sql, :main)
duration_result = ::ClickHouse::Client.select(duration_query, :main)
result[:duration_statistics] = duration_result.first.symbolize_keys.transform_values do |interval|
interval.to_f.round(3).seconds
end

View File

@ -173,7 +173,7 @@ module Ci
end
def execute_select_query(query)
::ClickHouse::Client.select(query.to_sql, :main).map(&:symbolize_keys)
::ClickHouse::Client.select(query, :main).map(&:symbolize_keys)
end
def collect_metrics

View File

@ -0,0 +1,8 @@
---
migration_job_name: BackfillFinishOnboardingForGroupSaml
description: Finishes the onboarding for a user if they are now attached to group saml
feature_category: onboarding
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/183559
milestone: '17.10'
queued_migration_version: 20250305135537
finalized_by: # version of the migration that finalized this BBM

View File

@ -0,0 +1,12 @@
---
table_name: merge_requests_approval_rules_approver_groups
classes:
- MergeRequests::ApprovalRulesApproverGroup
feature_categories:
- code_review_workflow
description: Stores approval groups for approval rules v2
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179877
milestone: '17.10'
gitlab_schema: gitlab_main_cell
sharding_key:
group_id: namespaces

View File

@ -0,0 +1,13 @@
---
table_name: merge_requests_approval_rules_approver_users
classes:
- MergeRequests::ApprovalRulesApproverUser
feature_categories:
- code_review_workflow
description: Stores approver users for approval rules v2
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179877
milestone: '17.10'
gitlab_schema: gitlab_main_cell
sharding_key:
group_id: namespaces
project_id: projects

View File

@ -0,0 +1,22 @@
# frozen_string_literal: true
class CreateMergeRequestsApprovalRulesApproverGroups < Gitlab::Database::Migration[2.2]
milestone '17.10'
def change
create_table :merge_requests_approval_rules_approver_groups do |t|
t.bigint :approval_rule_id, null: false
t.bigint :group_id, null: false
t.index :group_id
t.timestamps_with_timezone null: false
end
add_index(
:merge_requests_approval_rules_approver_groups,
%i[approval_rule_id group_id],
unique: true,
name: 'index_mrs_ars_approver_groups_on_ar_id_and_group_id'
)
end
end

View File

@ -0,0 +1,26 @@
# frozen_string_literal: true
class CreateMergeRequestsApprovalRulesApproverUsers < Gitlab::Database::Migration[2.2]
milestone '17.10'
def change
create_table :merge_requests_approval_rules_approver_users do |t|
t.bigint :approval_rule_id, null: false
t.bigint :user_id, null: false
t.bigint :project_id, null: true
t.bigint :group_id, null: true
t.index :user_id
t.index :project_id, name: 'index_mrs_approval_rules_approver_users_on_project_id'
t.index :group_id
t.timestamps_with_timezone null: false
end
add_index(
:merge_requests_approval_rules_approver_users,
%i[approval_rule_id user_id],
unique: true,
name: 'index_mrs_ars_users_on_ar_id_and_user_id'
)
end
end

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesApproverGroupsApprovalRuleFk < Gitlab::Database::Migration[2.2]
milestone '17.10'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_approver_groups, :merge_requests_approval_rules,
column: :approval_rule_id, on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_approver_groups, column: :approval_rule_id
end
end
end

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesApproverGroupsGroupFk < Gitlab::Database::Migration[2.2]
milestone '17.10'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_approver_groups, :namespaces, column: :group_id,
on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_approver_groups, column: :group_id
end
end
end

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesUsersUserFk < Gitlab::Database::Migration[2.2]
milestone '17.10'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_approver_users, :users, column: :user_id,
on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_approver_users, column: :user_id
end
end
end

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesUsersProjectFk < Gitlab::Database::Migration[2.2]
milestone '17.10'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_approver_users, :projects, column: :project_id,
on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_approver_users, column: :project_id
end
end
end

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesUsersApprovalRuleFk < Gitlab::Database::Migration[2.2]
milestone '17.10'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_approver_users, :merge_requests_approval_rules,
column: :approval_rule_id, on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_approver_users, column: :approval_rule_id
end
end
end

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesUsersGroupFk < Gitlab::Database::Migration[2.2]
milestone '17.10'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_approver_users, :namespaces, column: :group_id,
on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_approver_users, column: :group_id
end
end
end

View File

@ -0,0 +1,14 @@
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesUsersMultiColumnNotNullConstraint < Gitlab::Database::Migration[2.2]
milestone '17.10'
disable_ddl_transaction!
def up
add_multi_column_not_null_constraint(:merge_requests_approval_rules_approver_users, :group_id, :project_id)
end
def down
remove_multi_column_not_null_constraint(:merge_requests_approval_rules_approver_users, :group_id, :project_id)
end
end

View File

@ -0,0 +1,29 @@
# frozen_string_literal: true
class QueueBackfillFinishOnboardingForGroupSaml < Gitlab::Database::Migration[2.2]
milestone '17.10'
restrict_gitlab_migration gitlab_schema: :gitlab_main
MIGRATION = "BackfillFinishOnboardingForGroupSaml"
DELAY_INTERVAL = 2.minutes
BATCH_SIZE = 3_000
SUB_BATCH_SIZE = 250
MAX_BATCH_SIZE = 10_000
def up
queue_batched_background_migration(
MIGRATION,
:identities,
:id,
job_interval: DELAY_INTERVAL,
batch_size: BATCH_SIZE,
sub_batch_size: SUB_BATCH_SIZE,
max_batch_size: MAX_BATCH_SIZE
)
end
def down
delete_batched_background_migration(MIGRATION, :identities, :id, [])
end
end

View File

@ -0,0 +1,13 @@
# frozen_string_literal: true
class ValidateProjectNamespaceIdNullConstraint < Gitlab::Database::Migration[2.2]
milestone '17.10'
def up
validate_not_null_constraint :projects, :project_namespace_id
end
def down
# no-op
end
end

View File

@ -0,0 +1 @@
3dddd1d5c9f162ebc7e1f1628dc0dbff5a6104587dbf3df962b15a1b47e44aff

View File

@ -0,0 +1 @@
0231ed1f8496a8da0aa9e7941c188c15e94291d0462bcc4575c369ba7b5af2a5

View File

@ -0,0 +1 @@
71751d3c5b490ec202be7fc4370216c047944454284df1ce9e774ea218cb6cc1

View File

@ -0,0 +1 @@
0a852fc3ae3e8fc892dda967727b0ce7629b38c2ce84c050e4c5d886de6d43dd

View File

@ -0,0 +1 @@
af99cf986e829d045cf5e5ad11b72d40378cb90a956a97c1549db8806953a05a

View File

@ -0,0 +1 @@
3b18c1137fa082dddc82012f80750ec36266568d11bc8bd7160d8327d1153267

View File

@ -0,0 +1 @@
fe84c9693c07d7b5b2b771094693597ed538dbc67c1f22d4204ae807f0fc9078

View File

@ -0,0 +1 @@
f7604e3c541ec4b7b5e186c76365908c7c26035ea69f003cdf27d84d937e8180

View File

@ -0,0 +1 @@
68a2b468a90e4116867a7460660177301bd506107d2fafc41f0b63d18f7e5f8a

View File

@ -0,0 +1 @@
ad139258454e70107e8019c35171046e9b788ae272d34c1c68d182d5e1a43006

View File

@ -0,0 +1 @@
4b6d59e21058ca28b551da5aab555d4dc362b8faa06482a2f036698a4ccc1163

View File

@ -297,7 +297,8 @@ CREATE TABLE projects (
project_namespace_id bigint,
hidden boolean DEFAULT false NOT NULL,
organization_id bigint,
CONSTRAINT check_1a6f946a8a CHECK ((organization_id IS NOT NULL))
CONSTRAINT check_1a6f946a8a CHECK ((organization_id IS NOT NULL)),
CONSTRAINT check_fa75869cb1 CHECK ((project_namespace_id IS NOT NULL))
);
CREATE FUNCTION find_projects_by_id(projects_id bigint) RETURNS projects
@ -16476,6 +16477,43 @@ CREATE TABLE merge_requests_approval_rules (
CONSTRAINT check_c7c36145b7 CHECK ((char_length(name) <= 255))
);
CREATE TABLE merge_requests_approval_rules_approver_groups (
id bigint NOT NULL,
approval_rule_id bigint NOT NULL,
group_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
CREATE SEQUENCE merge_requests_approval_rules_approver_groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE merge_requests_approval_rules_approver_groups_id_seq OWNED BY merge_requests_approval_rules_approver_groups.id;
CREATE TABLE merge_requests_approval_rules_approver_users (
id bigint NOT NULL,
approval_rule_id bigint NOT NULL,
user_id bigint NOT NULL,
project_id bigint,
group_id bigint,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
CONSTRAINT check_ccdbd0e37e CHECK ((num_nonnulls(group_id, project_id) = 1))
);
CREATE SEQUENCE merge_requests_approval_rules_approver_users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE merge_requests_approval_rules_approver_users_id_seq OWNED BY merge_requests_approval_rules_approver_users.id;
CREATE TABLE merge_requests_approval_rules_groups (
id bigint NOT NULL,
approval_rule_id bigint NOT NULL,
@ -25959,6 +25997,10 @@ ALTER TABLE ONLY merge_requests ALTER COLUMN id SET DEFAULT nextval('merge_reque
ALTER TABLE ONLY merge_requests_approval_rules ALTER COLUMN id SET DEFAULT nextval('merge_requests_approval_rules_id_seq'::regclass);
ALTER TABLE ONLY merge_requests_approval_rules_approver_groups ALTER COLUMN id SET DEFAULT nextval('merge_requests_approval_rules_approver_groups_id_seq'::regclass);
ALTER TABLE ONLY merge_requests_approval_rules_approver_users ALTER COLUMN id SET DEFAULT nextval('merge_requests_approval_rules_approver_users_id_seq'::regclass);
ALTER TABLE ONLY merge_requests_approval_rules_groups ALTER COLUMN id SET DEFAULT nextval('merge_requests_approval_rules_groups_id_seq'::regclass);
ALTER TABLE ONLY merge_requests_approval_rules_merge_requests ALTER COLUMN id SET DEFAULT nextval('merge_requests_approval_rules_merge_requests_id_seq'::regclass);
@ -27594,9 +27636,6 @@ ALTER TABLE sprints
ALTER TABLE web_hook_logs
ADD CONSTRAINT check_df72cb58f5 CHECK ((char_length(url_hash) <= 44)) NOT VALID;
ALTER TABLE projects
ADD CONSTRAINT check_fa75869cb1 CHECK ((project_namespace_id IS NOT NULL)) NOT VALID;
ALTER TABLE ONLY ci_build_needs
ADD CONSTRAINT ci_build_needs_pkey PRIMARY KEY (id);
@ -28506,6 +28545,12 @@ ALTER TABLE ONLY merge_request_reviewers
ALTER TABLE ONLY merge_request_user_mentions
ADD CONSTRAINT merge_request_user_mentions_pkey PRIMARY KEY (id);
ALTER TABLE ONLY merge_requests_approval_rules_approver_groups
ADD CONSTRAINT merge_requests_approval_rules_approver_groups_pkey PRIMARY KEY (id);
ALTER TABLE ONLY merge_requests_approval_rules_approver_users
ADD CONSTRAINT merge_requests_approval_rules_approver_users_pkey PRIMARY KEY (id);
ALTER TABLE ONLY merge_requests_approval_rules_groups
ADD CONSTRAINT merge_requests_approval_rules_groups_pkey PRIMARY KEY (id);
@ -33997,6 +34042,12 @@ CREATE INDEX index_merge_request_reviewers_on_user_id ON merge_request_reviewers
CREATE UNIQUE INDEX index_merge_request_user_mentions_on_note_id ON merge_request_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL);
CREATE INDEX index_merge_requests_approval_rules_approver_groups_on_group_id ON merge_requests_approval_rules_approver_groups USING btree (group_id);
CREATE INDEX index_merge_requests_approval_rules_approver_users_on_group_id ON merge_requests_approval_rules_approver_users USING btree (group_id);
CREATE INDEX index_merge_requests_approval_rules_approver_users_on_user_id ON merge_requests_approval_rules_approver_users USING btree (user_id);
CREATE INDEX index_merge_requests_approval_rules_groups_on_group_id ON merge_requests_approval_rules_groups USING btree (group_id);
CREATE INDEX index_merge_requests_approval_rules_on_group_id ON merge_requests_approval_rules USING btree (group_id);
@ -34177,18 +34228,24 @@ CREATE INDEX index_mr_metrics_on_target_project_id_merged_at_nulls_last ON merge
CREATE INDEX index_mr_metrics_on_target_project_id_merged_at_time_to_merge ON merge_request_metrics USING btree (target_project_id, merged_at, created_at) WHERE (merged_at > created_at);
CREATE INDEX index_mrs_approval_rules_approver_users_on_project_id ON merge_requests_approval_rules_approver_users USING btree (project_id);
CREATE INDEX index_mrs_approval_rules_mrs_on_mr_id ON merge_requests_approval_rules_merge_requests USING btree (merge_request_id);
CREATE INDEX index_mrs_approval_rules_mrs_on_project_id ON merge_requests_approval_rules_merge_requests USING btree (project_id);
CREATE INDEX index_mrs_approval_rules_projects_on_project_id ON merge_requests_approval_rules_projects USING btree (project_id);
CREATE UNIQUE INDEX index_mrs_ars_approver_groups_on_ar_id_and_group_id ON merge_requests_approval_rules_approver_groups USING btree (approval_rule_id, group_id);
CREATE UNIQUE INDEX index_mrs_ars_groups_on_ar_id_and_group_id ON merge_requests_approval_rules_groups USING btree (approval_rule_id, group_id);
CREATE UNIQUE INDEX index_mrs_ars_mrs_on_ar_id_and_mr_id ON merge_requests_approval_rules_merge_requests USING btree (approval_rule_id, merge_request_id);
CREATE UNIQUE INDEX index_mrs_ars_projects_on_ar_id_and_project_id ON merge_requests_approval_rules_projects USING btree (approval_rule_id, project_id);
CREATE UNIQUE INDEX index_mrs_ars_users_on_ar_id_and_user_id ON merge_requests_approval_rules_approver_users USING btree (approval_rule_id, user_id);
CREATE INDEX index_namespace_admin_notes_on_namespace_id ON namespace_admin_notes USING btree (namespace_id);
CREATE UNIQUE INDEX index_namespace_aggregation_schedules_on_namespace_id ON namespace_aggregation_schedules USING btree (namespace_id);
@ -39332,6 +39389,9 @@ ALTER TABLE ONLY zoekt_enabled_namespaces
ALTER TABLE ONLY import_placeholder_memberships
ADD CONSTRAINT fk_1f4659deee FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_requests_approval_rules_approver_groups
ADD CONSTRAINT fk_1f8729ebf4 FOREIGN KEY (approval_rule_id) REFERENCES merge_requests_approval_rules(id) ON DELETE CASCADE;
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_1fbed67632 FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL;
@ -39611,6 +39671,9 @@ ALTER TABLE ONLY security_orchestration_policy_rule_schedules
ALTER TABLE ONLY abuse_reports
ADD CONSTRAINT fk_3fe6467b93 FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE ONLY merge_requests_approval_rules_approver_users
ADD CONSTRAINT fk_4025feea5b FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
ALTER TABLE ONLY protected_environment_approval_rules
ADD CONSTRAINT fk_405568b491 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@ -39767,6 +39830,9 @@ ALTER TABLE ONLY abuse_report_notes
ALTER TABLE ONLY approval_merge_request_rules
ADD CONSTRAINT fk_5822f009ea FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_requests_approval_rules_approver_users
ADD CONSTRAINT fk_582e5f36e8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY deploy_keys_projects
ADD CONSTRAINT fk_58a901ca7e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@ -39887,6 +39953,9 @@ ALTER TABLE p_ci_builds
ALTER TABLE ONLY routes
ADD CONSTRAINT fk_679ff8213d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY merge_requests_approval_rules_approver_groups
ADD CONSTRAINT fk_67fa93ad4b FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY ai_conversation_messages
ADD CONSTRAINT fk_68774ec148 FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;
@ -39944,6 +40013,9 @@ ALTER TABLE ONLY packages_conan_package_references
ALTER TABLE ONLY subscription_user_add_on_assignments
ADD CONSTRAINT fk_724c2df9a8 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_requests_approval_rules_approver_users
ADD CONSTRAINT fk_725cca295c FOREIGN KEY (approval_rule_id) REFERENCES merge_requests_approval_rules(id) ON DELETE CASCADE;
ALTER TABLE ONLY zentao_tracker_data
ADD CONSTRAINT fk_72a0e59cd8 FOREIGN KEY (instance_integration_id) REFERENCES instance_integrations(id) ON DELETE CASCADE;
@ -40097,6 +40169,9 @@ ALTER TABLE ONLY import_export_uploads
ALTER TABLE ONLY packages_npm_metadata
ADD CONSTRAINT fk_83625a27c0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_requests_approval_rules_approver_users
ADD CONSTRAINT fk_836efc3006 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY push_rules
ADD CONSTRAINT fk_83b29894de FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;

View File

@ -44,14 +44,15 @@ Support for the following GitLab-supported large language models (LLMs) is gener
| Mistral | [Mistral 7B-it v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3) | [vLLM](supported_llm_serving_platforms.md#for-self-hosted-model-deployments) | {{< icon name="check-circle-dashed" >}} Largely compatible | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="dash-circle" >}} Not compatible |
| Mistral | [Mixtral 8x7B-it v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1) | [vLLM](supported_llm_serving_platforms.md#for-self-hosted-model-deployments), [AWS Bedrock](https://aws.amazon.com/bedrock/mistral/) | {{< icon name="check-circle-dashed" >}} Largely compatible | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-dashed" >}} Largely compatible |
| Mistral | [Mixtral 8x22B-it v0.1](https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1) | [vLLM](supported_llm_serving_platforms.md#for-self-hosted-model-deployments) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-dashed" >}} Largely compatible |
| Claude 3 | [Claude 3.5 Sonnet](https://www.anthropic.com/news/claude-3-5-sonnet) | [AWS Bedrock](https://aws.amazon.com/bedrock/claude/) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible |
| Claude 3 | [Claude 3.5 Sonnet](https://www.anthropic.com/news/claude-3-5-sonnet) | [AWS Bedrock](https://aws.amazon.com/bedrock/claude/) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible |
| Claude 3 | [Claude 3.7 Sonnet](https://www.anthropic.com/news/claude-3-7-sonnet) | [AWS Bedrock](https://aws.amazon.com/bedrock/claude/) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible |
| GPT | [GPT-4 Turbo](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=python-secure#gpt-4) | [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-dashed" >}} Largely compatible |
| GPT | [GPT-4o](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=python-secure#gpt-4o-and-gpt-4-turbo) | [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible |
| GPT | [GPT-4o-mini](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=python-secure#gpt-4o-and-gpt-4-turbo) | [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-dashed" >}} Largely compatible |
| Llama | [Llama 3 8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct) | [AWS Bedrock](https://aws.amazon.com/bedrock/llama/) | {{< icon name="check-circle-dashed" >}} Largely compatible | {{< icon name="check-circle-dashed" >}} Largely compatible | Not applicable |
| Llama | [Llama 3.1 8B](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) | [AWS Bedrock](https://aws.amazon.com/bedrock/llama/) | {{< icon name="check-circle-dashed" >}} Largely compatible | {{< icon name="check-circle-filled" >}} Fully compatible | Not applicable |
| Llama | [Llama 3 70B](https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct) | [AWS Bedrock](https://aws.amazon.com/bedrock/llama/) | {{< icon name="check-circle-dashed" >}} Largely compatible| {{< icon name="check-circle-filled" >}} Fully compatible | Not applicable |
| Llama | [Llama 3.1 70B](https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct) | [AWS Bedrock](https://aws.amazon.com/bedrock/llama/) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | Not applicable |
| Llama | [Llama 3 8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct) | [vLLM](supported_llm_serving_platforms.md#for-self-hosted-model-deployments), [AWS Bedrock](https://aws.amazon.com/bedrock/llama/) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | Under evaluation. For more information, see [epic 14486](https://gitlab.com/groups/gitlab-org/-/epics/14486) |
| Llama | [Llama 3.1 8B](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) | [vLLM](supported_llm_serving_platforms.md#for-self-hosted-model-deployments), [AWS Bedrock](https://aws.amazon.com/bedrock/llama/) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | Under evaluation. For more information, see [epic 14486](https://gitlab.com/groups/gitlab-org/-/epics/14486) |
| Llama | [Llama 3 70B](https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct) | [vLLM](supported_llm_serving_platforms.md#for-self-hosted-model-deployments), [AWS Bedrock](https://aws.amazon.com/bedrock/llama/) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | Under evaluation. For more information, see [epic 14486](https://gitlab.com/groups/gitlab-org/-/epics/14486) |
| Llama | [Llama 3.1 70B](https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct) | [vLLM](supported_llm_serving_platforms.md#for-self-hosted-model-deployments), [AWS Bedrock](https://aws.amazon.com/bedrock/llama/) | {{< icon name="check-circle-filled" >}} Fully compatible | {{< icon name="check-circle-filled" >}} Fully compatible | Under evaluation. For more information, see [epic 14486](https://gitlab.com/groups/gitlab-org/-/epics/14486) |
### Experimental and beta models

View File

@ -88,7 +88,7 @@ We provide two debugging scripts to help administrators verify their self-hosted
```shell
poetry run troubleshoot \
--model-family=claude_3 \
--model-identifier=bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0
--model-identifier=bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0
```
For a `mixtral` model running on vLLM:

View File

@ -172,35 +172,43 @@ you can allow runner registration tokens. This setting and support for runner re
### Maximum artifacts size
An administrator can set the maximum size of the
[job artifacts](../cicd/job_artifacts.md) for:
You can set the maximum size of distinct [job artifacts](../cicd/job_artifacts.md) for:
- The entire instance
- Each project
- Each group
- An instance
- Projects
- Groups
For the setting on GitLab.com, see [Artifacts maximum size](../../user/gitlab_com/_index.md#gitlab-cicd).
The default maximum size for each artifact file in a job is 100 MB.
For GitLab.com, see [Artifacts maximum size](../../user/gitlab_com/_index.md#gitlab-cicd).
The value is in MB, and the default value is 100 MB per job. An administrator can change the default value for the:
Job artifacts defined with `artifacts:reports` can have [different limits](../../administration/instance_limits.md#maximum-file-size-per-type-of-artifact).
In this case, the smaller value is used.
- Instance:
{{< alert type="note" >}}
This setting applies to individual artifacts in a job, not the final archive file.
{{< /alert >}}
To modify the maximum artifacts size:
- For an instance:
1. On the left sidebar, at the bottom, select **Admin**.
1. On the left sidebar, select **Settings > CI/CD > Continuous Integration and Deployment**.
1. Select **Settings > CI/CD**.
1. Expand **Continuous Integration and Deployment**.
1. Change the value of **Maximum artifacts size (MB)**.
1. Select **Save changes** for the changes to take effect.
1. Select **Save changes**.
- Group (this overrides the instance setting):
- For a group or project:
1. Go to the group's **Settings > CI/CD > General Pipelines**.
Group settings override instance settings. Project settings override both instance and group settings.
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > CI/CD**.
1. Expand **General pipelines**
1. Change the value of **Maximum artifacts size** (in MB).
1. Select **Save changes** for the changes to take effect.
- Project (this overrides the instance and group settings):
1. Go to the project's **Settings > CI/CD > General Pipelines**.
1. Change the value of **Maximum artifacts size** (in MB).
1. Select **Save changes** for the changes to take effect.
1. Select **Save changes**.
### Default artifacts expiration

View File

@ -168,9 +168,10 @@ When you configure related JSON objects and use the template, the pipeline:
the [AWS CloudFormation](https://aws.amazon.com/cloudformation/) API.
1. **Pushes to an S3 bucket**: When your build runs, it creates an artifact.
The artifact is pushed to an [AWS S3](https://aws.amazon.com/s3/) bucket.
1. **Deploys to EC2**: The content is deployed on an [AWS EC2](https://aws.amazon.com/ec2/) instance.
1. **Deploys to EC2**: The content is deployed on an [AWS EC2](https://aws.amazon.com/ec2/) instance,
as shown in this diagram:
![CF-Provision-and-Deploy-EC2 diagram](../img/cf_ec2_diagram_v13_5.png)
![Shows the CF-Provision-and-Deploy-EC2 pipeline, including the steps of provisioning infrastructure, pushing artifacts to S3, and deploying to EC2.](../img/cf_ec2_diagram_v13_5.png)
### Configure the template and JSON

View File

@ -894,7 +894,7 @@ If you deploy to your environments with the help of a deployment service (for ex
the [Kubernetes integration](../../user/infrastructure/clusters/_index.md)), GitLab can open
a terminal session to your environment. You can then debug issues without leaving your web browser.
The Web terminal is a container-based deployment, which often lack basic tools (like an editor),
The Web terminal is a container-based deployment, which often lacks basic tools (like an editor),
and can be stopped or restarted at any time. If this happens, you lose all your
changes. Treat the Web terminal as a debugging tool, not a comprehensive online IDE.
@ -903,19 +903,16 @@ Web terminals:
- Are available to project Maintainers and Owners only.
- Must [be enabled](../../administration/integration/terminal.md).
In the UI, you can view the Web terminal by selecting **Terminal** from the actions menu:
In the UI, to view the Web terminal, either:
![Terminal button on environment index](img/environments_terminal_button_on_index_v14_3.png)
- From the **Actions** menu, select **Terminal**:
You can also access the terminal button from the page for a specific environment:
![Terminal button on environment index](img/environments_terminal_button_on_index_v14_3.png)
![Terminal button for an environment](img/environments_terminal_button_on_show_v13_10.png)
- On the page for a specific environment, on the right, select **Terminal** ({{< icon name="terminal">}}).
Select the button to establish the terminal session:
![Terminal page](../img/environments_terminal_page_v8_15.png)
This works like any other terminal. You're in the container created
Select the button to establish the terminal session.
It works like any other terminal. You're in the container created
by your deployment so you can:
- Run shell commands and get responses in real time.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

View File

@ -194,9 +194,7 @@ in pipelines triggered with a pipeline trigger token.
## See which pipeline trigger token was used
You can see which pipeline trigger token caused a job to run by visiting the single job page.
A part of the trigger token displays on the right of the page, under the job details:
![Marked as triggered on a single job page](img/trigger_single_job_v8.png)
A part of the trigger token displays on the right sidebar, under **Job details**.
In pipelines triggered with a trigger token, jobs are labeled as `triggered` in
**Build > Jobs**.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -69,7 +69,7 @@ Altering an existing model using a supervised learning process that utilizes a d
### Foundational Model
A general purpose LLM trained using a generic objective, typically next token prediction. These models are capable and flexible, and can be adjusted to solved many domain-specific tasks (through finetuning or prompt engineering). This means that these general purpose models are ideal to serve as the foundation of many downstream models. Examples of foundational models are: GPT-4o, Claude 3.5 Sonnet.
A general purpose LLM trained using a generic objective, typically next token prediction. These models are capable and flexible, and can be adjusted to solved many domain-specific tasks (through finetuning or prompt engineering). This means that these general purpose models are ideal to serve as the foundation of many downstream models. Examples of foundational models are: GPT-4o, Claude 3.7 Sonnet.
### Frozen Model

View File

@ -136,7 +136,7 @@ For example:
When you host an AI model yourself, you'll also need to choose a serving platform. A popular option for self-hosted models is Ollama.
In this analogy, the brain part for ChatGPT is the GPT-4 model, while in the Anthropic ecosystem, it's the Claude 3.5 Sonnet model. The serving platform acts as the vital framework that connects the brain to the world, enabling it to "think" and interact effectively.
In this analogy, the brain part for ChatGPT is the GPT-4 model, while in the Anthropic ecosystem, it's the Claude 3.7 Sonnet model. The serving platform acts as the vital framework that connects the brain to the world, enabling it to "think" and interact effectively.
For further information about supported serving platforms and models, please refer to the documentation for [LLM Serving Platforms](../../administration/gitlab_duo_self_hosted/supported_llm_serving_platforms.md) and [Models](../../administration/gitlab_duo_self_hosted/supported_models_and_hardware_requirements.md).

View File

@ -209,7 +209,7 @@ Edition, follow the guides below based on the installation method:
to a version upgrade: stop the server, get the code, update configuration files for
the new functionality, install libraries and do migrations, update the init
script, start the application and check its status.
- [Omnibus CE to EE](package/convert_to_ee.md) - Follow this guide to upgrade your Omnibus
- [Linux package CE to EE](package/convert_to_ee.md) - Follow this guide to upgrade your Linux package
GitLab Community Edition to the Enterprise Edition.
- [Docker CE to EE](../install/docker/upgrade.md#convert-community-edition-to-enterprise-edition) -
Follow this guide to upgrade your GitLab Community Edition container to an Enterprise Edition container.

View File

@ -355,7 +355,7 @@ such as:
- Tier: Ultimate with GitLab Duo Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}

View File

@ -10,7 +10,7 @@ title: GitLab Duo Workflow
- Tier: Ultimate
- Offering: GitLab.com
- Status: Experiment
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}

View File

@ -9,7 +9,7 @@ title: GitLab Duo Chat
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLMs: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet), Anthropic [Claude 3 Haiku](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-haiku), and [Vertex AI Search](https://cloud.google.com/enterprise-search). The LLM depends on the question asked.
- LLMs: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet), Anthropic [Claude 3 Haiku](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-haiku), and [Vertex AI Search](https://cloud.google.com/enterprise-search). The LLM depends on the question asked.
{{< /details >}}

View File

@ -30,7 +30,7 @@ The example questions on this page, including the [slash commands](#gitlab-duo-c
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: GitLab UI, Web IDE, VS Code, and JetBrains IDEs
- LLMs: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet), [Vertex AI Search](https://cloud.google.com/enterprise-search)
- LLMs: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet), [Vertex AI Search](https://cloud.google.com/enterprise-search)
{{< /details >}}
@ -131,7 +131,7 @@ If the epic contains a large amount of text (more than 40,000 words), GitLab Duo
- Tier: Ultimate with GitLab Duo Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: GitLab UI
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -163,7 +163,7 @@ While in the merge request, open Chat and type your question. For example:
- Tier: Ultimate with GitLab Duo Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: GitLab UI
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -186,7 +186,7 @@ You can ask about a specific GitLab commit. For example:
- Tier: Ultimate with GitLab Duo Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: GitLab UI
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -210,7 +210,7 @@ You can ask about a specific GitLab pipeline job. For example:
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: GitLab UI, Web IDE, VS Code, JetBrains IDEs
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -255,7 +255,7 @@ In the GitLab UI, you can also explain code in:
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: GitLab UI, Web IDE, VS Code, JetBrains IDEs
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -328,7 +328,7 @@ Programming languages that require compiling the source code may throw cryptic e
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: VS Code, JetBrains IDEs
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -380,7 +380,7 @@ You cannot use [Quick Chat](_index.md#in-gitlab-duo-quick-chat-in-the-editor-vie
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: Web IDE, VS Code, JetBrains IDEs
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -414,7 +414,7 @@ You can include additional instructions to be considered. For example:
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: Web IDE, VS Code, JetBrains IDEs
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -446,7 +446,7 @@ You can include additional instructions to be considered. For example:
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: Web IDE, VS Code, JetBrains IDEs
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -480,7 +480,7 @@ For more information, see [Use GitLab Duo Chat in VS Code](_index.md#use-gitlab-
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: GitLab UI, Web IDE, VS Code, JetBrains IDEs
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -489,7 +489,7 @@ For more information, see [Use GitLab Duo Chat in VS Code](_index.md#use-gitlab-
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423524) for GitLab.com in GitLab 16.7.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423524) for GitLab Self-Managed and GitLab Dedicated in GitLab 16.8.
- [Updated LLM](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/149619) from Claude 2.1 to Claude 3 Sonnet in GitLab 17.2.
- [Updated LLM](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/157696) from Claude 3 Sonnet to Claude 3.5 Sonnet in GitLab 17.2.
- [Updated LLM](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/157696) from Claude 3 Sonnet to Claude 3.7 Sonnet in GitLab 17.2.
- Changed to require GitLab Duo add-on in GitLab 17.6.
- [Enabled](https://gitlab.com/groups/gitlab-org/-/epics/15227) for [self-hosted model configuration](../../administration/gitlab_duo_self_hosted/_index.md#self-hosted-ai-gateway-and-llms) as well as the [default GitLab external AI vendor configuration](../../administration/gitlab_duo_self_hosted/_index.md#gitlabcom-ai-gateway-with-default-gitlab-external-vendor-llms) in GitLab 17.9.
@ -517,7 +517,7 @@ Alternatively, you can use GitLab Duo Root Cause Analysis to [troubleshoot faile
- Tier: Ultimate with GitLab Duo Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Editors: GitLab UI
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}

View File

@ -248,7 +248,7 @@ To change how a merge request shows changed lines:
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}

View File

@ -54,7 +54,7 @@ Provide feedback on this feature in [issue 443236](https://gitlab.com/gitlab-org
{{< details >}}
- Status: Beta
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}
@ -111,7 +111,7 @@ Additional settings and configuration are planned. To that work, see
{{< details >}}
- Status: Experiment
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}

View File

@ -9,7 +9,7 @@ title: Explain code in a file
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
{{< /details >}}

View File

@ -10,7 +10,7 @@ title: Code Suggestions
- Tier: Premium with GitLab Duo Pro, Ultimate with GitLab Duo Pro or Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLMs: For code completion, Fireworks AI-hosted [`Qwen2.5 7B`](https://fireworks.ai/models/fireworks/qwen2p5-coder-7b) and Vertex AI Codey [`code-gecko`](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/code-gecko). For code generation, Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet).
- LLMs: For code completion, Fireworks AI-hosted [`Qwen2.5 7B`](https://fireworks.ai/models/fireworks/qwen2p5-coder-7b) and Vertex AI Codey [`code-gecko`](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/code-gecko). For code generation, Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet).
{{< /details >}}

View File

@ -14,6 +14,11 @@ module ClickHouse
def to_redacted_sql(bind_index_manager = BindIndexManager.new)
raise NotImplementedError
end
# Override when placeholders should be supported
def placeholders
{}
end
end
end
end

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe ClickHouse::Client::QueryLike do
RSpec.describe ClickHouse::Client::QueryLike, feature_category: :database do
subject(:query) { described_class.new }
describe '#to_sql' do
@ -12,4 +12,8 @@ RSpec.describe ClickHouse::Client::QueryLike do
describe '#to_redacted_sql' do
it { expect { query.to_redacted_sql }.to raise_error(NotImplementedError) }
end
describe '#placeholders' do
it { expect(query.placeholders).to eq({}) }
end
end

View File

@ -3,10 +3,10 @@
# rubocop: disable CodeReuse/ActiveRecord
module ClickHouse
module Models
class BaseModel
class BaseModel < ClickHouse::Client::QueryLike
extend Forwardable
def_delegators :@query_builder, :to_sql
def_delegators :@query_builder, :to_sql, :to_redacted_sql
def initialize(query_builder = ClickHouse::QueryBuilder.new(self.class.table_name))
@query_builder = query_builder

View File

@ -43,10 +43,26 @@ module ClickHouse
condition.left.gt(Arel.sql(bind_manager.next_bind_str))
when Arel::Nodes::GreaterThanOrEqual
condition.left.gteq(Arel.sql(bind_manager.next_bind_str))
when Arel::Nodes::NamedFunction
redact_named_function(condition, bind_manager)
else
raise ArgumentError, "Unsupported Arel node type for Redactor: #{condition.class}"
end
end
def self.redact_named_function(condition, bind_manager)
redacted_condition =
Arel::Nodes::NamedFunction.new(condition.name, condition.expressions.dup)
case redacted_condition.name
when 'startsWith'
redacted_condition.expressions[1] = Arel.sql(bind_manager.next_bind_str)
else
redacted_condition.expressions = redacted_condition.expressions.map { Arel.sql(bind_manager.next_bind_str) }
end
redacted_condition
end
end
end
# rubocop:enable CodeReuse/ActiveRecord

View File

@ -0,0 +1,28 @@
# frozen_string_literal: true
module Gitlab
module BackgroundMigration
class BackfillFinishOnboardingForGroupSaml < BatchedMigrationJob
operation_name :backfill_finish_onboarding_for_group_saml # This is used as the key on collecting metrics
scope_to ->(relation) { relation.where(provider: 'group_saml') }
feature_category :onboarding
class User < ApplicationRecord
self.table_name = :users
end
def perform
each_sub_batch do |sub_batch|
# First get the user IDs from the identities query
user_ids = sub_batch
.joins("INNER JOIN users ON users.id = identities.user_id")
.where(provider: 'group_saml', users: { onboarding_in_progress: true })
.pluck(:user_id)
# Then update those users
User.where(id: user_ids).update_all(onboarding_in_progress: false)
end
end
end
end
end

View File

@ -51,6 +51,10 @@ module Gitlab
tools = data.dig('metadata', 'tools')
authors = data.dig('metadata', 'authors')
component_data = data.dig('metadata', 'component')
component = CyclonedxMetadataComponent.parse(component_data)
report.set_metadata_component(component) if component
report.metadata = ::Gitlab::Ci::Reports::Sbom::Metadata.new.tap do |metadata|
metadata.tools = tools if tools
metadata.authors = authors if authors

View File

@ -0,0 +1,45 @@
# frozen_string_literal: true
module Gitlab
module Ci
module Parsers
module Sbom
class CyclonedxMetadataComponent
REQUIRED_PROPERTIES = %w[
name
type
bom-ref
].freeze
def self.parse(...)
new(...).parse
end
def initialize(properties)
@properties = properties
end
def parse
return if missing_properties.present?
::Gitlab::Ci::Reports::Sbom::Component.new(
ref: properties['bom-ref'],
type: properties['type'],
name: properties['name'],
purl: nil,
version: nil
)
end
private
attr_reader :properties
def missing_properties
REQUIRED_PROPERTIES - properties&.keys.to_a
end
end
end
end
end
end

View File

@ -14,8 +14,8 @@ module Gitlab
adjacency_list[child] << parent
end
def add_component_info(ref, name, version)
component_info[ref] = { name: name, version: version }
def add_component_info(ref, name = nil, version = nil)
component_info[ref] = { name: name, version: version }.compact
end
def ancestors_for(child)

View File

@ -44,6 +44,10 @@ module Gitlab
dependencies.add_component_info(component.ref, component.name, component.version)
end
def set_metadata_component(component)
dependencies.add_component_info(component.ref)
end
def add_dependency(parent, child)
dependencies.add_edge(parent, child)
end

View File

@ -21868,6 +21868,9 @@ msgstr ""
msgid "DuoChat|Included references"
msgstr ""
msgid "DuoChat|New chat conversation."
msgstr ""
msgid "DuoChat|No results found"
msgstr ""

View File

@ -78,7 +78,6 @@ ee/spec/frontend/status_checks/components/modal_create_spec.js
ee/spec/frontend/status_checks/mount_spec.js
ee/spec/frontend/tracing/details/tracing_details_spec.js
ee/spec/frontend/tracing/details/tracing_header_spec.js
ee/spec/frontend/usage_quotas/code_suggestions/components/add_on_eligible_user_list_spec.js
ee/spec/frontend/usage_quotas/transfer/components/usage_by_month_spec.js
ee/spec/frontend/users/identity_verification/components/international_phone_input_spec.js
ee/spec/frontend/users/identity_verification/components/verify_phone_verification_code_spec.js

View File

@ -37,6 +37,7 @@ const mockDiscussion = (...children) => {
bodyHtml: c,
createdAt: '2023-05-18T14:24:07.000+00:00',
lastEditedAt: null,
lastEditedBy: null,
url: 'https://path/to/2/',
awardEmoji: null,
userPermissions: {

View File

@ -15,16 +15,26 @@ RSpec.describe ClickHouse::Models::BaseModel, feature_category: :database do
end
end
describe '#to_sql' do
it 'delegates to the query builder' do
expect(query_builder).to receive(:to_sql).and_return("SELECT * FROM dummy_table")
it { expect(described_class).to be < ClickHouse::Client::QueryLike }
shared_examples 'method delegated to query builder' do |method_name|
it "delegates ##{method_name} to @query_builder" do
expect(query_builder).to receive(method_name).and_return("SELECT * FROM dummy_table")
dummy_instance = dummy_class.new(query_builder)
expect(dummy_instance.to_sql).to eq("SELECT * FROM dummy_table")
expect(dummy_instance.public_send(method_name)).to eq("SELECT * FROM dummy_table")
end
end
describe '#to_sql' do
it_behaves_like 'method delegated to query builder', :to_sql
end
describe '#to_redacted_sql' do
it_behaves_like 'method delegated to query builder', :to_redacted_sql
end
describe '#where' do
it 'returns a new instance with refined query' do
dummy_instance = dummy_class.new(query_builder)

View File

@ -107,6 +107,42 @@ RSpec.describe ClickHouse::Redactor, feature_category: :database do
expect(redacted_query).to eq(expected_redacted_sql)
end
context 'when condition is a named function' do
let(:function_name) { 'randomFunction' }
let(:expressions) { [Arel.sql("'traversal_path'"), Arel.sql('42')] }
let(:function_node) do
Arel::Nodes::NamedFunction.new(
function_name,
expressions
)
end
subject(:redacted_query) do
new_builder = builder.where(function_node)
described_class.redact(new_builder)
end
it 'redacts all condition expressions' do
expected_redacted_sql = <<~SQL.lines(chomp: true).join(' ')
SELECT * FROM "test_table" WHERE randomFunction($1, $2)
SQL
expect(redacted_query).to eq(expected_redacted_sql)
end
context 'when using startsWith function' do
let(:function_name) { 'startsWith' }
it 'redacts only value argument' do
expected_redacted_sql = <<~SQL.lines(chomp: true).join(' ')
SELECT * FROM "test_table" WHERE startsWith('traversal_path', $1)
SQL
expect(redacted_query).to eq(expected_redacted_sql)
end
end
end
end
context 'with unsupported arel nodes' do

View File

@ -0,0 +1,61 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::BackgroundMigration::BackfillFinishOnboardingForGroupSaml, feature_category: :onboarding do
let(:users) { table(:users) }
let(:identities) { table(:identities) }
let(:first_user_with_saml) do
users.create!(email: 'user1@example.com', projects_limit: 0, onboarding_in_progress: true)
end
let!(:first_user_identity) { identities.create!(user_id: first_user_with_saml.id, provider: 'group_saml') }
let!(:user_with_saml_not_in_onboarding) do
record = users.create!(email: 'user2@example.com', projects_limit: 0, onboarding_in_progress: false)
identities.create!(user_id: record.id, provider: 'group_saml')
record
end
let!(:user_with_identity_not_group_saml) do
record = users.create!(email: 'user3@example.com', projects_limit: 0, onboarding_in_progress: true)
identities.create!(user_id: record.id, provider: 'foo')
record
end
let!(:last_user_no_identity) do
users.create!(email: 'user4@example.com', projects_limit: 0, onboarding_in_progress: true)
end
let(:last_user_with_identity) do
users.create!(email: 'user5@example.com', projects_limit: 0, onboarding_in_progress: true)
end
let!(:last_user_not_saml_identity) { identities.create!(user_id: last_user_with_identity.id, provider: 'foo') }
let!(:last_user_identity) { identities.create!(user_id: last_user_with_identity.id, provider: 'group_saml') }
subject(:migration) do
described_class.new(
start_id: first_user_identity.id,
end_id: last_user_identity.id,
batch_table: :identities,
batch_column: :id,
sub_batch_size: 100,
pause_ms: 0,
connection: ApplicationRecord.connection
)
end
describe '#perform' do
it 'updates the correct data' do
migration.perform
expect(first_user_with_saml.reload.onboarding_in_progress).to be(false)
expect(user_with_saml_not_in_onboarding.reload.onboarding_in_progress).to be(false)
expect(user_with_identity_not_group_saml.reload.onboarding_in_progress).to be(true)
expect(last_user_no_identity.reload.onboarding_in_progress).to be(true)
expect(last_user_with_identity.reload.onboarding_in_progress).to be(false)
end
end
end

View File

@ -0,0 +1,35 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Ci::Parsers::Sbom::CyclonedxMetadataComponent, feature_category: :dependency_management do
describe "#parse" do
let_it_be(:name) { 'Root Application' }
let_it_be(:type) { 'application' }
let_it_be(:ref) { 'bom-ref' }
subject(:component) { described_class.new(data).parse }
%w[name type bom-ref].each do |property|
context "without #{property}" do
let_it_be(:data) { { 'name' => name, 'type' => type, 'bom-ref' => ref }.delete(property.to_sym) }
it 'returns nil' do
expect(component).to be_nil
end
end
end
context 'with all required properties' do
let_it_be(:data) { { 'name' => name, 'type' => type, 'bom-ref' => ref } }
it 'returns a sbom component' do
expect(component).to be_kind_of(::Gitlab::Ci::Reports::Sbom::Component)
expect(component.component_type).to eq(type)
expect(component.name).to eq(name)
expect(component.ref).to eq(ref)
end
end
end
end

View File

@ -428,4 +428,44 @@ RSpec.describe Gitlab::Ci::Parsers::Sbom::Cyclonedx, feature_category: :dependen
parse!
end
end
context 'when metadata component is present' do
let(:ref) { 'urn:uuid:bbd321e1-f802-4fc1-ab0d-0cc629c3d53a' }
let(:type) { 'application' }
let(:name) { 'Root Application' }
let(:component) do
{
'type' => type,
'name' => name,
'bom-ref' => ref
}
end
let(:report_data) do
base_report_data.merge({ 'metadata' => { 'component' => component } })
end
it 'sets report metadata component' do
expect(report).to receive(:set_metadata_component)
.with(an_object_having_attributes(ref: ref, name: name, type: type))
parse!
end
context 'with incomplete component' do
let(:component) do
{
'type' => type,
'name' => name
}
end
it 'doesnt set report metadata component' do
expect(report).not_to receive(:set_metadata_component)
parse!
end
end
end
end

View File

@ -48,6 +48,19 @@ RSpec.describe Gitlab::Ci::Reports::Sbom::DependencyAdjacencyList, feature_categ
expect(dependency_list.ancestors_for(child)).to contain_exactly(component_data, component_data_2)
end
end
context 'with metadata component' do
let(:metadata_component) { 'metadata_ref' }
before do
dependency_list.add_component_info(metadata_component)
dependency_list.add_edge(metadata_component, child)
end
it 'returns the ancestor with empty hash' do
expect(dependency_list.ancestors_for(child)).to contain_exactly(component_data, {})
end
end
end
end
end

View File

@ -64,4 +64,19 @@ RSpec.describe Gitlab::Ci::Reports::Sbom::Report, feature_category: :dependency_
expect(component_last.ancestors).to match_array([expected_value])
end
end
describe '#add_metadata_component' do
let_it_be(:metadata_component) { create(:ci_reports_sbom_component) }
let_it_be(:component) { create(:ci_reports_sbom_component) }
it 'sets empty hash into ancestors' do
report.set_metadata_component(metadata_component)
report.add_component(component)
report.add_dependency(metadata_component.ref, component.ref)
report.ensure_ancestors!
expect(component.ancestors).to match_array([{}])
end
end
end

View File

@ -0,0 +1,29 @@
# frozen_string_literal: true
require 'spec_helper'
require_migration!
RSpec.describe QueueBackfillFinishOnboardingForGroupSaml, migration: :gitlab_main_cell, feature_category: :onboarding do
let!(:batched_migration) { described_class::MIGRATION }
it 'schedules a new batched migration' do
reversible_migration do |migration|
migration.before -> {
expect(batched_migration).not_to have_scheduled_batched_migration
}
attributes = {
table_name: :identities,
column_name: :id,
interval: described_class::DELAY_INTERVAL,
batch_size: described_class::BATCH_SIZE,
sub_batch_size: described_class::SUB_BATCH_SIZE,
max_batch_size: described_class::MAX_BATCH_SIZE
}
migration.after -> {
expect(batched_migration).to have_scheduled_batched_migration(attributes)
}
end
end
end

View File

@ -1,6 +1,20 @@
# frozen_string_literal: true
RSpec.shared_examples_for 'a pipeline analytics service' do
it 'does not execute raw sql queries' do
allow(::ClickHouse::Client).to receive(:select).and_call_original
expect(::ClickHouse::Client)
.not_to receive(:select)
.with(instance_of(String), instance_of(Symbol))
expect(::ClickHouse::Client)
.to receive(:select)
.with(kind_of(ClickHouse::Client::QueryLike), instance_of(Symbol))
result
end
context 'when ClickHouse database is not configured' do
before do
allow(::Gitlab::ClickHouse).to receive(:configured?).and_return(false)