Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8110c54a
Commit
8110c54a
authored
Feb 09, 2022
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore ability to assign groups
parent
b1072b3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
app/services/quick_actions/interpret_service.rb
app/services/quick_actions/interpret_service.rb
+1
-1
ee/spec/services/quick_actions/interpret_service_spec.rb
ee/spec/services/quick_actions/interpret_service_spec.rb
+19
-0
No files found.
app/services/quick_actions/interpret_service.rb
View file @
8110c54a
...
@@ -85,7 +85,7 @@ module QuickActions
...
@@ -85,7 +85,7 @@ module QuickActions
end
end
end
end
failed_parse
(
format
(
_
(
"Failed to find users for '%{params}'"
),
params:
params
))
unless
users
.
size
==
args
.
size
failed_parse
(
format
(
_
(
"Failed to find users for '%{params}'"
),
params:
params
))
if
users
.
size
<
args
.
size
users
users
end
end
...
...
ee/spec/services/quick_actions/interpret_service_spec.rb
View file @
8110c54a
...
@@ -132,6 +132,25 @@ RSpec.describe QuickActions::InterpretService do
...
@@ -132,6 +132,25 @@ RSpec.describe QuickActions::InterpretService do
expect
(
updates
[
:assignee_ids
]).
to
match_array
([
user
.
id
,
user2
.
id
])
expect
(
updates
[
:assignee_ids
]).
to
match_array
([
user
.
id
,
user2
.
id
])
end
end
context
'assign command with a group of users'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
let
(
:group_members
)
{
create_list
(
:user
,
3
)
}
let
(
:command
)
{
"/assign
#{
group
.
to_reference
}
"
}
before
do
group_members
.
each
{
group
.
add_developer
(
_1
)
}
end
it
'asssigns all group members'
do
merge_request
.
update!
(
assignee_ids:
[
user
.
id
])
_
,
updates
=
service
.
execute
(
command
,
merge_request
)
expect
(
updates
[
:assignee_ids
]).
to
match_array
([
user
.
id
]
+
group_members
.
map
(
&
:id
))
end
end
context
'assign command with multiple assignees'
do
context
'assign command with multiple assignees'
do
it
'fetches assignee and populates assignee_ids if content contains /assign'
do
it
'fetches assignee and populates assignee_ids if content contains /assign'
do
merge_request
.
update!
(
assignee_ids:
[
user
.
id
])
merge_request
.
update!
(
assignee_ids:
[
user
.
id
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment