Skip to content

Commit ceb2a76

Browse files
committed
Merge branch 'fix/gb/improve-manual-action-tooltips' into 'master'
Fix running manual action tooltip Closes #41418 See merge request gitlab-org/gitlab-ce!16489
2 parents 73cb6c3 + 6cdc711 commit ceb2a76

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Fix tooltip displayed for running manual actions
3+
merge_request: 16489
4+
author:
5+
type: fixed

lib/gitlab/ci/status/build/action.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ module Gitlab
22
module Ci
33
module Status
44
module Build
5+
##
6+
# Extended status for playable manual actions.
7+
#
58
class Action < Status::Extended
69
def label
710
if has_action?
@@ -12,7 +15,7 @@ def label
1215
end
1316

1417
def self.matches?(build, user)
15-
build.action?
18+
build.playable?
1619
end
1720
end
1821
end

spec/lib/gitlab/ci/status/build/action_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@
3737
describe '.matches?' do
3838
subject { described_class.matches?(build, user) }
3939

40-
context 'when build is an action' do
41-
let(:build) { create(:ci_build, :manual) }
40+
context 'when build is playable action' do
41+
let(:build) { create(:ci_build, :playable) }
4242

4343
it 'is a correct match' do
4444
expect(subject).to be true
4545
end
4646
end
4747

48-
context 'when build is not manual' do
49-
let(:build) { create(:ci_build) }
48+
context 'when build is not playable action' do
49+
let(:build) { create(:ci_build, :non_playable) }
5050

5151
it 'does not match' do
5252
expect(subject).to be false

0 commit comments

Comments
 (0)