Skip to content

Commit 83b3564

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 6338012 commit 83b3564

File tree

14 files changed

+71
-95
lines changed

14 files changed

+71
-95
lines changed

app/assets/javascripts/projects/default_project_templates.js

+4
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,8 @@ export default {
137137
text: s__('ProjectTemplates|NIST 800-53r5'),
138138
icon: '.template-option .icon-gitlab_logo',
139139
},
140+
gitlab_components: {
141+
text: s__('ProjectTemplates|GitLab CI/CD components'),
142+
icon: '.template-option .icon-gitlab_logo',
143+
},
140144
};

app/services/notification_service.rb

+32-32
Original file line numberDiff line numberDiff line change
@@ -437,38 +437,6 @@ def new_note(note)
437437
send_service_desk_notification(note)
438438
end
439439

440-
def send_new_note_notifications(note)
441-
notify_method = "note_#{note.noteable_ability_name}_email".to_sym
442-
443-
recipients = NotificationRecipients::BuildService.build_new_note_recipients(note)
444-
recipients.each do |recipient|
445-
mailer.send(notify_method, recipient.user.id, note.id, recipient.reason).deliver_later
446-
end
447-
end
448-
449-
def send_service_desk_notification(note)
450-
return unless note.noteable_type == 'Issue'
451-
return if note.confidential
452-
return unless note.project && ::ServiceDesk.enabled?(note.project)
453-
454-
issue = note.noteable
455-
recipients = issue.issue_email_participants
456-
457-
return unless recipients.any?
458-
459-
# Only populated if note is from external participant
460-
note_external_author = note.note_metadata&.email_participant&.downcase
461-
462-
recipients.each do |recipient|
463-
# Don't send Service Desk notification if the recipient is the author of the note.
464-
# We store emails as-is but compare downcased versions.
465-
next if recipient.email.downcase == note_external_author
466-
467-
mailer.service_desk_new_note_email(issue.id, note.id, recipient).deliver_later
468-
Gitlab::Metrics::BackgroundTransaction.current&.add_event(:service_desk_new_note_email)
469-
end
470-
end
471-
472440
# Notify users when a new release is created
473441
def send_new_release_notifications(release)
474442
unless release.author&.can_trigger_notifications?
@@ -895,6 +863,38 @@ def mailer
895863

896864
private
897865

866+
def send_new_note_notifications(note)
867+
notify_method = "note_#{note.noteable_ability_name}_email".to_sym
868+
869+
recipients = NotificationRecipients::BuildService.build_new_note_recipients(note)
870+
recipients.each do |recipient|
871+
mailer.send(notify_method, recipient.user.id, note.id, recipient.reason).deliver_later
872+
end
873+
end
874+
875+
def send_service_desk_notification(note)
876+
return unless note.noteable_type == 'Issue'
877+
return if note.confidential
878+
return unless note.project && ::ServiceDesk.enabled?(note.project)
879+
880+
issue = note.noteable
881+
recipients = issue.issue_email_participants
882+
883+
return unless recipients.any?
884+
885+
# Only populated if note is from external participant
886+
note_external_author = note.note_metadata&.email_participant&.downcase
887+
888+
recipients.each do |recipient|
889+
# Don't send Service Desk notification if the recipient is the author of the note.
890+
# We store emails as-is but compare downcased versions.
891+
next if recipient.email.downcase == note_external_author
892+
893+
mailer.service_desk_new_note_email(issue.id, note.id, recipient).deliver_later
894+
Gitlab::Metrics::BackgroundTransaction.current&.add_event(:service_desk_new_note_email)
895+
end
896+
end
897+
898898
def owners_without_invites(project)
899899
recipients = project.members.active_without_invites_and_requests.owners
900900

app/services/todo_service.rb

+13-13
Original file line numberDiff line numberDiff line change
@@ -224,19 +224,6 @@ def resolve_todos_for_target(target, current_user)
224224
GraphqlTriggers.issuable_todo_updated(target)
225225
end
226226

227-
# Resolves all todos related to target for all users
228-
def resolve_todos_with_attributes_for_target(target, attributes, resolution: :done, resolved_by_action: :system_done)
229-
target_attributes = { target_id: target.id, target_type: target.class.polymorphic_name }
230-
attributes.merge!(target_attributes)
231-
attributes[:preload_user_association] = true
232-
233-
todos = PendingTodosFinder.new(attributes).execute
234-
users = todos.map(&:user)
235-
todos_ids = todos.batch_update(state: resolution, resolved_by_action: resolved_by_action)
236-
users.each(&:update_todos_count_cache)
237-
todos_ids
238-
end
239-
240227
def resolve_todos(todos, current_user, resolution: :done, resolved_by_action: :system_done)
241228
todos_ids = todos.batch_update(state: resolution, resolved_by_action: resolved_by_action, snoozed_until: nil)
242229

@@ -321,6 +308,19 @@ def create_review_submitted_todo(target, review_author)
321308

322309
private
323310

311+
# Resolves all todos related to target for all users
312+
def resolve_todos_with_attributes_for_target(target, attributes, resolution: :done, resolved_by_action: :system_done)
313+
target_attributes = { target_id: target.id, target_type: target.class.polymorphic_name }
314+
attributes.merge!(target_attributes)
315+
attributes[:preload_user_association] = true
316+
317+
todos = PendingTodosFinder.new(attributes).execute
318+
users = todos.map(&:user)
319+
todos_ids = todos.batch_update(state: resolution, resolved_by_action: resolved_by_action)
320+
users.each(&:update_todos_count_cache)
321+
todos_ids
322+
end
323+
324324
def create_todos(users, attributes, namespace, project)
325325
users = Array(users)
326326

bin/secpick

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ module Secpick
195195
[
196196
"-o mr.create",
197197
"-o mr.target='#{stable_branch}'",
198-
"-o mr.description='Please apply Security Release template. /milestone %#{milestone}'"
198+
"-o mr.description='Please apply Security Release template.\\n/milestone %#{milestone}'"
199199
]
200200
end
201201

data/deprecations/15-9-insecure-ci-job-token.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
scope: project # Can be one or a combination of: [instance, group, project]
1111
reporter: jocelynjane # (required) GitLab username of the person reporting the deprecation
1212
stage: Software Supply Chain Security # (required) String value of the stage that the feature was created in. e.g., Growth
13-
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/383084 # (required) Link to the deprecation issue in GitLab
13+
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/395708 # (required) Link to the deprecation issue in GitLab
1414
check_impact: Refer to the [Understanding this change](https://gitlab.com/gitlab-org/gitlab/-/issues/395708#understanding-this-change) section for details.
1515
body: | # (required) Do not modify this line, instead modify the lines below.
1616
In GitLab 14.4, we introduced a setting to [limit access _from_ your project's CI/CD job tokens (`CI_JOB_TOKEN`)](https://docs.gitlab.com/ci/jobs/ci_job_token/#limit-your-projects-job-token-access) to make it more secure.

db/docs/batched_background_migrations/backfill_missing_namespace_id_on_notes.yml

-9
This file was deleted.

doc/update/deprecations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ This migration tool will be removed in GitLab 18.3.
13291329

13301330
- Announced in GitLab <span class="milestone">15.9</span>
13311331
- Removal in GitLab <span class="milestone">18.0</span> ([breaking change](https://docs.gitlab.com/update/terminology/#breaking-change))
1332-
- To discuss this change or learn more, see the [deprecation issue](https://gitlab.com/gitlab-org/gitlab/-/issues/383084).
1332+
- To discuss this change or learn more, see the [deprecation issue](https://gitlab.com/gitlab-org/gitlab/-/issues/395708).
13331333

13341334
</div>
13351335

lib/gitlab/project_template.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def localized_templates_table
8585
ProjectTemplate.new('kotlin_native_linux', 'Kotlin Native Linux', _('A basic template for developing Linux programs using Kotlin Native'), 'https://gitlab.com/gitlab-org/project-templates/kotlin-native-linux'),
8686
ProjectTemplate.new('typo3_distribution', 'TYPO3 Distribution', _('A template for starting a new TYPO3 project'), 'https://gitlab.com/gitlab-org/project-templates/typo3-distribution', 'illustrations/logos/typo3.svg'),
8787
ProjectTemplate.new('laravel', 'Laravel Framework', _('A basic folder structure of a Laravel application, to help you get started.'), 'https://gitlab.com/gitlab-org/project-templates/laravel', 'illustrations/logos/laravel.svg'),
88-
ProjectTemplate.new('nist_80053r5', 'NIST 800-53r5', _('A project containing issues for security and privacy controls published by the U.S. National Institute of Standards and Technology'), 'https://gitlab.com/gitlab-org/project-templates/nist_80053r5')
88+
ProjectTemplate.new('nist_80053r5', 'NIST 800-53r5', _('A project containing issues for security and privacy controls published by the U.S. National Institute of Standards and Technology'), 'https://gitlab.com/gitlab-org/project-templates/nist_80053r5'),
89+
ProjectTemplate.new('gitlab_components', 'GitLab CI/CD components', _('A basic folder structure and sample files for a CI/CD components project.'), 'https://gitlab.com/gitlab-org/project-templates/gitlab-component-template')
8990
]
9091
end
9192
# rubocop:enable Metrics/AbcSize

locale/gitlab.pot

+6
Original file line numberDiff line numberDiff line change
@@ -2134,6 +2134,9 @@ msgstr ""
21342134
msgid "A Let's Encrypt SSL certificate can not be obtained until your domain is verified."
21352135
msgstr ""
21362136

2137+
msgid "A basic folder structure and sample files for a CI/CD components project."
2138+
msgstr ""
2139+
21372140
msgid "A basic folder structure of a Laravel application, to help you get started."
21382141
msgstr ""
21392142

@@ -48142,6 +48145,9 @@ msgstr ""
4814248145
msgid "ProjectTemplates|Android"
4814348146
msgstr ""
4814448147

48148+
msgid "ProjectTemplates|GitLab CI/CD components"
48149+
msgstr ""
48150+
4814548151
msgid "ProjectTemplates|GitLab Cluster Management"
4814648152
msgstr ""
4814748153

qa/Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ gem 'capybara', '~> 3.40.0'
1111
gem 'capybara-screenshot', '~> 1.0.26'
1212
gem 'rake', '~> 13', '>= 13.2.1'
1313
gem 'rspec', '~> 3.13'
14-
gem 'selenium-webdriver', '= 4.31.0'
14+
gem 'selenium-webdriver', '= 4.32.0'
1515
gem 'rest-client', '~> 2.1.0'
1616
gem 'rspec_junit_formatter', '~> 0.6.0'
1717
gem 'faker', '~> 3.5', '>= 3.5.1'

qa/Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ GEM
316316
addressable (>= 2.3.5)
317317
faraday (>= 0.17.3, < 3)
318318
securerandom (0.4.1)
319-
selenium-webdriver (4.31.0)
319+
selenium-webdriver (4.32.0)
320320
base64 (~> 0.2)
321321
logger (~> 1.4)
322322
rexml (~> 3.2, >= 3.2.5)
@@ -401,7 +401,7 @@ DEPENDENCIES
401401
rspec-parameterized (~> 1.0.2)
402402
rspec_junit_formatter (~> 0.6.0)
403403
ruby-debug-ide (~> 0.7.5)
404-
selenium-webdriver (= 4.31.0)
404+
selenium-webdriver (= 4.32.0)
405405
slack-notifier (~> 2.4)
406406
terminal-table (~> 4.0.0)
407407
warning (~> 1.5)

spec/services/todo_service_spec.rb

+7-33
Original file line numberDiff line numberDiff line change
@@ -375,39 +375,6 @@
375375
end
376376
end
377377

378-
describe '#resolve_todos_with_attributes_for_target' do
379-
it 'marks related pending todos to the target for all the users as done' do
380-
first_todo = create(:todo, :assigned, user: member, project: project, target: issue, author: author)
381-
second_todo = create(:todo, :review_requested, user: john_doe, project: project, target: issue, author: author)
382-
another_todo = create(:todo, :assigned, user: john_doe, project: project, target: project, author: author)
383-
384-
service.resolve_todos_with_attributes_for_target(issue, {})
385-
386-
expect(first_todo.reload).to be_done
387-
expect(second_todo.reload).to be_done
388-
expect(another_todo.reload).to be_pending
389-
end
390-
391-
it 'marks related only filtered pending todos to the target for all the users as done' do
392-
first_todo = create(:todo, :assigned, user: member, project: project, target: issue, author: author)
393-
second_todo = create(:todo, :review_requested, user: john_doe, project: project, target: issue, author: author)
394-
another_todo = create(:todo, :assigned, user: john_doe, project: project, target: project, author: author)
395-
396-
service.resolve_todos_with_attributes_for_target(issue, { action: Todo::ASSIGNED })
397-
398-
expect(first_todo.reload).to be_done
399-
expect(second_todo.reload).to be_pending
400-
expect(another_todo.reload).to be_pending
401-
end
402-
403-
it 'fetches the pending todos with users preloaded' do
404-
expect(PendingTodosFinder).to receive(:new)
405-
.with(a_hash_including(preload_user_association: true)).and_call_original
406-
407-
service.resolve_todos_with_attributes_for_target(issue, { action: Todo::ASSIGNED })
408-
end
409-
end
410-
411378
describe '#new_note' do
412379
let!(:first_todo) { create(:todo, :assigned, user: john_doe, project: project, target: issue, author: author) }
413380
let!(:second_todo) { create(:todo, :assigned, user: john_doe, project: project, target: issue, author: author) }
@@ -1512,6 +1479,13 @@
15121479
expect(another_pending_todo.reload).to be_pending
15131480
expect(another_project_todo.reload).to be_pending
15141481
end
1482+
1483+
it 'fetches the pending todos with users preloaded' do
1484+
expect(PendingTodosFinder).to receive(:new)
1485+
.with(a_hash_including(preload_user_association: true)).and_call_original
1486+
1487+
service.resolve_access_request_todos(project_requester)
1488+
end
15151489
end
15161490

15171491
describe '#restore_todo' do

spec/support/helpers/project_template_test_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def all_templates
1010
serverless_framework tencent_serverless_framework
1111
jsonnet cluster_management kotlin_native_linux
1212
pelican bridgetown typo3_distribution laravel
13-
nist_80053r5
13+
nist_80053r5 gitlab_components
1414
]
1515
end
1616
end
Binary file not shown.

0 commit comments

Comments
 (0)