From ef65715456202845d7cc54878ca0e87f80dd6557 Mon Sep 17 00:00:00 2001 From: Peter Wilmott
Date: Sun, 17 Jan 2016 23:50:33 +0000
Subject: Drop ruby19, add ruby23
---
web/db/migrations/022_add_r23_target.rb | 6 ++++++
web/lib/ci.rb | 8 +++-----
web/lib/packages.rb | 8 ++++----
web/public/js/jquery.flot.plot.packages.per.target.js | 16 ++++++++--------
web/routes/visualizations.rb | 8 ++++----
web/views/ruby_targets.erb | 8 ++++----
web/views/visualizations.erb | 4 ++--
7 files changed, 31 insertions(+), 27 deletions(-)
create mode 100644 web/db/migrations/022_add_r23_target.rb
(limited to 'web')
diff --git a/web/db/migrations/022_add_r23_target.rb b/web/db/migrations/022_add_r23_target.rb
new file mode 100644
index 0000000..23474c4
--- /dev/null
+++ b/web/db/migrations/022_add_r23_target.rb
@@ -0,0 +1,6 @@
+Sequel.migration do
+ change do
+ drop_column :packages, :r19_target
+ add_column :packages, :r23_target, String
+ end
+end
diff --git a/web/lib/ci.rb b/web/lib/ci.rb
index 22fd6b0..0db0ff3 100644
--- a/web/lib/ci.rb
+++ b/web/lib/ci.rb
@@ -63,10 +63,7 @@ def generate_package_list(ci_type, num_of_packages)
end
end
elsif num_of_packages.is_a?(Integer)
- packages = []
- packages << Package.where(identifier: 'dev-ruby/color-1.7.1').first
- packages << Package.where(identifier: 'dev-ruby/crack-0.4.2-r1').first
- packages << Package.where(identifier: 'dev-ruby/atomic-1.1.99').first
+ packages = packages.sample(num_of_packages)
else
puts 'ERROR: Invalid value for NUM_OF_PACKAGES'
puts ci_type
@@ -76,7 +73,8 @@ def generate_package_list(ci_type, num_of_packages)
packages_with_targets = []
packages.uniq.each do |package|
- packages_with_targets << "#{package[:identifier]} #{package[:next_target]}"
+ package = Package.where(identifier: package).first
+ packages_with_targets << "#{package[:identifier]} #{package[:next_target]}"
end
packages_with_targets
diff --git a/web/lib/packages.rb b/web/lib/packages.rb
index 6e3f0b5..0f148de 100644
--- a/web/lib/packages.rb
+++ b/web/lib/packages.rb
@@ -10,9 +10,9 @@ def update_packages(ci_image)
ci_container.delete
packages_txt = packages_txt.lines.sort.uniq
- packages_txt.peach do |line|
+ packages_txt.each do |line|
next if line.empty?
- sha1, category, name, version, revision, slot, amd64_keyword, r19_target, r20_target, r21_target, r22_target = line.split(' ')
+ sha1, category, name, version, revision, slot, amd64_keyword, r20_target, r21_target, r22_target, r23_target = line.split(' ')
identifier = category + '/' + name + '-' + version + (revision == 'r0' ? '' : "-#{revision}")
@@ -20,9 +20,9 @@ def update_packages(ci_image)
gem_version = 'nil' if gem_version.nil?
next_target = 'nil'
- next_target = 'ruby20' if r19_target == 'ruby19' && r20_target == 'nil'
next_target = 'ruby21' if r20_target == 'ruby20' && r21_target == 'nil'
next_target = 'ruby22' if r21_target == 'ruby21' && r22_target == 'nil'
+ next_target = 'ruby23' if r22_target == 'ruby22' && r23_target == 'nil'
package = Package.find_or_create(
sha1: sha1,
@@ -33,10 +33,10 @@ def update_packages(ci_image)
slot: slot,
identifier: identifier,
amd64_keyword: amd64_keyword,
- r19_target: r19_target,
r20_target: r20_target,
r21_target: r21_target,
r22_target: r22_target,
+ r23_target: r23_target,
next_target: next_target,
gem_version: gem_version
)
diff --git a/web/public/js/jquery.flot.plot.packages.per.target.js b/web/public/js/jquery.flot.plot.packages.per.target.js
index bee9ff0..1916d92 100644
--- a/web/public/js/jquery.flot.plot.packages.per.target.js
+++ b/web/public/js/jquery.flot.plot.packages.per.target.js
@@ -1,13 +1,5 @@
$(function() {
var datasets = {
- "ruby_1.9_amd64": {
- label: "Ruby 1.9 amd64",
- data: [[1, $('td[id="ruby_1.9_amd64"]').text()]]
- },
- "ruby_1.9_~amd64": {
- label: "Ruby 1.9 ~amd64",
- data: [[1, $('td[id="ruby_1.9_~amd64"]').text()]]
- },
"ruby_2.0_amd64": {
label: "Ruby 2.0 amd64",
data: [[1, $('td[id="ruby_2.0_amd64"]').text()]]
@@ -31,6 +23,14 @@ $(function() {
"ruby_2.2_~amd64": {
label: "Ruby 2.2 ~amd64",
data: [[1, $('td[id="ruby_2.2_~amd64"]').text()]]
+ },
+ "ruby_2.3_amd64": {
+ label: "Ruby 2.3 amd64",
+ data: [[1, $('td[id="ruby_2.3_amd64"]').text()]]
+ },
+ "ruby_2.3_~amd64": {
+ label: "Ruby 2.3 ~amd64",
+ data: [[1, $('td[id="ruby_2.3_~amd64"]').text()]]
}
};
diff --git a/web/routes/visualizations.rb b/web/routes/visualizations.rb
index 1ec845b..a3518a0 100644
--- a/web/routes/visualizations.rb
+++ b/web/routes/visualizations.rb
@@ -5,14 +5,14 @@ class RubyTinderbox < Sinatra::Base
portage_timestamp = Package.first[:portage_timestamp]
# Ruby Targets
- ruby_1_9_amd64 = Package.where(r19_target: 'ruby19', amd64_keyword: 'amd64').count
- ruby_1_9__amd64 = Package.where(r19_target: 'ruby19', amd64_keyword: '~amd64').count
ruby_2_0_amd64 = Package.where(r20_target: 'ruby20', amd64_keyword: 'amd64').count
ruby_2_0__amd64 = Package.where(r20_target: 'ruby20', amd64_keyword: '~amd64').count
ruby_2_1_amd64 = Package.where(r21_target: 'ruby21', amd64_keyword: 'amd64').count
ruby_2_1__amd64 = Package.where(r21_target: 'ruby21', amd64_keyword: '~amd64').count
ruby_2_2_amd64 = Package.where(r22_target: 'ruby22', amd64_keyword: 'amd64').count
ruby_2_2__amd64 = Package.where(r22_target: 'ruby22', amd64_keyword: '~amd64').count
+ ruby_2_3_amd64 = Package.where(r23_target: 'ruby23', amd64_keyword: 'amd64').count
+ ruby_2_3__amd64 = Package.where(r23_target: 'ruby23', amd64_keyword: '~amd64').count
# Outdated Gems
uptodate = []
@@ -28,14 +28,14 @@ class RubyTinderbox < Sinatra::Base
erb :visualizations, locals: {
portage_timestamp: portage_timestamp,
update_timestamp: update_timestamp,
- ruby_1_9_amd64: ruby_1_9_amd64,
- ruby_1_9__amd64: ruby_1_9__amd64,
ruby_2_0_amd64: ruby_2_0_amd64,
ruby_2_0__amd64: ruby_2_0__amd64,
ruby_2_1_amd64: ruby_2_1_amd64,
ruby_2_1__amd64: ruby_2_1__amd64,
ruby_2_2_amd64: ruby_2_2_amd64,
ruby_2_2__amd64: ruby_2_2__amd64,
+ ruby_2_3_amd64: ruby_2_3_amd64,
+ ruby_2_3__amd64: ruby_2_3__amd64,
uptodate: uptodate.count,
outdated: outdated.count,
succeeded: succeeded,
diff --git a/web/views/ruby_targets.erb b/web/views/ruby_targets.erb
index e8c0db5..d70d1df 100644
--- a/web/views/ruby_targets.erb
+++ b/web/views/ruby_targets.erb
@@ -19,10 +19,10 @@
Package
- Ruby 1.9
Ruby 2.0
Ruby 2.1
Ruby 2.2
+ Ruby 2.3