Skip to content

Commit 2fa3b3a

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent e6b06e8 commit 2fa3b3a

File tree

68 files changed

+344
-444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+344
-444
lines changed

.markdownlint-cli2.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,3 @@ config:
162162
]
163163
ignores:
164164
- "doc/architecture"
165-
customRules:
166-
- "./doc/.markdownlint/rules/tabs_blank_lines.js"
167-
- "./doc/.markdownlint/rules/tabs_title_markup.js"
168-
- "./doc/.markdownlint/rules/tabs_title_text.js"
169-
- "./doc/.markdownlint/rules/tabs_wrapper_tags.js"

.rubocop_todo/gitlab/bounded_contexts.yml

-5
Original file line numberDiff line numberDiff line change
@@ -2312,7 +2312,6 @@ Gitlab/BoundedContexts:
23122312
- 'ee/app/graphql/resolvers/dast_site_validation_resolver.rb'
23132313
- 'ee/app/graphql/resolvers/description_versions_diff_resolver.rb'
23142314
- 'ee/app/graphql/resolvers/dora/performance_scores_count_resolver.rb'
2315-
- 'ee/app/graphql/resolvers/dora_metrics_resolver.rb'
23162315
- 'ee/app/graphql/resolvers/epic_ancestors_resolver.rb'
23172316
- 'ee/app/graphql/resolvers/epic_issues_resolver.rb'
23182317
- 'ee/app/graphql/resolvers/epics/children_resolver.rb'
@@ -2413,10 +2412,6 @@ Gitlab/BoundedContexts:
24132412
- 'ee/app/graphql/types/dora/performance_score_connection_type.rb'
24142413
- 'ee/app/graphql/types/dora/performance_score_count_type.rb'
24152414
- 'ee/app/graphql/types/dora/project_filter_input_type.rb'
2416-
- 'ee/app/graphql/types/dora_metric_bucketing_interval_enum.rb'
2417-
- 'ee/app/graphql/types/dora_metric_type.rb'
2418-
- 'ee/app/graphql/types/dora_metric_type_enum.rb'
2419-
- 'ee/app/graphql/types/dora_type.rb'
24202415
- 'ee/app/graphql/types/epic_descendant_count_type.rb'
24212416
- 'ee/app/graphql/types/epic_descendant_weight_sum_type.rb'
24222417
- 'ee/app/graphql/types/epic_health_status_type.rb'

.rubocop_todo/layout/line_length.yml

-3
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ Layout/LineLength:
482482
- 'ee/app/graphql/resolvers/app_sec/dast/profile_resolver.rb'
483483
- 'ee/app/graphql/resolvers/board_groupings/epics_resolver.rb'
484484
- 'ee/app/graphql/resolvers/boards/epic_lists_resolver.rb'
485-
- 'ee/app/graphql/resolvers/dora_metrics_resolver.rb'
486485
- 'ee/app/graphql/resolvers/external_issue_resolver.rb'
487486
- 'ee/app/graphql/resolvers/incident_management/oncall_rotations_resolver.rb'
488487
- 'ee/app/graphql/resolvers/incident_management/oncall_schedule_resolver.rb'
@@ -503,7 +502,6 @@ Layout/LineLength:
503502
- 'ee/app/graphql/types/dast_scan_type_enum.rb'
504503
- 'ee/app/graphql/types/dast_scanner_profile_type.rb'
505504
- 'ee/app/graphql/types/dast_site_profile_type.rb'
506-
- 'ee/app/graphql/types/dora_metric_type_enum.rb'
507505
- 'ee/app/graphql/types/epic_health_status_type.rb'
508506
- 'ee/app/graphql/types/epic_sort_enum.rb'
509507
- 'ee/app/graphql/types/epic_type.rb'
@@ -1112,7 +1110,6 @@ Layout/LineLength:
11121110
- 'ee/spec/graphql/resolvers/boards/board_list_epics_resolver_spec.rb'
11131111
- 'ee/spec/graphql/resolvers/ci/code_coverage_activities_resolver_spec.rb'
11141112
- 'ee/spec/graphql/resolvers/dast_site_validation_resolver_spec.rb'
1115-
- 'ee/spec/graphql/resolvers/dora_metrics_resolver_spec.rb'
11161113
- 'ee/spec/graphql/resolvers/epics_resolver_spec.rb'
11171114
- 'ee/spec/graphql/resolvers/external_issue_resolver_spec.rb'
11181115
- 'ee/spec/graphql/resolvers/incident_management/escalation_policies_resolver_spec.rb'

.rubocop_todo/style/inline_disable_annotation.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1093,8 +1093,6 @@ Style/InlineDisableAnnotation:
10931093
- 'ee/app/graphql/types/deployments/approval_type.rb'
10941094
- 'ee/app/graphql/types/dora/performance_score_connection_type.rb'
10951095
- 'ee/app/graphql/types/dora/performance_score_count_type.rb'
1096-
- 'ee/app/graphql/types/dora_metric_type.rb'
1097-
- 'ee/app/graphql/types/dora_type.rb'
10981096
- 'ee/app/graphql/types/epic_descendant_count_type.rb'
10991097
- 'ee/app/graphql/types/epic_descendant_weight_sum_type.rb'
11001098
- 'ee/app/graphql/types/epic_health_status_type.rb'

Gemfile.checksum

+7-7
Original file line numberDiff line numberDiff line change
@@ -524,13 +524,13 @@
524524
{"name":"prime","version":"0.1.3","platform":"ruby","checksum":"baf031c50d6ce923594913befc8ac86a3251bffb9d6a5e8b03687962054e53e3"},
525525
{"name":"prism","version":"1.2.0","platform":"ruby","checksum":"24ff9cd3232346e68052659f14c9a618022ea98935f774df465206aba5c06d2f"},
526526
{"name":"proc_to_ast","version":"0.1.0","platform":"ruby","checksum":"92a73fa66e2250a83f8589f818b0751bcf227c68f85916202df7af85082f8691"},
527-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"aarch64-linux-gnu","checksum":"7a3e8d7e95f7e53a6870381135f5f4b6c8c3f3b244b7cd760e3582c5abd86512"},
528-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"aarch64-linux-musl","checksum":"87f1cf92f39ce2be861732820c6b719dda4ee9a97b5bf7a627510a45b5a50977"},
529-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"arm64-darwin","checksum":"d828fecea444373367e7d3c7c67c898479816a6400813f641634ba2f64ca91c5"},
530-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"ruby","checksum":"de402deeb56234fb8866bebe91c69410a8f8e377ac557305c688e8e1705f0a75"},
531-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"x86_64-darwin","checksum":"a4501fb9da7a89200e6f8aeaecdbe9e06f491083cac7a611a0c37feeb803adff"},
532-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"x86_64-linux-gnu","checksum":"68cd5e4d0c9be98129f27856f2746c4b21b7162edbe48d71dfd76143097c4b8e"},
533-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"x86_64-linux-musl","checksum":"3f618d48a631a72027d1cfd090a904d4abfd3e543eec10e0d89f456633e35510"},
527+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"aarch64-linux-gnu","checksum":"e2a52234bed534fbce8185b781f49e2a584808a3713fb77287fb3017ae4e8dad"},
528+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"aarch64-linux-musl","checksum":"4d09f7c011cba48ca119515988e1683c4a99fc4310fb33145817541043556f55"},
529+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"arm64-darwin","checksum":"2d5277fe916d76e92a2801685d02bb7da4c8d62ba32e9bb83eb1edc9ad8bb165"},
530+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"ruby","checksum":"20ff9ef443767bc45d338882fbc6a9a853cdae190ec68cfd9395a5ac44384004"},
531+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"x86_64-darwin","checksum":"aab97474ccc96cc707af4be5b26f8d2fe89f4d67013ad996ae10f17712f527ff"},
532+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"x86_64-linux-gnu","checksum":"f17f2b069f73a976b421cf6730974d3addf196656b8437deca9c36845f658f9e"},
533+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"x86_64-linux-musl","checksum":"e2af29e954f40fda4c3acb5c3b9722dbfc724d8d67a28e01904233e558c4ce1d"},
534534
{"name":"pry","version":"0.14.2","platform":"java","checksum":"fd780670977ba04ff7ee32dabd4d02fe4bf02e977afe8809832d5dca1412862e"},
535535
{"name":"pry","version":"0.14.2","platform":"ruby","checksum":"c4fe54efedaca1d351280b45b8849af363184696fcac1c72e0415f9bdac4334d"},
536536
{"name":"pry-byebug","version":"3.10.1","platform":"ruby","checksum":"c8f975c32255bfdb29e151f5532130be64ff3d0042dc858d0907e849125581f8"},

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ GEM
14621462
coderay
14631463
parser
14641464
unparser
1465-
prometheus-client-mmap (1.2.8)
1465+
prometheus-client-mmap (1.2.9)
14661466
base64
14671467
bigdecimal
14681468
logger

Gemfile.next.checksum

+7-7
Original file line numberDiff line numberDiff line change
@@ -529,13 +529,13 @@
529529
{"name":"prime","version":"0.1.3","platform":"ruby","checksum":"baf031c50d6ce923594913befc8ac86a3251bffb9d6a5e8b03687962054e53e3"},
530530
{"name":"prism","version":"1.2.0","platform":"ruby","checksum":"24ff9cd3232346e68052659f14c9a618022ea98935f774df465206aba5c06d2f"},
531531
{"name":"proc_to_ast","version":"0.1.0","platform":"ruby","checksum":"92a73fa66e2250a83f8589f818b0751bcf227c68f85916202df7af85082f8691"},
532-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"aarch64-linux-gnu","checksum":"7a3e8d7e95f7e53a6870381135f5f4b6c8c3f3b244b7cd760e3582c5abd86512"},
533-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"aarch64-linux-musl","checksum":"87f1cf92f39ce2be861732820c6b719dda4ee9a97b5bf7a627510a45b5a50977"},
534-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"arm64-darwin","checksum":"d828fecea444373367e7d3c7c67c898479816a6400813f641634ba2f64ca91c5"},
535-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"ruby","checksum":"de402deeb56234fb8866bebe91c69410a8f8e377ac557305c688e8e1705f0a75"},
536-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"x86_64-darwin","checksum":"a4501fb9da7a89200e6f8aeaecdbe9e06f491083cac7a611a0c37feeb803adff"},
537-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"x86_64-linux-gnu","checksum":"68cd5e4d0c9be98129f27856f2746c4b21b7162edbe48d71dfd76143097c4b8e"},
538-
{"name":"prometheus-client-mmap","version":"1.2.8","platform":"x86_64-linux-musl","checksum":"3f618d48a631a72027d1cfd090a904d4abfd3e543eec10e0d89f456633e35510"},
532+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"aarch64-linux-gnu","checksum":"e2a52234bed534fbce8185b781f49e2a584808a3713fb77287fb3017ae4e8dad"},
533+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"aarch64-linux-musl","checksum":"4d09f7c011cba48ca119515988e1683c4a99fc4310fb33145817541043556f55"},
534+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"arm64-darwin","checksum":"2d5277fe916d76e92a2801685d02bb7da4c8d62ba32e9bb83eb1edc9ad8bb165"},
535+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"ruby","checksum":"20ff9ef443767bc45d338882fbc6a9a853cdae190ec68cfd9395a5ac44384004"},
536+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"x86_64-darwin","checksum":"aab97474ccc96cc707af4be5b26f8d2fe89f4d67013ad996ae10f17712f527ff"},
537+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"x86_64-linux-gnu","checksum":"f17f2b069f73a976b421cf6730974d3addf196656b8437deca9c36845f658f9e"},
538+
{"name":"prometheus-client-mmap","version":"1.2.9","platform":"x86_64-linux-musl","checksum":"e2af29e954f40fda4c3acb5c3b9722dbfc724d8d67a28e01904233e558c4ce1d"},
539539
{"name":"pry","version":"0.14.2","platform":"java","checksum":"fd780670977ba04ff7ee32dabd4d02fe4bf02e977afe8809832d5dca1412862e"},
540540
{"name":"pry","version":"0.14.2","platform":"ruby","checksum":"c4fe54efedaca1d351280b45b8849af363184696fcac1c72e0415f9bdac4334d"},
541541
{"name":"pry-byebug","version":"3.10.1","platform":"ruby","checksum":"c8f975c32255bfdb29e151f5532130be64ff3d0042dc858d0907e849125581f8"},

Gemfile.next.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,7 @@ GEM
14821482
coderay
14831483
parser
14841484
unparser
1485-
prometheus-client-mmap (1.2.8)
1485+
prometheus-client-mmap (1.2.9)
14861486
base64
14871487
bigdecimal
14881488
logger

app/assets/javascripts/lib/dompurify.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,19 @@ const getAllowedIconUrls = (gon = window.gon) =>
2828
.filter(Boolean)
2929
.map((path) => relativePathToAbsolute(path, getBaseURL()));
3030

31-
const isUrlAllowed = (url) =>
32-
getAllowedIconUrls().some((allowedUrl) => getNormalizedURL(url).startsWith(allowedUrl));
31+
const isUrlAllowed = (url) => {
32+
try {
33+
const normalizedUrl = new URL(getNormalizedURL(url));
34+
return getAllowedIconUrls().some((allowedUrlString) => {
35+
const allowedUrl = new URL(allowedUrlString);
36+
return (
37+
allowedUrl.origin === normalizedUrl.origin && normalizedUrl.pathname === allowedUrl.pathname
38+
);
39+
});
40+
} catch {
41+
return false;
42+
}
43+
};
3344

3445
const isHrefSafe = (url) => url.match(/^#/) || isUrlAllowed(url);
3546

app/controllers/admin/background_migrations_controller.rb

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class BackgroundMigrationsController < ApplicationController
66
urgency :low
77

88
around_action :support_multiple_databases
9+
authorize! :read_admin_background_migrations, only: [:index, :show]
910

1011
def index
1112
@relations_by_tab = {

app/controllers/concerns/issuable_collections.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def preload_for_collection
125125
@preload_for_collection ||= case collection_type
126126
when 'Issue'
127127
common_attributes + [
128-
::Gitlab::Issues::TypeAssociationGetter.call,
128+
:work_item_type,
129129
:project, { project: :namespace }
130130
]
131131
when 'MergeRequest'

app/controllers/projects/releases/evidences_controller.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ def authorize_read_release_evidence!
2525
end
2626

2727
def release
28-
@release ||= project.releases.find_by_tag!(sanitized_tag_name)
28+
@release ||= project.releases.find_by_tag!(tag_name)
2929
end
3030

3131
def evidence
3232
release.evidences.find(params[:id])
3333
end
3434

35-
def sanitized_tag_name
36-
CGI.unescape(params[:tag])
35+
def tag_name
36+
params[:tag]
3737
end
3838
end
3939
end

app/graphql/mutations/work_items/convert.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def resolve(attributes)
4545
private
4646

4747
def find_work_item_type!(gid)
48-
work_item_type = ::WorkItems::Type.find_by_correct_id_with_fallback(gid.model_id)
48+
work_item_type = ::WorkItems::Type.find_by_id_with_fallback(gid.model_id)
4949

5050
return work_item_type if work_item_type.present?
5151

app/graphql/mutations/work_items/create.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def params_with_resolve_discussion_params(attributes)
144144

145145
def params_with_work_item_type(attributes)
146146
work_item_type_id = attributes.delete(:work_item_type_id)&.model_id
147-
work_item_type = ::WorkItems::Type.find_by_correct_id_with_fallback(work_item_type_id)
147+
work_item_type = ::WorkItems::Type.find_by_id_with_fallback(work_item_type_id)
148148

149149
attributes[:work_item_type] = work_item_type
150150

app/graphql/mutations/work_items/create_from_task.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def resolve(id:, work_item_data:)
4848

4949
def work_item_data_with_fallback_type(work_item_data)
5050
work_item_type_id = work_item_data.delete(:work_item_type_id)
51-
work_item_type = ::WorkItems::Type.find_by_correct_id_with_fallback(work_item_type_id)
51+
work_item_type = ::WorkItems::Type.find_by_id_with_fallback(work_item_type_id)
5252

5353
work_item_data[:work_item_type] = work_item_type
5454

app/graphql/resolvers/concerns/issues/look_ahead_preloads.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def unconditional_includes
1616
project: [:project_feature, :group]
1717
},
1818
:author,
19-
::Gitlab::Issues::TypeAssociationGetter.call
19+
:work_item_type
2020
]
2121
end
2222

@@ -28,7 +28,7 @@ def preloads
2828
timelogs: [:timelogs],
2929
customer_relations_contacts: { customer_relations_contacts: [:group] },
3030
escalation_status: [:incident_management_issuable_escalation_status],
31-
type: ::Gitlab::Issues::TypeAssociationGetter.call
31+
type: :work_item_type
3232
}
3333
end
3434
end

app/graphql/resolvers/concerns/work_items/look_ahead_preloads.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ module LookAheadPreloads
1212

1313
def preloads
1414
{
15-
work_item_type: ::Gitlab::Issues::TypeAssociationGetter.call,
15+
work_item_type: :work_item_type,
1616
web_url: { namespace: :route, project: [:project_namespace, { namespace: :route }] },
17-
widgets: { ::Gitlab::Issues::TypeAssociationGetter.call => :enabled_widget_definitions },
17+
widgets: { work_item_type: :enabled_widget_definitions },
1818
archived: :project
1919
}
2020
end
@@ -54,7 +54,7 @@ def unconditional_includes
5454
project: [:project_feature, :group]
5555
},
5656
:author,
57-
::Gitlab::Issues::TypeAssociationGetter.call,
57+
:work_item_type,
5858
*super
5959
]
6060
end

app/graphql/resolvers/work_items/ancestors_resolver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def preload_resource_parents(work_items)
5757
end
5858

5959
def unconditional_includes
60-
[:namespace, :work_item_parent, ::Gitlab::Issues::TypeAssociationGetter.call]
60+
[:namespace, :work_item_parent, :work_item_type]
6161
end
6262
end
6363
end

app/models/issue.rb

+14-34
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def most_recent
143143
validates :work_item_type, presence: true
144144
validates :confidential, inclusion: { in: [true, false], message: 'must be a boolean' }
145145

146-
validate :allowed_work_item_type_change, on: :update, if: :correct_work_item_type_id_changed?
146+
validate :allowed_work_item_type_change, on: :update, if: :work_item_type_id_changed?
147147
validate :due_date_after_start_date, if: :validate_due_date?
148148
validate :parent_link_confidentiality
149149

@@ -207,7 +207,7 @@ def most_recent
207207

208208
scope :with_alert_management_alerts, -> { joins(:alert_management_alert) }
209209
scope :with_api_entity_associations, -> {
210-
preload(::Gitlab::Issues::TypeAssociationGetter.call,
210+
preload(:work_item_type,
211211
:timelogs, :closed_by, :assignees, :author, :issuable_severity,
212212
:labels, namespace: [{ parent: :route }, :route], milestone: { project: [:route, { namespace: :route }] },
213213
project: [:project_namespace, :project_feature, :route, { group: :route }, { namespace: :route }],
@@ -218,16 +218,16 @@ def most_recent
218218
types = Array(types)
219219

220220
# Using != 1 since we also want the guard clause to handle empty arrays
221-
return joins(:correct_work_item_type).where(work_item_types: { base_type: types }) if types.size != 1
221+
return joins(:work_item_type).where(work_item_types: { base_type: types }) if types.size != 1
222222

223223
# This optimization helps the planer use the correct indexes when filtering by a single type
224224
where(
225-
'"issues"."correct_work_item_type_id" = (?)',
226-
WorkItems::Type.by_type(types.first).select(:correct_id).limit(1)
225+
'"issues"."work_item_type_id" = (?)',
226+
WorkItems::Type.by_type(types.first).select(:id).limit(1)
227227
)
228228
}
229229
scope :without_issue_type, ->(types) {
230-
joins(::Gitlab::Issues::TypeAssociationGetter.call).where.not(work_item_types: { base_type: types })
230+
joins(:work_item_type).where.not(work_item_types: { base_type: types })
231231
}
232232

233233
scope :public_only, -> { where(confidential: false) }
@@ -242,10 +242,10 @@ def most_recent
242242

243243
scope :service_desk, -> {
244244
where(
245-
"(author_id = ? AND correct_work_item_type_id = ?) OR correct_work_item_type_id = ?",
245+
"(author_id = ? AND work_item_type_id = ?) OR work_item_type_id = ?",
246246
Users::Internal.support_bot.id,
247-
WorkItems::Type.default_issue_type.correct_id,
248-
WorkItems::Type.default_by_type(:ticket).correct_id
247+
WorkItems::Type.default_issue_type.id,
248+
WorkItems::Type.default_by_type(:ticket).id
249249
)
250250
}
251251
scope :inc_relations_for_view, -> do
@@ -277,7 +277,7 @@ def most_recent
277277
scope :with_projects_matching_search_data, -> { where('issue_search_data.project_id = issues.project_id') }
278278

279279
scope :with_work_item_type, -> {
280-
joins(::Gitlab::Issues::TypeAssociationGetter.call)
280+
joins(:work_item_type)
281281
}
282282

283283
before_validation :ensure_namespace_id, :ensure_work_item_type
@@ -359,30 +359,12 @@ def self.participant_includes
359359
[:assignees] + super
360360
end
361361

362-
# TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/499911
363-
def work_item_type
364-
correct_work_item_type
365-
end
366-
367-
# TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/499911
368-
def work_item_type_id
369-
correct_work_item_type&.id
370-
end
371-
372362
def work_item_type_id=(input_work_item_type_id)
373-
work_item_type = WorkItems::Type.find_by_correct_id_with_fallback(input_work_item_type_id)
374-
375-
self.correct_work_item_type_id = work_item_type&.correct_id
363+
work_item_type = WorkItems::Type.find_by_id_with_fallback(input_work_item_type_id)
376364

377365
super(work_item_type&.id)
378366
end
379367

380-
def work_item_type=(work_item_type)
381-
self.correct_work_item_type = work_item_type
382-
383-
super
384-
end
385-
386368
def next_object_by_relative_position(ignoring: nil, order: :asc)
387369
array_mapping_scope = ->(id_expression) do
388370
relation = Issue.where(Issue.arel_table[:project_id].eq(id_expression))
@@ -928,18 +910,16 @@ def ensure_namespace_id
928910
end
929911

930912
def ensure_work_item_type
931-
return if work_item_type.present? ||
932-
correct_work_item_type_id.present? ||
933-
correct_work_item_type_id_change&.last.present?
913+
return if work_item_type.present? || work_item_type_id.present? || work_item_type_id_change&.last.present?
934914

935915
self.work_item_type = WorkItems::Type.default_by_type(DEFAULT_ISSUE_TYPE)
936916
end
937917

938918
def allowed_work_item_type_change
939-
return unless changes[:correct_work_item_type_id]
919+
return unless changes[:work_item_type_id]
940920

941921
involved_types = WorkItems::Type.where(
942-
correct_id: changes[:correct_work_item_type_id].compact
922+
id: changes[:work_item_type_id].compact
943923
).pluck(:base_type).uniq
944924
disallowed_types = involved_types - WorkItems::Type::CHANGEABLE_BASE_TYPES
945925

0 commit comments

Comments
 (0)