[Collab-qa-commits] r1969 - retitle-old-ita-itp
Lucas Nussbaum
lucas at alioth.debian.org
Wed Jul 27 16:04:44 UTC 2011
Author: lucas
Date: 2011-07-27 16:04:44 +0000 (Wed, 27 Jul 2011)
New Revision: 1969
Added:
retitle-old-ita-itp/close-old-rfp.rb
Log:
add script to close old rfp bugs
Added: retitle-old-ita-itp/close-old-rfp.rb
===================================================================
--- retitle-old-ita-itp/close-old-rfp.rb (rev 0)
+++ retitle-old-ita-itp/close-old-rfp.rb 2011-07-27 16:04:44 UTC (rev 1969)
@@ -0,0 +1,72 @@
+#!/usr/bin/ruby -w
+# Closes old RFP
+# Always wait for UDD to be updated before running again!
+
+require 'pp'
+require 'dbi'
+
+rfp_months = 18
+
+really_mail = true
+
+
+#### old RFP
+
+dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
+sth = dbh.prepare("select id, arrival, owner, title, last_modified from bugs
+ where package='wnpp' and title ~ 'RFP:'
+ and last_modified < current_date - interval '#{rfp_months} months' and done = ''
+ and id not in (select id from bugs_merged_with where id > merged_with)")
+sth.execute ; rows = sth.fetch_all
+rows.each do |r|
+ id = r['id']
+ subject = r['title']
+ next if subject !~ /^RFP: ([^ ]+) /
+ source = $1
+ f = File::new('tmpfile', 'w')
+ puts "#{id}..."
+ f.puts <<-EOF
+From: Lucas Nussbaum <lucas at debian.org>
+To: #{id}@bugs.debian.org
+Cc: control at bugs.debian.org
+Subject: #{source}: closing old inactive RFP
+
+close #{id}
+thanks
+
+Hello,
+
+This is an automatic mail sent to close this RFP.
+
+Your RFP wnpp bug is being closed because of the following reasons:
+- It hasn't seen any activity for the last #{rfp_months} months.
+- The amount of RFPs on the Debian BTS is huge and we need to
+ clean up a bit the place.
+
+As this an automatic procedure, it could of course have something
+wrong and probably it would be closing some bugs that are not intended
+by owners and submitters to be closed, for example if the RFP is still
+of your interest, or there has been some kind of activity around it.
+In that case, please do not hesitate to reopen the bug!
+
+To re-open it, you simply have to mail control at bugs.debian.org
+with a body text like this:
+
+reopen 123456
+thanks bts
+
+Replacing '123456' for the number of your RFP bug. The subject of the
+mail is ignored. Or if you have any kind of problems when dealing with
+the BTS, feel free to contact me and I'd be more than happy to help
+you on this: <lucas at debian.org>.
+
+Thanks for your cooperation,
+--
+Lucas, for the QA team <debian-qa at lists.debian.org>
+ EOF
+ f.close
+ if really_mail
+ raise "sendmail failed for #{source}!" if not system("/usr/sbin/sendmail -t < tmpfile")
+ end
+end
+puts "old RFP: #{rows.length} packages processed"
Property changes on: retitle-old-ita-itp/close-old-rfp.rb
___________________________________________________________________
Added: svn:executable
+ *
More information about the Collab-qa-commits
mailing list