diff --git a/app/helpers/build_lists_helper.rb b/app/helpers/build_lists_helper.rb index 72aa9d3dd..65dc53948 100644 --- a/app/helpers/build_lists_helper.rb +++ b/app/helpers/build_lists_helper.rb @@ -5,7 +5,7 @@ module BuildListsHelper return 'success' end if [BuildList::BUILD_ERROR, BuildList::PLATFORM_NOT_FOUND, - BuildList::PROJECT_NOT_FOUND, BuildList::PROJECT_VERSION_NOT_FOUND, + BuildList::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH, BuildList::REJECTED_PUBLISH].include? status return 'error' end diff --git a/app/models/activity_feed_observer.rb b/app/models/activity_feed_observer.rb index 608881d40..97ab59e35 100644 --- a/app/models/activity_feed_observer.rb +++ b/app/models/activity_feed_observer.rb @@ -131,7 +131,7 @@ class ActivityFeedObserver < ActiveRecord::Observer when 'BuildList' if [BuildList::BUILD_PUBLISHED, BuildList::SUCCESS, BuildList::BUILD_ERROR, BuildList::PLATFORM_NOT_FOUND, - BuildList::PROJECT_NOT_FOUND, BuildList::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH].include? record.status or + BuildList::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH].include? record.status or (record.status == BuildList::BUILD_PENDING && record.bs_id_changed?) record.project.admins.each do |recipient| ActivityFeed.create( diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 2474eca1d..7e5b46b17 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -53,8 +53,6 @@ class BuildList < ActiveRecord::Base ERROR = 1 PLATFORM_NOT_FOUND = 1 - PLATFORM_PENDING = 2 - PROJECT_NOT_FOUND = 3 PROJECT_VERSION_NOT_FOUND = 4 PROJECT_SOURCE_ERROR = 6 DEPENDENCIES_ERROR = 555 @@ -81,8 +79,6 @@ class BuildList < ActiveRecord::Base BUILD_STARTED, BUILD_ERROR, PLATFORM_NOT_FOUND, - PLATFORM_PENDING, - PROJECT_NOT_FOUND, PROJECT_VERSION_NOT_FOUND ] @@ -98,8 +94,6 @@ class BuildList < ActiveRecord::Base BUILD_STARTED => :build_started, SUCCESS => :success, PLATFORM_NOT_FOUND => :platform_not_found, - PLATFORM_PENDING => :platform_pending, - PROJECT_NOT_FOUND => :project_not_found, PROJECT_VERSION_NOT_FOUND => :project_version_not_found, } @@ -163,9 +157,7 @@ class BuildList < ActiveRecord::Base build_list.add_to_queue == BuildList::SUCCESS } %w[BUILD_PENDING - PLATFORM_PENDING PLATFORM_NOT_FOUND - PROJECT_NOT_FOUND PROJECT_VERSION_NOT_FOUND ].each do |code| transition :waiting_for_response => code.demodulize.downcase.to_sym, :if => lambda { |build_list| @@ -176,9 +168,7 @@ class BuildList < ActiveRecord::Base event :start_build do transition [ :build_pending, - :platform_pending, :platform_not_found, - :project_not_found, :project_version_not_found ] => :build_started end diff --git a/config/locales/models/build_list.en.yml b/config/locales/models/build_list.en.yml index 2586d6833..7c37b7792 100644 --- a/config/locales/models/build_list.en.yml +++ b/config/locales/models/build_list.en.yml @@ -121,7 +121,6 @@ en: build_started: Build started platform_not_found: Platform not found platform_pending: Platform pending - project_not_found: Project not found project_version_not_found: Project version not found log: diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index a3e66f5e2..2fbed25c1 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -118,7 +118,6 @@ ru: build_started: собирается platform_not_found: платформа не найдена platform_pending: платформа в процессе создания - project_not_found: проект не найден project_version_not_found: версия не найдена log: diff --git a/spec/controllers/api/v1/build_lists_controller_spec.rb b/spec/controllers/api/v1/build_lists_controller_spec.rb index 885ef6782..63c970f03 100644 --- a/spec/controllers/api/v1/build_lists_controller_spec.rb +++ b/spec/controllers/api/v1/build_lists_controller_spec.rb @@ -130,15 +130,15 @@ describe Api::V1::BuildListsController do context "if it has another status" do it "should return correct json error message" do - @build_list.update_column(:status, BuildList::PROJECT_NOT_FOUND) + @build_list.update_column(:status, BuildList::PROJECT_VERSION_NOT_FOUND) do_cancel response.body.should == {:is_canceled => false, :url => api_v1_build_list_path(@build_list, :format => :json), :message => incorrect_action_message}.to_json end it "should not cancel build list" do - @build_list.update_column(:status, BuildList::PROJECT_NOT_FOUND) + @build_list.update_column(:status, BuildList::PROJECT_VERSION_NOT_FOUND) do_cancel - @build_list.reload.status.should == BuildList::PROJECT_NOT_FOUND + @build_list.reload.status.should == BuildList::PROJECT_VERSION_NOT_FOUND end end end @@ -183,7 +183,7 @@ describe Api::V1::BuildListsController do context "if it has another status" do before(:each) do - @build_list.update_column(:status, BuildList::PROJECT_NOT_FOUND) + @build_list.update_column(:status, BuildList::PROJECT_VERSION_NOT_FOUND) do_publish end @@ -192,7 +192,7 @@ describe Api::V1::BuildListsController do end it "should not cancel build list" do - @build_list.reload.status.should == BuildList::PROJECT_NOT_FOUND + @build_list.reload.status.should == BuildList::PROJECT_VERSION_NOT_FOUND end end end @@ -243,7 +243,7 @@ describe Api::V1::BuildListsController do context "if it has another status" do before(:each) do - @build_list.update_column(:status, BuildList::PROJECT_NOT_FOUND) + @build_list.update_column(:status, BuildList::PROJECT_VERSION_NOT_FOUND) do_reject_publish end @@ -252,7 +252,7 @@ describe Api::V1::BuildListsController do end it "should not cancel build list" do - @build_list.reload.status.should == BuildList::PROJECT_NOT_FOUND + @build_list.reload.status.should == BuildList::PROJECT_VERSION_NOT_FOUND end end end