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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
8d5d6ada
Commit
8d5d6ada
authored
May 23, 2018
by
Kamil Trzciński
Committed by
Dylan Griffith
May 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix weird Rails bug that leads to `runner_id=null` in SQL query
parent
051f385e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
app/services/ci/register_job_service.rb
app/services/ci/register_job_service.rb
+1
-1
spec/services/ci/register_job_service_spec.rb
spec/services/ci/register_job_service_spec.rb
+2
-6
No files found.
app/services/ci/register_job_service.rb
View file @
8d5d6ada
...
...
@@ -90,7 +90,7 @@ module Ci
def
builds_for_group_runner
# Workaround for weird Rails bug, that makes `runner.groups.to_sql` to return `runner_id = NULL`
groups
=
Group
.
joins
(
:runner_namespaces
).
merge
(
runner
.
runner_namespaces
)
groups
=
Group
.
joins
(
:runner_namespaces
).
where
(
runner_namespaces:
{
runner_id:
runner
}
)
hierarchy_groups
=
Gitlab
::
GroupHierarchy
.
new
(
groups
).
base_and_descendants
projects
=
Project
.
where
(
namespace_id:
hierarchy_groups
)
.
with_group_runners_enabled
...
...
spec/services/ci/register_job_service_spec.rb
View file @
8d5d6ada
...
...
@@ -5,15 +5,11 @@ module Ci
set
(
:group
)
{
create
(
:group
)
}
set
(
:project
)
{
create
(
:project
,
group:
group
,
shared_runners_enabled:
false
,
group_runners_enabled:
false
)
}
set
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let!
(
:shared_runner
)
{
create
(
:ci_runner
,
is_shared:
tru
e
)
}
let!
(
:specific_runner
)
{
create
(
:ci_runner
,
is_shared:
false
)
}
let!
(
:shared_runner
)
{
create
(
:ci_runner
,
:instanc
e
)
}
let!
(
:specific_runner
)
{
create
(
:ci_runner
,
:project
,
projects:
[
project
]
)
}
let!
(
:group_runner
)
{
create
(
:ci_runner
,
:group
,
groups:
[
group
])
}
let!
(
:pending_job
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
before
do
specific_runner
.
assign_to
(
project
)
end
describe
'#execute'
do
context
'runner follow tag list'
do
it
"picks build with the same tag"
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