Commit 03e94951 authored by Alex Kalderimis's avatar Alex Kalderimis

Support attn alias for attention

Changelog: changed
parent e77715bc
......@@ -168,7 +168,7 @@ module QuickActions
next unless definition
definition.execute(self, arg)
usage_ping_tracking(name, arg)
usage_ping_tracking(definition.name, arg)
end
end
......@@ -186,7 +186,7 @@ module QuickActions
def usage_ping_tracking(quick_action_name, arg)
Gitlab::UsageDataCounters::QuickActionActivityUniqueCounter.track_unique_action(
quick_action_name,
quick_action_name.to_s,
args: arg&.strip,
user: current_user
)
......
......@@ -291,7 +291,7 @@ module Gitlab
parse_params do |attention_param|
extract_users(attention_param)
end
command :attention do |users|
command :attention, :attn do |users|
next if users.empty?
users.each do |user|
......
......@@ -726,6 +726,17 @@ RSpec.describe QuickActions::InterpretService do
expect(reviewer).to be_attention_requested
end
it 'supports attn alias' do
attn_cmd = content.gsub(/attention/, 'attn')
_, _, message = service.execute(attn_cmd, issuable)
expect(message).to eq("Requested attention from #{developer.to_reference}.")
reviewer.reload
expect(reviewer).to be_attention_requested
end
end
shared_examples 'remove attention command' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment