Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2024-09-05 21:07:30 +00:00
parent 04a542b641
commit 94bf8a50bb
73 changed files with 725 additions and 296 deletions

View File

@ -155,7 +155,6 @@ gitaly-transactions:
KNAPSACK_TEST_FILE_PATTERN: "qa/specs/features/**/3_create/**/*_spec.rb"
QA_GITALY_TRANSACTIONS_ENABLED: "true"
rules:
- !reference [.rules:test:smoke-for-omnibus-mr, rules]
- !reference [.rules:test:qa-parallel, rules]
- if: $QA_SUITES =~ /Test::Instance::All/
@ -242,7 +241,6 @@ git-sha256-repositories:
QA_USE_SHA256_REPOSITORY_OBJECT_STORAGE: true
GITLAB_QA_OPTS: "--enable-feature support_sha256_repositories"
rules:
- !reference [.rules:test:smoke-for-omnibus-mr, rules]
- !reference [.rules:test:feature-flags-set, rules]
- !reference [.rules:test:qa-parallel, rules]
- if: $QA_SUITES =~ /Test::Instance::All/

View File

@ -130,18 +130,3 @@ Layout/LineBreakAfterFinalMixin:
- 'lib/gitlab/ci/config/interpolation/config.rb'
- 'lib/gitlab/cluster/rack_timeout_observer.rb'
- 'lib/gitlab/etag_caching/router/graphql.rb'
- 'lib/gitlab/git_post_receive.rb'
- 'lib/gitlab/prometheus_client.rb'
- 'lib/gitlab/spamcheck/result.rb'
- 'lib/gitlab/user_access_snippet.rb'
- 'lib/gitlab/view/presenter/delegated.rb'
- 'lib/system_check/incoming_email/mail_room_enabled_check.rb'
- 'lib/system_check/incoming_email/mail_room_running_check.rb'
- 'qa/qa/ee/page/workspace/new.rb'
- 'qa/qa/ee/scenario/test/integration/group_saml.rb'
- 'qa/qa/page/organization/new.rb'
- 'qa/qa/page/organization/show.rb'
- 'qa/qa/page/project/issue/show.rb'
- 'qa/qa/page/project/snippet/new.rb'
- 'qa/qa/resource/base.rb'
- 'qa/qa/scenario/test/instance/airgapped.rb'

View File

@ -338,16 +338,6 @@ export default {
required
/>
</gl-form-group>
<!--Interval Pattern-->
<gl-form-group :label="$options.i18n.intervalPattern" label-for="schedule-interval">
<interval-pattern-input
id="schedule-interval"
:initial-cron-interval="cron"
:daily-limit="dailyLimit"
:send-native-errors="false"
@cronValue="setCronValue"
/>
</gl-form-group>
<!--Timezone-->
<gl-form-group :label="$options.i18n.cronTimezoneText" label-for="schedule-timezone">
<timezone-dropdown
@ -358,6 +348,16 @@ export default {
@input="setTimezone"
/>
</gl-form-group>
<!--Interval Pattern-->
<gl-form-group :label="$options.i18n.intervalPattern" label-for="schedule-interval">
<interval-pattern-input
id="schedule-interval"
:initial-cron-interval="cron"
:daily-limit="dailyLimit"
:send-native-errors="false"
@cronValue="setCronValue"
/>
</gl-form-group>
<!--Branch/Tag Selector-->
<gl-form-group :label="$options.i18n.targetBranchTag" label-for="schedule-target-branch-tag">
<ref-selector

View File

@ -211,7 +211,7 @@ export default {
:disabled="disableDecrementLineStart"
@click="updateLineOffset(-1, 0)"
/>
<div class="flex monospace gl-items-center gl-justify-center gl-px-3">
<div class="monospace gl-flex gl-items-center gl-justify-center gl-px-3">
<strong>{{ absoluteLineOffset[0] }}</strong>
</div>
<gl-button
@ -238,7 +238,7 @@ export default {
:disabled="disableDecrementLineEnd"
@click="updateLineOffset(0, -1)"
/>
<div class="flex monospace gl-items-center gl-justify-center gl-px-3">
<div class="monospace gl-flex gl-items-center gl-justify-center gl-px-3">
<strong>{{ absoluteLineOffset[1] }}</strong>
</div>
<gl-button

View File

@ -143,7 +143,7 @@ export default {
:action="canPushCodeStatus.action"
/>
<error-message v-if="errorMessage" :message="errorMessage" />
<div class="ide-view flex-grow gl-flex">
<div class="ide-view gl-flex gl-grow">
<template v-if="loadDeferred">
<find-file
:files="allBlobs"

View File

@ -20,7 +20,9 @@ export default {
</script>
<template>
<div class="d-flex-center text-nowrap js-ide-status-mr gl-flex-nowrap">
<div
class="text-nowrap js-ide-status-mr gl-flex gl-flex-nowrap gl-items-center gl-justify-center"
>
<gl-icon name="merge-request" />
<span class="ml-1 gl-hidden sm:gl-block">{{ s__('WebIDE|Merge request') }}</span>
<gl-link class="ml-1" :href="url">{{ text }}</gl-link>

View File

@ -55,7 +55,7 @@ export default {
};
</script>
<template>
<div class="flex overflow-auto gl-h-full gl-items-center gl-justify-center">
<div class="overflow-auto gl-flex gl-h-full gl-items-center gl-justify-center">
<div class="text-center gl-max-w-75 gl-p-4">
<img :alt="$options.i18n.imgAlt" :src="$options.gitlabLogo" class="svg gl-h-12 gl-w-12" />
<h1 class="gl-heading-display gl-my-6">{{ $options.i18n.heading }}</h1>

View File

@ -64,8 +64,16 @@ export default {
<template>
<div v-if="status" v-gl-tooltip :title="status.text" role="note" class="gl-flex gl-items-center">
<span>{{ __('Terminal') }}:</span>
<span class="square s16 d-flex-center ml-1" :aria-label="status.text">
<gl-loading-icon v-if="isLoading" inline size="sm" class="d-flex-center" />
<span
class="square s16 ml-1 gl-flex gl-items-center gl-justify-center"
:aria-label="status.text"
>
<gl-loading-icon
v-if="isLoading"
inline
size="sm"
class="gl-flex gl-items-center gl-justify-center"
/>
<gl-icon v-else-if="status.icon" :name="status.icon" :size="16" />
</span>
</div>

View File

@ -32,7 +32,7 @@ export default {
:href="helpPath"
:title="__('About this feature')"
target="_blank"
class="d-flex-center"
class="gl-flex gl-items-center gl-justify-center"
>
<gl-icon name="question-o" class="gl-ml-3" />
</gl-link>

View File

@ -364,21 +364,11 @@ li.note {
.append-bottom-20 { margin-bottom: 20px; }
.center { text-align: center; }
.block { display: block; }
.flex { display: flex; }
.vertical-align-text-top { vertical-align: text-top; }
.vertical-align-middle { vertical-align: middle; }
.flex-align-self-center { align-self: center; }
.flex-grow { flex-grow: 1; }
.flex-no-shrink { flex-shrink: 0; }
.ws-normal { white-space: normal; }
.overflow-auto { overflow: auto; }
.d-flex-center {
display: flex;
align-items: center;
justify-content: center;
}
/** COMMON SIZING CLASSES **/
.w-0 { width: 0; }
.w-8em { width: 8em; }

View File

@ -158,3 +158,9 @@
}
}
}
// Override Bootstrap class with offset for system-header and
// performance bar when present
.fixed-top {
top: $calc-system-headers-height;
}

View File

@ -107,7 +107,7 @@ $white-gc-bg: #eaf2f5;
.line-numbers,
.diff-line-num,
.code-search-line {
background-color: $gray-10;
background-color: $white;
&.conflict_marker,
&.conflict_our {

View File

@ -51,12 +51,6 @@ $type-scale: (
.border-radius-default { border-radius: $gl-border-radius-base; }
.box-shadow-default { box-shadow: 0 2px 4px 0 $t-gray-a-24; }
// Override Bootstrap class with offset for system-header and
// performance bar when present
.fixed-top {
top: $calc-system-headers-height;
}
// stylelint-disable-next-line gitlab/no-gl-class
.gl-top-app-header {
top: $calc-application-header-height;

View File

@ -23,6 +23,11 @@ module Enums
cargo: 14
}.with_indifferent_access.freeze
REACHABILITY_TYPES = {
unknown: 0,
in_use: 1 # In case package imported and being used in code.
}.with_indifferent_access.freeze
DEPENDENCY_SCANNING_PURL_TYPES = %w[
composer
conan
@ -120,6 +125,10 @@ module Enums
purl_types.invert
end
def self.reachability_types
REACHABILITY_TYPES
end
def self.package_manager_from_trivy_pkg_type(pkg_type)
PACKAGE_MANAGERS_FROM_TRIVY_PKG_TYPE[pkg_type]
end

View File

@ -104,6 +104,10 @@ module Operations
Ability.issues_readable_by_user(issues, current_user)
end
def path
Gitlab::Routing.url_helpers.project_feature_flag_path(project, self)
end
def hook_attrs
{
id: id,

View File

@ -8,3 +8,5 @@ class PersonalAccessTokenPolicy < BasePolicy
enable :revoke_token
end
end
PersonalAccessTokenPolicy.prepend_mod

View File

@ -81,6 +81,7 @@ module MergeRequests
notification_service.async.changed_reviewer_of_merge_request(merge_request, current_user, old_reviewers)
todo_service.reassigned_reviewable(merge_request, current_user, old_reviewers)
invalidate_cache_counts(merge_request, users: affected_reviewers.compact)
invalidate_cache_counts(merge_request, users: merge_request.assignees)
new_reviewers = merge_request.reviewers - old_reviewers
merge_request_activity_counter.track_users_review_requested(users: new_reviewers)

View File

@ -4,5 +4,6 @@
- content_for :usage_quotas_tabs do
= render_if_exists 'shared/usage_quotas/tabs_content/pipelines'
#js-storage-usage-app{ data: storage_usage_app_data(@namespace) }
= render_if_exists 'shared/usage_quotas/tabs_content/pages'
= render 'shared/usage_quotas/index'

View File

@ -4,7 +4,7 @@
.btn-group.mobile-git-clone.js-mobile-git-clone.btn-block
= clipboard_button(button_text: default_clone_label, size: :medium, category: :primary, variant: :confirm, text: default_url_to_repo(project), hide_button_icon: true, class: "clone-dropdown-btn js-clone-dropdown-label")
%button.btn.gl-button.btn-confirm.dropdown-toggle.js-dropdown-toggle.flex-grow-0.d-flex-center.w-auto.ml-0{ type: "button", data: { toggle: "dropdown" } }
%button.btn.gl-button.btn-confirm.dropdown-toggle.js-dropdown-toggle.flex-grow-0.gl-flex.gl-items-center.gl-justify-center.w-auto.ml-0{ type: "button", data: { toggle: "dropdown" } }
= sprite_icon("chevron-down", css_class: "dropdown-btn-icon icon")
%ul.dropdown-menu.dropdown-menu-selectable.dropdown-menu-right.clone-options-dropdown{ data: { dropdown: true } }
- if ssh_enabled?

View File

@ -9,3 +9,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17477
milestone: '12.4'
gitlab_schema: gitlab_main
sharding_key_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/461838 # table is scheduled to be dropped
removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/164288
removed_in_milestone: '17.4'

View File

@ -9,3 +9,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18046
milestone: '12.4'
gitlab_schema: gitlab_main
sharding_key_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/461838 # table is scheduled to be dropped
removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/164288
removed_in_milestone: '17.4'

View File

@ -12,3 +12,5 @@ allow_cross_foreign_keys:
- gitlab_main_clusterwide
sharding_key:
project_id: projects
removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/164288
removed_in_milestone: '17.4'

View File

@ -12,3 +12,5 @@ allow_cross_foreign_keys:
- gitlab_main_clusterwide
sharding_key:
project_id: projects
removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/164288
removed_in_milestone: '17.4'

View File

@ -9,3 +9,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/3799
milestone: '9.3'
gitlab_schema: gitlab_main
sharding_key_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/465327
removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/164288
removed_in_milestone: '17.4'

View File

@ -12,3 +12,5 @@ allow_cross_foreign_keys:
- gitlab_main_clusterwide
sharding_key:
project_id: projects
removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/164288
removed_in_milestone: '17.4'

View File

@ -0,0 +1,16 @@
# frozen_string_literal: true
class AddReachabilityColumnToSbomOccurancesTable < Gitlab::Database::Migration[2.2]
milestone '17.4'
def up
with_lock_retries do
add_column :sbom_occurrences, :reachability, :smallint, default: 0
end
end
def down
with_lock_retries do
remove_column :sbom_occurrences, :reachability
end
end
end

View File

@ -1,40 +1,13 @@
# frozen_string_literal: true
class AddEmailParticipantsWidgetToWorkItemTypes < Gitlab::Database::Migration[2.2]
class WorkItemType < MigrationRecord
self.table_name = 'work_item_types'
end
class WidgetDefinition < MigrationRecord
self.table_name = 'work_item_widget_definitions'
end
restrict_gitlab_migration gitlab_schema: :gitlab_main
disable_ddl_transaction!
milestone '17.4'
WIDGET_NAME = 'Email participants'
WIDGET_ENUM_VALUE = 25
WORK_ITEM_TYPES = %w[
Incident
Issue
Ticket
].freeze
def up
widgets = WorkItemType.where(name: WORK_ITEM_TYPES).map do |type|
{ work_item_type_id: type.id, name: WIDGET_NAME, widget_type: WIDGET_ENUM_VALUE }
end
return if widgets.empty?
WidgetDefinition.upsert_all(
widgets,
unique_by: :index_work_item_widget_definitions_on_default_witype_and_name
)
# no-op
end
def down
WidgetDefinition.where(widget_type: WIDGET_ENUM_VALUE).delete_all
# no-op
end
end

View File

@ -0,0 +1,41 @@
# frozen_string_literal: true
class DropIssuesPrometheusAlertEventsForeignKeys < Gitlab::Database::Migration[2.2]
milestone '17.4'
disable_ddl_transaction!
TABLE_NAME = :issues_prometheus_alert_events
EVENTS_FK_NAME = 'fk_rails_b32edb790f'
ISSUES_FK_NAME = 'fk_rails_db5b756534'
def up
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :prometheus_alert_events,
column: :prometheus_alert_event_id
end
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :issues,
column: :issue_id
end
end
# Original SQL:
#
# ALTER TABLE ONLY issues_prometheus_alert_events
# ADD CONSTRAINT fk_rails_b32edb790f FOREIGN KEY (prometheus_alert_event_id)
# REFERENCES prometheus_alert_events(id) ON DELETE CASCADE;
#
# ALTER TABLE ONLY issues_prometheus_alert_events
# ADD CONSTRAINT fk_rails_db5b756534 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
#
def down
add_concurrent_foreign_key TABLE_NAME, :prometheus_alert_events,
column: :prometheus_alert_event_id,
name: EVENTS_FK_NAME
add_concurrent_foreign_key TABLE_NAME, :issues,
column: :issue_id,
name: ISSUES_FK_NAME
end
end

View File

@ -0,0 +1,38 @@
# frozen_string_literal: true
class DropIssuesPrometheusAlertEvents < Gitlab::Database::Migration[2.2]
milestone '17.4'
TABLE_NAME = :issues_prometheus_alert_events
PRIMARY_KEY = :issues_prometheus_alert_events_pkey
INDEX_NAME = :issue_id_issues_prometheus_alert_events_index
def up
drop_table TABLE_NAME
end
# Original SQL:
#
# CREATE TABLE issues_prometheus_alert_events (
# issue_id bigint NOT NULL,
# prometheus_alert_event_id bigint NOT NULL,
# created_at timestamp with time zone NOT NULL,
# updated_at timestamp with time zone NOT NULL
# );
#
# CREATE INDEX issue_id_issues_prometheus_alert_events_index ON issues_prometheus_alert_events
# USING btree (prometheus_alert_event_id);
#
# ALTER TABLE ONLY issues_prometheus_alert_events
# ADD CONSTRAINT issues_prometheus_alert_events_pkey PRIMARY KEY (issue_id, prometheus_alert_event_id);
#
def down
create_table TABLE_NAME, primary_key: [:issue_id, :prometheus_alert_event_id] do |t|
t.bigint :issue_id, null: false
t.bigint :prometheus_alert_event_id, null: false
t.timestamps_with_timezone null: false
t.index :prometheus_alert_event_id, name: INDEX_NAME
end
end
end

View File

@ -0,0 +1,41 @@
# frozen_string_literal: true
class DropSelfManagedIssuesPrometheusAlertEventsForeignKeys < Gitlab::Database::Migration[2.2]
milestone '17.4'
disable_ddl_transaction!
TABLE_NAME = :issues_self_managed_prometheus_alert_events
EVENTS_FK_NAME = 'fk_rails_f7db2d72eb'
ISSUES_FK_NAME = 'fk_rails_cc5d88bbb0'
def up
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :prometheus_alert_events,
column: :self_managed_prometheus_alert_event_id
end
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :issues,
column: :issue_id
end
end
# Original SQL:
#
# ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
# ADD CONSTRAINT fk_rails_cc5d88bbb0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
#
# ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
# ADD CONSTRAINT fk_rails_f7db2d72eb FOREIGN KEY (self_managed_prometheus_alert_event_id)
# REFERENCES self_managed_prometheus_alert_events(id) ON DELETE CASCADE;
#
def down
add_concurrent_foreign_key TABLE_NAME, :self_managed_prometheus_alert_events,
column: :self_managed_prometheus_alert_event_id,
name: EVENTS_FK_NAME
add_concurrent_foreign_key TABLE_NAME, :issues,
column: :issue_id,
name: ISSUES_FK_NAME
end
end

View File

@ -0,0 +1,39 @@
# frozen_string_literal: true
class DropSelfManagedIssuesPrometheusAlertEvents < Gitlab::Database::Migration[2.2]
milestone '17.4'
TABLE_NAME = :issues_self_managed_prometheus_alert_events
PRIMARY_KEY = :issues_self_managed_prometheus_alert_events_pkey
INDEX_NAME = :issue_id_issues_self_managed_rometheus_alert_events_index
def up
drop_table TABLE_NAME
end
# Original SQL:
#
# CREATE TABLE issues_self_managed_prometheus_alert_events (
# issue_id bigint NOT NULL,
# self_managed_prometheus_alert_event_id bigint NOT NULL,
# created_at timestamp with time zone NOT NULL,
# updated_at timestamp with time zone NOT NULL
# );
#
# CREATE INDEX issue_id_issues_self_managed_rometheus_alert_events_index
# ON issues_self_managed_prometheus_alert_events USING btree (self_managed_prometheus_alert_event_id);
#
# ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
# ADD CONSTRAINT issues_self_managed_prometheus_alert_events_pkey
# PRIMARY KEY (issue_id, self_managed_prometheus_alert_event_id);
#
def down
create_table TABLE_NAME, primary_key: [:issue_id, :self_managed_prometheus_alert_event_id] do |t|
t.bigint :issue_id, null: false
t.bigint :self_managed_prometheus_alert_event_id, null: false
t.timestamps_with_timezone null: false
t.index :self_managed_prometheus_alert_event_id, name: INDEX_NAME
end
end
end

View File

@ -0,0 +1,41 @@
# frozen_string_literal: true
class DropPrometheusAlertEventsForeignKeys < Gitlab::Database::Migration[2.2]
milestone '17.4'
disable_ddl_transaction!
TABLE_NAME = :prometheus_alert_events
ALERTS_FK_NAME = 'fk_rails_106f901176'
PROJECT_FK_NAME = 'fk_rails_4675865839'
def up
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :prometheus_alerts,
column: :prometheus_alert_id
end
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :projects,
column: :project_id
end
end
# Original SQL:
#
# ALTER TABLE ONLY prometheus_alert_events
# ADD CONSTRAINT fk_rails_106f901176 FOREIGN KEY (prometheus_alert_id) REFERENCES prometheus_alerts(id)
# ON DELETE CASCADE;
#
# ALTER TABLE ONLY prometheus_alert_events
# ADD CONSTRAINT fk_rails_4675865839 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
#
def down
add_concurrent_foreign_key TABLE_NAME, :prometheus_alerts,
column: :prometheus_alert_id,
name: ALERTS_FK_NAME
add_concurrent_foreign_key TABLE_NAME, :projects,
column: :project_id,
name: PROJECT_FK_NAME
end
end

View File

@ -0,0 +1,54 @@
# frozen_string_literal: true
class DropPrometheusAlertEvents < Gitlab::Database::Migration[2.2]
milestone '17.4'
TABLE_NAME = :prometheus_alert_events
UNIQUE_INDEX_NAME = :index_prometheus_alert_event_scoped_payload_key
STATUS_INDEX = :index_prometheus_alert_events_on_project_id_and_status
def up
drop_table TABLE_NAME
end
# Original SQL:
#
# CREATE TABLE prometheus_alert_events (
# id bigint NOT NULL,
# project_id bigint NOT NULL,
# prometheus_alert_id bigint NOT NULL,
# started_at timestamp with time zone NOT NULL,
# ended_at timestamp with time zone,
# status smallint,
# payload_key character varying
# );
#
# CREATE SEQUENCE prometheus_alert_events_id_seq
# START WITH 1
# INCREMENT BY 1
# NO MINVALUE
# NO MAXVALUE
# CACHE 1;
#
# ALTER SEQUENCE prometheus_alert_events_id_seq OWNED BY prometheus_alert_events.id;
#
# CREATE UNIQUE INDEX index_prometheus_alert_event_scoped_payload_key ON prometheus_alert_events
# USING btree (prometheus_alert_id, payload_key);
#
# CREATE INDEX index_prometheus_alert_events_on_project_id_and_status ON prometheus_alert_events
# USING btree (project_id, status);
#
def down
create_table TABLE_NAME do |t|
t.bigint :project_id, null: false
t.bigint :prometheus_alert_id, null: false
t.datetime_with_timezone :started_at, null: false
t.datetime_with_timezone :ended_at
t.integer :status, limit: 2
t.string :payload_key
t.index [:prometheus_alert_id, :payload_key], name: UNIQUE_INDEX_NAME, unique: true
t.index [:project_id, :status], name: STATUS_INDEX
end
end
end

View File

@ -0,0 +1,40 @@
# frozen_string_literal: true
class DropSelfManagedPrometheusAlertEventsForeignKeys < Gitlab::Database::Migration[2.2]
milestone '17.4'
disable_ddl_transaction!
TABLE_NAME = :self_managed_prometheus_alert_events
PROJECTS_FK_NAME = 'fk_rails_3936dadc62'
ENVIRONMENTS_FK_NAME = 'fk_rails_39d83d1b65'
def up
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :projects,
column: :project_id
end
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :environments,
column: :environment_id
end
end
# Original SQL:
#
# ALTER TABLE ONLY self_managed_prometheus_alert_events
# ADD CONSTRAINT fk_rails_3936dadc62 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
#
# ALTER TABLE ONLY self_managed_prometheus_alert_events
# ADD CONSTRAINT fk_rails_39d83d1b65 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
#
def down
add_concurrent_foreign_key TABLE_NAME, :projects,
column: :project_id,
name: PROJECTS_FK_NAME
add_concurrent_foreign_key TABLE_NAME, :environments,
column: :environment_id,
name: ENVIRONMENTS_FK_NAME
end
end

View File

@ -0,0 +1,58 @@
# frozen_string_literal: true
class DropSelfManagedPrometheusAlertEvents < Gitlab::Database::Migration[2.2]
milestone '17.4'
TABLE_NAME = :self_managed_prometheus_alert_events
UNIQUE_INDEX_NAME = :idx_project_id_payload_key_self_managed_prometheus_alert_events
ENVIRONMENT_INDEX = :index_self_managed_prometheus_alert_events_on_environment_id
def up
drop_table TABLE_NAME
end
# Original SQL:
#
# CREATE TABLE self_managed_prometheus_alert_events (
# id bigint NOT NULL,
# project_id bigint NOT NULL,
# environment_id bigint,
# started_at timestamp with time zone NOT NULL,
# ended_at timestamp with time zone,
# status smallint NOT NULL,
# title character varying(255) NOT NULL,
# query_expression character varying(255),
# payload_key character varying(255) NOT NULL
# );
#
# CREATE SEQUENCE self_managed_prometheus_alert_events_id_seq
# START WITH 1
# INCREMENT BY 1
# NO MINVALUE
# NO MAXVALUE
# CACHE 1;
#
# ALTER SEQUENCE self_managed_prometheus_alert_events_id_seq OWNED BY self_managed_prometheus_alert_events.id;
#
# CREATE UNIQUE INDEX idx_project_id_payload_key_self_managed_prometheus_alert_events
# ON self_managed_prometheus_alert_events USING btree (project_id, payload_key);
#
# CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events
# USING btree (environment_id);
#
def down
create_table TABLE_NAME do |t|
t.bigint :project_id, null: false
t.bigint :environment_id
t.datetime_with_timezone :started_at, null: false
t.datetime_with_timezone :ended_at
t.integer :status, limit: 2, null: false
t.string :title, limit: 255, null: false
t.string :query_expression, limit: 255
t.string :payload_key, limit: 255, null: false
t.index [:project_id, :payload_key], name: UNIQUE_INDEX_NAME, unique: true
t.index :environment_id, name: ENVIRONMENT_INDEX
end
end
end

View File

@ -0,0 +1,68 @@
# frozen_string_literal: true
class DropPrometheusAlertsForeignKeys < Gitlab::Database::Migration[2.2]
milestone '17.4'
disable_ddl_transaction!
TABLE_NAME = :prometheus_alerts
ALERTS_FK_NAME = 'fk_51ab4b6089'
ENVIRONMENTS_FK_NAME = 'fk_rails_6d9b283465'
METRICS_FK_NAME = 'fk_rails_e6351447ec'
PROJECTS_FK_NAME = 'fk_rails_f0e8db86aa'
def up
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :environments,
column: :environment_id
end
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :prometheus_metrics,
column: :prometheus_metric_id
end
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :projects,
column: :project_id
end
with_lock_retries do
remove_foreign_key_if_exists :alert_management_alerts, TABLE_NAME,
column: :prometheus_alert_id
end
end
# Original SQL:
#
# ALTER TABLE ONLY alert_management_alerts
# ADD CONSTRAINT fk_51ab4b6089 FOREIGN KEY (prometheus_alert_id) REFERENCES prometheus_alerts(id)
# ON DELETE CASCADE;
#
# ALTER TABLE ONLY prometheus_alerts
# ADD CONSTRAINT fk_rails_6d9b283465 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
#
# ALTER TABLE ONLY prometheus_alerts
# ADD CONSTRAINT fk_rails_e6351447ec FOREIGN KEY (prometheus_metric_id) REFERENCES prometheus_metrics(id)
# ON DELETE CASCADE;
#
# ALTER TABLE ONLY prometheus_alerts
# ADD CONSTRAINT fk_rails_f0e8db86aa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
#
def down
add_concurrent_foreign_key :alert_management_alerts, TABLE_NAME,
column: :prometheus_alert_id,
name: ALERTS_FK_NAME
add_concurrent_foreign_key TABLE_NAME, :environments,
column: :environment_id,
name: ENVIRONMENTS_FK_NAME
add_concurrent_foreign_key TABLE_NAME, :prometheus_metrics,
column: :prometheus_metric_id,
name: METRICS_FK_NAME
add_concurrent_foreign_key TABLE_NAME, :projects,
column: :project_id,
name: PROJECTS_FK_NAME
end
end

View File

@ -0,0 +1,62 @@
# frozen_string_literal: true
class DropPrometheusAlerts < Gitlab::Database::Migration[2.2]
milestone '17.4'
TABLE_NAME = :prometheus_alerts
UNIQUE_INDEX_NAME = :index_prometheus_alerts_metric_environment
ENVIRONMENT_INDEX_NAME = :index_prometheus_alerts_on_environment_id
METRIC_INDEX_NAME = :index_prometheus_alerts_on_prometheus_metric_id
def up
drop_table TABLE_NAME
end
# Original SQL:
#
# CREATE TABLE prometheus_alerts (
# id bigint NOT NULL,
# created_at timestamp with time zone NOT NULL,
# updated_at timestamp with time zone NOT NULL,
# threshold double precision NOT NULL,
# operator integer NOT NULL,
# environment_id bigint NOT NULL,
# project_id bigint NOT NULL,
# prometheus_metric_id bigint NOT NULL,
# runbook_url text,
# CONSTRAINT check_cb76d7e629 CHECK ((char_length(runbook_url) <= 255))
# );
#
# CREATE SEQUENCE prometheus_alerts_id_seq
# START WITH 1
# INCREMENT BY 1
# NO MINVALUE
# NO MAXVALUE
# CACHE 1;
#
# ALTER SEQUENCE prometheus_alerts_id_seq OWNED BY prometheus_alerts.id;
#
# CREATE UNIQUE INDEX index_prometheus_alerts_metric_environment ON prometheus_alerts
# USING btree (project_id, prometheus_metric_id, environment_id);
#
# CREATE INDEX index_prometheus_alerts_on_environment_id ON prometheus_alerts USING btree (environment_id);
#
# CREATE INDEX index_prometheus_alerts_on_prometheus_metric_id ON prometheus_alerts
# USING btree (prometheus_metric_id);
#
def down
create_table TABLE_NAME do |t|
t.timestamps_with_timezone null: false
t.float :threshold, null: false
t.integer :operator, null: false
t.bigint :environment_id, null: false
t.bigint :project_id, null: false
t.bigint :prometheus_metric_id, null: false
t.text :runbook_url, limit: 255
t.index [:project_id, :prometheus_metric_id, :environment_id], name: UNIQUE_INDEX_NAME, unique: true
t.index :environment_id, name: ENVIRONMENT_INDEX_NAME
t.index :prometheus_metric_id, name: METRIC_INDEX_NAME
end
end
end

View File

@ -0,0 +1,27 @@
# frozen_string_literal: true
class DropPrometheusMetricsForeignKeys < Gitlab::Database::Migration[2.2]
milestone '17.4'
disable_ddl_transaction!
TABLE_NAME = :prometheus_metrics
PROJECT_FK_NAME = 'fk_rails_4c8957a707'
def up
with_lock_retries do
remove_foreign_key_if_exists TABLE_NAME, :projects,
column: :project_id
end
end
# Original SQL:
#
# ALTER TABLE ONLY prometheus_metrics
# ADD CONSTRAINT fk_rails_4c8957a707 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
#
def down
add_concurrent_foreign_key TABLE_NAME, :projects,
column: :project_id,
name: PROJECT_FK_NAME
end
end

View File

@ -0,0 +1,77 @@
# frozen_string_literal: true
class DropPrometheusMetrics < Gitlab::Database::Migration[2.2]
milestone '17.4'
TABLE_NAME = :prometheus_metrics
UNIQUE_NULL_PROJECT_INDEX = :index_prometheus_metrics_on_identifier_and_null_project
UNIQUE_PROJECT_INDEX = :index_prometheus_metrics_on_identifier_and_project_id
COMMON_INDEX = :index_prometheus_metrics_on_common
GROUP_INDEX = :index_prometheus_metrics_on_group
PROJECT_INDEX = :index_prometheus_metrics_on_project_id
def up
drop_table TABLE_NAME
end
# Original SQL:
#
# CREATE TABLE prometheus_metrics (
# id bigint NOT NULL,
# project_id bigint,
# title character varying NOT NULL,
# query character varying NOT NULL,
# y_label character varying NOT NULL,
# unit character varying NOT NULL,
# legend character varying,
# "group" integer NOT NULL,
# created_at timestamp with time zone NOT NULL,
# updated_at timestamp with time zone NOT NULL,
# common boolean DEFAULT false NOT NULL,
# identifier character varying,
# dashboard_path text,
# CONSTRAINT check_0ad9f01463 CHECK ((char_length(dashboard_path) <= 2048))
# );
# CREATE SEQUENCE prometheus_metrics_id_seq
# START WITH 1
# INCREMENT BY 1
# NO MINVALUE
# NO MAXVALUE
# CACHE 1;
#
# ALTER SEQUENCE prometheus_metrics_id_seq OWNED BY prometheus_metrics.id;
#
# CREATE INDEX index_prometheus_metrics_on_common ON prometheus_metrics USING btree (common);
#
# CREATE INDEX index_prometheus_metrics_on_group ON prometheus_metrics USING btree ("group");
#
# CREATE UNIQUE INDEX index_prometheus_metrics_on_identifier_and_null_project ON prometheus_metrics
# USING btree (identifier) WHERE (project_id IS NULL);
#
# CREATE UNIQUE INDEX index_prometheus_metrics_on_identifier_and_project_id ON prometheus_metrics
# USING btree (identifier, project_id);
#
# CREATE INDEX index_prometheus_metrics_on_project_id ON prometheus_metrics USING btree (project_id);
#
def down
create_table TABLE_NAME do |t|
t.bigint :project_id
t.string :title, null: false
t.string :query, null: false
t.string :y_label, null: false
t.string :unit, null: false
t.string :legend
t.integer "group", null: false
t.timestamps_with_timezone null: false
t.boolean :common, null: false, default: false
t.string :identifier
t.text :dashboard_path, limit: 2048
t.index :common, name: COMMON_INDEX
t.index "group", name: GROUP_INDEX
t.index :identifier, unique: true, name: UNIQUE_NULL_PROJECT_INDEX, where: 'project_id IS NULL'
t.index [:identifier, :project_id], unique: true, name: UNIQUE_PROJECT_INDEX
t.index :project_id, name: PROJECT_INDEX
end
end
end

View File

@ -0,0 +1 @@
8cee30e569bba31dc5bd81163c47426a1f2796d7c0c4329d2547d44f25980178

View File

@ -0,0 +1 @@
3e095ae2635398bfc8c8f81c09421cb2d37c5134a0378966ae138f7166c6699c

View File

@ -0,0 +1 @@
562007a8ac4412e4f8cd598104d46e3db4970a46a9b15323b94b3941f1320dac

View File

@ -0,0 +1 @@
6ab3237e46e64a264bdf76eb4beaa30a37e0ce7c241f9c8c7bd0832f3f232f1e

View File

@ -0,0 +1 @@
16cb059ba2ad7ad65e47256a6932dd8fa3f9e956af359ccbc4979f4167e3a1fc

View File

@ -0,0 +1 @@
779afee3e07820550eb8f381c287183673c8910ac72d2ac66f75524cc22d755c

View File

@ -0,0 +1 @@
ebe7b7dfaf5b0aac570f83df38e5e23fbd5edbc7defff80c442ac58218aa976b

View File

@ -0,0 +1 @@
4205802e8cedc81e449e6a3ac5b806d6300457cdbd4dbe96fb547b57d2556de1

View File

@ -0,0 +1 @@
863655adbc15360c31ab0e5c4f0ea079b4ab5481bb57df9608aea3069ce23820

View File

@ -0,0 +1 @@
75b527e70d1d446cdc47a485f66531488d56e2ef61a770b1fb12d0b821aa021e

View File

@ -0,0 +1 @@
b56bd572ba745bedc275dee79138a28789572151ed46a40f40244acb233f5303

View File

@ -0,0 +1 @@
8f32eea35b048297fcb6d835c9991b6a9f20ce809634f1c66c8335ff68dd0c5d

View File

@ -0,0 +1 @@
7ff2eb3e3931c96492de17c15702a40c70e3d435a6d989139345f95fd56bd538

View File

@ -12403,20 +12403,6 @@ CREATE SEQUENCE issues_id_seq
ALTER SEQUENCE issues_id_seq OWNED BY issues.id;
CREATE TABLE issues_prometheus_alert_events (
issue_id bigint NOT NULL,
prometheus_alert_event_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
CREATE TABLE issues_self_managed_prometheus_alert_events (
issue_id bigint NOT NULL,
self_managed_prometheus_alert_event_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
CREATE TABLE iterations_cadences (
id bigint NOT NULL,
group_id bigint NOT NULL,
@ -16844,73 +16830,6 @@ CREATE SEQUENCE projects_visits_id_seq
ALTER SEQUENCE projects_visits_id_seq OWNED BY projects_visits.id;
CREATE TABLE prometheus_alert_events (
id bigint NOT NULL,
project_id bigint NOT NULL,
prometheus_alert_id bigint NOT NULL,
started_at timestamp with time zone NOT NULL,
ended_at timestamp with time zone,
status smallint,
payload_key character varying
);
CREATE SEQUENCE prometheus_alert_events_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE prometheus_alert_events_id_seq OWNED BY prometheus_alert_events.id;
CREATE TABLE prometheus_alerts (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
threshold double precision NOT NULL,
operator integer NOT NULL,
environment_id bigint NOT NULL,
project_id bigint NOT NULL,
prometheus_metric_id bigint NOT NULL,
runbook_url text,
CONSTRAINT check_cb76d7e629 CHECK ((char_length(runbook_url) <= 255))
);
CREATE SEQUENCE prometheus_alerts_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE prometheus_alerts_id_seq OWNED BY prometheus_alerts.id;
CREATE TABLE prometheus_metrics (
id bigint NOT NULL,
project_id bigint,
title character varying NOT NULL,
query character varying NOT NULL,
y_label character varying NOT NULL,
unit character varying NOT NULL,
legend character varying,
"group" integer NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
common boolean DEFAULT false NOT NULL,
identifier character varying,
dashboard_path text,
CONSTRAINT check_0ad9f01463 CHECK ((char_length(dashboard_path) <= 2048))
);
CREATE SEQUENCE prometheus_metrics_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE prometheus_metrics_id_seq OWNED BY prometheus_metrics.id;
CREATE TABLE protected_branch_merge_access_levels (
id bigint NOT NULL,
protected_branch_id bigint NOT NULL,
@ -17699,6 +17618,7 @@ CREATE TABLE sbom_occurrences (
archived boolean DEFAULT false NOT NULL,
traversal_ids bigint[] DEFAULT '{}'::bigint[] NOT NULL,
ancestors jsonb DEFAULT '[]'::jsonb NOT NULL,
reachability smallint DEFAULT 0,
CONSTRAINT check_3f2d2c7ffc CHECK ((char_length(package_manager) <= 255)),
CONSTRAINT check_9b29021fa8 CHECK ((char_length(component_name) <= 255)),
CONSTRAINT check_e6b8437cfe CHECK ((char_length(input_file_path) <= 1024))
@ -18108,27 +18028,6 @@ CREATE SEQUENCE security_trainings_id_seq
ALTER SEQUENCE security_trainings_id_seq OWNED BY security_trainings.id;
CREATE TABLE self_managed_prometheus_alert_events (
id bigint NOT NULL,
project_id bigint NOT NULL,
environment_id bigint,
started_at timestamp with time zone NOT NULL,
ended_at timestamp with time zone,
status smallint NOT NULL,
title character varying(255) NOT NULL,
query_expression character varying(255),
payload_key character varying(255) NOT NULL
);
CREATE SEQUENCE self_managed_prometheus_alert_events_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE self_managed_prometheus_alert_events_id_seq OWNED BY self_managed_prometheus_alert_events.id;
CREATE TABLE sent_notifications (
project_id bigint,
noteable_id bigint,
@ -22155,12 +22054,6 @@ ALTER TABLE ONLY projects_sync_events ALTER COLUMN id SET DEFAULT nextval('proje
ALTER TABLE ONLY projects_visits ALTER COLUMN id SET DEFAULT nextval('projects_visits_id_seq'::regclass);
ALTER TABLE ONLY prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('prometheus_alert_events_id_seq'::regclass);
ALTER TABLE ONLY prometheus_alerts ALTER COLUMN id SET DEFAULT nextval('prometheus_alerts_id_seq'::regclass);
ALTER TABLE ONLY prometheus_metrics ALTER COLUMN id SET DEFAULT nextval('prometheus_metrics_id_seq'::regclass);
ALTER TABLE ONLY protected_branch_merge_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_branch_merge_access_levels_id_seq'::regclass);
ALTER TABLE ONLY protected_branch_push_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_branch_push_access_levels_id_seq'::regclass);
@ -22271,8 +22164,6 @@ ALTER TABLE ONLY security_training_providers ALTER COLUMN id SET DEFAULT nextval
ALTER TABLE ONLY security_trainings ALTER COLUMN id SET DEFAULT nextval('security_trainings_id_seq'::regclass);
ALTER TABLE ONLY self_managed_prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('self_managed_prometheus_alert_events_id_seq'::regclass);
ALTER TABLE ONLY sent_notifications ALTER COLUMN id SET DEFAULT nextval('sent_notifications_id_seq'::regclass);
ALTER TABLE ONLY sentry_issues ALTER COLUMN id SET DEFAULT nextval('sentry_issues_id_seq'::regclass);
@ -24110,12 +24001,6 @@ ALTER TABLE ONLY issue_user_mentions
ALTER TABLE ONLY issues
ADD CONSTRAINT issues_pkey PRIMARY KEY (id);
ALTER TABLE ONLY issues_prometheus_alert_events
ADD CONSTRAINT issues_prometheus_alert_events_pkey PRIMARY KEY (issue_id, prometheus_alert_event_id);
ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
ADD CONSTRAINT issues_self_managed_prometheus_alert_events_pkey PRIMARY KEY (issue_id, self_managed_prometheus_alert_event_id);
ALTER TABLE ONLY sprints
ADD CONSTRAINT iteration_start_and_due_date_iterations_cadence_id_constraint EXCLUDE USING gist (iterations_cadence_id WITH =, daterange(start_date, due_date, '[]'::text) WITH &&) WHERE ((group_id IS NOT NULL)) DEFERRABLE INITIALLY DEFERRED;
@ -24749,15 +24634,6 @@ ALTER TABLE ONLY projects_sync_events
ALTER TABLE ONLY projects_visits
ADD CONSTRAINT projects_visits_pkey PRIMARY KEY (id, visited_at);
ALTER TABLE ONLY prometheus_alert_events
ADD CONSTRAINT prometheus_alert_events_pkey PRIMARY KEY (id);
ALTER TABLE ONLY prometheus_alerts
ADD CONSTRAINT prometheus_alerts_pkey PRIMARY KEY (id);
ALTER TABLE ONLY prometheus_metrics
ADD CONSTRAINT prometheus_metrics_pkey PRIMARY KEY (id);
ALTER TABLE ONLY protected_branch_merge_access_levels
ADD CONSTRAINT protected_branch_merge_access_levels_pkey PRIMARY KEY (id);
@ -24935,9 +24811,6 @@ ALTER TABLE ONLY security_training_providers
ALTER TABLE ONLY security_trainings
ADD CONSTRAINT security_trainings_pkey PRIMARY KEY (id);
ALTER TABLE ONLY self_managed_prometheus_alert_events
ADD CONSTRAINT self_managed_prometheus_alert_events_pkey PRIMARY KEY (id);
ALTER TABLE ONLY sent_notifications
ADD CONSTRAINT sent_notifications_pkey PRIMARY KEY (id);
@ -26788,8 +26661,6 @@ CREATE INDEX idx_project_audit_events_on_project_created_at_id ON ONLY project_a
CREATE INDEX idx_project_audit_events_on_project_id_author_created_at_id ON ONLY project_audit_events USING btree (project_id, author_id, created_at, id DESC);
CREATE UNIQUE INDEX idx_project_id_payload_key_self_managed_prometheus_alert_events ON self_managed_prometheus_alert_events USING btree (project_id, payload_key);
CREATE INDEX idx_project_repository_check_partial ON projects USING btree (repository_storage, created_at) WHERE (last_repository_check_at IS NULL);
CREATE INDEX idx_projects_api_created_at_id_for_archived ON projects USING btree (created_at, id) WHERE ((archived = true) AND (pending_delete = false) AND (hidden = false));
@ -29838,26 +29709,6 @@ CREATE INDEX index_projects_visits_on_entity_id ON ONLY projects_visits USING bt
CREATE INDEX index_projects_visits_on_user_id_and_entity_id_and_visited_at ON ONLY projects_visits USING btree (user_id, entity_id, visited_at);
CREATE UNIQUE INDEX index_prometheus_alert_event_scoped_payload_key ON prometheus_alert_events USING btree (prometheus_alert_id, payload_key);
CREATE INDEX index_prometheus_alert_events_on_project_id_and_status ON prometheus_alert_events USING btree (project_id, status);
CREATE UNIQUE INDEX index_prometheus_alerts_metric_environment ON prometheus_alerts USING btree (project_id, prometheus_metric_id, environment_id);
CREATE INDEX index_prometheus_alerts_on_environment_id ON prometheus_alerts USING btree (environment_id);
CREATE INDEX index_prometheus_alerts_on_prometheus_metric_id ON prometheus_alerts USING btree (prometheus_metric_id);
CREATE INDEX index_prometheus_metrics_on_common ON prometheus_metrics USING btree (common);
CREATE INDEX index_prometheus_metrics_on_group ON prometheus_metrics USING btree ("group");
CREATE UNIQUE INDEX index_prometheus_metrics_on_identifier_and_null_project ON prometheus_metrics USING btree (identifier) WHERE (project_id IS NULL);
CREATE UNIQUE INDEX index_prometheus_metrics_on_identifier_and_project_id ON prometheus_metrics USING btree (identifier, project_id);
CREATE INDEX index_prometheus_metrics_on_project_id ON prometheus_metrics USING btree (project_id);
CREATE INDEX index_protected_branch_merge_access ON protected_branch_merge_access_levels USING btree (protected_branch_id);
CREATE INDEX index_protected_branch_merge_access_levels_on_group_id ON protected_branch_merge_access_levels USING btree (group_id);
@ -30192,8 +30043,6 @@ CREATE INDEX index_security_trainings_on_provider_id ON security_trainings USING
CREATE UNIQUE INDEX index_security_trainings_on_unique_project_id ON security_trainings USING btree (project_id) WHERE (is_primary IS TRUE);
CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id);
CREATE INDEX index_sent_notifications_on_issue_email_participant_id ON sent_notifications USING btree (issue_email_participant_id);
CREATE INDEX index_sent_notifications_on_noteable_type_noteable_id ON sent_notifications USING btree (noteable_id) WHERE ((noteable_type)::text = 'Issue'::text);
@ -30958,10 +30807,6 @@ CREATE INDEX index_zoom_meetings_on_issue_status ON zoom_meetings USING btree (i
CREATE INDEX index_zoom_meetings_on_project_id ON zoom_meetings USING btree (project_id);
CREATE INDEX issue_id_issues_prometheus_alert_events_index ON issues_prometheus_alert_events USING btree (prometheus_alert_event_id);
CREATE INDEX issue_id_issues_self_managed_rometheus_alert_events_index ON issues_self_managed_prometheus_alert_events USING btree (self_managed_prometheus_alert_event_id);
CREATE UNIQUE INDEX issue_user_mentions_on_issue_id_and_note_id_index ON issue_user_mentions USING btree (issue_id, note_id);
CREATE UNIQUE INDEX issue_user_mentions_on_issue_id_index ON issue_user_mentions USING btree (issue_id) WHERE (note_id IS NULL);
@ -33547,9 +33392,6 @@ ALTER TABLE ONLY approval_group_rules_groups
ALTER TABLE ONLY approval_group_rules_protected_branches
ADD CONSTRAINT fk_514003db08 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY alert_management_alerts
ADD CONSTRAINT fk_51ab4b6089 FOREIGN KEY (prometheus_alert_id) REFERENCES prometheus_alerts(id) ON DELETE CASCADE;
ALTER TABLE ONLY deploy_tokens
ADD CONSTRAINT fk_51bf7bfb69 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@ -34738,9 +34580,6 @@ ALTER TABLE ONLY issue_email_participants
ALTER TABLE ONLY merge_request_context_commits
ADD CONSTRAINT fk_rails_0fe0039f60 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
ALTER TABLE ONLY prometheus_alert_events
ADD CONSTRAINT fk_rails_106f901176 FOREIGN KEY (prometheus_alert_id) REFERENCES prometheus_alerts(id) ON DELETE CASCADE;
ALTER TABLE ONLY audit_events_streaming_headers
ADD CONSTRAINT fk_rails_109fcf96e2 FOREIGN KEY (external_audit_event_destination_id) REFERENCES audit_events_external_audit_event_destinations(id) ON DELETE CASCADE;
@ -35044,18 +34883,12 @@ ALTER TABLE ONLY issue_user_mentions
ALTER TABLE ONLY namespace_settings
ADD CONSTRAINT fk_rails_3896d4fae5 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY self_managed_prometheus_alert_events
ADD CONSTRAINT fk_rails_3936dadc62 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY packages_cleanup_policies
ADD CONSTRAINT fk_rails_393ba98591 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY approval_project_rules_groups
ADD CONSTRAINT fk_rails_396841e79e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY self_managed_prometheus_alert_events
ADD CONSTRAINT fk_rails_39d83d1b65 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
ALTER TABLE ONLY chat_teams
ADD CONSTRAINT fk_rails_3b543909cb FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@ -35146,9 +34979,6 @@ ALTER TABLE ONLY merge_requests_closing_issues
ALTER TABLE ONLY protected_environment_deploy_access_levels
ADD CONSTRAINT fk_rails_45cc02a931 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY prometheus_alert_events
ADD CONSTRAINT fk_rails_4675865839 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY smartcard_identities
ADD CONSTRAINT fk_rails_4689f889a9 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@ -35176,9 +35006,6 @@ ALTER TABLE ONLY issue_metrics
ALTER TABLE ONLY project_metrics_settings
ADD CONSTRAINT fk_rails_4c6037ee4f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY prometheus_metrics
ADD CONSTRAINT fk_rails_4c8957a707 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY dependency_proxy_blob_states
ADD CONSTRAINT fk_rails_4cdbb92cbd FOREIGN KEY (dependency_proxy_blob_id) REFERENCES dependency_proxy_blobs(id) ON DELETE CASCADE;
@ -35434,9 +35261,6 @@ ALTER TABLE ONLY error_tracking_errors
ALTER TABLE ONLY ml_model_version_metadata
ADD CONSTRAINT fk_rails_6b8fcb2af1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY prometheus_alerts
ADD CONSTRAINT fk_rails_6d9b283465 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
ALTER TABLE ONLY term_agreements
ADD CONSTRAINT fk_rails_6ea6520e4a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@ -35938,9 +35762,6 @@ ALTER TABLE ONLY merge_trains
ALTER TABLE ONLY board_project_recent_visits
ADD CONSTRAINT fk_rails_b315dd0c80 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE;
ALTER TABLE ONLY issues_prometheus_alert_events
ADD CONSTRAINT fk_rails_b32edb790f FOREIGN KEY (prometheus_alert_event_id) REFERENCES prometheus_alert_events(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_trains
ADD CONSTRAINT fk_rails_b374b5225d FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
@ -36133,9 +35954,6 @@ ALTER TABLE ONLY vulnerability_finding_links
ALTER TABLE ONLY namespace_details
ADD CONSTRAINT fk_rails_cc11a451f8 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
ADD CONSTRAINT fk_rails_cc5d88bbb0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
ALTER TABLE ONLY operations_strategies_user_lists
ADD CONSTRAINT fk_rails_ccb7e4bc0b FOREIGN KEY (user_list_id) REFERENCES operations_user_lists(id) ON DELETE CASCADE;
@ -36226,9 +36044,6 @@ ALTER TABLE ONLY jira_imports
ALTER TABLE ONLY dependency_proxy_blobs
ADD CONSTRAINT fk_rails_db58bbc5d7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY issues_prometheus_alert_events
ADD CONSTRAINT fk_rails_db5b756534 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
ALTER TABLE ONLY board_user_preferences
ADD CONSTRAINT fk_rails_dbebdaa8fe FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE;
@ -36322,9 +36137,6 @@ ALTER TABLE ONLY software_license_policies
ALTER TABLE ONLY approval_merge_request_rule_sources
ADD CONSTRAINT fk_rails_e605a04f76 FOREIGN KEY (approval_merge_request_rule_id) REFERENCES approval_merge_request_rules(id) ON DELETE CASCADE;
ALTER TABLE ONLY prometheus_alerts
ADD CONSTRAINT fk_rails_e6351447ec FOREIGN KEY (prometheus_metric_id) REFERENCES prometheus_metrics(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_request_metrics
ADD CONSTRAINT fk_rails_e6d7c24d1b FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
@ -36415,9 +36227,6 @@ ALTER TABLE ONLY dast_pre_scan_verifications
ALTER TABLE ONLY analytics_dashboards_pointers
ADD CONSTRAINT fk_rails_f0e7c640c3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY prometheus_alerts
ADD CONSTRAINT fk_rails_f0e8db86aa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY import_export_uploads
ADD CONSTRAINT fk_rails_f129140f9e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@ -36466,9 +36275,6 @@ ALTER TABLE ONLY design_user_mentions
ALTER TABLE ONLY internal_ids
ADD CONSTRAINT fk_rails_f7d46b66c6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
ADD CONSTRAINT fk_rails_f7db2d72eb FOREIGN KEY (self_managed_prometheus_alert_event_id) REFERENCES self_managed_prometheus_alert_events(id) ON DELETE CASCADE;
ALTER TABLE ONLY security_trainings
ADD CONSTRAINT fk_rails_f80240fae0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE NOT VALID;

View File

@ -108,9 +108,9 @@ model_list:
api_base: YOUR_HOSTING_SERVER
```
## Step 2: Install the GitLab AI Gateway
## Step 2: Install the GitLab AI Gateway via Docker or Helm chart
### Install by using Docker
## Install by using Docker
Prerequisites:
@ -130,7 +130,7 @@ permissions, and potentially other unknown issues. If you are trying to run on D
for Windows, see the [getting help page](https://about.gitlab.com/get-help/) for links
to community resources (such as IRC or forums) to seek help from other users.
#### Set up the volumes location
### Set up the volumes location
Create a directory where the logs will reside on the Docker host. It can be under your user's home directory (for example
`~/gitlab-agw`), or in a directory like `/srv/gitlab-agw`. To create that directory, run:
@ -239,7 +239,7 @@ should open the AI Gateway API documentation.
After starting the container, visit `gitlab-aigw.example.com`. It might take
a while before the Docker container starts to respond to queries.
## Upgrade the AI Gateway
### Upgrade the AI Gateway Docker image
To upgrade the AI Gateway, download the newest Docker image tag.
@ -269,9 +269,9 @@ To upgrade the AI Gateway, download the newest Docker image tag.
1. Ensure that the environment variables are all set correctly
### Install by using the AI Gateway Helm chart
## Install by using the AI Gateway Helm chart
#### Prerequisites
### Prerequisites
To complete this guide, you must have the following:

View File

@ -22323,6 +22323,8 @@ Describes an external status check.
| <a id="featureflagactive"></a>`active` | [`Boolean!`](#boolean) | Whether the feature flag is active. |
| <a id="featureflagid"></a>`id` | [`OperationsFeatureFlagID!`](#operationsfeatureflagid) | Global ID of the feature flag. |
| <a id="featureflagname"></a>`name` | [`String!`](#string) | Name of the feature flag. |
| <a id="featureflagpath"></a>`path` | [`String!`](#string) | Path to feature flag. |
| <a id="featureflagreference"></a>`reference` | [`String!`](#string) | Reference to feature flag. |
### `FileUpload`

View File

@ -3,6 +3,7 @@
module Gitlab
class GitPostReceive
include Gitlab::Identifier
attr_reader :container, :identifier, :changes, :push_options
def initialize(container, identifier, changes, push_options = {})

View File

@ -4,6 +4,7 @@ module Gitlab
# Helper methods to interact with Prometheus network services & resources
class PrometheusClient
include Gitlab::Utils::StrongMemoize
Error = Class.new(StandardError)
ConnectionError = Class.new(Gitlab::PrometheusClient::Error)
UnexpectedResponseError = Class.new(Gitlab::PrometheusClient::Error)

View File

@ -4,6 +4,7 @@ module Gitlab
module Spamcheck
class Result
include ::Spam::SpamConstants
attr_reader :response
VERDICT_MAPPING = {

View File

@ -4,6 +4,7 @@ module Gitlab
class UserAccessSnippet < UserAccess
extend ::Gitlab::Utils::Override
extend ::Gitlab::Cache::RequestCache
# TODO: apply override check https://gitlab.com/gitlab-org/gitlab/issues/205677
request_cache_key do

View File

@ -11,6 +11,7 @@ module Gitlab
# See https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/presenters/README.md#validate-accidental-overrides
# for more information.
include Gitlab::View::Presenter::Base
delegator_override_with Gitlab::Routing.url_helpers
delegator_override :can?
delegator_override :can_all?

View File

@ -4,6 +4,7 @@ module SystemCheck
module IncomingEmail
class MailRoomEnabledCheck < SystemCheck::BaseCheck
include ::SystemCheck::InitHelpers
set_name 'Mailroom enabled?'
def skip?

View File

@ -4,6 +4,7 @@ module SystemCheck
module IncomingEmail
class MailRoomRunningCheck < SystemCheck::BaseCheck
include ::SystemCheck::InitHelpers
set_name 'MailRoom running?'
def skip?

View File

@ -5,6 +5,7 @@ module QA
module Organization
class New < QA::Page::Base
include QA::Page::Component::Dropdown
view 'app/assets/javascripts/organizations/shared/components/new_edit_form.vue' do
element 'organization-name'
element 'submit-button'

View File

@ -5,6 +5,7 @@ module QA
module Organization
class Show < QA::Page::Base
include QA::Page::Component::Dropdown
view 'app/assets/javascripts/organizations/show/components/organization_avatar.vue' do
element 'organization-name'
end

View File

@ -9,6 +9,7 @@ module QA
include Page::Component::DesignManagement
include Page::Component::Issuable::Sidebar
include Page::Component::Issuable::Common
# We need to check phone_layout? instead of mobile_layout? here
# since tablets have the regular top navigation bar
prepend Mobile::Page::Project::Issue::Show if Runtime::Env.phone_layout?

View File

@ -7,6 +7,7 @@ module QA
class New < Page::Base
include Page::Component::NewSnippet
include Component::LazyLoader
view 'app/views/shared/empty_states/_snippets.html.haml' do
element 'create-first-snippet-link'
element 'snippets-empty-state'

View File

@ -8,6 +8,7 @@ module QA
class Base
include ApiFabricator
extend Capybara::DSL
using Rainbow
NoValueError = Class.new(RuntimeError)

View File

@ -7,6 +7,7 @@ module QA
class Airgapped < Template
include Bootable
include SharedAttributes
def perform(address, *rspec_options)
Runtime::Scenario.define(:network, 'airgapped')

View File

@ -45,6 +45,7 @@ RSpec.describe 'Database schema', feature_category: :database do
# See: https://docs.gitlab.com/ee/development/migration_style_guide.html#dropping-a-database-table
REMOVED_FKS = {
# example_table: %w[example_column]
alert_management_alerts: %w[prometheus_alert_id]
}.with_indifferent_access.freeze
# List of columns historically missing a FK, don't add more columns

View File

@ -43,14 +43,16 @@ RSpec.describe 'Registration enabled callout', feature_category: :system_access
before do
visit admin_root_path
find_by_testid('close-registration-enabled-callout').click
within('body.page-initialised') do
find_by_testid('close-registration-enabled-callout').click
end
wait_for_requests
visit root_dashboard_path
end
it 'does not display callout', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/391192' do
it 'does not display callout' do
expect(page).not_to have_content callout_title
end
end

View File

@ -1,11 +0,0 @@
# frozen_string_literal: true
require 'spec_helper'
require_migration!
RSpec.describe AddEmailParticipantsWidgetToWorkItemTypes, :migration, feature_category: :team_planning do
it_behaves_like 'migration that adds widget to work items definitions',
widget_name: described_class::WIDGET_NAME,
work_item_types: described_class::WORK_ITEM_TYPES,
namespaced: true
end

View File

@ -154,6 +154,16 @@ RSpec.describe Operations::FeatureFlag do
end
end
describe '#path' do
let(:namespace) { build(:namespace) }
let(:project) { build(:project, namespace: namespace) }
let(:feature_flag) { build(:operations_feature_flag, iid: 1, project: project) }
it 'returns path of the feature flag' do
expect(feature_flag.path).to eq "/#{project.full_path}/-/feature_flags/1"
end
end
describe '#hook_attrs' do
it 'includes expected attributes' do
hook_attrs = {

View File

@ -693,6 +693,12 @@ RSpec.describe MergeRequests::UpdateService, :mailer, feature_category: :code_re
expect(user3.review_requested_open_merge_requests_count).to eq(0)
end
it 'invalidates assignee merge request count cache' do
expect(merge_request.assignees).to all(receive(:invalidate_merge_request_cache_counts))
update_merge_request(reviewer_ids: [user2.id])
end
it_behaves_like 'triggers GraphQL subscription mergeRequestReviewersUpdated' do
let(:action) { update_merge_request({ reviewer_ids: [user2.id] }) }
end