BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3a94919e
Commit
3a94919e
authored
May 16, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not allow to trigger manual actions that were skipped
parent
a78b1b27
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
build.rb
app/models/ci/build.rb
+1
-1
build_spec.rb
spec/models/ci/build_spec.rb
+40
-0
No files found.
app/models/ci/build.rb
View file @
3a94919e
...
...
@@ -184,7 +184,7 @@ module Ci
end
def
playable?
action?
&&
(
manual?
||
complet
e?
)
action?
&&
(
manual?
||
retryabl
e?
)
end
def
action?
...
...
spec/models/ci/build_spec.rb
View file @
3a94919e
...
...
@@ -1270,6 +1270,46 @@ describe Ci::Build do
end
end
describe
'#playable?'
do
context
'when build is a manual action'
do
context
'when build has been skipped'
do
subject
{
build_stubbed
(
:ci_build
,
:manual
,
status: :skipped
)
}
it
{
is_expected
.
not_to
be_playable
}
end
context
'when build has been canceled'
do
subject
{
build_stubbed
(
:ci_build
,
:manual
,
status: :canceled
)
}
it
{
is_expected
.
to
be_playable
}
end
context
'when build is successful'
do
subject
{
build_stubbed
(
:ci_build
,
:manual
,
status: :success
)
}
it
{
is_expected
.
to
be_playable
}
end
context
'when build has failed'
do
subject
{
build_stubbed
(
:ci_build
,
:manual
,
status: :failed
)
}
it
{
is_expected
.
to
be_playable
}
end
context
'when build is a manual untriggered action'
do
subject
{
build_stubbed
(
:ci_build
,
:manual
,
status: :manual
)
}
it
{
is_expected
.
to
be_playable
}
end
end
context
'when build is not a manual action'
do
subject
{
build_stubbed
(
:ci_build
,
:success
)
}
it
{
is_expected
.
not_to
be_playable
}
end
end
describe
'project settings'
do
describe
'#allow_git_fetch'
do
it
'return project allow_git_fetch configuration'
do
...
...
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