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
d8dd25a6
Commit
d8dd25a6
authored
Apr 30, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce Project#all_runners and use in Ci::UpdateBuildQueueService
parent
dad35d62
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
app/models/project.rb
app/models/project.rb
+6
-3
app/services/ci/update_build_queue_service.rb
app/services/ci/update_build_queue_service.rb
+1
-9
No files found.
app/models/project.rb
View file @
d8dd25a6
...
@@ -1304,10 +1304,13 @@ class Project < ActiveRecord::Base
...
@@ -1304,10 +1304,13 @@ class Project < ActiveRecord::Base
@group_runners
||=
group_runners_enabled?
?
Ci
::
Runner
.
belonging_to_parent_group_of_project
(
self
.
id
)
:
Ci
::
Runner
.
none
@group_runners
||=
group_runners_enabled?
?
Ci
::
Runner
.
belonging_to_parent_group_of_project
(
self
.
id
)
:
Ci
::
Runner
.
none
end
end
def
all_runners
union
=
Gitlab
::
SQL
::
Union
.
new
([
runners
,
group_runners
,
shared_runners
])
Ci
::
Runner
.
from
(
"(
#{
union
.
to_sql
}
) ci_runners"
)
end
def
any_runners?
(
&
block
)
def
any_runners?
(
&
block
)
union
=
Gitlab
::
SQL
::
Union
.
new
([
runners
,
shared_runners
,
group_runners
])
all_runners
.
active
.
any?
(
&
block
)
runners
=
Ci
::
Runner
.
from
(
"(
#{
union
.
to_sql
}
) ci_runners"
).
active
runners
.
any?
(
&
block
)
end
end
def
valid_runners_token?
(
token
)
def
valid_runners_token?
(
token
)
...
...
app/services/ci/update_build_queue_service.rb
View file @
d8dd25a6
module
Ci
module
Ci
class
UpdateBuildQueueService
class
UpdateBuildQueueService
def
execute
(
build
)
def
execute
(
build
)
tick_for
(
build
,
build
.
project
.
runners
)
tick_for
(
build
,
build
.
project
.
all_runners
)
if
build
.
project
.
group_runners_enabled?
tick_for
(
build
,
Ci
::
Runner
.
belonging_to_parent_group_of_project
(
build
.
project_id
))
end
if
build
.
project
.
shared_runners_enabled?
tick_for
(
build
,
Ci
::
Runner
.
shared
)
end
end
end
private
private
...
...
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