Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add is_open attribute to track bug status.

  • Loading branch information...
commit 93f144fd8fde03262206a717e5664772ce984c97 1 parent d7996fe
@zuhao authored
View
2  app/models/bug.rb
@@ -1,5 +1,5 @@
class Bug < ActiveRecord::Base
- attr_accessible :name, :bz_id, :is_review
+ attr_accessible :name, :bz_id, :is_review, :is_open
belongs_to :fedora_rpm
def url
View
13 app/models/fedora_rpm.rb
@@ -107,7 +107,7 @@ def retrieve_versions
begin
rpm_spec = URI.parse(spec_url).read
is_patched = (rpm_spec.scan(/\nPatch0:\s*.*\n/).size != 0)
-
+
rpm_version = rpm_spec.scan(/\nVersion:\s*.*\n/).first.split.last
if !version_valid?(rpm_version)
if rpm_version.include?('%{majorver}')
@@ -122,19 +122,19 @@ def retrieve_versions
rv.is_patched = is_patched
self.rpm_versions << rv
if version_title == 'rawhide'
- #Import the maintainer's e-mail
+ #Import the maintainer's e-mail
fedora_user_list = rpm_spec.scan(/<.*[@].*>/)
fedora_user_list.each do |user|
if user != "<rel-eng@lists.fedoraproject.org>" #We don't want to add Fedora Release Engineering
#Remove those "<>"
user[0] = ""
- user.gsub!(">", "")
+ user.gsub!(">", "")
self.fedora_user = user
break
end
end
puts "Maintainer: #{self.fedora_user}"
-
+
self.homepage = rpm_spec.scan(/\nURL:\s*.*\n/).first.split.last
rpm_spec.split("\n").each { |line|
@@ -180,11 +180,12 @@ def retrieve_bugs
xmlrpc = Bugzilla::XMLRPC.new("bugzilla.redhat.com")
bugs = Bugzilla::Bug.new(xmlrpc).search("summary" => name, "product" => "fedora")["bugs"]
bugs.each { |bug|
- arb = Bug.new
+ arb = Bug.new
arb.name = bug["summary"]
arb.bz_id = bug["id"]
arb.last_updated = bug["last_change_time"].to_time
arb.is_review = true if arb.name =~ /^Review Request.*#{name}\s.*$/
+ arb.is_open = bug['is_open']
self.bugs << arb
}
end
@@ -285,7 +286,7 @@ def self.build_rpms(spec_file)
}
rpms
end
-
+
def obfuscated_fedora_user
return self.fedora_user.to_s.gsub("@", " AT ").gsub(".", " DOT ")
end
View
5 app/views/fedorarpms/show.html.haml
@@ -98,7 +98,10 @@
- @rpm.bugs.each do |b|
%tr
%td
- = link_to b.bz_id, b.url
+ - if b.is_open
+ = link_to b.bz_id, b.url
+ - else
+ %strike= link_to b.bz_id, b.url
%td
= b.name.truncate(30)
%td{:style => "text-align: center;"}
View
5 db/migrate/20130312132803_add_is_open_to_bugs.rb
@@ -0,0 +1,5 @@
+class AddIsOpenToBugs < ActiveRecord::Migration
+ def change
+ add_column :bugs, :is_open, :boolean
+ end
+end
View
3  db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130103111220) do
+ActiveRecord::Schema.define(:version => 20130312132803) do
create_table "bugs", :force => true do |t|
t.string "name"
@@ -21,6 +21,7 @@
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "last_updated"
+ t.boolean "is_open"
end
create_table "builds", :force => true do |t|
Please sign in to comment.
Something went wrong with that request. Please try again.