/[collab-qa]/bapase/gen_html.rb
ViewVC logotype

Contents of /bapase/gen_html.rb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 538 - (hide annotations) (download)
Mon Dec 3 21:47:20 2007 UTC (5 years, 5 months ago) by lucas
File size: 2453 byte(s)
Lots of BAPASE improvements.

- datafiles.rb and html.rb split off gen_html.rb
- tags are semi-documented in README
- OK() renamed to WAIT(). new semantic for OK.
- now generates scores_orphaned.html, with O packages, and a different metric.
  also added column for O bug age.
1 lucas 516 #!/usr/bin/ruby -w
2    
3     require 'date'
4 lucas 538 require 'datafiles'
5     require 'html'
6 lucas 516
7     DATEZERO = Date::parse('0000-01-01')
8     CURDATE = Date::today
9    
10 lucas 538 $testing = read_testing
11     $srcpkg, $pkgs = read_sources
12     $popcon = read_popcon
13     $rcbugs, $bugs = read_bugs
14     $wnpp = read_wnpp
15 lucas 516 $actions = Actions::read('package-actions.txt')
16 lucas 538 $orph = OrphanedPackage::readfile
17 lucas 516
18 lucas 538 # Compute score for all packages
19 lucas 516 $score = {}
20     $pkgs.keys.each do |pkg|
21     score = 0
22     if $testing[pkg]
23     ts = $testing[pkg]
24     score += ts.testingdays
25     score += (ts.syncdays * 0.5) if ts.syncdays > 10
26     else
27     score += 1000000
28     end
29     if $actions[pkg] and $actions[pkg].act_todo
30     score += 100000 # bump score if action needed
31     end
32     if $popcon[pkg] < 500
33     score += (500 - $popcon[pkg]) * 2
34     end
35     if $rcbugs[pkg] > 0
36     if $rcbugs[pkg] > 4
37     score += 5 * 300
38     else
39     score += $rcbugs[pkg] * 300
40     end
41     end
42     # score bugs
43     if $bugs[pkg] > 0
44     pc = $popcon[pkg]
45     bugs = $bugs[pkg]
46     if pc < 4000
47     norm = 1 + 0.002 * pc
48     elsif pc < 60000
49     norm = 7.85 + (16.0/56000) * pc
50     else
51     norm = 25
52     end
53     if bugs > norm
54     ret = (bugs - norm)/norm * 100 * 10 # 10 % en trop -> 100 pts
55     score += (ret > 2000 ? 2000 : ret)
56     end
57     end
58     $score[pkg] = score if score > 0
59     end
60    
61 lucas 538 # Compute score, orphaned packages only
62     $oscore = {}
63     $pkgs.keys.each do |pkg|
64     next if !$orph.has_key?(pkg)
65     score = 0
66     score += (Time::now - $orph[pkg].date) / 86400 * 10
67 lucas 516 if $testing[pkg]
68 lucas 538 ts = $testing[pkg]
69     score += ts.testingdays
70     score += (ts.syncdays * 0.5) if ts.syncdays > 10
71 lucas 516 else
72 lucas 538 score += 1000000
73 lucas 516 end
74 lucas 538 if $actions[pkg] and $actions[pkg].act_todo
75     score += 100000 # bump score if action needed
76     end
77     if $popcon[pkg] < 500
78     score += (500 - $popcon[pkg]) * 2
79     end
80     if $rcbugs[pkg] > 0
81     if $rcbugs[pkg] > 4
82     score += 5 * 300
83     else
84     score += $rcbugs[pkg] * 300
85 lucas 516 end
86     end
87 lucas 538 # score bugs
88     if $bugs[pkg] > 0
89     pc = $popcon[pkg]
90     bugs = $bugs[pkg]
91     if pc < 4000
92     norm = 1 + 0.002 * pc
93     elsif pc < 60000
94     norm = 7.85 + (16.0/56000) * pc
95     else
96     norm = 25
97 lucas 516 end
98 lucas 538 if bugs > norm
99     ret = (bugs - norm)/norm * 100 * 10 # 10% more -> 100 pts
100     score += (ret > 2000 ? 2000 : ret)
101     end
102 lucas 516 end
103 lucas 538 $oscore[pkg] = score if score > 0
104 lucas 516 end
105 lucas 538
106     # Generate HTML files
107     f = File::new('scores.html', 'w')
108     gen_html($score, f)
109     f.close
110     f = File::new('scores_orphaned.html', 'w')
111     gen_html($oscore, f, true)
112     f.close

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5