Conversation
Old one is expected behaviour. So this looks like a feature/improvement. It makes sense for me if your project requires super-specific ENV so you cant allow other runners to serve your build. So feature looks reasonable.
|
It seems reasonable. |
I thought that Maybe we can even extend it to support specific runners per-branch basis. For example |
We introduced specific runners so people can add own laptop/server/vps as runner for own projects only. Ex. I used this to extend build capacity for my fork in one instance. But advantages of |
@@ -15,8 +15,11 @@ class Builds < Grape::API | |||
|
|||
ActiveRecord::Base.transaction do | |||
build = if current_runner.shared? | |||
Build.first_pending | |||
# don't run projects which are assigned to specific runners | |||
projects = RunnerProject.distinct(:project).pluck(:project_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
@randx it's updated. What do you think? |
This project uses | ||
%span.label.label-info specific | ||
runner. | ||
Builds will be run only by #{@project.runners.each.map { |r| "#" + r.id.to_s }.join(", ")}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move logic like @project.runners.each.map { |r| "#" + r.id.to_s }.join(", ")
to helper.
@ayufan I left some feedback. Also fix houndci comment please |
@randx I addressed all the comments. |
@ayufan thank you |
@@ -23,10 +23,10 @@ | |||
%ul | |||
%li | |||
%span.label.label-success shared | |||
\- run any builds | |||
\- run builds from all non-assigned projects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-assigned -> unassigned
@ayufan This looks nice. I made a few comments on grammar. |
@dblessing Thanks. Fixed. |
%p If you want runner to build only specific projects you just need to enable them in table below | ||
- else | ||
.bs-callout.bs-callout-info | ||
%h4 This runner will process build only from ASSIGNED projects | ||
%p If you want runner to build all projects you just need to disable all assignee projects | ||
%p If you want runner to build non assigned projects you just need to disable all assignee projects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, missed this non-assigned
.
Fixed once again :) |
Cool, great work. Thanks. |
@vsizov can you review this please? |
@@ -22,4 +22,16 @@ def html_badge_code(project, ref) | |||
url = status_project_url(project, ref: ref, format: 'png') | |||
"<a href='#{project_url(project, ref: ref)}'><img src='#{url}' /></a>" | |||
end | |||
|
|||
def runners_for_project(project) | |||
project.runners.each.map { |r| "#" + r.id.to_s }.join(", ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove each
from here
@vsizov updated |
@vsizov ? |
Fixed builds for specific runners
Don't run projects which are assigned to specific runner by shared runner.