diff --git a/Gemfile b/Gemfile index f84548a16..bb35d23f6 100644 --- a/Gemfile +++ b/Gemfile @@ -12,14 +12,9 @@ gem 'pundit' gem 'paperclip' gem 'sinatra', :require => nil gem 'sidekiq' -gem 'kiqit' +gem 'kiqit', :git => 'https://github.com/DuratarskeyK/kiqit.git' gem 'sidekiq-scheduler', '~> 2.0' gem 'sidekiq-failures' -#gem 'resque' -#gem 'resque-status' -#gem 'resque_mailer' -#gem 'resque-scheduler', '~>2.5.4' -#gem 'perform_later', git: 'git://github.com/KensoDev/perform_later.git' # should be after resque_mailer gem 'russian' gem 'state_machines-activerecord' gem 'redis-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 717230cc4..9fca7c552 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/activeadmin/activeadmin.git - revision: cce908d9793ba1fce8483afe5e4112f97d7d0857 + revision: 1b5c9259c4cfe183039498e0e1eb2c6c146d2273 specs: activeadmin (1.0.0.pre2) arbre (~> 1.0, >= 1.0.2) @@ -17,6 +17,14 @@ GIT sass-rails sprockets (< 4) +GIT + remote: https://github.com/DuratarskeyK/kiqit.git + revision: 5ce2a3b3857ffe276e2a3e7929f12e73ff35b9c4 + specs: + kiqit (2.4.0) + activerecord + sidekiq + GEM remote: https://rubygems.org/ remote: https://rails-assets.org/ @@ -59,7 +67,7 @@ GEM addressable (2.4.0) airbrake (5.3.0) airbrake-ruby (~> 1.3) - airbrake-ruby (1.3.1) + airbrake-ruby (1.3.2) angular-i18n (0.1.2) angular-rails-templates (1.0.0) railties (>= 4.2, < 6) @@ -176,7 +184,7 @@ GEM railties (>= 3.2, < 5) responders its-it (1.2.1) - jbuilder (2.4.1) + jbuilder (2.5.0) activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) jquery-rails (4.1.1) @@ -185,17 +193,14 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (5.0.5) railties (>= 3.2.16) - js-routes (1.2.5) + js-routes (1.2.6) railties (>= 3.2) sprockets-rails json (1.8.3) - kaminari (0.16.3) + kaminari (0.17.0) actionpack (>= 3.0.0) activesupport (>= 3.0.0) key_struct (0.4.2) - kiqit (2.4.0) - activerecord - sidekiq (> 2.5) libv8 (3.16.14.15) localeapp (1.0.2) gli @@ -345,7 +350,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) netrc (~> 0.7) - rr (1.1.2) + rr (1.2.0) rspec-core (3.4.4) rspec-support (~> 3.4.0) rspec-expectations (3.4.0) @@ -502,7 +507,7 @@ GEM rack (>= 1.0.0) thor (0.19.1) thread_safe (0.3.5) - tilt (2.0.4) + tilt (2.0.5) time_diff (0.3.0) activesupport i18n @@ -546,7 +551,7 @@ DEPENDENCIES hirb jbuilder js-routes - kiqit + kiqit! localeapp mailcatcher meta-tags diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index 12be9f7bd..fc61945f3 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -104,20 +104,20 @@ class Projects::BuildListsController < Projects::BaseController project_ids = prs[:projects].select{ |k, v| v == '1' }.keys arch_ids = prs[:arches]. select{ |k, v| v == '1' }.keys #FIX -# enqueue( -# BuildLists::DependentPackagesJob, -# @build_list.id, -# current_user.id, -# project_ids, -# arch_ids, -# { -# auto_publish_status: prs[:auto_publish_status], -# auto_create_container: prs[:auto_create_container], -# include_testing_subrepository: prs[:include_testing_subrepository], -# use_cached_chroot: prs[:use_cached_chroot], -# use_extra_tests: prs[:use_extra_tests] -# } -# ) + Sidekiq::Client.push( + 'class' => BuildLists::DependentPackagesJob, + 'args' => [@build_list.id, + current_user.id, + project_ids, + arch_ids, + { + auto_publish_status: prs[:auto_publish_status], + auto_create_container: prs[:auto_create_container], + include_testing_subrepository: prs[:include_testing_subrepository], + use_cached_chroot: prs[:use_cached_chroot], + use_extra_tests: prs[:use_extra_tests] + }] + ) flash[:notice] = t('flash.build_list.dependent_projects_job_added_to_queue') redirect_to build_list_path(@build_list) end diff --git a/app/jobs/build_lists/dependent_packages_job.rb b/app/jobs/build_lists/dependent_packages_job.rb index d26241d55..e01f88dea 100644 --- a/app/jobs/build_lists/dependent_packages_job.rb +++ b/app/jobs/build_lists/dependent_packages_job.rb @@ -1,8 +1,8 @@ module BuildLists class DependentPackagesJob - @queue = :middle + sidekiq_options :queue => :middle - def self.perform(build_list_id, user_id, project_ids, arch_ids, options) + def perform(build_list_id, user_id, project_ids, arch_ids, options) build_list = BuildList.find(build_list_id) return if build_list.save_to_platform.personal? user = User.find(user_id) diff --git a/app/views/projects/build_lists/dependent_projects.html.slim b/app/views/projects/build_lists/dependent_projects.html.slim index 48e7f0dd2..11a108216 100644 --- a/app/views/projects/build_lists/dependent_projects.html.slim +++ b/app/views/projects/build_lists/dependent_projects.html.slim @@ -1,65 +1,64 @@ - set_meta_tags title: [title_object(@build_list.project), t('activerecord.models.build_list')] -= render 'submenu' +.row.top-space + .col-md-10.col-md-offset-1 + rd-widget + rd-widget-header title=t('.title') + rd-widget-body + .row + = simple_form_for @build_list, + url: dependent_projects_build_list_path(@build_list), + html: { method: :post }, + wrapper: :horizontal_form, + wrapper_mappings: { boolean: :horizontal_boolean, + select: :horizontal_select } do |f| -.container.col-md-offset-2.col-md-8 - h3 - = t('.title') - .row - = simple_form_for @build_list, - url: dependent_projects_build_list_path(@build_list), - html: { method: :post }, - wrapper: :horizontal_form, - wrapper_mappings: { boolean: :horizontal_boolean, - select: :horizontal_select } do |f| + .col-md-6 + .row + .col-sm-offset-3.col-sm-9 + h4 + = t('.projects') + - @build_list.packages.each do |package| + - dependent_projects(package).each do |project, packages| + .col-sm-offset-3.col-sm-9 + .checkbox + label + input[type = "checkbox" + value = 1 + name = "build_list[projects][#{project.id}]" + checked = true] + = link_to project.name_with_owner, project_path(project.name_with_owner) + span.help-block + => t('.packages') + = packages * ', ' + .col-md-6 + .row + .col-sm-offset-3.col-sm-9 + h4 + = t('.architecture') + - arches = @build_list.build_for_platform.platform_arch_settings.by_default.pluck(:arch_id) + - Arch.recent.each do |arch| + .col-sm-offset-3.col-sm-9 + .checkbox + label + input[type = 'checkbox' + value = 1 + name = "build_list[arches][#{arch.id}]" + checked = arches.include?(arch.id)] + = arch.name + .row + .col-sm-offset-3.col-sm-9 + h4 + = t('.preferences') + = f.input :auto_publish_status, as: :select, collection: auto_publish_statuses, + include_blank: false + = f.input :auto_create_container, as: :boolean + = f.input :include_testing_subrepository, as: :boolean + = f.input :use_cached_chroot, as: :boolean + = f.input :use_extra_tests, as: :boolean - .col-md-6 - .row - .col-sm-offset-3.col-sm-9 - h4 - = t('.projects') - - @build_list.packages.each do |package| - - dependent_projects(package).each do |project, packages| - .col-sm-offset-3.col-sm-9 - .checkbox - label - input[type = "checkbox" - value = 1 - name = "build_list[projects][#{project.id}]" - checked = true] - = link_to project.name_with_owner, project_path(project.name_with_owner) - span.help-block - => t('.packages') - = packages * ', ' - .col-md-6 - .row - .col-sm-offset-3.col-sm-9 - h4 - = t('.architecture') - - arches = @build_list.build_for_platform.platform_arch_settings.by_default.pluck(:arch_id) - - Arch.recent.each do |arch| - .col-sm-offset-3.col-sm-9 - .checkbox - label - input[type = 'checkbox' - value = 1 - name = "build_list[arches][#{arch.id}]" - checked = arches.include?(arch.id)] - = arch.name - .row - .col-sm-offset-3.col-sm-9 - h4 - = t('.preferences') - = f.input :auto_publish_status, as: :select, collection: auto_publish_statuses, - include_blank: false - = f.input :auto_create_container, as: :boolean - = f.input :include_testing_subrepository, as: :boolean - = f.input :use_cached_chroot, as: :boolean - = f.input :use_extra_tests, as: :boolean - - .row - .col-sm-offset-3.col-sm-9 - hr - => f.button :submit, t('layout.create') - a.btn.btn-primary href=build_list_path(@build_list) - = t('layout.cancel') + .row + .pull-right + => f.button :submit, t('layout.create') + a.btn.btn-primary href=build_list_path(@build_list) + = t('layout.cancel')