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
61dbbbff
Commit
61dbbbff
authored
Jun 17, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-06-17
parents
e14c0331
937c1b5b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
9 deletions
+23
-9
app/services/ci/register_job_service.rb
app/services/ci/register_job_service.rb
+5
-7
changelogs/unreleased/optimise-paused-runners.yml
changelogs/unreleased/optimise-paused-runners.yml
+5
-0
changelogs/unreleased/remove-ci_job_request_with_tags_matcher.yml
...gs/unreleased/remove-ci_job_request_with_tags_matcher.yml
+5
-0
lib/api/runner.rb
lib/api/runner.rb
+5
-1
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+3
-1
No files found.
app/services/ci/register_job_service.rb
View file @
61dbbbff
...
@@ -27,14 +27,12 @@ module Ci
...
@@ -27,14 +27,12 @@ module Ci
valid
=
true
valid
=
true
if
Feature
.
enabled?
(
'ci_job_request_with_tags_matcher'
)
# pick builds that does not have other tags than runner's one
# pick builds that does not have other tags than runner's one
builds
=
builds
.
matches_tag_ids
(
runner
.
tags
.
ids
)
builds
=
builds
.
matches_tag_ids
(
runner
.
tags
.
ids
)
# pick builds that have at least one tag
# pick builds that have at least one tag
unless
runner
.
run_untagged?
unless
runner
.
run_untagged?
builds
=
builds
.
with_any_tags
builds
=
builds
.
with_any_tags
end
end
end
builds
.
find
do
|
build
|
builds
.
find
do
|
build
|
...
...
changelogs/unreleased/optimise-paused-runners.yml
0 → 100644
View file @
61dbbbff
---
title
:
Optimise paused runners to reduce amount of used requests
merge_request
:
author
:
type
:
performance
changelogs/unreleased/remove-ci_job_request_with_tags_matcher.yml
0 → 100644
View file @
61dbbbff
---
title
:
Remove the ci_job_request_with_tags_matcher
merge_request
:
author
:
type
:
performance
lib/api/runner.rb
View file @
61dbbbff
...
@@ -84,7 +84,11 @@ module API
...
@@ -84,7 +84,11 @@ module API
end
end
post
'/request'
do
post
'/request'
do
authenticate_runner!
authenticate_runner!
no_content!
unless
current_runner
.
active?
unless
current_runner
.
active?
header
'X-GitLab-Last-Update'
,
current_runner
.
ensure_runner_queue_value
break
no_content!
end
if
current_runner
.
runner_queue_value_latest?
(
params
[
:last_update
])
if
current_runner
.
runner_queue_value_latest?
(
params
[
:last_update
])
header
'X-GitLab-Last-Update'
,
params
[
:last_update
]
header
'X-GitLab-Last-Update'
,
params
[
:last_update
]
...
...
spec/requests/api/runner_spec.rb
View file @
61dbbbff
...
@@ -356,11 +356,13 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
...
@@ -356,11 +356,13 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
context
'when valid token is provided'
do
context
'when valid token is provided'
do
context
'when Runner is not active'
do
context
'when Runner is not active'
do
let
(
:runner
)
{
create
(
:ci_runner
,
:inactive
)
}
let
(
:runner
)
{
create
(
:ci_runner
,
:inactive
)
}
let
(
:update_value
)
{
runner
.
ensure_runner_queue_value
}
it
'returns 204 error'
do
it
'returns 204 error'
do
request_job
request_job
expect
(
response
).
to
have_gitlab_http_status
204
expect
(
response
).
to
have_gitlab_http_status
(
204
)
expect
(
response
.
header
[
'X-GitLab-Last-Update'
]).
to
eq
(
update_value
)
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