aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wilmott <p@p8952.info>2015-08-16 23:01:20 +0100
committerPeter Wilmott <p@p8952.info>2015-08-16 23:01:20 +0100
commit23e071019b3e86551190439a4b3c0e484caef5e8 (patch)
tree703bc33ae3c975ae8a302bd4e2680c78fe972503
parentRemoved git migration notice (diff)
downloadruby-tinderbox-23e071019b3e86551190439a4b3c0e484caef5e8.tar.gz
ruby-tinderbox-23e071019b3e86551190439a4b3c0e484caef5e8.tar.bz2
ruby-tinderbox-23e071019b3e86551190439a4b3c0e484caef5e8.zip
Only list succeeded and passed packages on the new targets page
-rw-r--r--web/lib/ci.rb5
-rw-r--r--web/routes/tasks.rb12
2 files changed, 7 insertions, 10 deletions
diff --git a/web/lib/ci.rb b/web/lib/ci.rb
index 1a01965..e21fad1 100644
--- a/web/lib/ci.rb
+++ b/web/lib/ci.rb
@@ -63,8 +63,7 @@ def generate_package_list(ci_type, num_of_packages)
end
end
elsif num_of_packages.is_a?(Integer)
- puts packages.count
- packages = packages[25..(25 + num_of_packages)]
+ packages = packages.sample(num_of_packages)
else
puts 'ERROR: Invalid value for NUM_OF_PACKAGES'
puts ci_type
@@ -90,7 +89,7 @@ def update_build(log_path)
timestamp = build_array[4]
target = build_array[2].sub('_target', '')
- result = File.read("#{build}/result")
+ result = File.read("#{build}/result").strip
emerge_info = File.read("#{build}/emerge-info") if File.exist?("#{build}/emerge-info")
emerge_pqv = File.read("#{build}/emerge-pqv") if File.exist?("#{build}/emerge-pqv")
build_log = File.read("#{build}/build.log") if File.exist?("#{build}/build.log")
diff --git a/web/routes/tasks.rb b/web/routes/tasks.rb
index 9cf3597..4fb48d1 100644
--- a/web/routes/tasks.rb
+++ b/web/routes/tasks.rb
@@ -5,20 +5,18 @@ class RubyTinderbox < Sinatra::Base
packages = []
Package.each do |package|
build_current = package.build_dataset.where(target: 'current').reverse_order(:timestamp).first
- next if build_current.nil?
+ next if build_current.nil? || build_current[:result] != 'succeeded'
build_next = package.build_dataset.where(target: 'next').reverse_order(:timestamp).first
- next if build_next.nil?
+ next if build_next.nil? || build_next[:result] != 'succeeded'
repoman_current = package.repoman_dataset.where(target: 'current').reverse_order(:timestamp).first
- next if repoman_current.nil?
+ next if repoman_current.nil? || repoman_current[:result] != 'passed'
repoman_next = package.repoman_dataset.where(target: 'next').reverse_order(:timestamp).first
- next if repoman_next.nil?
+ next if repoman_next.nil? || repoman_next[:result] != 'passed'
- if repoman_current[:result] == 'passed' || repoman_current[:result] == 'partial' && repoman_next[:result] == 'passed' || repoman_next[:result] == 'partial'
- packages << [package, build_current, build_next, repoman_current, repoman_next]
- end
+ packages << [package, build_current, build_next, repoman_current, repoman_next]
end
packages = packages.compact.sort_by { |package| package[0][:identifier] }
erb :new_targets, locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp }