Class: Nailed::Bugzilla
- Inherits:
-
Object
- Object
- Nailed::Bugzilla
- Defined in:
- lib/nailed.rb
Instance Method Summary collapse
- #get_bugs ⇒ Object
-
#initialize ⇒ Bugzilla
constructor
A new instance of Bugzilla.
- #write_bug_trends ⇒ Object
- #write_l3_trends ⇒ Object
Constructor Details
#initialize ⇒ Bugzilla
Returns a new instance of Bugzilla.
11 12 13 |
# File 'lib/nailed.rb', line 11 def initialize Bicho.client = Bicho::Client.new(Nailed.get_config["bugzilla"]["url"]) end |
Instance Method Details
#get_bugs ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/nailed.rb', line 15 def get_bugs Nailed.get_config["products"].each do |product,values| values["versions"].each do |version| begin Bicho::Bug.where(:product => version).each do |bug| attributes = { :bug_id => bug.id, :summary => bug.summary, :status => bug.status, :is_open => bug.is_open, :product_name => bug.product, :component => bug.component, :severity => bug.severity, :priority => bug.priority, :whiteboard => bug.whiteboard, :assigned_to => bug.assigned_to, :creation_time => "#{bug.creation_time.to_date}T#{bug.creation_time.hour}:#{bug.creation_time.min}:#{bug.creation_time.sec}+00:00", :last_change_time => "#{bug.last_change_time.to_date}T#{bug.last_change_time.hour}:#{bug.last_change_time.min}:#{bug.last_change_time.sec}+00:00", :url => bug.url.gsub(/novell.com\//,'suse.com/show_bug.cgi?id=') } db_handler = (Bugreport.get(bug.id) || Bugreport.new).update(attributes) end rescue Nailed.log("error","Could not fetch Bugs for #{version}.") end end unless values["versions"].nil? end end |
#write_bug_trends ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/nailed.rb', line 45 def write_bug_trends Nailed.get_config["products"].each do |product,values| values["versions"].each do |version| open = Bugreport.count(:is_open => true, :product_name => version) fixed = Bugreport.count(:status => "VERIFIED", :product_name => version) + \ Bugreport.count(:status => "RESOLVED", :product_name => version) db_handler = Bugtrend.first_or_create( :time => Time.new.strftime("%Y-%m-%d %H:%M:%S"), :open => open, :fixed => fixed, :product_name => version ) Nailed.save_state(db_handler) end unless values["versions"].nil? end end |
#write_l3_trends ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/nailed.rb', line 63 def write_l3_trends open = 0 Nailed.get_config["products"].each do |product,values| values["versions"].each do |version| open += Bugreport.count(:product_name => version, :whiteboard.like => "%openL3%", :is_open => true) end unless values["versions"].nil? end db_handler = L3Trend.first_or_create( :time => Time.new.strftime("%Y-%m-%d %H:%M:%S"), :open => open ) Nailed.save_state(db_handler) end |