#316: added chekbox into #new action for attaching testing subrepo
This commit is contained in:
parent
49ecbe9280
commit
b3ba6555e2
|
@ -82,7 +82,7 @@ class Ability
|
||||||
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([: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) }
|
can(:publish_into_testing, BuildList) { |build_list| can?(:create, build_list) && build_list.save_to_platform.main? }
|
||||||
can(:create, BuildList) {|build_list|
|
can(:create, BuildList) {|build_list|
|
||||||
build_list.project.is_package &&
|
build_list.project.is_package &&
|
||||||
can?(:write, build_list.project) &&
|
can?(:write, build_list.project) &&
|
||||||
|
|
|
@ -56,7 +56,8 @@ class BuildList < ActiveRecord::Base
|
||||||
attr_accessible :include_repos, :auto_publish, :build_for_platform_id, :commit_hash,
|
attr_accessible :include_repos, :auto_publish, :build_for_platform_id, :commit_hash,
|
||||||
:arch_id, :project_id, :save_to_repository_id, :update_type,
|
:arch_id, :project_id, :save_to_repository_id, :update_type,
|
||||||
:save_to_platform_id, :project_version, :auto_create_container,
|
:save_to_platform_id, :project_version, :auto_create_container,
|
||||||
:extra_repositories, :extra_build_lists, :extra_params, :external_nodes
|
:extra_repositories, :extra_build_lists, :extra_params, :external_nodes,
|
||||||
|
:include_testing_subrepository
|
||||||
|
|
||||||
LIVE_TIME = 4.week # for unpublished
|
LIVE_TIME = 4.week # for unpublished
|
||||||
MAX_LIVE_TIME = 3.month # for published
|
MAX_LIVE_TIME = 3.month # for published
|
||||||
|
@ -449,6 +450,7 @@ class BuildList < ActiveRecord::Base
|
||||||
), "#{repo.platform.name}_#{repo.name}_"
|
), "#{repo.platform.name}_#{repo.name}_"
|
||||||
h["#{prefix}release"] = insert_token_to_path(path + 'release', repo.platform)
|
h["#{prefix}release"] = insert_token_to_path(path + 'release', repo.platform)
|
||||||
h["#{prefix}updates"] = insert_token_to_path(path + 'updates', repo.platform) if repo.platform.main?
|
h["#{prefix}updates"] = insert_token_to_path(path + 'updates', repo.platform) if repo.platform.main?
|
||||||
|
h["#{prefix}testing"] = insert_token_to_path(path + 'testing', repo.platform) if include_testing_subrepository?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
host = EventLog.current_controller.request.host_with_port rescue ::Rosa::Application.config.action_mailer.default_url_options[:host]
|
host = EventLog.current_controller.request.host_with_port rescue ::Rosa::Application.config.action_mailer.default_url_options[:host]
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
.both
|
.both
|
||||||
|
|
||||||
%h3= t("activerecord.attributes.build_list.preferences")
|
%h3= t("activerecord.attributes.build_list.preferences")
|
||||||
- [:auto_publish, :auto_create_container].each do |kind|
|
- [:auto_publish, :auto_create_container, :include_testing_subrepository].each do |kind|
|
||||||
.both
|
.both
|
||||||
- checked, field = params[:build_list].try(:[], kind), "build_list[#{kind}]"
|
- checked, field = params[:build_list].try(:[], kind), "build_list[#{kind}]"
|
||||||
= hidden_field_tag field, false, :id => nil
|
= hidden_field_tag field, false, :id => nil
|
||||||
|
|
|
@ -39,6 +39,9 @@
|
||||||
.rightlist
|
.rightlist
|
||||||
= link_to "#{@build_list.save_to_platform.name}/#{@build_list.save_to_repository.name}", [@build_list.save_to_platform, @build_list.save_to_repository]
|
= link_to "#{@build_list.save_to_platform.name}/#{@build_list.save_to_repository.name}", [@build_list.save_to_platform, @build_list.save_to_repository]
|
||||||
.both
|
.both
|
||||||
|
.leftlist= t("activerecord.attributes.build_list.include_testing_subrepository")
|
||||||
|
.rightlist= t("layout.#{@build_list.include_testing_subrepository?}_")
|
||||||
|
.both
|
||||||
.leftlist= t("activerecord.attributes.build_list.include_repos")
|
.leftlist= t("activerecord.attributes.build_list.include_repos")
|
||||||
.rightlist= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ')
|
.rightlist= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ')
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -21,6 +21,7 @@ en:
|
||||||
is_circle: Recurrent build
|
is_circle: Recurrent build
|
||||||
updated_at: Notified at
|
updated_at: Notified at
|
||||||
additional_repos: Additional repositories
|
additional_repos: Additional repositories
|
||||||
|
include_testing_subrepository: "Include 'testing' subrepository"
|
||||||
include_repos: Included repositories
|
include_repos: Included repositories
|
||||||
created_at: Created on
|
created_at: Created on
|
||||||
save_to_repository: Save to repository
|
save_to_repository: Save to repository
|
||||||
|
|
|
@ -21,6 +21,7 @@ ru:
|
||||||
is_circle: Циклическая сборка
|
is_circle: Циклическая сборка
|
||||||
updated_at: Информация получена
|
updated_at: Информация получена
|
||||||
additional_repos: Дополнительные репозитории
|
additional_repos: Дополнительные репозитории
|
||||||
|
include_testing_subrepository: "Подключить 'testing' подрепозиторий"
|
||||||
include_repos: Подключаемые репозитории
|
include_repos: Подключаемые репозитории
|
||||||
created_at: Создан
|
created_at: Создан
|
||||||
save_to_repository: Сохранить в репозиторий
|
save_to_repository: Сохранить в репозиторий
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddUseTestingRepoToBuildList < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :build_lists, :include_testing_subrepository, :boolean
|
||||||
|
end
|
||||||
|
end
|
13
db/schema.rb
13
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20131022082416) do
|
ActiveRecord::Schema.define(:version => 20131107152408) do
|
||||||
|
|
||||||
create_table "activity_feeds", :force => true do |t|
|
create_table "activity_feeds", :force => true do |t|
|
||||||
t.integer "user_id", :null => false
|
t.integer "user_id", :null => false
|
||||||
|
@ -112,7 +112,7 @@ ActiveRecord::Schema.define(:version => 20131022082416) do
|
||||||
t.datetime "notified_at"
|
t.datetime "notified_at"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.boolean "is_circle", :default => false
|
t.boolean "is_circle", :default => false
|
||||||
t.text "additional_repos"
|
t.text "additional_repos"
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.string "update_type"
|
t.string "update_type"
|
||||||
|
@ -120,20 +120,20 @@ ActiveRecord::Schema.define(:version => 20131022082416) do
|
||||||
t.integer "save_to_platform_id"
|
t.integer "save_to_platform_id"
|
||||||
t.text "include_repos"
|
t.text "include_repos"
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.boolean "auto_publish", :default => true
|
t.boolean "auto_publish", :default => true
|
||||||
t.string "package_version"
|
t.string "package_version"
|
||||||
t.string "commit_hash"
|
t.string "commit_hash"
|
||||||
t.integer "priority", :default => 0, :null => false
|
t.integer "priority", :default => 0, :null => false
|
||||||
t.datetime "started_at"
|
t.datetime "started_at"
|
||||||
t.integer "duration"
|
t.integer "duration"
|
||||||
t.integer "advisory_id"
|
t.integer "advisory_id"
|
||||||
t.integer "mass_build_id"
|
t.integer "mass_build_id"
|
||||||
t.integer "save_to_repository_id"
|
t.integer "save_to_repository_id"
|
||||||
t.text "results"
|
t.text "results"
|
||||||
t.boolean "new_core", :default => true
|
t.boolean "new_core", :default => true
|
||||||
t.string "last_published_commit_hash"
|
t.string "last_published_commit_hash"
|
||||||
t.integer "container_status"
|
t.integer "container_status"
|
||||||
t.boolean "auto_create_container", :default => false
|
t.boolean "auto_create_container", :default => false
|
||||||
t.text "extra_repositories"
|
t.text "extra_repositories"
|
||||||
t.text "extra_build_lists"
|
t.text "extra_build_lists"
|
||||||
t.integer "publisher_id"
|
t.integer "publisher_id"
|
||||||
|
@ -141,6 +141,7 @@ ActiveRecord::Schema.define(:version => 20131022082416) do
|
||||||
t.text "extra_params"
|
t.text "extra_params"
|
||||||
t.string "external_nodes"
|
t.string "external_nodes"
|
||||||
t.integer "builder_id"
|
t.integer "builder_id"
|
||||||
|
t.boolean "include_testing_subrepository"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "build_lists", ["advisory_id"], :name => "index_build_lists_on_advisory_id"
|
add_index "build_lists", ["advisory_id"], :name => "index_build_lists_on_advisory_id"
|
||||||
|
|
Loading…
Reference in New Issue