Merge pull request #947 from warpc/757-enable-extra-containers-for-main-platforms

[refs #757]: Enable extra containers for main platforms
This commit is contained in:
Vladimir Sharshov 2013-02-25 07:43:28 -08:00
commit bbc699cb6d
21 changed files with 223 additions and 116 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -10,13 +10,14 @@ $(document).ready(function() {
var all_repositories = $('.all_platforms input');
all_repositories.removeAttr('checked');
var use_save_to_repository = $('#build_list_use_save_to_repository');
var auto_create_container = $('#build_list_auto_create_container');
if (build_platform.size() == 0) {
$('#extra-repos-and-containers').slideDown();
all_repositories.removeAttr('disabled');
use_save_to_repository.removeAttr('disabled');
auto_create_container.removeAttr('checked');
} else {
$('#extra-repos-and-containers').slideUp();
updateExtraReposAndBuildLists();
use_save_to_repository.attr('disabled', 'disabled').attr('checked', 'checked');
all_repositories.attr('disabled', 'disabled');
var parent = build_platform.parent();
@ -32,39 +33,34 @@ $(document).ready(function() {
build_list_auto_publish.removeAttr('disabled').attr('checked', 'checked');
} else {
build_list_auto_publish.removeAttr('checked').attr('disabled', 'disabled');
auto_create_container.attr('checked', 'checked');
}
var path = '/build_lists/autocomplete_to_extra_repos_and_builds?platform_id=' + platform_id;
$('#extra_repos').attr('data-autocomplete', path);
});
$('#build_list_save_to_repository_id').trigger('change');
$('#extra-repos-and-containers #add').click(function() {
var id = $('#extra_repo_field').val();
if (id.length > 0) {
$.get("/build_lists/add_extra_repos_and_containers", { extra_id: id })
.done(function(data) {
$("#extra-repos-and-containers table tbody").append(data);
});
}
$('#extra-repos-and-build-lists #add').click(function() {
updateExtraReposAndBuildLists();
return false;
});
$(document).on('click', '#extra-repos-and-containers .delete', function() {
$(document).on('click', '#extra-repos-and-build-lists .delete', function() {
$(this)[0].parentElement.parentElement.remove();
});
function setBranchSelected(selected_option) {
var pl_name = selected_option.text().match(/([\w-.]+)\/[\w-.]+/)[1];
var bl_version_sel = $('#build_list_project_version');
var branch_pl_opt = bl_version_sel.find('option[value="' + pl_name + '"]');
// If there is branch we need - set it selected:
if (branch_pl_opt.size() > 0) {
bl_version_sel.find('option[selected]').removeAttr('selected');
branch_pl_opt.attr('selected', 'selected');
bl_version_sel.val(branch_pl_opt);
// hack for FF to force render of select box.
bl_version_sel[0].innerHTML = bl_version_sel[0].innerHTML;
}
}
$('#extra-repos-and-build-lists-dialog').dialog({
autoOpen: false,
resizable: false,
width: 500
});
$('#extra-repos-and-build-lists .icon-question-sign').click(function() {
var dialog = $('#extra-repos-and-build-lists-dialog');
if (dialog.is(':visible')) { dialog.dialog('close'); } else { dialog.dialog('open'); }
});
var ownership_btn = $('.btn.ownership');
ownership_btn.click(function() {
@ -100,3 +96,25 @@ $(document).ready(function() {
showButtonPanel: true
});
});
function updateExtraReposAndBuildLists() {
$.get("/build_lists/update_extra_repos_and_builds", $('#new_build_list').serialize())
.done(function(data) {
$("#extra-repos-and-build-lists table tbody").html(data);
});
}
function setBranchSelected(selected_option) {
var pl_name = selected_option.text().match(/([\w-.]+)\/[\w-.]+/)[1];
var bl_version_sel = $('#build_list_project_version');
var branch_pl_opt = bl_version_sel.find('option[value="' + pl_name + '"]');
// If there is branch we need - set it selected:
if (branch_pl_opt.size() > 0) {
bl_version_sel.find('option[selected]').removeAttr('selected');
branch_pl_opt.attr('selected', 'selected');
bl_version_sel.val(branch_pl_opt);
// hack for FF to force render of select box.
bl_version_sel[0].innerHTML = bl_version_sel[0].innerHTML;
}
}

View File

@ -1767,7 +1767,7 @@ table#myTable thead tr.search th form.button_to div input {
border: 1px solid #DDDDDD;
}
#extra-repos-and-containers {
#extra-repos-and-build-lists {
width: 330px;
.actions { width: 15px; }
}
@ -1821,3 +1821,15 @@ table#myTable thead tr.search th form.button_to div input {
float: right;
margin-left: 10px;
}
#extra-repos-and-build-lists {
width: 330px;
.actions { width: 15px; }
h3 { display: inline-block; }
}
#extra-repos-and-build-lists-dialog {
font-size: 12px;
text-align: left;
p { margin: 0; }
}

View File

@ -114,31 +114,33 @@ class Projects::BuildListsController < Projects::BaseController
}
end
def autocomplete_to_extra_repos_and_containers
platforms = Platform.includes(:repositories).search(params[:term]).
accessible_by(current_ability, :read).search_order.limit(5)
results = []
platforms.each{ |p| p.repositories.each{ |r| results << {:id => r.id, :label => "#{p.name}/#{r.name}", :value => "#{p.name}/#{r.name}"} } }
bl = BuildList.where(:id => params[:term]).published_container.
accessible_by(current_ability, :read).first
def autocomplete_to_extra_repos_and_builds
results, save_to_platform = [], Platform.find(params[:platform_id])
bl = BuildList.where(:id => params[:term]).published_container.accessible_by(current_ability, :read)
if save_to_platform.main?
bl = bl.where(:save_to_platform_id => save_to_platform.id)
else
platforms = Platform.includes(:repositories).search(params[:term]).
accessible_by(current_ability, :read).search_order.limit(5)
platforms.each{ |p| p.repositories.each{ |r| results << {:id => r.id, :label => "#{p.name}/#{r.name}", :value => "#{p.name}/#{r.name}"} } }
end
bl = bl.first
results << {:id => "#{bl.id}-build-list", :value => bl.id, :label => "#{bl.id} (#{bl.project.name} - #{bl.arch.name})"} if bl
render json: results.to_json
end
def add_extra_repos_and_containers
if params[:extra_id] =~ /-build-list$/
id = params[:extra_id].gsub(/-build-list$/, '')
subject = BuildList.where(:id => id).published_container
def update_extra_repos_and_builds
results, save_to_repository = [], Repository.find(params[:build_list][:save_to_repository_id])
extra_repos = params[:build_list][:extra_repositories] || []
extra_bls = params[:build_list][:extra_build_lists] || []
(params[:extra_repo].gsub!(/-build-list$/, '') ? extra_bls : extra_repos) << params[:extra_repo]
build_lists = BuildList.where(:id => extra_bls).published_container.accessible_by(current_ability, :read)
if save_to_repository.platform.main?
build_lists = build_lists.where(:save_to_platform_id => save_to_repository.platform_id)
else
subject = Repository.where(:id => params[:extra_id])
end
subject = subject.accessible_by(current_ability, :read).first
if subject
render :partial => 'extra', :locals => {:subject => subject}
else
render :nothing => true
results.concat Repository.where(:id => extra_repos).accessible_by(current_ability, :read)
end
render :partial => 'extra', :collection => results.concat(build_lists)
end
protected
@ -171,7 +173,7 @@ class Projects::BuildListsController < Projects::BaseController
end
if @build_list.save and @build_list.now_publish
if @build_list.save && @build_list.can_publish? && @build_list.now_publish
redirect_to :back, :notice => t('layout.build_lists.publish_success')
else
redirect_to :back, :notice => t('layout.build_lists.publish_fail')

View File

@ -85,6 +85,10 @@ module BuildListsHelper
p.html_safe
end
def can_publish_in_future?(bl)
[BuildList::SUCCESS, BuildList::FAILED_PUBLISH, BuildList::BUILD_PUBLISHED, BuildList::TESTS_FAILED].include?(bl.status)
end
def log_reload_time_options
t = I18n.t("layout.build_lists.log.reload_times").map { |i| i.reverse }

View File

@ -42,16 +42,15 @@ class BuildList < ActiveRecord::Base
validate lambda {
errors.add(:save_to_repository, I18n.t('flash.build_list.wrong_project')) unless save_to_repository.projects.exists?(project_id)
}
validate :check_extra_repositories, :on => :create
validate :check_extra_containers, :on => :create
before_validation :prepare_extra_repositories_and_containers, :on => :create
before_validation :prepare_extra_repositories, :on => :create
before_validation :prepare_extra_build_lists, :on => :create
before_create :use_save_to_repository_for_main_platforms
attr_accessible :include_repos, :auto_publish, :build_for_platform_id, :commit_hash,
:arch_id, :project_id, :save_to_repository_id, :update_type,
:save_to_platform_id, :project_version, :use_save_to_repository,
:auto_create_container, :extra_repositories, :extra_containers
:auto_create_container, :extra_repositories, :extra_build_lists
LIVE_TIME = 4.week # for unpublished
MAX_LIVE_TIME = 3.month # for published
@ -132,8 +131,8 @@ class BuildList < ActiveRecord::Base
serialize :additional_repos
serialize :include_repos
serialize :results, Array
serialize :extra_repositories, Array
serialize :extra_containers, Array
serialize :extra_repositories, Array
serialize :extra_build_lists, Array
after_commit :place_build
after_destroy :remove_container
@ -275,7 +274,7 @@ class BuildList < ActiveRecord::Base
end
def can_create_container?
(can_publish? || build_publish?) && [WAITING_FOR_RESPONSE, FAILED_PUBLISH].include?(container_status)
[SUCCESS, BUILD_PUBLISH, FAILED_PUBLISH, BUILD_PUBLISHED, TESTS_FAILED].include?(status) && [WAITING_FOR_RESPONSE, FAILED_PUBLISH].include?(container_status)
end
#TODO: Share this checking on product owner.
@ -284,11 +283,17 @@ class BuildList < ActiveRecord::Base
end
def can_publish?
[SUCCESS, FAILED_PUBLISH, BUILD_PUBLISHED, TESTS_FAILED].include? status
[SUCCESS, FAILED_PUBLISH, BUILD_PUBLISHED, TESTS_FAILED].include?(status) && extra_build_lists_published?
end
def extra_build_lists_published?
# All extra build lists should be published before publishing this build list for main platforms!
return true unless save_to_platform.main?
BuildList.where(:id => extra_build_lists).where('status != ?', BUILD_PUBLISHED).count == 0
end
def can_reject_publish?
can_publish? && !save_to_repository.publish_without_qa && !build_published?
[SUCCESS, FAILED_PUBLISH, TESTS_FAILED].include?(status) && !save_to_repository.publish_without_qa
end
def add_to_queue
@ -418,7 +423,7 @@ class BuildList < ActiveRecord::Base
end
end
host = EventLog.current_controller.request.host_with_port rescue ::Rosa::Application.config.action_mailer.default_url_options[:host]
BuildList.where(:id => extra_containers).each do |bl|
BuildList.where(:id => extra_build_lists).each do |bl|
path = "http://#{host}/downloads/#{bl.save_to_platform.name}/container/"
path << "#{bl.id}/#{bl.arch.name}/#{bl.save_to_repository.name}/release"
include_repos_hash["container_#{bl.id}"] = path
@ -476,28 +481,30 @@ class BuildList < ActiveRecord::Base
@current_ability ||= Ability.new(user)
end
def check_extra_repositories
if extra_repositories.present? && user
repos_count = Repository.where(:id => extra_repositories).
accessible_by(current_ability, :read).count
errors.add(:extra_repositories, I18n.t('flash.build_list.wrong_extra_repositories')) if repos_count != extra_repositories.count
def prepare_extra_repositories
if save_to_platform && save_to_platform.main?
self.extra_repositories = nil
else
self.extra_repositories = Repository.where(:id => extra_repositories).
accessible_by(current_ability, :read).pluck('repositories.id')
end
end
def check_extra_containers
if extra_containers.present? && user
bls_count = BuildList.where(:id => extra_containers).
published_container.accessible_by(current_ability, :read).count
errors.add(:extra_containers, I18n.t('flash.build_list.wrong_extra_containers')) if bls_count != extra_containers.count
end
end
def prepare_extra_build_lists
bls = BuildList.where(:id => extra_build_lists).published_container.accessible_by(current_ability, :read)
if save_to_platform && save_to_platform.main?
bls = bls.where(:save_to_platform_id => save_to_platform.id)
if save_to_platform.distrib_type == 'rhel'
bls = bls.where('
(build_lists.arch_id = ? AND projects.publish_i686_into_x86_64 is not true) OR
(projects.publish_i686_into_x86_64 is true)
', arch_id).joins(:project)
else
bls = bls.where(:arch_id => arch_id)
end
def prepare_extra_repositories_and_containers
if save_to_repository && save_to_repository.platform.main?
self.extra_repositories = self.extra_containers = nil
end
self.extra_repositories = extra_repositories.uniq if extra_repositories.present?
self.extra_containers = extra_containers.uniq if extra_containers.present?
self.extra_build_lists = bls.pluck('build_lists.id')
end
end

View File

@ -56,11 +56,11 @@ json.build_list do |json|
:json => json_extra_repos
end
extra_containers = BuildList.where(:id => @build_list.extra_containers)
json.extra_containers extra_containers do |json_extra_containers, bl|
json_extra_containers.(bl, :id, :status)
json_extra_containers.container_path container_url(false, bl)
json_extra_containers.url api_v1_build_list_path(bl, :format => :json)
extra_build_lists = BuildList.where(:id => @build_list.extra_build_lists)
json.extra_build_lists extra_build_lists do |json_extra_build_lists, bl|
json_extra_build_lists.(bl, :id, :status)
json_extra_build_lists.container_path container_url(false, bl)
json_extra_build_lists.url api_v1_build_list_path(bl, :format => :json)
end

View File

@ -1,9 +1,9 @@
%tr
- if subject.is_a?(BuildList)
%td= link_to "#{subject.id} (#{subject.project.name} - #{subject.arch.name})", subject
- if extra.is_a?(BuildList)
%td= link_to "#{extra.id} (#{extra.project.name} - #{extra.arch.name})", extra
- else
%td= link_to "#{subject.platform.name}/#{subject.name}", [subject.platform, subject]
%td= link_to "#{extra.platform.name}/#{extra.name}", [extra.platform, extra]
%td.actions
- field = subject.is_a?(BuildList) ? 'extra_containers' : 'extra_repositories'
= hidden_field_tag "build_list[#{field}][]", subject.id
- field = extra.is_a?(BuildList) ? 'extra_build_lists' : 'extra_repositories'
= hidden_field_tag "build_list[#{field}][]", extra.id
%span.delete &nbsp;

View File

@ -23,18 +23,32 @@
%h3= t("activerecord.attributes.build_list.update_type")
.lineForm= f.select :update_type, BuildList::UPDATE_TYPES
#extra-repos-and-containers
#extra-repos-and-build-lists
%h3= t("activerecord.attributes.build_list.extra_repos")
= autocomplete_field_tag 'extra_repos', nil, autocomplete_to_extra_repos_and_containers_build_lists_path, :id_element => '#extra_repo_field'
%span.icon-question-sign
%div#extra-repos-and-build-lists-dialog{:title => t("activerecord.attributes.build_list.extra_repos")}
%b= t('helpers.extra_repos_and_build_lists.header')
%br
%br
%b= t('helpers.extra_repos_and_build_lists.build_lists.header')
- (1..4).each do |index|
%p= t("helpers.extra_repos_and_build_lists.build_lists.message#{index}").html_safe
%br
%b= t('helpers.extra_repos_and_build_lists.repos.header')
%p= t('helpers.extra_repos_and_build_lists.repos.message1')
%br
%b= t('helpers.extra_repos_and_build_lists.repos.header2')
%p= t('helpers.extra_repos_and_build_lists.repos.message2')
%p= t('helpers.extra_repos_and_build_lists.repos.message3').html_safe
= autocomplete_field_tag 'extra_repos', nil, autocomplete_to_extra_repos_and_builds_build_lists_path, :id_element => '#extra_repo_field'
= hidden_field_tag 'extra_repo', nil, :id => 'extra_repo_field'
= submit_tag t("layout.add"), :class => 'button', :id => 'add'
%table.tablesorter{:cellpadding => "0", :cellspacing => "0"}
%tbody
- Repository.where(id: @build_list.extra_repositories).each do |repo|
= render 'extra', :subject => repo
- BuildList.where(id: @build_list.extra_containers).each do |bl|
= render 'extra', :subject => bl
= render :partial => 'extra', :collection => Repository.where(id: @build_list.extra_repositories)
= render :partial => 'extra', :collection => BuildList.where(id: @build_list.extra_build_lists)
%h3= t("activerecord.attributes.build_list.preferences")
- [:auto_publish, :auto_create_container, :use_save_to_repository].each do |kind|

View File

@ -72,12 +72,12 @@
.rightlist= t("layout.#{@build_list.new_core?}_")
.both
- if @build_list.extra_containers.present? || @build_list.extra_repositories.present?
- if @build_list.extra_build_lists.present? || @build_list.extra_repositories.present?
.leftlist= t("activerecord.attributes.build_list.extra_repos")
.rightlist
- Repository.where(:id => @build_list.extra_repositories).each do |repo|
%p= link_to "#{repo.platform.name}/#{repo.name}", [repo.platform, repo]
- BuildList.where(:id => @build_list.extra_containers).each do |bl|
- BuildList.where(:id => @build_list.extra_build_lists).each do |bl|
%p= link_to "#{bl.id} (#{bl.project.name} - #{bl.arch.name})", bl
.both
@ -151,11 +151,16 @@
- if can?(:publish, @build_list)
- if @build_list.build_published?
= submit_tag t("layout.publish_again"), :confirm => t("layout.publish_again_warning"), :name => 'publish'
- elsif @build_list.can_publish?
- confirm = @build_list.tests_failed? ? t('layout.build_lists.tests_failed') : t('layout.confirm')
= submit_tag t("layout.publish"), :confirm => confirm, :name => 'publish'
- if @build_list.can_reject_publish? && can?(:reject_publish, @build_list)
= submit_tag t("layout.reject_publish"), :confirm => t("layout.confirm"), :name => 'reject_publish'
- elsif can_publish_in_future?(@build_list)
- if @build_list.extra_build_lists_published?
- confirm = @build_list.tests_failed? ? t('layout.build_lists.tests_failed') : t('layout.confirm')
= submit_tag t("layout.publish"), :confirm => confirm, :name => 'publish'
- else
.flash_notify
.alert.alert-error= t('layout.build_lists.publish_with_extra_fail')
.both
- if @build_list.can_reject_publish? && can?(:reject_publish, @build_list)
= submit_tag t("layout.reject_publish"), :confirm => t("layout.confirm"), :name => 'reject_publish'
- if @build_list.can_create_container? && can?(:create_container, @build_list)
= link_to t("layout.build_lists.create_container"), create_container_build_list_path(@build_list),
:method => :put, :confirm => t("layout.confirm"), :class => 'button'

View File

@ -7,7 +7,7 @@ en:
build_list:
bs_id: Id
name: Name
extra_repos: Extra repositories and containers
extra_repos: Extra repositories and build lists
auto_create_container: Create container automatically
container_path: Container path
status: Status
@ -73,6 +73,7 @@ en:
create_container_fail: 'Errors during container creating!'
publish_success: 'Build is queued for publishing'
publish_fail: 'Errors during build publishing!'
publish_with_extra_fail: 'All extra build lists should be published before publishing this build list!'
cancel_success: 'Build canceled'
cancel_fail: 'Errors during build cancelation!'
reject_publish_success: 'Publishing rejected'
@ -150,6 +151,21 @@ en:
show_filter: Show filters
hide_filter: Hide filters
helpers:
extra_repos_and_build_lists:
header: 'Ability to attach at assembly additional sources of packages: repositories of platforms and packages of build lists.'
build_lists:
header: 'Requirements for attaching build lists:'
message1: '- only build list with container can be connected;'
message2: '- for main platform You can connect only build lists which destined for same platform;'
message3: '- only build lists with the same architecture will be connected or oriented to the both architectures (the property Publish i686 packages into x86_64 repository (only for rhel) in the settings of project is true).'
message4: '<i>Example: only build lists with x86_64 architecture will be connected to x86_64</i>'
repos:
header: 'Requirements for attaching repositories:'
message1: '- attaching repositories from other platform available only for build list into the personal platform.'
header2: 'How to attach a repository:'
message2: '- write the name of platform, choose repository from the list for attaching and click to "Add" button.'
message3: '<i>Example: correct input "uxteam_personal", wrong - "uxteam_personal/main".</i>'
flash:
build_list:
saved: Build list for project version '%{project_version}', platform '%{build_for_platform}' and architecture '%{arch}' has been created successfully
@ -166,5 +182,3 @@ en:
frozen_platform: In case of a repository for package storage with frozen platform allowed only bugfix and security updates
wrong_include_repos: Include repos have to belongs to build for platform
wrong_commit_hash: Unable find commit '%{commit_hash}' in project
wrong_extra_repositories: Some repositories does not exist
wrong_extra_containers: Some containers does not exist

View File

@ -7,7 +7,7 @@ ru:
build_list:
bs_id: Id
name: Название
extra_repos: Дополнительные репозитории и контейнеры
extra_repos: Дополнительные репозитории и сборки
auto_create_container: Создать контейнер автоматически
container_path: Путь до контейнера
status: Статус
@ -74,6 +74,7 @@ ru:
cancel_fail: 'При отмене сборки произошла ошибка!'
publish_success: 'Сборка поставлена в очередь на публикацию.'
publish_fail: 'При публикации сборки произошла ошибка!'
publish_with_extra_fail: 'Все дополнительные сборки должны быть опубликованы до публикации этой сборки!'
reject_publish_success: 'Публикация отклонена'
reject_publish_fail: 'Не удалось отклонить публикацию сборки'
container_published: 'Контейнер размещен в репозитории'
@ -149,6 +150,21 @@ ru:
show_filter: Показать фильтры
hide_filter: Скрыть фильтры
helpers:
extra_repos_and_build_lists:
header: 'Возможность подключить для сборки дополнительные источники пакетов: репозитории из платформ и пакеты из сборочных заданий.'
build_lists:
header: 'Требования для подключемых сборочных заданий:'
message1: '- только задание с контейнером может быть подключен;'
message2: '- для основных платформ возможно подключить только задания, которые предназначены для этой же платформы;'
message3: '- будут подключены только задания с архитектурой, соотвествующей создаваемой, или предназначененные для обеих архитектур (установлено свойство Публиковать i686 пакеты в x86_64 репозиторий (только для rhel) в настройках проекта).'
message4: '<i>Пример: для x86_64 архитектуры будут подключены только сборочные задания, собранные для x86_64</i>'
repos:
header: 'Требования для репозиториев:'
message1: '- использовать репозитории из других платформ возможно только для сборки в персональную платформу.'
header2: 'Как подключить репозиторий:'
message2: '- добавьте имя платформы, затем из списка выберете репозиторий для поключения и нажмите кнопку "Добавить".'
message3: '<i>Пример: правильно ввести "uxteam_personal", неправильно: "uxteam_personal/main".</i>'
flash:
build_list:
saved: Билд лист для версии '%{project_version}', платформы '%{build_for_platform}' и архитектуры '%{arch}' создан успешно
@ -165,5 +181,3 @@ ru:
frozen_platform: В случае выбора репозитория для сохранения пакетов из замороженнной платформы разрешены только bugfix и security обновления
wrong_include_repos: Включаемые репозитории должны принадлежать платформе для сборки
wrong_commit_hash: Невозможно найти коммит '%{commit_hash}' в проекте
wrong_extra_repositories: Некоторые репозитории не существуют
wrong_extra_containers: Некоторые контейнеры не существуют

View File

@ -221,8 +221,8 @@ Rosa::Application.routes.draw do
get :log
end
collection {
get :autocomplete_to_extra_repos_and_containers
get :add_extra_repos_and_containers
get :autocomplete_to_extra_repos_and_builds
get :update_extra_repos_and_builds
post :search
}
end

View File

@ -2,6 +2,6 @@ class AddExtraRepositoriesAndContainersToBuildList < ActiveRecord::Migration
def change
add_column :build_lists, :auto_create_container, :boolean, :default => false
add_column :build_lists, :extra_repositories, :text
add_column :build_lists, :extra_containers, :text
add_column :build_lists, :extra_containers, :text
end
end

View File

@ -0,0 +1,5 @@
class RenameExtraContainersIntoExtraBuildLists < ActiveRecord::Migration
def change
rename_column :build_lists, :extra_containers, :extra_build_lists
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130218135847) do
ActiveRecord::Schema.define(:version => 20130222112415) do
create_table "activity_feeds", :force => true do |t|
t.integer "user_id", :null => false
@ -136,7 +136,7 @@ ActiveRecord::Schema.define(:version => 20130218135847) do
t.boolean "use_save_to_repository", :default => true
t.boolean "auto_create_container", :default => false
t.text "extra_repositories"
t.text "extra_containers"
t.text "extra_build_lists"
end
add_index "build_lists", ["advisory_id"], :name => "index_build_lists_on_advisory_id"

View File

@ -17,7 +17,7 @@ module AbfWorker
case status
when COMPLETED
subject.build_success
subject.now_publish if subject.auto_publish?
subject.now_publish if subject.auto_publish? && subject.can_publish?
when FAILED
subject.build_error
item.update_attributes({:status => BuildList::BUILD_ERROR})

View File

@ -312,9 +312,7 @@ describe Projects::BuildListsController do
it 'should filter by project_name and update_date' do
get :index, :filter => {:project_name => @build_list3.project.name, :ownership => 'everything',
"updated_at_start(1i)" => @build_list3.updated_at.year.to_s,
"updated_at_start(2i)" => @build_list3.updated_at.month.to_s,
"updated_at_start(3i)" => @build_list3.updated_at.day.to_s}
"updated_at_start" => @build_list3.updated_at.strftime('%d/%m/%Y')}
assigns[:build_lists].should_not include(@build_list1)
assigns[:build_lists].should_not include(@build_list2)
assigns[:build_lists].should include(@build_list3)

View File

@ -10,7 +10,7 @@ describe Projects::Git::TreesController do
@another_user = FactoryGirl.create(:user)
@params = { :owner_name => @project.owner.uname,
:project_name => @project.name,
:treeish => "#{@project.owner.uname}-#{@project.name}-master"}
:treeish => "#{@project.name}-master"}
fill_project @project
end

View File

@ -815,3 +815,17 @@ a.badge:hover {
.badge-inverse[href] {
background-color: #1a1a1a;
}
[class^="icon-"], [class*=" icon-"] {
display: inline-block;
width: 14px;
height: 14px;
margin-top: 1px;
line-height: 14px;
vertical-align: text-top;
background-image: url("glyphicons-halflings.png");
background-position: 14px 14px;
background-repeat: no-repeat;
}
.icon-question-sign {
background-position: -96px -96px;
}