From df83fe65e144baddded961f67676536119ab5d04 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 10 Jan 2014 00:54:48 +0400 Subject: [PATCH 01/18] #336: added ability for clean up packages from testing repository --- app/models/build_list.rb | 9 ++++ .../build_lists_publish_task_manager.rb | 41 +++++++++++++++++-- lib/abf_worker/publish_observer.rb | 8 ++++ 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 1981e1816..7c2b9d4e1 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -158,6 +158,7 @@ class BuildList < ActiveRecord::Base after_transition :on => :published, :do => [:set_version_and_tag, :actualize_packages] after_transition :on => :publish, :do => :set_publisher + after_transition :build_published_into_testing => :publish, :do => :cleanup_packages_from_testing after_transition :on => :cancel, :do => :cancel_job after_transition :on => [:published, :fail_publish, :build_error, :tests_failed], :do => :notify_users @@ -540,6 +541,14 @@ class BuildList < ActiveRecord::Base save end + def cleanup_packages_from_testing + AbfWorker::BuildListsPublishTaskManager.cleanup_packages_from_testing( + build_for_platform_id, + save_to_repository_id, + id + ) + end + def current_ability @current_ability ||= Ability.new(user) end diff --git a/lib/abf_worker/build_lists_publish_task_manager.rb b/lib/abf_worker/build_lists_publish_task_manager.rb index 275fbfb69..65cacf450 100644 --- a/lib/abf_worker/build_lists_publish_task_manager.rb +++ b/lib/abf_worker/build_lists_publish_task_manager.rb @@ -6,7 +6,9 @@ module AbfWorker %w(PROJECTS_FOR_CLEANUP LOCKED_PROJECTS_FOR_CLEANUP LOCKED_BUILD_LISTS - PACKAGES_FOR_CLEANUP).each do |kind| + PACKAGES_FOR_CLEANUP + REP_AND_PLS_OF_BUILD_LISTS_FOR_CLEANUP_FROM_TESTING + BUILD_LISTS_FOR_CLEANUP_FROM_TESTING).each do |kind| const_set kind, "#{REDIS_MAIN_KEY}#{kind.downcase.gsub('_', '-')}" end @@ -58,6 +60,13 @@ module AbfWorker end end + def cleanup_packages_from_testing(platform_id, repository_id, *build_lists) + return if build_lists.blank? + key = "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{repository_id}-#{platform_id}" + redis.lpush REP_AND_PLS_OF_BUILD_LISTS_FOR_CLEANUP_FROM_TESTING, "#{repository_id}-#{platform_id}" + redis.lpush key, build_lists + end + def unlock_build_list(build_list) redis.lrem LOCKED_BUILD_LISTS, 0, build_list.id end @@ -213,8 +222,15 @@ module AbfWorker locked_rep.present? && locked_rep.include?(rep.to_i) ? nil : [rep.to_i, pl.to_i] end.compact + for_cleanup_from_testing = @redis.lrange(REP_AND_PLS_OF_BUILD_LISTS_FOR_CLEANUP_FROM_TESTING, 0, -1).map do |key| + next if redis.llen("#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{key}") == 0 + rep, pl = *key.split('-') + locked_rep.present? && locked_rep.include?(rep.to_i) ? nil : [rep.to_i, pl.to_i] + end.compact if testing + for_cleanup_from_testing ||= [] + counter = 1 - available_repos = available_repos.map{ |bl| [bl.save_to_repository_id, bl.build_for_platform_id] } | for_cleanup + available_repos = available_repos.map{ |bl| [bl.save_to_repository_id, bl.build_for_platform_id] } | for_cleanup | for_cleanup_from_testing available_repos.each do |save_to_repository_id, build_for_platform_id| next if RepositoryStatus.not_ready.where(:repository_id => save_to_repository_id, :platform_id => build_for_platform_id).exists? break if counter > @workers_count @@ -258,6 +274,18 @@ module AbfWorker end end + if testing + build_lists_for_cleanup_from_testing = @redis.lrange( + "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{save_to_repository_id}-#{build_for_platform_id}" + 0, -1 + ) + BuildList.where(:id => build_lists_for_cleanup_from_testing).each do |b| + self.class.fill_packages(b, old_packages) + end if build_lists_for_cleanup_from_testing.present? + end + build_lists_for_cleanup_from_testing ||= [] + + bl = build_lists.first return false if !bl && old_packages[:sources].empty? @@ -301,7 +329,10 @@ module AbfWorker }, :repository => {:id => save_to_repository_id}, :time_living => 9600, # 160 min - :extra => {:repository_status_id => repository_status.id} + :extra => { + :repository_status_id => repository_status.id, + :build_lists_for_cleanup_from_testing => build_lists_for_cleanup_from_testing + } } packages, build_list_ids, new_sources = self.class.packages_structure, [], {} @@ -337,6 +368,10 @@ module AbfWorker @redis.lpush LOCKED_PROJECTS_FOR_CLEANUP, key end + build_lists_for_cleanup_from_testing.each do |key| + @redis.lrem "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{save_to_repository_id}-#{build_for_platform_id}", 0, key + end + return true end diff --git a/lib/abf_worker/publish_observer.rb b/lib/abf_worker/publish_observer.rb index 7ad128c9a..f12d9e7f1 100644 --- a/lib/abf_worker/publish_observer.rb +++ b/lib/abf_worker/publish_observer.rb @@ -37,6 +37,14 @@ module AbfWorker end update_results elsif !extra['resign'] # Simple publish + bls = extra['build_lists_for_cleanup_from_testing'] + if status != COMPLETED && bls.present? + AbfWorker::BuildListsPublishTaskManager.cleanup_packages_from_testing( + repository_status.platform_id, + repository_status.repository_id, + bls + ) + end update_rpm_builds end ensure From 6a6fcc321ffc4b58e2d2f76936302e70da810ee6 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 10 Jan 2014 02:56:11 +0400 Subject: [PATCH 02/18] #336: use set instead of list --- .../javascripts/angularjs/locales.js.erb | 4 +-- app/models/build_list.rb | 29 +++++++++---------- .../build_lists_publish_task_manager.rb | 23 +++++++-------- 3 files changed, 25 insertions(+), 31 deletions(-) diff --git a/app/assets/javascripts/angularjs/locales.js.erb b/app/assets/javascripts/angularjs/locales.js.erb index 5d5901301..fdd2c2d0c 100644 --- a/app/assets/javascripts/angularjs/locales.js.erb +++ b/app/assets/javascripts/angularjs/locales.js.erb @@ -11,7 +11,7 @@ var _locales = { 'Всего %1 тега', 'Всего %1 тегов' ], - <%= BuildList::STATUSES.map{|s| "'build_list.status.#{s}':'#{BuildList.human_status(s)}'"}.join(',') %> + <%= BuildList::STATUSES.map{|s| "'build_list.status.#{s}': '#{BuildList.human_status(s)}'"}.join(',') %> }, <%I18n.locale = :en%> 'en-us': { @@ -23,6 +23,6 @@ var _locales = { 'Total %1 tag', 'Total %1 tags' ], - <%= BuildList::STATUSES.map{|s| "'build_list.status.#{s}':'#{BuildList.human_status(s)}'"}.join(',') %> + <%= BuildList::STATUSES.map{|s| "'build_list.status.#{s}': '#{BuildList.human_status(s)}'"}.join(',') %> } }; \ No newline at end of file diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 7c2b9d4e1..82ccf58b9 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -146,19 +146,16 @@ class BuildList < ActiveRecord::Base end end - after_transition do |build_list, transition| - status = HUMAN_STATUSES[build_list.status] - if build_list.mass_build && MassBuild::COUNT_STATUSES.include?(status) - MassBuild.increment_counter "#{status.to_s}_count", build_list.mass_build_id - end - end - after_transition :on => :place_build, :do => :add_job_to_abf_worker_queue, :if => lambda { |build_list| build_list.external_nodes.blank? } after_transition :on => :published, :do => [:set_version_and_tag, :actualize_packages] after_transition :on => :publish, :do => :set_publisher - after_transition :build_published_into_testing => :publish, :do => :cleanup_packages_from_testing + after_transition(:on => :publish) do |build_list, transition| + if transition.from == BUILD_PUBLISHED_INTO_TESTING + build_list.cleanup_packages_from_testing + end + end after_transition :on => :cancel, :do => :cancel_job after_transition :on => [:published, :fail_publish, :build_error, :tests_failed], :do => :notify_users @@ -489,6 +486,14 @@ class BuildList < ActiveRecord::Base } end + def cleanup_packages_from_testing + AbfWorker::BuildListsPublishTaskManager.cleanup_packages_from_testing( + build_for_platform_id, + save_to_repository_id, + id + ) + end + protected def create_container @@ -541,14 +546,6 @@ class BuildList < ActiveRecord::Base save end - def cleanup_packages_from_testing - AbfWorker::BuildListsPublishTaskManager.cleanup_packages_from_testing( - build_for_platform_id, - save_to_repository_id, - id - ) - end - def current_ability @current_ability ||= Ability.new(user) end diff --git a/lib/abf_worker/build_lists_publish_task_manager.rb b/lib/abf_worker/build_lists_publish_task_manager.rb index 65cacf450..1b6c96e3e 100644 --- a/lib/abf_worker/build_lists_publish_task_manager.rb +++ b/lib/abf_worker/build_lists_publish_task_manager.rb @@ -62,9 +62,10 @@ module AbfWorker def cleanup_packages_from_testing(platform_id, repository_id, *build_lists) return if build_lists.blank? - key = "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{repository_id}-#{platform_id}" - redis.lpush REP_AND_PLS_OF_BUILD_LISTS_FOR_CLEANUP_FROM_TESTING, "#{repository_id}-#{platform_id}" - redis.lpush key, build_lists + rep_pl = "#{repository_id}-#{platform_id}" + key = "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{rep_pl}" + redis.sadd REP_AND_PLS_OF_BUILD_LISTS_FOR_CLEANUP_FROM_TESTING, "#{rep_pl}" + redis.sadd key, build_lists end def unlock_build_list(build_list) @@ -222,8 +223,8 @@ module AbfWorker locked_rep.present? && locked_rep.include?(rep.to_i) ? nil : [rep.to_i, pl.to_i] end.compact - for_cleanup_from_testing = @redis.lrange(REP_AND_PLS_OF_BUILD_LISTS_FOR_CLEANUP_FROM_TESTING, 0, -1).map do |key| - next if redis.llen("#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{key}") == 0 + for_cleanup_from_testing = @redis.smembers(REP_AND_PLS_OF_BUILD_LISTS_FOR_CLEANUP_FROM_TESTING).map do |key| + next if @redis.scard("#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{key}") == 0 rep, pl = *key.split('-') locked_rep.present? && locked_rep.include?(rep.to_i) ? nil : [rep.to_i, pl.to_i] end.compact if testing @@ -270,24 +271,20 @@ module AbfWorker packages = JSON.parse packages old_packages[:sources] |= packages['sources'] Arch.pluck(:name).each do |arch| - old_packages[:binaries][arch.to_sym] |= packages['binaries'][arch] + old_packages[:binaries][arch.to_sym] |= packages['binaries'][arch] || [] end end if testing - build_lists_for_cleanup_from_testing = @redis.lrange( - "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{save_to_repository_id}-#{build_for_platform_id}" - 0, -1 - ) + build_lists_for_cleanup_from_testing = @redis.smembers("#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{save_to_repository_id}-#{build_for_platform_id}") BuildList.where(:id => build_lists_for_cleanup_from_testing).each do |b| self.class.fill_packages(b, old_packages) end if build_lists_for_cleanup_from_testing.present? end build_lists_for_cleanup_from_testing ||= [] - bl = build_lists.first - return false if !bl && old_packages[:sources].empty? + return false if !bl && old_packages[:binaries].values.flatten.empty? save_to_repository = Repository.find save_to_repository_id # Checks mirror sync status @@ -369,7 +366,7 @@ module AbfWorker end build_lists_for_cleanup_from_testing.each do |key| - @redis.lrem "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{save_to_repository_id}-#{build_for_platform_id}", 0, key + @redis.srem "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{save_to_repository_id}-#{build_for_platform_id}", key end return true From 4b4b1fe5d8552d698eae74427bb7c95934c034a2 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 10 Jan 2014 02:57:44 +0400 Subject: [PATCH 03/18] #336: rollback changes --- app/models/build_list.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 82ccf58b9..843cab408 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -146,6 +146,13 @@ class BuildList < ActiveRecord::Base end end + after_transition do |build_list, transition| + status = HUMAN_STATUSES[build_list.status] + if build_list.mass_build && MassBuild::COUNT_STATUSES.include?(status) + MassBuild.increment_counter "#{status.to_s}_count", build_list.mass_build_id + end + end + after_transition :on => :place_build, :do => :add_job_to_abf_worker_queue, :if => lambda { |build_list| build_list.external_nodes.blank? } after_transition :on => :published, From a16682c5f9b26e215d3b3910970180afaad38778 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 10 Jan 2014 03:01:01 +0400 Subject: [PATCH 04/18] #336: small refactoring --- lib/abf_worker/build_lists_publish_task_manager.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/abf_worker/build_lists_publish_task_manager.rb b/lib/abf_worker/build_lists_publish_task_manager.rb index 1b6c96e3e..83896cf54 100644 --- a/lib/abf_worker/build_lists_publish_task_manager.rb +++ b/lib/abf_worker/build_lists_publish_task_manager.rb @@ -64,7 +64,7 @@ module AbfWorker return if build_lists.blank? rep_pl = "#{repository_id}-#{platform_id}" key = "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{rep_pl}" - redis.sadd REP_AND_PLS_OF_BUILD_LISTS_FOR_CLEANUP_FROM_TESTING, "#{rep_pl}" + redis.sadd REP_AND_PLS_OF_BUILD_LISTS_FOR_CLEANUP_FROM_TESTING, rep_pl redis.sadd key, build_lists end From d101d33a7059e17f9dda6106f3e7ec59d2f68377 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 10 Jan 2014 19:10:28 +0400 Subject: [PATCH 05/18] #336: misprint --- lib/abf_worker/build_lists_publish_task_manager.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/abf_worker/build_lists_publish_task_manager.rb b/lib/abf_worker/build_lists_publish_task_manager.rb index 83896cf54..7bf62fa99 100644 --- a/lib/abf_worker/build_lists_publish_task_manager.rb +++ b/lib/abf_worker/build_lists_publish_task_manager.rb @@ -278,7 +278,7 @@ module AbfWorker if testing build_lists_for_cleanup_from_testing = @redis.smembers("#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{save_to_repository_id}-#{build_for_platform_id}") BuildList.where(:id => build_lists_for_cleanup_from_testing).each do |b| - self.class.fill_packages(b, old_packages) + self.class.fill_packages(b, old_packages, :fullname) end if build_lists_for_cleanup_from_testing.present? end build_lists_for_cleanup_from_testing ||= [] From 777e8c5b4327d378c159b7cf7c3151701ff1814e Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 10 Jan 2014 20:26:54 +0400 Subject: [PATCH 06/18] #336: rollback changes, small improvements --- lib/abf_worker/build_lists_publish_task_manager.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/abf_worker/build_lists_publish_task_manager.rb b/lib/abf_worker/build_lists_publish_task_manager.rb index 7bf62fa99..e771ceeed 100644 --- a/lib/abf_worker/build_lists_publish_task_manager.rb +++ b/lib/abf_worker/build_lists_publish_task_manager.rb @@ -284,7 +284,7 @@ module AbfWorker build_lists_for_cleanup_from_testing ||= [] bl = build_lists.first - return false if !bl && old_packages[:binaries].values.flatten.empty? + return false if !bl && old_packages[:sources].empty? && old_packages[:binaries].values.flatten.empty? save_to_repository = Repository.find save_to_repository_id # Checks mirror sync status @@ -365,8 +365,13 @@ module AbfWorker @redis.lpush LOCKED_PROJECTS_FOR_CLEANUP, key end + rep_pl = "#{save_to_repository_id}-#{build_for_platform_id}" + r_key = "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{rep_pl}" build_lists_for_cleanup_from_testing.each do |key| - @redis.srem "#{BUILD_LISTS_FOR_CLEANUP_FROM_TESTING}-#{save_to_repository_id}-#{build_for_platform_id}", key + @redis.srem r_key, key + end + if @redis.scard(r_key) == 0 + @redis.srem REP_AND_PLS_OF_BUILD_LISTS_FOR_CLEANUP_FROM_TESTING, rep_pl end return true From 5db65160852104050e211dca709a55565a85376d Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 14 Jan 2014 01:51:12 +0400 Subject: [PATCH 07/18] #339: added synchronizing_publications into Repository --- app/models/build_list.rb | 26 +++++++++++++++++++ ...d_synchronize_publication_to_repository.rb | 5 ++++ db/schema.rb | 11 ++++---- 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20140113205657_add_synchronize_publication_to_repository.rb diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 843cab408..24b3b34e9 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -47,6 +47,11 @@ 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 lambda { + if status == BUILD_PUBLISH && !can_publish_into_repository? + errors.add(:save_to_repository, I18n.t('flash.build_list.not_all_build_lists_success')) + end + } before_validation lambda { self.include_repos = include_repos.uniq if include_repos.present? }, :on => :create before_validation :prepare_extra_repositories, :on => :create before_validation :prepare_extra_build_lists, :on => :create @@ -313,6 +318,27 @@ class BuildList < ActiveRecord::Base [SUCCESS, BUILD_PUBLISH, FAILED_PUBLISH, BUILD_PUBLISHED, TESTS_FAILED, BUILD_PUBLISHED_INTO_TESTING, FAILED_PUBLISH_INTO_TESTING].include?(status) && [WAITING_FOR_RESPONSE, FAILED_PUBLISH].include?(container_status) end + def can_publish_into_repository? + return true if !save_to_repository.synchronizing_publications? || save_to_platform.personal? || project.architecture_dependent? + arch_ids = save_to_platform.platform_arch_settings.by_default.pluck(:arch_id) + BuildList.where( + :project_id => project_id, + :save_to_repository_id => save_to_repository_id, + :arch_id => arch_ids, + :commit_hash => commit_hash, + :status => [ + SUCCESS, + BUILD_PUBLISHED, + BUILD_PUBLISH, + FAILED_PUBLISH, + TESTS_FAILED, + BUILD_PUBLISHED_INTO_TESTING, + BUILD_PUBLISH_INTO_TESTING, + FAILED_PUBLISH_INTO_TESTING + ] + ).group(:arch_id).count == arch_ids.size + end + #TODO: Share this checking on product owner. def can_cancel? build_started? || build_pending? diff --git a/db/migrate/20140113205657_add_synchronize_publication_to_repository.rb b/db/migrate/20140113205657_add_synchronize_publication_to_repository.rb new file mode 100644 index 000000000..ddf57995f --- /dev/null +++ b/db/migrate/20140113205657_add_synchronize_publication_to_repository.rb @@ -0,0 +1,5 @@ +class AddSynchronizePublicationToRepository < ActiveRecord::Migration + def change + add_column :repositories, :synchronizing_publications, :boolean, :default => false, :null => false + end +end diff --git a/db/schema.rb b/db/schema.rb index f90c5de5a..aa7a3851b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20131126154305) do +ActiveRecord::Schema.define(:version => 20140113205657) do create_table "activity_feeds", :force => true do |t| t.integer "user_id", :null => false @@ -487,12 +487,13 @@ ActiveRecord::Schema.define(:version => 20131126154305) do add_index "relations", ["target_type", "target_id"], :name => "index_relations_on_target_type_and_target_id" create_table "repositories", :force => true do |t| - t.string "description", :null => false - t.integer "platform_id", :null => false + t.string "description", :null => false + t.integer "platform_id", :null => false t.datetime "created_at" t.datetime "updated_at" - t.string "name", :null => false - t.boolean "publish_without_qa", :default => true + t.string "name", :null => false + t.boolean "publish_without_qa", :default => true + t.boolean "synchronizing_publications", :default => false, :null => false end add_index "repositories", ["platform_id"], :name => "index_repositories_on_platform_id" From 1d54fa01ec6e01821b304e320ab084b465280104 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 14 Jan 2014 01:54:09 +0400 Subject: [PATCH 08/18] #339: added #architecture_dependent to Project --- .../20140113215223_add_architecture_dependent_to_project.rb | 5 +++++ db/schema.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20140113215223_add_architecture_dependent_to_project.rb diff --git a/db/migrate/20140113215223_add_architecture_dependent_to_project.rb b/db/migrate/20140113215223_add_architecture_dependent_to_project.rb new file mode 100644 index 000000000..b1fd34e95 --- /dev/null +++ b/db/migrate/20140113215223_add_architecture_dependent_to_project.rb @@ -0,0 +1,5 @@ +class AddArchitectureDependentToProject < ActiveRecord::Migration + def change + add_column :projects, :architecture_dependent, :boolean, :default => false, :null => false + end +end diff --git a/db/schema.rb b/db/schema.rb index aa7a3851b..eee0323ca 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140113205657) do +ActiveRecord::Schema.define(:version => 20140113215223) do create_table "activity_feeds", :force => true do |t| t.integer "user_id", :null => false @@ -439,6 +439,7 @@ ActiveRecord::Schema.define(:version => 20140113205657) do t.integer "maintainer_id" t.boolean "publish_i686_into_x86_64", :default => false t.string "owner_uname", :null => false + t.boolean "architecture_dependent", :default => false, :null => false end add_index "projects", ["owner_id", "name", "owner_type"], :name => "index_projects_on_name_and_owner_id_and_owner_type", :unique => true, :case_sensitive => false From 0f68d1712fa913cc1b304176a338c34b153c22a7 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 14 Jan 2014 02:05:26 +0400 Subject: [PATCH 09/18] #339: added locales --- config/locales/models/build_list.en.yml | 3 ++- config/locales/models/build_list.ru.yml | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/locales/models/build_list.en.yml b/config/locales/models/build_list.en.yml index 8abaa2253..376ef745d 100644 --- a/config/locales/models/build_list.en.yml +++ b/config/locales/models/build_list.en.yml @@ -193,4 +193,5 @@ en: can_not_published: Build can only be published with status "Build complete" 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_commit_hash: "Unable find commit '%{commit_hash}' in project" + not_all_build_lists_success: 'Project has been builded successfully not for all default arches' diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index 1e4a2cc5e..12a4284e2 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -180,10 +180,10 @@ ru: flash: build_list: - saved: Билд лист для версии '%{project_version}', платформы '%{build_for_platform}' и архитектуры '%{arch}' создан успешно - save_error: Не удалось сохранить билд лист для версии '%{project_version}', платформы '%{build_for_platform}' и архитектуры '%{arch}' + saved: "Билд лист для версии '%{project_version}', платформы '%{build_for_platform}' и архитектуры '%{arch}' создан успешно" + save_error: "Не удалось сохранить билд лист для версии '%{project_version}', платформы '%{build_for_platform}' и архитектуры '%{arch}'" no_project_version_selected: Выберите какую-нибудь версию - no_project_version_found: Выбранная версия '%{project_version}' не найдена + no_project_version_found: "Выбранная версия '%{project_version}' не найдена" no_arch_or_platform_selected: Выберите хотя бы одну архитектуру и платформу wrong_platform: Для основного репозитория (main) может быть выбран только его же основная платформа! wrong_build_for_platform: Тип платформы "build_for_platform" должен быть "main" @@ -193,4 +193,5 @@ ru: can_not_published: Опубликовать сборку можно только со статусом "Собран" frozen_platform: В случае выбора репозитория для сохранения пакетов из замороженнной платформы разрешены только bugfix и security обновления wrong_include_repos: Включаемые репозитории должны принадлежать платформе для сборки - wrong_commit_hash: Невозможно найти коммит '%{commit_hash}' в проекте + wrong_commit_hash: "Невозможно найти коммит '%{commit_hash}' в проекте" + not_all_build_lists_success: Проект собран успешно не для всех дефолтных артитектур From 0c6d4b8995ed926edf5468ffcac162c978ec5f1d Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 14 Jan 2014 02:37:27 +0400 Subject: [PATCH 10/18] #339: added locales, updated UI --- app/controllers/platforms/repositories_controller.rb | 5 +---- app/models/project.rb | 2 +- app/models/repository.rb | 2 +- app/views/platforms/repositories/_form.html.haml | 4 ++++ app/views/projects/projects/_form.html.haml | 4 ++++ config/locales/models/project.en.yml | 1 + config/locales/models/project.ru.yml | 1 + config/locales/models/repository.en.yml | 1 + config/locales/models/repository.ru.yml | 1 + 9 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/controllers/platforms/repositories_controller.rb b/app/controllers/platforms/repositories_controller.rb index 7a5658e26..b73c50bd8 100644 --- a/app/controllers/platforms/repositories_controller.rb +++ b/app/controllers/platforms/repositories_controller.rb @@ -22,10 +22,7 @@ class Platforms::RepositoriesController < Platforms::BaseController end def update - if @repository.update_attributes( - :description => params[:repository][:description], - :publish_without_qa => (params[:repository][:publish_without_qa] || @repository.publish_without_qa) - ) + if @repository.update_attributes params[:repository].slice(:description, :synchronizing_publications).merge(:publish_without_qa => (params[:repository][:publish_without_qa] || @repository.publish_without_qa)) flash[:notice] = I18n.t("flash.repository.updated") redirect_to platform_repository_path(@platform, @repository) else diff --git a/app/models/project.rb b/app/models/project.rb index 0006bb175..efdf0f6d2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -48,7 +48,7 @@ class Project < ActiveRecord::Base attr_accessible :name, :description, :visibility, :srpm, :is_package, :default_branch, :has_issues, :has_wiki, :maintainer_id, :publish_i686_into_x86_64, - :url, :srpms_list, :mass_import, :add_to_repository_id + :url, :srpms_list, :mass_import, :add_to_repository_id, :architecture_dependent attr_readonly :owner_id, :owner_type scope :recent, order("lower(#{table_name}.name) ASC") diff --git a/app/models/repository.rb b/app/models/repository.rb index b4ef59437..983acdeeb 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -26,7 +26,7 @@ class Repository < ActiveRecord::Base before_destroy :detele_directory - attr_accessible :name, :description, :publish_without_qa + attr_accessible :name, :description, :publish_without_qa, :synchronizing_publications attr_readonly :name, :platform_id attr_accessor :projects_list diff --git a/app/views/platforms/repositories/_form.html.haml b/app/views/platforms/repositories/_form.html.haml index 0e430665c..3ae96c914 100644 --- a/app/views/platforms/repositories/_form.html.haml +++ b/app/views/platforms/repositories/_form.html.haml @@ -7,6 +7,10 @@ .leftlist= f.label :publish_without_qa, t("activerecord.attributes.repository.publish_without_qa"), :class => :label .rightlist= f.check_box :publish_without_qa, :class => 'check_box' + +.leftlist= f.label :synchronizing_publications +.rightlist= f.check_box :synchronizing_publications + .both .hr diff --git a/app/views/projects/projects/_form.html.haml b/app/views/projects/projects/_form.html.haml index 04b3f4cb9..af92b3e1b 100644 --- a/app/views/projects/projects/_form.html.haml +++ b/app/views/projects/projects/_form.html.haml @@ -25,6 +25,10 @@ .check= f.check_box :is_package, 'ng-model' => 'project.is_package', 'ng-change' => 'project.publish_i686_into_x86_64 = false' .forcheck= f.label :is_package .both + %div{'ng-show' => 'project.is_package'} + .check= f.check_box :architecture_dependent, 'ng-model' => 'project.architecture_dependent' + .forcheck= f.label :architecture_dependent + .both - unless [:new, :create].include? act #publish_form{'ng-show' => 'project.is_package'} .check= f.check_box :publish_i686_into_x86_64, 'ng-model' => 'project.publish_i686_into_x86_64' diff --git a/config/locales/models/project.en.yml b/config/locales/models/project.en.yml index 586f0c5fb..fceb6f333 100644 --- a/config/locales/models/project.en.yml +++ b/config/locales/models/project.en.yml @@ -116,6 +116,7 @@ en: publish_i686_into_x86_64: Publish i686 packages into x86_64 repository (only for rhel) maintainer: Maintainer of project maintainer_id: Maintainer of project + architecture_dependent: Architecture-dependent errors: project: uname: The name can only use lower case Latin letters (a-z), numbers (0-9) and underscore (_) diff --git a/config/locales/models/project.ru.yml b/config/locales/models/project.ru.yml index 12821d64c..fae79540c 100644 --- a/config/locales/models/project.ru.yml +++ b/config/locales/models/project.ru.yml @@ -116,6 +116,7 @@ ru: publish_i686_into_x86_64: Публиковать i686 пакеты в x86_64 репозиторий (только для rhel) maintainer_id: Майнтейнер проекта maintainer: Майнтейнер проекта + architecture_dependent: Архитектурно-зависимый errors: project: uname: В имени можно использовать только строчные символы латинского алфавита (a-z), цифры (0-9) и символ нижнего подчеркивания (_) diff --git a/config/locales/models/repository.en.yml b/config/locales/models/repository.en.yml index a431aea3d..ccfb2783c 100644 --- a/config/locales/models/repository.en.yml +++ b/config/locales/models/repository.en.yml @@ -70,3 +70,4 @@ en: created_at: Created updated_at: Updated owner: Owner + synchronizing_publications: Publish only on success all build_lists for each arch (checking by commit sha) diff --git a/config/locales/models/repository.ru.yml b/config/locales/models/repository.ru.yml index 9474f1ffb..f36edc913 100644 --- a/config/locales/models/repository.ru.yml +++ b/config/locales/models/repository.ru.yml @@ -70,3 +70,4 @@ ru: created_at: Создан updated_at: Обновлен owner: Владелец + synchronizing_publications: Публиковать build_lists только при успешной сборке под каждую архитектуру (проверка по sha коммита) From 09e360b8a9a076c75f7112868d0a84fcb8df9067 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 14 Jan 2014 22:14:14 +0400 Subject: [PATCH 11/18] #339: updated build_list#show UI --- app/views/projects/build_lists/show.html.haml | 4 ++++ app/views/projects/build_lists/show.json.jbuilder | 1 + 2 files changed, 5 insertions(+) diff --git a/app/views/projects/build_lists/show.html.haml b/app/views/projects/build_lists/show.html.haml index 5cbc139ab..d81448ccd 100644 --- a/app/views/projects/build_lists/show.html.haml +++ b/app/views/projects/build_lists/show.html.haml @@ -160,6 +160,10 @@ .flash_notify .alert.alert-error= t('layout.build_lists.publish_with_extra_fail') .both + %div{'ng-show' => 'build_list.can_publish && build_list.can_publish_in_future && !build_list.can_publish_into_repository'} + .flash_notify + .alert.alert-error= t('flash.build_list.not_all_build_lists_success') + .both - if can?(:cancel, @build_list) = link_to t("layout.build_lists.cancel"), cancel_build_list_path(@build_list), diff --git a/app/views/projects/build_lists/show.json.jbuilder b/app/views/projects/build_lists/show.json.jbuilder index 4a9b46b16..03a1a6d98 100644 --- a/app/views/projects/build_lists/show.json.jbuilder +++ b/app/views/projects/build_lists/show.json.jbuilder @@ -18,6 +18,7 @@ json.build_list do json.extra_build_lists_published @build_list.extra_build_lists_published? json.can_publish_in_future can_publish_in_future?(@build_list) + json.can_publish_into_repository @build_list.can_publish_into_repository? json.container_path container_url if @build_list.container_published? From a881dd73cacb77cf2f7cbe0e4c4a5f7d1f646d34 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 14 Jan 2014 22:42:35 +0400 Subject: [PATCH 12/18] #339: small refactoring, checking ability to publish into repository on auto publishing --- .../projects/build_lists_controller.rb | 2 +- app/models/ability.rb | 29 ++++++++++++------- app/models/build_list.rb | 15 +++++----- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index b16ebeb0b..1b09e7962 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -34,7 +34,7 @@ class Projects::BuildListsController < Projects::BaseController :build_for_platform, :user, :source_packages, - :project + :project => :project_statistics ) @build_server_status = AbfWorker::StatusInspector.projects_status diff --git a/app/models/ability.rb b/app/models/ability.rb index 5f3d2c7ae..bfef4d1e3 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -64,7 +64,7 @@ class Ability can([:mass_import, :run_mass_import], Project) if user.platforms.main.find{ |p| local_admin?(p) }.present? can :read, Project, :visibility => 'open' can [:read, :archive, :membered, :get_id], Project, :owner_type => 'User', :owner_id => user.id - can [:read, :archive, :membered, :get_id], Project, :owner_type => 'Group', :owner_id => user.group_ids + can [:read, :archive, :membered, :get_id], Project, :owner_type => 'Group', :owner_id => user_group_ids can([:read, :archive, :membered, :get_id], Project, read_relations_for('projects')) {|project| local_reader? project} can(:write, Project) {|project| local_writer? project} # for grack can [:update, :sections, :manage_collaborators, :autocomplete_maintainers, :add_member, :remove_member, :update_member, :members], Project do |project| @@ -81,7 +81,7 @@ class Ability can [:read, :log, :owned, :everything], BuildList, :user_id => user.id can [:read, :log, :related, :everything], BuildList, :project => {:owner_type => 'User', :owner_id => user.id} - can [:read, :log, :related, :everything], BuildList, :project => {:owner_type => 'Group', :owner_id => user.group_ids} + can [:read, :log, :related, :everything], BuildList, :project => {:owner_type => 'Group', :owner_id => user_group_ids} can([:read, :log, :everything, :list], BuildList, read_relations_for('build_lists', 'projects')) {|build_list| can? :read, build_list.project} can(:publish_into_testing, BuildList) { |build_list| can?(:create, build_list) && build_list.save_to_platform.main? } @@ -109,7 +109,7 @@ class Ability can([:cancel, :create_container], BuildList) {|build_list| can?(:write, build_list.project)} can [:read, :owned, :related, :members], Platform, :owner_type => 'User', :owner_id => user.id - can [:read, :related, :members], Platform, :owner_type => 'Group', :owner_id => user.group_ids + can [:read, :related, :members], Platform, :owner_type => 'Group', :owner_id => user_group_ids can([:read, :related, :members], Platform, read_relations_for('platforms')) {|platform| local_reader? platform} can [:read, :related], Platform, :id => user.repositories.pluck(:platform_id) can([:update, :destroy, :change_visibility], Platform) {|platform| owner?(platform) } @@ -119,7 +119,7 @@ class Ability can(:cancel, MassBuild) {|mass_build| (owner?(mass_build.save_to_platform) || local_admin?(mass_build.save_to_platform)) && !mass_build.stop_build} can [:read, :projects_list, :projects], Repository, :platform => {:owner_type => 'User', :owner_id => user.id} - can [:read, :projects_list, :projects], Repository, :platform => {:owner_type => 'Group', :owner_id => user.group_ids} + can [:read, :projects_list, :projects], Repository, :platform => {:owner_type => 'Group', :owner_id => user_group_ids} can([:read, :projects_list, :projects], Repository, read_relations_for('repositories')) {|repository| can? :show, repository.platform} can([:read, :projects_list, :projects], Repository, read_relations_for('repositories', 'platforms')) {|repository| local_reader? repository.platform} can([:create, :edit, :update, :destroy, :projects_list, :projects, :add_project, :remove_project, :regenerate_metadata, :sync_lock_file, :add_repo_lock_file, :remove_repo_lock_file], Repository) {|repository| local_admin? repository.platform} @@ -134,7 +134,7 @@ class Ability can([:read, :create, :withdraw], Token) {|token| local_admin?(token.subject)} can :read, Product, :platform => {:owner_type => 'User', :owner_id => user.id, :platform_type => 'main'} - can :read, Product, :platform => {:owner_type => 'Group', :owner_id => user.group_ids, :platform_type => 'main'} + can :read, Product, :platform => {:owner_type => 'Group', :owner_id => user_group_ids, :platform_type => 'main'} can(:read, Product, read_relations_for('products', 'platforms')) {|product| product.platform.main?} can([:create, :update, :destroy, :clone], Product) {|product| local_admin? product.platform and product.platform.main?} @@ -142,17 +142,17 @@ class Ability can(:destroy, ProductBuildList) {|pbl| can?(:destroy, pbl.product)} can [:read, :create], PrivateUser, :platform => {:owner_type => 'User', :owner_id => user.id} - can [:read, :create], PrivateUser, :platform => {:owner_type => 'Group', :owner_id => user.group_ids} + can [:read, :create], PrivateUser, :platform => {:owner_type => 'Group', :owner_id => user_group_ids} can :read, Issue, :project => {:owner_type => 'User', :owner_id => user.id} - can :read, Issue, :project => {:owner_type => 'Group', :owner_id => user.group_ids} + can :read, Issue, :project => {:owner_type => 'Group', :owner_id => user_group_ids} can(:read, Issue, read_relations_for('issues', 'projects')) {|issue| can? :read, issue.project rescue nil} can(:create, Issue) {|issue| can? :read, issue.project} can(:update, Issue) {|issue| issue.user_id == user.id or local_admin?(issue.project)} cannot :manage, Issue, :project => {:has_issues => false} # switch off issues can [:read, :commits, :files], PullRequest, :to_project => {:owner_type => 'User', :owner_id => user.id} - can [:read, :commits, :files], PullRequest, :to_project => {:owner_type => 'Group', :owner_id => user.group_ids} + can [:read, :commits, :files], PullRequest, :to_project => {:owner_type => 'Group', :owner_id => user_group_ids} can([:read, :commits, :files], PullRequest, read_relations_for('pull_requests', 'to_projects')) {|pull| can? :read, pull.to_project} can :create, PullRequest can(:update, PullRequest) {|pull| pull.user_id == user.id or local_admin?(pull.to_project)} @@ -231,7 +231,7 @@ class Ability ["#{table}.#{key} IN ( SELECT target_id FROM relations WHERE relations.target_type = ? AND (relations.actor_type = 'User' AND relations.actor_id = ? OR - relations.actor_type = 'Group' AND relations.actor_id IN (?)))", parent.classify, @user, @user.group_ids] + relations.actor_type = 'Group' AND relations.actor_id IN (?)))", parent.classify, @user, user_group_ids] end def local_reader?(target) @@ -247,6 +247,15 @@ class Ability end def owner?(target) - target.owner == @user or @user.own_groups.include?(target.owner) + target.owner == @user or user_own_groups.include?(target.owner) end + + def user_own_groups + @user_own_groups ||= @user.own_groups + end + + def user_group_ids + @group_ids ||= @user.group_ids + end + end diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 24b3b34e9..14b74eb5a 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -47,11 +47,11 @@ 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 lambda { - if status == BUILD_PUBLISH && !can_publish_into_repository? - errors.add(:save_to_repository, I18n.t('flash.build_list.not_all_build_lists_success')) - end - } + # validate lambda { + # if status == BUILD_PUBLISH && !can_publish_into_repository? + # errors.add(:save_to_repository, I18n.t('flash.build_list.not_all_build_lists_success')) + # end + # } before_validation lambda { self.include_repos = include_repos.uniq if include_repos.present? }, :on => :create before_validation :prepare_extra_repositories, :on => :create before_validation :prepare_extra_build_lists, :on => :create @@ -365,7 +365,7 @@ class BuildList < ActiveRecord::Base end def can_auto_publish? - auto_publish? && can_publish? && has_new_packages? + auto_publish? && can_publish? && has_new_packages? && can_publish_into_repository? end def can_publish? @@ -388,7 +388,8 @@ class BuildList < ActiveRecord::Base def average_build_time return 0 unless project - project.project_statistics.where(:arch_id => arch_id).pluck(:average_build_time).first || 0 + @average_build_time ||= project.project_statistics. + find{ |ps| ps.arch_id == arch_id }.try(:average_build_time) || 0 end def self.human_status(status) From 89cd7641465586d28ea1c114cc01825b985be1c9 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 14 Jan 2014 23:13:26 +0400 Subject: [PATCH 13/18] [abf/abf-ideas#52] fixed: increasing release tag at mass build --- app/models/mass_build.rb | 4 +++- app/models/project.rb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/mass_build.rb b/app/models/mass_build.rb index 1515e5106..ff29c772a 100644 --- a/app/models/mass_build.rb +++ b/app/models/mass_build.rb @@ -44,9 +44,11 @@ class MassBuild < ActiveRecord::Base if project = Project.joins(:repositories).where('repositories.id in (?)', save_to_platform.repository_ids).find_by_name(name) begin return if self.reload.stop_build + increase_rt = increase_release_tag? arches_list.each do |arch| rep_id = (project.repository_ids & save_to_platform.repository_ids).first - project.build_for self, rep_id, arch + project.build_for self, rep_id, arch, 0, increase_rt + increase_rt = false end rescue RuntimeError, Exception end diff --git a/app/models/project.rb b/app/models/project.rb index 0006bb175..f1ddf3036 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -162,7 +162,7 @@ class Project < ActiveRecord::Base #path #share by NFS end - def build_for(mass_build, repository_id, arch = Arch.find_by_name('i586'), priority = 0) + def build_for(mass_build, repository_id, arch = Arch.find_by_name('i586'), priority = 0, increase_rt = false) build_for_platform = mass_build.build_for_platform save_to_platform = mass_build.save_to_platform user = mass_build.user @@ -180,7 +180,7 @@ class Project < ActiveRecord::Base default_branch end - increase_release_tag(project_version, user, "MassBuild##{mass_build.id}: Increase release tag") if mass_build.increase_release_tag? + increase_release_tag(project_version, user, "MassBuild##{mass_build.id}: Increase release tag") if increase_rt build_list = build_lists.build do |bl| bl.save_to_platform = save_to_platform From 1fb8d93eff8b207b40e77e4e68fefc6d4558a89f Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Wed, 15 Jan 2014 00:33:47 +0400 Subject: [PATCH 14/18] #339: cleanup --- app/models/build_list.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 14b74eb5a..c66246d83 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -47,11 +47,6 @@ 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 lambda { - # if status == BUILD_PUBLISH && !can_publish_into_repository? - # errors.add(:save_to_repository, I18n.t('flash.build_list.not_all_build_lists_success')) - # end - # } before_validation lambda { self.include_repos = include_repos.uniq if include_repos.present? }, :on => :create before_validation :prepare_extra_repositories, :on => :create before_validation :prepare_extra_build_lists, :on => :create From c9dbb38a4f12486ec12973428fa27740f0e2aba5 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Wed, 15 Jan 2014 14:15:41 +0400 Subject: [PATCH 15/18] #339: updated locales --- config/locales/models/repository.en.yml | 2 +- config/locales/models/repository.ru.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/models/repository.en.yml b/config/locales/models/repository.en.yml index ccfb2783c..98a444abd 100644 --- a/config/locales/models/repository.en.yml +++ b/config/locales/models/repository.en.yml @@ -70,4 +70,4 @@ en: created_at: Created updated_at: Updated owner: Owner - synchronizing_publications: Publish only on success all build_lists for each arch (checking by commit sha) + synchronizing_publications: Publish only on success all build_lists for each arch (checking by commit hash) diff --git a/config/locales/models/repository.ru.yml b/config/locales/models/repository.ru.yml index f36edc913..38e61a860 100644 --- a/config/locales/models/repository.ru.yml +++ b/config/locales/models/repository.ru.yml @@ -70,4 +70,4 @@ ru: created_at: Создан updated_at: Обновлен owner: Владелец - synchronizing_publications: Публиковать build_lists только при успешной сборке под каждую архитектуру (проверка по sha коммита) + synchronizing_publications: Публиковать сборочные листы только при успешной сборке под каждую архитектуру (проверка по хэшу коммита) From 386919f64eb2136de37abbaf189fb1093224bda8 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Wed, 15 Jan 2014 14:39:24 +0400 Subject: [PATCH 16/18] #339: misprint --- config/locales/models/build_list.ru.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index 12a4284e2..308224f62 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -194,4 +194,4 @@ ru: frozen_platform: В случае выбора репозитория для сохранения пакетов из замороженнной платформы разрешены только bugfix и security обновления wrong_include_repos: Включаемые репозитории должны принадлежать платформе для сборки wrong_commit_hash: "Невозможно найти коммит '%{commit_hash}' в проекте" - not_all_build_lists_success: Проект собран успешно не для всех дефолтных артитектур + not_all_build_lists_success: Проект собран успешно не для всех дефолтных архитектур From fdcb4cdaf791da25f2366b3d00f72abc57ffe338 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Wed, 15 Jan 2014 15:14:42 +0400 Subject: [PATCH 17/18] #339: misprint --- app/models/ability.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index bfef4d1e3..0774cb532 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -255,7 +255,7 @@ class Ability end def user_group_ids - @group_ids ||= @user.group_ids + @user_group_ids ||= @user.group_ids end end From 150180e4bfab36279a6f55aaf7a3487634d15ea3 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Wed, 15 Jan 2014 21:56:55 +0400 Subject: [PATCH 18/18] remove temporally hook --- app/controllers/api/v1/jobs_controller.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/controllers/api/v1/jobs_controller.rb b/app/controllers/api/v1/jobs_controller.rb index 613e1cda0..6911264de 100644 --- a/app/controllers/api/v1/jobs_controller.rb +++ b/app/controllers/api/v1/jobs_controller.rb @@ -17,11 +17,6 @@ class Api::V1::JobsController < Api::V1::BaseController if current_user.system? if task = (Resque.pop('rpm_worker_default') || Resque.pop('rpm_worker')) @build_list = BuildList.where(:id => task['args'][0]['id']).first - # Temporally - if @build_list.build_for_platform.name == 'red3' - @build_list.restart_job - @build_list = nil - end end end