diff --git a/app/jobs/abf_worker/rpm_worker_observer.rb b/app/jobs/abf_worker/rpm_worker_observer.rb index 85f568719..75a38f9bd 100644 --- a/app/jobs/abf_worker/rpm_worker_observer.rb +++ b/app/jobs/abf_worker/rpm_worker_observer.rb @@ -2,6 +2,11 @@ module AbfWorker class RpmWorkerObserver < AbfWorker::BaseObserver RESTARTED_BUILD_LISTS = 'abf-worker::rpm-worker-observer::restarted-build-lists' + # EXIT CODES: + # 6 - Unpermitted architecture + # other - Build error + EXIT_CODE_UNPERMITTED_ARCHITECTURE = 6 + @queue = :rpm_worker_observer def self.perform(options) @@ -29,7 +34,14 @@ module AbfWorker subject.publish_into_testing end when FAILED - subject.build_error + + case options['exit_status'].to_i + when EXIT_CODE_UNPERMITTED_ARCHITECTURE + subject.unpermitted_arch + else + subject.build_error + end + item.update_attributes({status: BuildList::BUILD_ERROR}) unless rerunning_tests when STARTED subject.start_build diff --git a/app/models/build_list.rb b/app/models/build_list.rb index f6617bc14..c94e5627f 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -191,7 +191,7 @@ class BuildList < ActiveRecord::Base end event :unpermitted_arch do - transition build_pending: :unpermitted_arch + transition [:build_started, :build_canceling, :build_canceled] => :unpermitted_arch end event :rerun_tests do