Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Fixed builds for specific runners #488

Merged
merged 1 commit into from Jan 12, 2015
Merged

Fixed builds for specific runners #488

merged 1 commit into from Jan 12, 2015

Conversation

ayufan
Copy link
Member

@ayufan ayufan commented Oct 30, 2014

Don't run projects which are assigned to specific runner by shared runner.

@dzaporozhets
Copy link
Member

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.
But If we want to change behaviour in this way we need next:

  • CHANGELOG entry
  • Place in UI where I can see that my project wont be served by shared runners
  • Runner UI should say that specific runners lock project from shared runners
  • tests for your change

@ayufan
Copy link
Member Author

ayufan commented Oct 30, 2014

It seems reasonable.

@ayufan
Copy link
Member Author

ayufan commented Oct 30, 2014

I thought that specific runners are there to limit where projects can be run. I would expect project to run only on selected runner. It maybe useful in cases where server can deploy application to production servers.

Maybe we can even extend it to support specific runners per-branch basis. For example master is always executed on the selected one. I think that I saw somewhere PR for that.

@dzaporozhets
Copy link
Member

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 specific runners are there to limit where projects can be run are bigger. Still this can be a breaking change for someone. So it should be properly described in UI and has CHANGELOG item

@@ -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)

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]

@ayufan
Copy link
Member Author

ayufan commented Nov 10, 2014

@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(", ")}.
Copy link
Member

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.

@dzaporozhets
Copy link
Member

@ayufan I left some feedback. Also fix houndci comment please

@ayufan
Copy link
Member Author

ayufan commented Nov 17, 2014

@randx I addressed all the comments.

@dzaporozhets
Copy link
Member

@ayufan thank you

@ayufan
Copy link
Member Author

ayufan commented Jan 2, 2015

@randx @vsizov any update?

@@ -23,10 +23,10 @@
%ul
%li
%span.label.label-success shared
\- run any builds
\- run builds from all non-assigned projects
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-assigned -> unassigned

@dblessing
Copy link
Member

@ayufan This looks nice. I made a few comments on grammar.

@ayufan
Copy link
Member Author

ayufan commented Jan 2, 2015

@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
Copy link
Member

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.

@ayufan
Copy link
Member Author

ayufan commented Jan 2, 2015

Fixed once again :)

@dblessing
Copy link
Member

Cool, great work. Thanks.

@dzaporozhets
Copy link
Member

@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(", ")
Copy link
Contributor

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

@ayufan
Copy link
Member Author

ayufan commented Jan 8, 2015

@vsizov updated

@ayufan
Copy link
Member Author

ayufan commented Jan 12, 2015

@vsizov ?

vsizov added a commit that referenced this pull request Jan 12, 2015
Fixed builds for specific runners
@vsizov vsizov merged commit 8aaab14 into gitlabhq:master Jan 12, 2015
@ayufan ayufan deleted the topic/shared-runners branch January 19, 2015 10:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
5 participants