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
75225239
Commit
75225239
authored
Nov 05, 2020
by
Furkan Ayhan
Committed by
Vitali Tatarintev
Nov 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor build/bridge codes by using processable
Here, we are moving same codes into processable
parent
3510277d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
21 deletions
+12
-21
lib/gitlab/ci/config/entry/bridge.rb
lib/gitlab/ci/config/entry/bridge.rb
+1
-10
lib/gitlab/ci/config/entry/job.rb
lib/gitlab/ci/config/entry/job.rb
+1
-10
lib/gitlab/ci/config/entry/processable.rb
lib/gitlab/ci/config/entry/processable.rb
+10
-1
No files found.
lib/gitlab/ci/config/entry/bridge.rb
View file @
75225239
...
...
@@ -18,7 +18,6 @@ module Gitlab
validates
:config
,
allowed_keys:
ALLOWED_KEYS
+
PROCESSABLE_ALLOWED_KEYS
with_options
allow_nil:
true
do
validates
:allow_failure
,
boolean:
true
validates
:when
,
inclusion:
{
in:
ALLOWED_WHEN
,
message:
"should be one of:
#{
ALLOWED_WHEN
.
join
(
', '
)
}
"
...
...
@@ -48,7 +47,7 @@ module Gitlab
inherit:
false
,
metadata:
{
allowed_needs:
%i[job bridge]
}
attributes
:when
,
:allow_failure
attributes
:when
def
self
.
matching?
(
name
,
config
)
!
name
.
to_s
.
start_with?
(
'.'
)
&&
...
...
@@ -60,14 +59,6 @@ module Gitlab
true
end
def
manual_action?
self
.
when
==
'manual'
end
def
ignored?
allow_failure
.
nil?
?
manual_action?
:
allow_failure
end
def
value
super
.
merge
(
trigger:
(
trigger_value
if
trigger_defined?
),
...
...
lib/gitlab/ci/config/entry/job.rb
View file @
75225239
...
...
@@ -24,7 +24,6 @@ module Gitlab
validates
:script
,
presence:
true
with_options
allow_nil:
true
do
validates
:allow_failure
,
boolean:
true
validates
:when
,
inclusion:
{
in:
ALLOWED_WHEN
,
message:
"should be one of:
#{
ALLOWED_WHEN
.
join
(
', '
)
}
"
...
...
@@ -118,7 +117,7 @@ module Gitlab
description:
'Parallel configuration for this job.'
,
inherit:
false
attributes
:script
,
:tags
,
:
allow_failure
,
:
when
,
:dependencies
,
attributes
:script
,
:tags
,
:when
,
:dependencies
,
:needs
,
:retry
,
:parallel
,
:start_in
,
:interruptible
,
:timeout
,
:resource_group
,
:release
...
...
@@ -141,18 +140,10 @@ module Gitlab
end
end
def
manual_action?
self
.
when
==
'manual'
end
def
delayed?
self
.
when
==
'delayed'
end
def
ignored?
allow_failure
.
nil?
?
manual_action?
:
allow_failure
end
def
value
super
.
merge
(
before_script:
before_script_value
,
...
...
lib/gitlab/ci/config/entry/processable.rb
View file @
75225239
...
...
@@ -32,6 +32,7 @@ module Gitlab
with_options
allow_nil:
true
do
validates
:extends
,
array_of_strings_or_string:
true
validates
:rules
,
array_of_hashes:
true
validates
:allow_failure
,
boolean:
true
end
end
...
...
@@ -64,7 +65,7 @@ module Gitlab
inherit:
false
,
default:
{}
attributes
:extends
,
:rules
attributes
:extends
,
:rules
,
:allow_failure
end
def
compose!
(
deps
=
nil
)
...
...
@@ -136,6 +137,14 @@ module Gitlab
root_variables
.
merge
(
variables_value
.
to_h
)
end
def
manual_action?
self
.
when
==
'manual'
end
def
ignored?
allow_failure
.
nil?
?
manual_action?
:
allow_failure
end
end
end
end
...
...
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